Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:10:10

0001 
0002 #include "DQM/HcalCommon/interface/DetectorQuantity.h"
0003 
0004 namespace hcaldqm {
0005   namespace quantity {
0006     int getValue_iphi(HcalDetId const &did) { return did.iphi(); }
0007 
0008     int getValue_ieta(HcalDetId const &did) {
0009       int x = did.ieta();
0010       if (x < 0)
0011         x = did.subdet() == HcalForward ? x + 41 : x + 42;
0012       else
0013         x = did.subdet() == HcalForward ? x + 42 : x + 41;
0014       return x;
0015     }
0016 
0017     int getValue_depth(HcalDetId const &did) { return did.depth(); }
0018 
0019     int getValue_Subdet(HcalDetId const &did) { return did.subdet() - 1; }
0020 
0021     int getValue_SubdetPM(HcalDetId const &did) {
0022       return did.ieta() < 0 ? 2 * (did.subdet() - 1) : 2 * (did.subdet() - 1) + 1;
0023     }
0024 
0025     uint32_t getBin_iphi(HcalDetId const &did) { return (uint32_t)(did.iphi()); }
0026 
0027     uint32_t getBin_ieta(HcalDetId const &did) { return (uint32_t)(getValue_ieta(did) + 1); }
0028 
0029     uint32_t getBin_depth(HcalDetId const &did) {  //return (uint32_t)(did.depth());}
0030       return (uint32_t)(did.subdet() == HcalOuter ? 7 : did.depth());
0031     }
0032 
0033     uint32_t getBin_Subdet(HcalDetId const &did) { return (uint32_t)(did.subdet()); }
0034 
0035     uint32_t getBin_SubdetPM(HcalDetId const &did) { return (uint32_t)(getValue_SubdetPM(did) + 1); }
0036 
0037     HcalDetId getDid_iphi(int v) { return HcalDetId(HcalBarrel, v, 1, 1); }
0038 
0039     HcalDetId getDid_ieta(int v) {
0040       return HcalDetId(HcalBarrel, v <= 41 ? (v <= 12 ? v - 41 : v - 42) : (v >= 71 ? v - 42 : v - 41), 1, 1);
0041     }
0042 
0043     HcalDetId getDid_depth(int v) { return HcalDetId(HcalBarrel, 1, 1, v); }
0044 
0045     HcalDetId getDid_Subdet(int v) { return HcalDetId((HcalSubdetector)(v + 1), 1, 1, 1); }
0046 
0047     HcalDetId getDid_SubdetPM(int v) { return HcalDetId((HcalSubdetector)(v / 2 + 1), v % 2 == 0 ? 1 : -1, 1, 1); }
0048 
0049     std::vector<std::string> getLabels_iphi() { return std::vector<std::string>(); }
0050 
0051     std::vector<std::string> getLabels_ieta() {
0052       std::vector<std::string> labels;
0053       char name[10];
0054       for (int i = 0; i < 84; i++) {
0055         sprintf(name, "%d", getDid_ieta(i).ieta());
0056         labels.push_back(std::string(name));
0057       }
0058       return labels;
0059     }
0060 
0061     std::vector<std::string> getLabels_depth() { return std::vector<std::string>(); }
0062 
0063     std::vector<std::string> getLabels_Subdet() {
0064       std::vector<std::string> labels;
0065       labels.reserve(4);
0066       for (int i = 0; i < 4; i++)
0067         labels.push_back(constants::SUBDET_NAME[i]);
0068       return labels;
0069     }
0070 
0071     std::vector<std::string> getLabels_SubdetPM() {
0072       std::vector<std::string> labels;
0073       labels.reserve(8);
0074       for (int i = 0; i < 8; i++)
0075         labels.push_back(constants::SUBDETPM_NAME[i]);
0076       return labels;
0077     }
0078   }  // namespace quantity
0079 }  // namespace hcaldqm