File indexing completed on 2025-08-05 08:17:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef JETQADEFS_H
0013 #define JETQADEFS_H
0014
0015 #include <calotrigger/TriggerAnalyzer.h>
0016
0017 #include <phool/phool.h>
0018
0019 #include <algorithm>
0020 #include <iostream>
0021 #include <map>
0022 #include <string>
0023 #include <vector>
0024
0025
0026
0027
0028 namespace JetQADefs
0029 {
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 enum GL1
0041 {
0042 Clock = 0,
0043 ZDCS = 1,
0044 ZDCN = 2,
0045 ZDCNS = 3,
0046 HCalSingle = 4,
0047 HCalCoin = 5,
0048 MBDS = 8,
0049 MBDN = 9,
0050 MBDNS1 = 10,
0051 MBDNS2 = 11,
0052 MBDNSVtx10 = 12,
0053 MBDNSVtx30 = 13,
0054 MBDNSVtx60 = 14,
0055 MBDNSHCalSingle = 15,
0056 MBDNSJet1 = 16,
0057 MBDNSJet2 = 17,
0058 MBDNSJet3 = 18,
0059 MBDNSJet4 = 19,
0060 Jet1 = 20,
0061 Jet2 = 21,
0062 Jet3 = 22,
0063 Jet4 = 23,
0064 MBDNSPhoton1 = 24,
0065 MBDNSPhoton2 = 25,
0066 MBDNSPhoton3 = 26,
0067 MBDNSPhoton4 = 27,
0068 Photon1 = 28,
0069 Photon2 = 29,
0070 Photon3 = 30,
0071 Photon4 = 31,
0072 MBDNS2Vtx10 = 32,
0073 MBDNS2Vtx30 = 33,
0074 MBDNS2Vtx60 = 34,
0075 MBDNS2Vtx150 = 35,
0076 MBDNS2Photon6Vtx10 = 36,
0077 MBDNS2Photon8Vtx10 = 37,
0078 MBDNS2Photon10Vtx10 = 38,
0079 MBDNS2Photon12Vtx10 = 39,
0080 MBDNS2Photon6Vtx150 = 40,
0081 MBDNS2Photon8Vtx150 = 41,
0082 MBDNS2Photon10Vtx150 = 42,
0083 MBDNS2Photon12Vtx150 = 43,
0084 Inclusive = 44
0085 };
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 inline std::map<uint32_t, std::string> MapTriggerFlagToName()
0098 {
0099 static const std::map<uint32_t, std::string> mapFlagToName =
0100 {
0101 {Clock , "Clock"},
0102 {ZDCS , "ZDC South"},
0103 {ZDCN , "ZDC North"},
0104 {ZDCNS , "ZDC Coincidence"},
0105 {HCalSingle , "HCAL Singles"},
0106 {HCalCoin , "HCAL Coincidence"},
0107 {MBDS , "MBD S >= 1"},
0108 {MBDN , "MBD N >= 1"},
0109 {MBDNS1 , "MBD N&S >= 1"},
0110 {MBDNS2 , "MBD N&S >= 2"},
0111 {MBDNSVtx10 , "MBD N&S >= 1, vtx < 10 cm"},
0112 {MBDNSVtx30 , "MBD N&S >= 1, vtx < 30 cm"},
0113 {MBDNSVtx60 , "MBD N&S >= 1, vtx < 60 cm"},
0114 {MBDNS2Vtx10 , "MBD N&S >= 2, vtx < 10 cm"},
0115 {MBDNS2Vtx30 , "MBD N&S >= 2, vtx < 30 cm"},
0116 {MBDNS2Vtx60 , "MBD N&S >= 2, vtx < 60 cm"},
0117 {MBDNS2Vtx150 , "MBD N&S >= 2, vtx < 150 cm"},
0118 {MBDNSHCalSingle , "HCAL Singles + MBD NS >= 1"},
0119 {MBDNSJet1 , "Jet 6 GeV + MBD NS >= 1"},
0120 {MBDNSJet2 , "Jet 8 GeV + MBD NS >= 1"},
0121 {MBDNSJet3 , "Jet 10 GeV + MBD NS >= 1"},
0122 {MBDNSJet4 , "Jet 12 GeV + MBD NS >= 1"},
0123 {Jet1 , "Jet 6 GeV"},
0124 {Jet2 , "Jet 8 GeV"},
0125 {Jet3 , "Jet 10 GeV"},
0126 {Jet4 , "Jet 12 GeV"},
0127 {MBDNSPhoton1 , "Photon 2 GeV+ MBD NS >= 1"},
0128 {MBDNSPhoton2 , "Photon 3 GeV + MBD NS >= 1"},
0129 {MBDNSPhoton3 , "Photon 4 GeV + MBD NS >= 1"},
0130 {MBDNSPhoton4 , "Photon 5 GeV + MBD NS >= 1"},
0131 {MBDNS2Photon6Vtx10 , "Photon 6 GeV + MBD NS >= 2, vtx < 10 cm"},
0132 {MBDNS2Photon8Vtx10 , "Photon 8 GeV + MBD NS >= 2, vtx < 10 cm"},
0133 {MBDNS2Photon10Vtx10 , "Photon 10 GeV + MBD NS >= 2, vtx < 10 cm"},
0134 {MBDNS2Photon12Vtx10 , "Photon 12 GeV + MBD NS >= 2, vtx < 10 cm"},
0135 {MBDNS2Photon6Vtx150 , "Photon 6 GeV + MBD NS >= 2, vtx < 150 cm"},
0136 {MBDNS2Photon8Vtx150 , "Photon 8 GeV + MBD NS >= 2, vtx < 150 cm"},
0137 {MBDNS2Photon10Vtx150 , "Photon 10 GeV + MBD NS >= 2, vtx < 150 cm"},
0138 {MBDNS2Photon12Vtx150 , "Photon 12 GeV + MBD NS >= 2, vtx < 150 cm"},
0139 {Photon1 , "Photon 2 GeV"},
0140 {Photon2 , "Photon 3 GeV"},
0141 {Photon3 , "Photon 4 GeV"},
0142 {Photon4 , "Photon 5 GeV"},
0143 {Inclusive , "Inclusive"}
0144 };
0145 return mapFlagToName;
0146 }
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161 inline bool DidTriggerFire(const uint32_t trg, TriggerAnalyzer* analyzer)
0162 {
0163
0164 if (MapTriggerFlagToName().count(trg) == 0)
0165 {
0166 std::cerr << PHWHERE << ": PANIC: unknown trigger flag (" << trg << ") provided! Aborting" << std::endl;
0167 exit(1);
0168 }
0169 return analyzer->didTriggerFire( MapTriggerFlagToName()[trg] );
0170
0171 }
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183 inline std::string MakeQAHistName(
0184 const std::string& base,
0185 const std::string& module,
0186 const std::string& tag = "")
0187 {
0188
0189
0190 std::string name = base;
0191
0192
0193 name.insert(0, "h_" + module + "_");
0194 if (!tag.empty())
0195 {
0196 name.append("_" + tag);
0197 }
0198 std::transform(
0199 name.begin(),
0200 name.end(),
0201 name.begin(),
0202 ::tolower
0203 );
0204 return name;
0205
0206 }
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219 inline std::vector<std::string> MakeQAHistNames(
0220 const std::vector<std::string>& bases,
0221 const std::string& module,
0222 const std::string& tag = "")
0223 {
0224
0225 std::vector<std::string> names = bases;
0226
0227
0228 for (auto& name : names)
0229 {
0230 name.insert(0, "h_" + module + "_");
0231 if (!tag.empty())
0232 {
0233 name.append("_" + tag);
0234 }
0235 std::transform(
0236 name.begin(),
0237 name.end(),
0238 name.begin(),
0239 ::tolower);
0240 }
0241 return names;
0242
0243 }
0244
0245 }
0246
0247 #endif
0248
0249