IncludeFiles: Difference between revisions
Line 1: | Line 1: | ||
=Finding Include Files= | =Finding Include Files= | ||
== Introduction == | |||
This page discusses where to find the source for files that are #include'ed that are into Mu2e files. There are separate discussions for include directives in source code files, in .fcl files and in auxillary files, such as the geometry files and the Magnetic Field map files. The second on source code files also discusses namespaces | |||
==C++ Code== | ==C++ Code== | ||
This section discusses where to find files specified by include directives in source files. It will not discuss finding source for system and compiler supplied headers; for those you can find references in the [[CppFAQ | Mu2e C++ FAQ]]. | |||
Such header files fall into 4 categories | |||
#From a Mu2e repository, such as Offline, Production, Tutorial, TrkAna, Stuntple .. | |||
#From an external product other than ROOT. | |||
#ROOT | |||
#Exceptions to the above patterns | |||
In the Mu2e repositories, you will see include directives that take one of the following forms, | |||
#include "Offline/RecoDataProducts/inc/KalSeed.hh" | #include "Offline/RecoDataProducts/inc/KalSeed.hh" | ||
Line 59: | Line 71: | ||
|} | |} | ||
=== Files Included from ROOT=== | === Files Included from ROOT=== | ||
Line 84: | Line 95: | ||
is found in the repository mu2e_pcie_utils, which can be found in the above table. | is found in the repository mu2e_pcie_utils, which can be found in the above table. | ||
=== IDES vim and emacs === | |||
== .fcl Files == | |||
== Auxillary Files == | |||
==FCL Files== | ==FCL Files== |
Revision as of 19:07, 7 September 2023
Finding Include Files
Introduction
This page discusses where to find the source for files that are #include'ed that are into Mu2e files. There are separate discussions for include directives in source code files, in .fcl files and in auxillary files, such as the geometry files and the Magnetic Field map files. The second on source code files also discusses namespaces
C++ Code
This section discusses where to find files specified by include directives in source files. It will not discuss finding source for system and compiler supplied headers; for those you can find references in the Mu2e C++ FAQ.
Such header files fall into 4 categories
- From a Mu2e repository, such as Offline, Production, Tutorial, TrkAna, Stuntple ..
- From an external product other than ROOT.
- ROOT
- Exceptions to the above patterns
In the Mu2e repositories, you will see include directives that take one of the following forms,
#include "Offline/RecoDataProducts/inc/KalSeed.hh" #include "art/Framework/Principal/Event.h" #include "TH1F.h" #include <iostream>
The remainder of this page will discuss how to find the source code for header files included in the Mu2e code.
The table below summarizes information about each external product that is used by Mu2e. The first column specifies the UPS package name. Second column gives the first element in an include path; it is often but not always the same as the UPS package name; note that there are some differences in capitalization and dash (-) vs underscore (_). The third column gives the environment variable used to locate the source file; in most, but not all cases, it follows the pattern of capitalizing the UPS package name and adding _INC. Note that include directives for ROOT files are just filenames with no additional path information. The fourth column gives the name of the namespace using within that packages; this is irregular and you just need to look it up as needed. Note that some repositories do not use a namespace and their symbols are in the global namespace; in all cases these packages name their files with a distinct prefix, such as gsl_, G4 or T, which serves as proxy for a namespace. The final column gives the url of the respository; if you use these urls, it's your responsibility to navigate to the correct version of the files you wish to view.
UPS Package Name | Include Prefix | Environment Variable | Namespace | Source - Be careful to use the correct tag! |
art | art | ART_INC | art:: | https://github.com/art-framework-suite/art |
artdaq-core | artdaq-core | ARTDAQ_CORE_INC | artdaq:: | https://github.com/art-daq/artdaq_core |
artdaq-core-mu2e | artdaq-core-mu2e | ARTDAQ_CORE_MU2E_INC | mu2e:: | https://github.com/Mu2e/artdaq_core_mu2e |
art_root_io | art_root_io | ART_ROOT_IO_INC | art:: | https://github.com/art-framework-suite/art-root-io |
boost | boost | BOOST_INC | boost:: | https://github.com/boostorg/boost |
BTrk | BTrk | BTRK_INC | (global) | https://github.com/KFTrack/BTrk |
canvas | canvas | CANVAS_INC | art:: | https://github.com/art-framework-suite/canvas |
cetlib | cetlib | CETLIB_INC | cet:: | https://github.com/art-framework-suite/cetlib |
cetlib_except | cetlib_except | CETLIB_EXCEPT_INC | cet:: | https://github.com/art-framework-suite/cetlib-except |
clhep | CLHEP | CLHEP_INC | CLHEP:: | https://gitlab.cern.ch/CLHEP/CLHEP |
fhiclepp | fhiclcpp | FHICLCPP_INC | fhicl:: | https://github.com/art-framework-suite/fhicl-cpp |
geatn4 | Geant4 | G4INCLUDE | (global) | https://gitlab.cern.ch/geant4/geant4 |
gsl | gsl | GSL_INC | (global) | https://github.com/ampl/gsl |
KinKal | KinKal | KINKAL_INC | KinKal:: | https://github.com/KFTrack/KinKal] |
mu2e_pcie_utils | mu2e_pcie_utils | MU2E_PCIE_UTILS_INC | DTCLib:: | https://github.com/Mu2e/mu2e_pcie_utils |
messagefaciltiy | messagefacility | MESSAGEFACILITY_INC | mf:: | https://github.com/art-framework-suite/messagefacility |
tbb | tbb | TBB_INC | tbb:: | |
xercesc | xercesc | XERCES_C_INC | xercesc:: | https://github.com/apache/xerces-c |
root | (none) | ROOT_INC | (global) | https://github.com/root-project/root |
Files Included from ROOT
The syntax to incluude a root header file is to specify a path relative to $ROOT_INC. Because of the way that the root repository is structured, this results in most include directives containing only the filename. In almost all cases, the filename starts with a capital letter T, for example
#include "TH1F.h"
There are a small number of exceptional cases in which the filename starts with a capital letter R. Two cases that occur in the Mu2e code base are:
#include "Rtypes.h" #include "Riostream.h"
Finally, some header files live in subdirectories under $ROOT_INC. The two subdirectories that occur in the Mu2e code base are Math and TVMA, for example
#include "Math/Vector3D.h" #include "TMVA/Factory.h"
Exceptions
One other exception was found in a recent scan of Offline. The file included with,
#include "dtcInterfaceLib/DTC_Packets.h"
is found in the repository mu2e_pcie_utils, which can be found in the above table.
IDES vim and emacs
.fcl Files
Auxillary Files
FCL Files
Auxillary Files
SimpleConfig, BField maps ...