Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-26 03:51:38

0001 #ifndef DigiTask_h
0002 #define DigiTask_h
0003 
0004 /**
0005  *  file:           DigiTask.h
0006  *  Author:         VK
0007  *  Description:
0008  *      HCAL DIGI Data Tier Processing.
0009  *
0010  *  Online:
0011  *      
0012  *  Offline:
0013  *      - HF Q2/(Q1+Q2) is not included.
0014  */
0015 
0016 #include "DQM/HcalCommon/interface/DQTask.h"
0017 #include "DQM/HcalCommon/interface/Utilities.h"
0018 #include "DQM/HcalCommon/interface/HashFilter.h"
0019 #include "DQM/HcalCommon/interface/ElectronicsMap.h"
0020 #include "DQM/HcalCommon/interface/Container1D.h"
0021 #include "DQM/HcalCommon/interface/Container2D.h"
0022 #include "DQM/HcalCommon/interface/ContainerProf1D.h"
0023 #include "DQM/HcalCommon/interface/ContainerProf2D.h"
0024 #include "DQM/HcalCommon/interface/ContainerSingle1D.h"
0025 #include "DQM/HcalCommon/interface/ContainerSingle2D.h"
0026 #include "DQM/HcalCommon/interface/ContainerSingleProf2D.h"
0027 #include "DQM/HcalCommon/interface/ContainerXXX.h"
0028 
0029 class DigiTask : public hcaldqm::DQTask {
0030 public:
0031   DigiTask(edm::ParameterSet const &);
0032   ~DigiTask() override {}
0033 
0034   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0035   std::shared_ptr<hcaldqm::Cache> globalBeginLuminosityBlock(edm::LuminosityBlock const &,
0036                                                              edm::EventSetup const &) const override;
0037   void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
0038 
0039 protected:
0040   void _process(edm::Event const &, edm::EventSetup const &) override;
0041   void _resetMonitors(hcaldqm::UpdateFreq) override;
0042 
0043   edm::InputTag _tagQIE11;
0044   edm::InputTag _tagHO;
0045   edm::InputTag _tagQIE10;
0046   edm::EDGetTokenT<QIE11DigiCollection> _tokQIE11;
0047   edm::EDGetTokenT<HODigiCollection> _tokHO;
0048   edm::EDGetTokenT<QIE10DigiCollection> _tokQIE10;
0049   edm::ESGetToken<HcalDbService, HcalDbRecord> hcalDbServiceToken_;
0050 
0051   double _cutSumQ_HBHE, _cutSumQ_HO, _cutSumQ_HF;
0052   double _thresh_unihf;
0053 
0054   //    flag vector
0055   std::vector<hcaldqm::flag::Flag> _vflags;
0056   enum DigiFlag { fDigiSize = 0, fUni = 1, fNChsHF = 2, fUnknownIds = 3, fLED = 4, fCapId = 5, nDigiFlag = 6 };
0057 
0058   //    hashes/FED vectors
0059   std::vector<uint32_t> _vhashFEDs;
0060 
0061   std::map<HcalSubdetector, int> _refDigiSize;
0062 
0063   //    emap
0064   hcaldqm::electronicsmap::ElectronicsMap _ehashmap;  // online only
0065   hcaldqm::electronicsmap::ElectronicsMap _dhashmap;
0066 
0067   //    Filters
0068   hcaldqm::filter::HashFilter _filter_VME;
0069   hcaldqm::filter::HashFilter _filter_uTCA;
0070   hcaldqm::filter::HashFilter _filter_FEDHF;
0071   hcaldqm::filter::HashFilter _filter_QIE1011;
0072   hcaldqm::filter::HashFilter _filter_QIE8;
0073   hcaldqm::filter::HashFilter _filter_TDC2bit;
0074   hcaldqm::filter::HashFilter _filter_TDC6bit;
0075 
0076   /* hcaldqm::Containers */
0077   //    ADC, fC - Charge - just filling - no summary!
0078   hcaldqm::Container1D _cADC_SubdetPM;
0079   hcaldqm::Container1D _cfC_SubdetPM;
0080   hcaldqm::Container1D _cSumQ_SubdetPM;
0081   hcaldqm::ContainerProf2D _cSumQ_depth;
0082   hcaldqm::ContainerProf1D _cSumQvsLS_SubdetPM;
0083   hcaldqm::ContainerProf1D _cSumQvsBX_SubdetPM;  // online only!
0084 
0085   // ADC, fC for HF (QIE10 has different ADC/fC)
0086   hcaldqm::Container1D _cADC_SubdetPM_QIE1011;
0087   hcaldqm::Container1D _cfC_SubdetPM_QIE1011;
0088   hcaldqm::Container1D _cSumQ_SubdetPM_QIE1011;
0089   hcaldqm::ContainerProf1D _cSumQvsLS_SubdetPM_QIE1011;
0090   hcaldqm::ContainerProf1D _cSumQvsBX_SubdetPM_QIE1011;  // online only!
0091 
0092   //    Shape - just filling - not summary!
0093   hcaldqm::Container1D _cShapeCut_FED;
0094   hcaldqm::Container2D _cADCvsTS_SubdetPM;
0095   hcaldqm::Container2D _cADCvsTS_SubdetPM_QIE1011;
0096 
0097   //    Timing
0098   //    just filling - no summary!
0099   hcaldqm::Container1D _cTimingCut_SubdetPM;
0100   hcaldqm::Container1D _cTimingCutHTH_SubdetPM;
0101   hcaldqm::ContainerProf2D _cTimingCut_FEDuTCA;
0102   hcaldqm::ContainerProf2D _cTimingCut_ElectronicsuTCA;
0103   hcaldqm::ContainerProf1D _cTimingCutvsLS_FED;
0104   hcaldqm::ContainerProf1D _cTimingCutvsLS_SubdetPM;
0105   hcaldqm::ContainerProf2D _cTimingCut_depth;
0106   hcaldqm::ContainerProf1D _cTimingCutvsiphi_SubdetPM;  // online only!
0107   hcaldqm::ContainerProf1D _cTimingCutvsieta_Subdet;    // online only!
0108 
0109   //    Only for Online mode! just filling - no summary!
0110   hcaldqm::ContainerProf1D _cQ2Q12CutvsLS_FEDHF;  //    online only!
0111 
0112   //    Occupancy w/o a Cut - whatever is sitting in the Digi Collection
0113   //    used to determine Missing Digis => used for Summary!
0114   hcaldqm::Container2D _cOccupancy_FEDuTCA;
0115   hcaldqm::Container2D _cOccupancy_ElectronicsuTCA;
0116   hcaldqm::Container2D _cOccupancy_Crate;
0117   hcaldqm::Container2D _cOccupancy_CrateSlot;
0118   hcaldqm::Container2D _cOccupancy_depth;
0119   hcaldqm::Container1D _cOccupancyvsiphi_SubdetPM;  // online only
0120   hcaldqm::Container1D _cOccupancyvsieta_Subdet;    // online only
0121 
0122   //    Occupancy w/ a Cut
0123   //    used to determine if occupancy is symmetric or not. =>
0124   //    used for Summary
0125   hcaldqm::Container2D _cOccupancyCut_FEDuTCA;
0126   hcaldqm::Container2D _cOccupancyCut_ElectronicsuTCA;
0127   hcaldqm::Container2D _cOccupancyCut_depth;
0128   hcaldqm::Container1D _cOccupancyCutvsiphi_SubdetPM;  // online only
0129   hcaldqm::Container1D _cOccupancyCutvsieta_Subdet;    // online only
0130   //hcaldqm::Container2D _cOccupancyCutvsSlotvsLS_HFPM; // online only
0131   hcaldqm::Container2D _cOccupancyCutvsiphivsLS_SubdetPM;  // online only
0132 
0133   //    Occupancy w/o and w/ a Cut vs BX and vs LS
0134   hcaldqm::ContainerProf1D _cOccupancyvsLS_Subdet;
0135   hcaldqm::ContainerProf1D _cOccupancyCutvsLS_Subdet;  // online only
0136   hcaldqm::ContainerProf1D _cOccupancyCutvsBX_Subdet;  // online only
0137 
0138   //    #Time Samples for a digi. Used for Summary generation
0139   hcaldqm::Container1D _cDigiSize_Crate;
0140   hcaldqm::Container1D _cDigiSize_FED;
0141   hcaldqm::ContainerProf1D _cDigiSizevsLS_FED;     // online only
0142   hcaldqm::ContainerXXX<uint32_t> _xDigiSize;      // online only
0143   hcaldqm::ContainerXXX<uint32_t> _xUniHF, _xUni;  // online only
0144   hcaldqm::ContainerXXX<uint32_t> _xNChs;          // online only
0145   hcaldqm::ContainerXXX<uint32_t> _xNChsNominal;   // online only
0146   hcaldqm::ContainerXXX<uint32_t> _xBadCapid;      // online only
0147 
0148   // QIE10 TDC histograms
0149   hcaldqm::Container2D _cLETDCvsADC_2bit_SubdetPM;
0150   hcaldqm::Container2D _cLETDCvsADC_6bit_SubdetPM;
0151   hcaldqm::Container2D _cLETDCvsTS_2bit_SubdetPM;
0152   hcaldqm::Container2D _cLETDCvsTS_6bit_SubdetPM;
0153   hcaldqm::Container1D _cLETDCTime_SubdetPM;
0154   hcaldqm::ContainerProf2D _cLETDCTime_depth;
0155   hcaldqm::Container2D _cLETDCTimevsADC_SubdetPM;
0156 
0157   // Bad TDC histograms
0158   hcaldqm::Container1D _cBadTDCValues_SubdetPM;
0159   hcaldqm::Container1D _cBadTDCvsBX_SubdetPM;
0160   hcaldqm::Container1D _cBadTDCvsLS_SubdetPM;
0161   hcaldqm::Container2D _cBadTDCCount_depth;
0162 
0163   hcaldqm::Container1D _cBadTDCValues;
0164   hcaldqm::Container1D _cBadTDCvsBX;
0165   hcaldqm::Container1D _cBadTDCvsLS;
0166 
0167   // (Capid - BX) % 4
0168   hcaldqm::Container1D _cCapidMinusBXmod4_SubdetPM;
0169   hcaldqm::ContainerSingle2D _cCapidMinusBXmod4_CrateSlotuTCA[4];  // CrateSlot 2D histograms for each (capid-BX)%4
0170   hcaldqm::ContainerSingle2D _cCapid_BadvsFEDvsLS;
0171   hcaldqm::ContainerSingle2D
0172       _cCapid_BadvsFEDvsLSmod60;  // Same as _cCapid_BadvsFEDvsLS, but only for last 50 LSes (for sound alarm turning off when problem goes away)
0173 
0174   //    #events counters
0175   MonitorElement *meNumEvents1LS;  // to transfer the #events to harvesting
0176   MonitorElement *meUnknownIds1LS;
0177   bool _unknownIdsPresent;
0178 
0179   hcaldqm::Container2D _cSummaryvsLS_FED;    // online only
0180   hcaldqm::ContainerSingle2D _cSummaryvsLS;  // online only
0181 
0182   bool _qie10InConditions;  // Flag to protect against QIE10 digis not in conditions in 2016.
0183 
0184   std::map<HcalSubdetector, short> _capidmbx;  // Expected (capid - BX) % 4 for each subdet
0185 
0186   // LED monitoring stuff
0187   double _thresh_led;
0188   std::map<HcalSubdetector, std::vector<HcalDetId> > _ledCalibrationChannels;
0189 
0190   hcaldqm::Container1D _LED_CUCountvsLS_Subdet;       // Misfire count vs LS
0191   hcaldqm::Container1D _LED_CUCountvsLSmod60_Subdet;  // Misfire count vs LS
0192   hcaldqm::Container2D _LED_ADCvsBX_Subdet;           // Pin diode amplitude vs BX
0193 };
0194 
0195 #endif