Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-02 00:53:33

0001 #ifndef DataFormats_L1TGlobal_GlobalObject_h
0002 #define DataFormats_L1TGlobal_GlobalObject_h
0003 
0004 #include <string>
0005 #include <utility>
0006 #include <vector>
0007 
0008 namespace l1t {
0009 
0010   /* Enum of L1T GlobalObjects
0011 
0012      IMPORTANT
0013        The elements of the enum l1t::GlobalObject are used in the data format GlobalObjectMapRecord.
0014        One instance of GlobalObjectMapRecord is produced online by the HLT,
0015        and it is written to disk as part of the RAW data tier.
0016        Said instance of GlobalObjectMapRecord is produced at HLT by the plugin L1TGlobalProducer,
0017        which implements the emulator of the Stage-2 Level-1 Global Trigger.
0018 
0019        In order not to change the meaning of existing data when adding entries to the enum l1t::GlobalObject,
0020        it is necessary to add such new entries with an explicit integer value which has not been used before in the enum.
0021 
0022        When adding new elements to the enum l1t::GlobalObject, make sure to also update accordingly
0023        (a) the vector l1t::kGlobalObjectEnumStringPairs in this file, and
0024        (b) the unit test implemented in test/test_catch2_l1tGlobalObject.cc in this package.
0025 
0026        For further information on the subject, please see
0027         https://github.com/cms-sw/cmssw/pull/42634#discussion_r1302636113
0028         https://github.com/cms-sw/cmssw/issues/42719
0029   */
0030   enum GlobalObject {
0031     gtMu = 0,
0032     gtMuShower = 1,
0033     gtEG = 2,
0034     gtJet = 3,
0035     gtTau = 4,
0036     gtETM = 5,
0037     gtETT = 6,
0038     gtHTT = 7,
0039     gtHTM = 8,
0040     gtETMHF = 9,
0041     gtTowerCount = 10,
0042     gtMinBiasHFP0 = 11,
0043     gtMinBiasHFM0 = 12,
0044     gtMinBiasHFP1 = 13,
0045     gtMinBiasHFM1 = 14,
0046     gtETTem = 15,
0047     gtAsymmetryEt = 16,
0048     gtAsymmetryHt = 17,
0049     gtAsymmetryEtHF = 18,
0050     gtAsymmetryHtHF = 19,
0051     gtCentrality0 = 20,
0052     gtCentrality1 = 21,
0053     gtCentrality2 = 22,
0054     gtCentrality3 = 23,
0055     gtCentrality4 = 24,
0056     gtCentrality5 = 25,
0057     gtCentrality6 = 26,
0058     gtCentrality7 = 27,
0059     gtExternal = 28,
0060     gtZDCP = 29,
0061     gtZDCM = 30,
0062     ObjNull = 31,
0063     gtHTMHF = 32,
0064   };
0065 
0066   const std::vector<std::pair<GlobalObject, std::string>> kGlobalObjectEnumStringPairs = {
0067       {gtMu, "Mu"},                    //  0
0068       {gtMuShower, "MuShower"},        //  1
0069       {gtEG, "EG"},                    //  2
0070       {gtJet, "Jet"},                  //  3
0071       {gtTau, "Tau"},                  //  4
0072       {gtETM, "ETM"},                  //  5
0073       {gtETT, "ETT"},                  //  6
0074       {gtHTT, "HTT"},                  //  7
0075       {gtHTM, "HTM"},                  //  8
0076       {gtETMHF, "ETMHF"},              //  9
0077       {gtTowerCount, "TowerCount"},    // 10
0078       {gtMinBiasHFP0, "MinBiasHFP0"},  // 11
0079       {gtMinBiasHFM0, "MinBiasHFM0"},  // 12
0080       {gtMinBiasHFP1, "MinBiasHFP1"},  // 13
0081       {gtMinBiasHFM1, "MinBiasHFM1"},  // 14
0082       {gtETTem, "ETTem"},              // 15
0083       {gtAsymmetryEt, "AsymEt"},       // 16
0084       {gtAsymmetryHt, "AsymHt"},       // 17
0085       {gtAsymmetryEtHF, "AsymEtHF"},   // 18
0086       {gtAsymmetryHtHF, "AsymHtHF"},   // 19
0087       {gtCentrality0, "CENT0"},        // 20
0088       {gtCentrality1, "CENT1"},        // 21
0089       {gtCentrality2, "CENT2"},        // 22
0090       {gtCentrality3, "CENT3"},        // 23
0091       {gtCentrality4, "CENT4"},        // 24
0092       {gtCentrality5, "CENT5"},        // 25
0093       {gtCentrality6, "CENT6"},        // 26
0094       {gtCentrality7, "CENT7"},        // 27
0095       {gtExternal, "External"},        // 28
0096       {gtZDCP, "ZDCP"},                // 29
0097       {gtZDCM, "ZDCM"},                // 30
0098       {ObjNull, "ObjNull"},            // 31
0099       {gtHTMHF, "HTMHF"},              // 32
0100   };
0101 
0102   // utility functions to convert GlobalObject enum to std::string and viceversa
0103   l1t::GlobalObject GlobalObjectStringToEnum(const std::string&);
0104   std::string GlobalObjectEnumToString(const GlobalObject&);
0105 
0106 }  // namespace l1t
0107 
0108 #endif