Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-16 01:19:29

0001 #ifndef Constants_h
0002 #define Constants_h
0003 
0004 #include "DQM/HcalCommon/interface/HcalCommonHeaders.h"
0005 
0006 #include <vector>
0007 
0008 namespace hcaldqm {
0009   namespace constants {
0010     /*
0011  *  Detector Subsystem Status States
0012  */
0013     double const GOOD = 1.0;
0014     double const PROBLEMATIC = 0.9;
0015     double const BAD = 0.5;
0016     double const VERY_LOW = 0.5;
0017     double const VERY_LOW_XXX = 0;
0018     double const NOT_APPLICABLE = -1;
0019     double const DELTA = 0.005;
0020 
0021     /*
0022  *  Electronics Constants
0023  */
0024     //  FED2Crate array and CRATE2FED array
0025     //  use conversion functions in Utilities.h
0026     //  For fast look up
0027     //  This is for uTCA Crates/FEDs only - no other way...
0028     // As of 2021: https://cmshcal.docs.cern.ch/hcos/crateFedMap/
0029     std::map<unsigned int, unsigned int> const crate2fed_map = {
0030         {24, 1100},
0031         {20, 1102},
0032         {21, 1104},
0033         {25, 1106},
0034         {31, 1108},
0035         {35, 1110},
0036         {37, 1112},
0037         {34, 1114},
0038         {30, 1116},
0039         {22, 1118},
0040         {29, 1120},
0041         {32, 1122},
0042         {3, 724},
0043         {7, 726},
0044         {6, 728},
0045         {13, 730},
0046 
0047         // New HO crates as of 2020
0048         {23, 1124},
0049         {27, 1126},
0050         {26, 1128},
0051         {38, 1134},
0052     };
0053 
0054     std::map<unsigned int, unsigned int> const fed2crate_map = {
0055         {724, 3},   {725, 3},   {726, 7},   {727, 7},   {728, 6},   {729, 6},   {730, 13},  {731, 13},  {1100, 24},
0056         {1101, 24}, {1102, 20}, {1103, 20}, {1104, 21}, {1105, 21}, {1106, 25}, {1107, 25}, {1108, 31}, {1109, 31},
0057         {1110, 35}, {1111, 35}, {1112, 37}, {1113, 37}, {1114, 34}, {1115, 34}, {1116, 30}, {1117, 30}, {1118, 22},
0058         {1119, 22}, {1120, 29}, {1121, 29}, {1122, 32}, {1123, 32}, {1124, 23}, {1125, 23}, {1126, 27}, {1127, 27},
0059         {1128, 26}, {1129, 26}, {1134, 38}, {1135, 38}, {1140, 24}, {1141, 20}, {1142, 21}, {1143, 25}, {1144, 31},
0060         {1145, 35}, {1146, 37}, {1147, 34}, {1148, 30},
0061     };
0062 
0063     std::vector<unsigned int> const fedList = {
0064         724,  725,  726,  727,  728,  729,  730,  731,  1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,
0065         1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125,
0066         1126, 1127, 1128, 1129, 1134, 1135, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148};
0067     std::vector<unsigned int> const fedListuTCA = {1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110,
0068                                                    1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121,
0069                                                    1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1134, 1135, 1140,
0070                                                    1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148};
0071     std::vector<unsigned int> const fedListVME = {724, 725, 726, 727, 728, 729, 730, 731};
0072     std::vector<unsigned int> const crateList = {3,  6,  7,  13, 20, 21, 22, 23, 24, 25,
0073                                                  26, 27, 29, 30, 31, 32, 34, 35, 37, 38};
0074     std::vector<unsigned int> const crateListuTCA = {20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 37, 38};
0075     std::vector<unsigned int> const crateListVME = {3, 6, 7, 13};
0076     std::vector<unsigned int> const crateListHF = {22, 29, 32};
0077     std::vector<unsigned int> const crateListHO = {23, 26, 27, 38};
0078 
0079     int const FED_uTCA_MAX_REAL = 50;
0080 
0081     //  FEDs use the first 50 uTCA FED numbers only everywhere
0082     int const FED_VME_MIN = FEDNumbering::MINHCALFEDID;
0083     int const FED_VME_MAX = FEDNumbering::MAXHCALFEDID;
0084     int const FED_VME_DELTA = 1;
0085     int const FED_VME_NUM = FED_VME_MAX - FED_VME_MIN + 1;
0086 
0087     int const FED_uTCA_MIN = FEDNumbering::MINHCALuTCAFEDID;
0088     //      int const FED_uTCA_MAX = FEDNumbering::MAXHCALuTCAFEDID;
0089     int const FED_uTCA_MAX = FED_uTCA_MIN + FED_uTCA_MAX_REAL - 1;
0090     int const FED_uTCA_NUM = FED_uTCA_MAX - FED_uTCA_MIN + 1;
0091     int const FED_uTCA_DELTA = 1;
0092     int const FED_TOTAL_NUM = FED_VME_NUM + FED_uTCA_NUM;
0093 
0094     //  Crates
0095     int const CRATE_VME_MIN = 0;
0096     int const CRATE_VME_MAX = 18;
0097     int const CRATE_VME_DELTA = 1;
0098     int const CRATE_VME_NUM = CRATE_VME_MAX - CRATE_VME_MIN + 1;
0099 
0100     int const CRATE_uTCA_MIN = 20;
0101     int const CRATE_uTCA_MAX = 37;
0102     int const CRATE_uTCA_DELTA = 1;
0103     int const CRATE_uTCA_NUM = CRATE_uTCA_MAX - CRATE_uTCA_MIN + 1;
0104     int const CRATE_TOTAL_NUM = CRATE_VME_NUM + CRATE_uTCA_NUM;
0105 
0106     //  Slots
0107     int const SLOT_uTCA_MIN = 1;
0108     int const SLOT_uTCA_MAX = 12;
0109     int const SLOT_uTCA_DELTA = 1;
0110     int const SLOT_uTCA_NUM = SLOT_uTCA_MAX - SLOT_uTCA_MIN + 1;
0111 
0112     int const SLOT_VME_MIN1 = 2;
0113     int const SLOT_VME_MAX1 = 7;
0114     int const SLOT_VME_MIN2 = 13;
0115     int const SLOT_VME_MAX2 = 18;
0116     int const SLOT_VME_NUM1 = SLOT_VME_MAX1 - SLOT_VME_MIN1 + 1;
0117     int const SLOT_VME_NUM2 = SLOT_VME_MAX2 - SLOT_VME_MIN2 + 1;
0118     int const SLOT_VME_NUM = SLOT_VME_NUM1 + SLOT_VME_NUM2;
0119 
0120     int const SPIGOT_MIN = 0;
0121     int const SPIGOT_MAX = 11;
0122     int const SPIGOT_NUM = SPIGOT_MAX - SPIGOT_MIN + 1;
0123 
0124     //  Fibers
0125     int const FIBER_VME_MIN = 1;
0126     int const FIBER_VME_MAX = 8;
0127     int const FIBER_VME_NUM = FIBER_VME_MAX - FIBER_VME_MIN + 1;
0128     int const FIBER_uTCA_MIN1 = 0;
0129     int const FIBER_uTCA_MAX1 = 11;
0130     int const FIBER_uTCA_MIN2 = 12;
0131     int const FIBER_uTCA_MAX2 = 23;
0132     int const FIBER_uTCA_NUM = FIBER_uTCA_MAX1 - FIBER_uTCA_MIN1 + 1 + FIBER_uTCA_MAX2 - FIBER_uTCA_MIN2 + 1;
0133 
0134     int const FIBERCH_MIN = 0;
0135     int const FIBERCH_MAX = 5;
0136     int const FIBERCH_NUM = FIBERCH_MAX - FIBERCH_MIN + 1;
0137 
0138     //  TP SLBs, Fibers
0139     int const SLB_MIN = 1;
0140     int const SLB_MAX = 6;
0141     int const SLB_NUM = SLB_MAX - SLB_MIN + 1;
0142 
0143     int const TPFIBER_MIN = 0;
0144     int const TPFIBER_MAX = 5;
0145     int const TPFIBER_NUM = TPFIBER_MAX - TPFIBER_MIN + 1;
0146 
0147     int const SLBCH_MIN = 0;
0148     int const SLBCH_MAX = 3;
0149     int const SLBCH_NUM = SLBCH_MAX - SLBCH_MIN + 1;
0150 
0151     int const TPFIBERCH_MIN = 0;
0152     int const TPFIBERCH_MAX = 7;
0153     int const TPFIBERCH_NUM = TPFIBERCH_MAX - TPFIBERCH_MIN + 1;
0154 
0155     /*
0156  *  Detector Constants
0157  */
0158 
0159     //  Hcal Subdetector
0160     int const HB = 1;
0161     int const HE = 2;
0162     int const HO = 3;
0163     int const HF = 4;
0164     int const SUBDET_NUM = 4;
0165     int const TPSUBDET_NUM = 2;
0166     std::string const SUBDET_NAME[SUBDET_NUM] = {"HB", "HE", "HO", "HF"};
0167     std::string const SUBDETPM_NAME[2 * SUBDET_NUM] = {"HBM", "HBP", "HEM", "HEP", "HOM", "HOP", "HFM", "HFP"};
0168     std::string const SUBSYSTEM = "Hcal";
0169     std::string const TPSUBDET_NAME[TPSUBDET_NUM] = {"HBHE", "HF"};
0170     std::string const TPSUBDETPM_NAME[2 * TPSUBDET_NUM] = {"HBHEM", "HBHEP", "HFM", "HFP"};
0171     std::string const TPSUBDETFW_NAME[2 * TPSUBDET_NUM] = {"Pure HB", "Overlap HBHE", "Pure HE", "HF"};
0172 
0173     //  iphis
0174     int const IPHI_MIN = 1;
0175     int const IPHI_MAX = 72;
0176     int const IPHI_NUM = 72;
0177     int const IPHI_NUM_HF = 36;
0178     int const IPHI_NUM_TPHF = 18;
0179     int const IPHI_DELTA = 1;
0180     int const IPHI_DELTA_HF = 2;
0181     int const IPHI_DELTA_TPHF = 4;
0182 
0183     //  ietas
0184     int const IETA_MIN = 1;
0185     int const IETA_DELTA = 1;
0186     int const IETA_MAX = 41;
0187     int const IETA_NUM = 2 * (IETA_MAX - IETA_MIN + 1) + 1;
0188     int const IETA_MIN_HB = 1;
0189     int const IETA_MAX_HB = 16;
0190     int const IETA_MIN_HE = 16;
0191     int const IETA_MAX_HE = 29;
0192     int const IETA_MIN_HO = 1;
0193     int const IETA_MAX_HO = 15;
0194     int const IETA_MIN_HF = 29;
0195     int const IETA_MAX_HF = 41;
0196 
0197     int const IETA_MAX_TPHBHE = 28;
0198     int const IETA_MAX_TPHF = 32;
0199 
0200     //  Depth
0201     int const DEPTH_MIN = 1;
0202     int const DEPTH_DELTA = 1;
0203     int const DEPTH_MAX = 4;
0204     int const DEPTH_NUM = 4;
0205 
0206     //  Caps
0207     int const CAPS_NUM = 4;
0208 
0209     //  Number of FG Bits
0210     int const NUM_FGBITS = 6;
0211 
0212     /*
0213  *  Number of Channels Constants
0214  */
0215     int const CHS_NUM[SUBDET_NUM] = {2592, 2592, 2192, 1728};  // HO ??!
0216     int const TPCHS_NUM[TPSUBDET_NUM] = {2 * 28 * 72, 144};
0217 
0218     /*
0219  *  Number of Time Samples
0220  */
0221     int const TS_NUM[SUBDET_NUM] = {10, 10, 10, 4};
0222 
0223     /*
0224  *  Value Constants
0225  */
0226     double const AXIS_ENERGY_MIN = -10.;
0227     double const AXIS_ENERGY_MAX = 200;
0228     int const AXIS_ENERGY_NBINS = 400;
0229     double const AXIS_TIME_MIN = -50.;
0230     double const AXIS_TIME_MAX = 50;
0231     int const AXIS_TIME_NBINS = 200;
0232     int const AXIS_ADC_NBINS_PED = 100;
0233     double const AXIS_ADC_MAX_PED = 5;
0234     int const AXIS_ADC_NBINS = 128;
0235     double const AXIS_ADC_MIN = 0;
0236     double const AXIS_ADC_MAX = 128;
0237     int const AXIS_NOMFC_NBINS_3000 = 300;
0238     double const AXIS_NOMFC_MAX_3000 = 3000.;
0239     int const AXIS_NOMFC_NBINS = 300;
0240     double const AXIS_NOMFC_MIN = 0;
0241     double const AXIS_NOMFC_MAX = 3000.;
0242     int const AXIS_TIMETS_NBINS = 10;
0243     double const AXIS_TIMETS_MIN = 0;
0244     double const AXIS_TIMETS_MAX = 10;
0245 
0246     int const CALIBEVENTS_MIN = 100;
0247     int const GARBAGE_VALUE = -1000;
0248     int const FIBEROFFSET_INVALID = -1000;
0249 
0250     int const RAW_EMPTY = 16;
0251     int const UTCA_DATAFLAVOR = 0x5;
0252 
0253     double const adc2fC[256] = {
0254         1.58,   4.73,   7.88,   11.0,   14.2,   17.3,   20.5,   23.6,   26.8,   29.9,   33.1,   36.2,   39.4,
0255         42.5,   45.7,   48.8,   53.6,   60.1,   66.6,   73.0,   79.5,   86.0,   92.5,   98.9,   105,    112,
0256         118,    125,    131,    138,    144,    151,    157,    164,    170,    177,    186,    199,    212,
0257         225,    238,    251,    264,    277,    289,    302,    315,    328,    341,    354,    367,    380,
0258         393,    406,    418,    431,    444,    464,    490,    516,    542,    568,    594,    620,    569,
0259         594,    619,    645,    670,    695,    720,    745,    771,    796,    821,    846,    871,    897,
0260         922,    947,    960,    1010,   1060,   1120,   1170,   1220,   1270,   1320,   1370,   1430,   1480,
0261         1530,   1580,   1630,   1690,   1740,   1790,   1840,   1890,   1940,   2020,   2120,   2230,   2330,
0262         2430,   2540,   2640,   2740,   2850,   2950,   3050,   3150,   3260,   3360,   3460,   3570,   3670,
0263         3770,   3880,   3980,   4080,   4240,   4450,   4650,   4860,   5070,   5280,   5490,
0264 
0265         5080,   5280,   5480,   5680,   5880,   6080,   6280,   6480,   6680,   6890,   7090,   7290,   7490,
0266         7690,   7890,   8090,   8400,   8810,   9220,   9630,   10000,  10400,  10900,  11300,  11700,  12100,
0267         12500,  12900,  13300,  13700,  14100,  14500,  15000,  15400,  15800,  16200,  16800,  17600,  18400,
0268         19300,  20100,  20900,  21700,  22500,  23400,  24200,  25000,  25800,  26600,  27500,  28300,  29100,
0269         29900,  30700,  31600,  32400,  33200,  34400,  36100,  37700,  39400,  41000,  42700,  44300,  41100,
0270         42700,  44300,  45900,  47600,  49200,  50800,  52500,  54100,  55700,  57400,  59000,  60600,  62200,
0271         63900,  65500,  68000,  71300,  74700,  78000,  81400,  84700,  88000,  91400,  94700,  98100,  101000,
0272         105000, 108000, 111000, 115000, 118000, 121000, 125000, 128000, 131000, 137000, 145000, 152000, 160000,
0273         168000, 176000, 183000, 191000, 199000, 206000, 214000, 222000, 230000, 237000, 245000, 253000, 261000,
0274         268000, 276000, 284000, 291000, 302000, 316000, 329000, 343000, 356000, 370000, 384000};
0275 
0276     /*
0277  *  TObject Related. The first 3 bits are set by the Axis Class
0278  *  0 - log X axis
0279  *  1 - log Y axis
0280  *  2 - log Z axis
0281  */
0282     int const BIT_OFFSET = 19;
0283     int const BIT_AXIS_XLOG = 0;
0284     int const BIT_AXIS_YLOG = 1;
0285     int const BIT_AXIS_ZLOG = 2;
0286     int const BIT_AXIS_LS = 3;
0287     int const BIT_AXIS_FLAG = 4;
0288 
0289     /*
0290  *  Orbit Gap Operations enum
0291  */
0292     uint8_t const EVENTTYPE_PEDESTAL = 1;
0293     uint8_t const EVENTTYPE_LASER = 14;
0294     uint8_t const EVENTTYPE_LED = 15;
0295     enum OrbitGapType {
0296       tNull = 0,
0297       tPedestal = 1,
0298       tLED = 2,
0299       tHFRaddam = 3,
0300       tHBHEHPD = 4,
0301       tHO = 5,
0302       tHF = 6,
0303       tZDC = 7,
0304       tHEPMega = 8,
0305       tHEMMega = 9,
0306       tHBPMega = 10,
0307       tHBMMega = 11,
0308       tSomething = 12,
0309       tCRF = 13,
0310       tCalib = 14,
0311       tSafe = 15,
0312       tUnknown = 16,
0313       nOrbitGapType = 17
0314     };
0315   }  // namespace constants
0316 }  // namespace hcaldqm
0317 
0318 #endif