Skip to content

Doxygen

While following examples are ment towards Doxygen, they currently show how includes how be properly used. Each source/header file has to be added to group (@addgroup groupname). For list of groups available, see mpdroot/Doxygen.h in the MpdRoot repository. Group has to be terminated at the end of the file (@}). All headers from MpdRoot are in double quotes, all other headers are considered external and included via angled braces. Includes follow in the order:

  1. Own header of the class introduced in the given source file (i.e. if we are in MyClass.cpp, first header is MyClass.h). Directly before this header is added directive // clang-format off and straight after this include is used directive // clang-format on
  2. Other headers of MpdRoot sorted alphabetically.
  3. All other headers sorted alphabetically. Before system (non-MpdRoot) headers is used (doxygen) directive // @cond and after them is used directive // @endcond. This ensures, that contents of system headers will not become part of generated documentation.

Sorting of includes will be done automatically using clang-format during commit provided developer doesn't do so manually.

Example cpp File

/*! @addtogroup Tpc
@{
  @class Mpd::Tpc::ActsTracker
*/
// This file is a part of the NICA project.
//
// Copyright (C) 2026 JINR
// clang-format off
#include "Mpd/Detectors/Tpc/Tracking/Acts/ActsTracker.h"
// clang-format on
#include "Mpd/Core/Base/CodeTimer.h"
#include "Mpd/Detectors/Tpc/Tracking/Acts/ActsTrackerHelpers.h"
#include "Mpd/Detectors/Tpc/Tracking/Acts/Utilities/TrackHelpers.h"
/// @cond
#include <iostream>
#include <map>
#include <TFile.h>
/// @endcond

namespace Mpd::Tpc {
InitStatus ActsTracker::Init()
...
} // namespace Mpd::Tpc
/*! @} */

Example h File

Please note, that header railguides are the first and the last lines in the file. Any description (even doxygen) follows after these lines. Also, it is not allowed to use #pragma once since it is not a c++ standard and can lead to problems with ROOT integration.

#ifndef MPDTPCACTSTRACKER_H
#define MPDTPCACTSTRACKER_H
/*! @addtogroup Tpc
@{
  @class Mpd::Tpc::ActsTracker
*/
#include "Mpd/Detectors/Tpc/Tracking/Acts/ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp"
#include "Mpd/Detectors/Tpc/Tracking/Acts/EventData.h"
#include "Mpd/Detectors/Tpc/Tracking/Acts/InputHit.h"
/// @cond
#include <Acts/Utilities/Logger.hpp>
#include <ActsExamples/Framework/DataHandle.hpp>
#include <ActsExamples/Framework/IAlgorithm.hpp>
#include <FairTask.h>
#include <set>
#include <TString.h>
#include <vector>
/// @endcond

class TClonesArray;

namespace Mpd::Tpc {
... some class definitions
} // namespace Mpd::Tpc
/*! @} */
#endif // #ifndef MPDTPCACTSTRACKER_H

Last update: May 19, 2026