1 #ifndef OANALYSISDEFS_HXX
2 #define OANALYSISDEFS_HXX
11 #include "TParticlePDG.h"
18 namespace eventAnalysisEnums {
89 BitField = BitField | 1UL<<det;
114 if (path.find(
"Basket") != std::string::npos) {
116 if (path.find(
"P0D") != std::string::npos) {
120 else if (path.find(
"DsECal") != std::string::npos) {
124 else if (path.find(
"FGD1") != std::string::npos) {
128 else if (path.find(
"FGD2") != std::string::npos) {
132 else if (path.find(
"TPC1") != std::string::npos) {
136 else if (path.find(
"TPC2") != std::string::npos) {
140 else if (path.find(
"TPC3") != std::string::npos) {
144 else if (path.find(
"SFG") != std::string::npos) {
148 else if (path.find(
"TopHAT") != std::string::npos) {
151 else if (path.find(
"BottomHAT") != std::string::npos) {
155 else if (path.find(
"TOF") != std::string::npos) {
165 if (path.find(
"Clam") != std::string::npos) {
167 if (path.find(
"BrlECal") != std::string::npos) {
168 if (path.find(
"Top") != std::string::npos) {
170 }
else if (path.find(
"Side") != std::string::npos) {
171 if (path.find(
"LeftClam") != std::string::npos) {
173 }
else if (path.find(
"RightClam") != std::string::npos) {
176 }
else if (path.find(
"Bottom") != std::string::npos) {
181 else if (path.find(
"P0DECal") != std::string::npos) {
182 if (path.find(
"Top") != std::string::npos) {
184 }
else if (path.find(
"Side") != std::string::npos) {
185 if (path.find(
"LeftClam") != std::string::npos) {
187 }
else if (path.find(
"RightClam") != std::string::npos) {
190 }
else if (path.find(
"Bottom") != std::string::npos) {
195 else if ((path.find(
"MRD") != std::string::npos) ||
196 (path.find(
"FluxReturn") != std::string::npos)) {
202 if (path.find(
"OA") != std::string::npos) {
206 else if (path.find(
"INGRID") != std::string::npos) {
252 return "BrlECalBottom";
255 return "BrlECalLeft";
258 return "BrlECalRight";
264 return "P0DECalBottom";
267 return "P0DECalLeft";
270 return "P0DECalRight";
284 default: {
return "NONE"; }
439 std::cerr <<
"[ERROR](" << __FILE__
":" << __LINE__
440 <<
"): Attempted to cast " << intdet
441 <<
" to a eventAnalysisEnums::ESubdetector." << std::endl;
442 throw std::make_pair(
"eventAnalysisEnums::ESubdetector.", intdet);
450 Int_t pdg = pdgInfo->PdgCode();
453 Int_t charge = TMath::Nint(pdgInfo->Charge() / 3.0);
454 std::string particleClass = pdgInfo->ParticleClass();
458 if ((TMath::Abs(pdg) == 11) || (TMath::Abs(pdg) == 13) ||
459 (TMath::Abs(pdg) == 15)) {
463 if (particleClass.find(
"Baryon") != std::string::npos) {
465 }
else if (particleClass.find(
"Meson") != std::string::npos) {
470 }
else if (pdg == 22) {
487 TString tablePath = TString(gSystem->Getenv(
"EVENTANALYSISROOT")) +
488 "/input/oaanalysis_pdg_table.txt";
489 bool Gottit = gSystem->AccessPathName(tablePath);
491 std::cerr <<
"[ERROR](" << __FILE__ <<
":" << __LINE__ <<
") " << tablePath
492 <<
" is not accesible, cannot load extra PDG data. "
494 "${EVENTANALYSISROOT}/input/oaanalysis_pdg_table.txt)"
496 throw std::exception();
498 gEnv->SetValue(
"Root.DatabasePDG", tablePath);
504 return "Charged Lepton";
507 return "Charged Baryon";
510 return "Charged Meson";
516 return "Charged Other";
519 return "Neutral Other";
524 default: {
return "NONE"; }
556 #endif // OANALYSISDEFS_HXX
const unsigned long DetMask[]
void SetDetectorUsed(unsigned long &BitField, ESubdetector det)
the rest of the off-axis detector
std::string DetectorName(ESubdetector const subdet)
EParticleCategory PDGInfoToCategory(const TParticlePDG *pdgInfo)
ESubdetector Next(ESubdetector const subdet)
std::string ParticleName(EParticleCategory const category)
bool GetDetectorUsed(unsigned long BitField, ESubdetector det)
ESubdetector PathToSubdetector(const std::string path)
ESubdetector IntToSubdetector(int const intdet)