Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:31

0001 #ifndef LaserTask_h
0002 #define LaserTask_h
0003 
0004 /*
0005  *  file:           LaserTask.h
0006  *  Author:         Viktor Khristenko
0007  *  Date:           16.10.2015
0008  */
0009 
0010 #include "DQM/HcalCommon/interface/DQTask.h"
0011 #include "DQM/HcalCommon/interface/Utilities.h"
0012 #include "DQM/HcalCommon/interface/ElectronicsMap.h"
0013 #include "DQM/HcalCommon/interface/ContainerXXX.h"
0014 #include "DQM/HcalCommon/interface/Container1D.h"
0015 #include "DQM/HcalCommon/interface/Container2D.h"
0016 #include "DQM/HcalCommon/interface/ContainerSingle1D.h"
0017 #include "DQM/HcalCommon/interface/ContainerSingleProf1D.h"
0018 #include "DQM/HcalCommon/interface/ContainerSingle2D.h"
0019 #include "DQM/HcalCommon/interface/ContainerSingleProf2D.h"
0020 #include "DQM/HcalCommon/interface/ContainerProf1D.h"
0021 #include "DQM/HcalCommon/interface/ContainerProf2D.h"
0022 #include "FWCore/Framework/interface/Run.h"
0023 
0024 class LaserTask : public hcaldqm::DQTask {
0025 public:
0026   LaserTask(edm::ParameterSet const &);
0027   ~LaserTask() override {}
0028 
0029   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0030   void dqmEndRun(edm::Run const &r, edm::EventSetup const &) override {
0031     if (_ptype == hcaldqm::fLocal) {
0032       if (r.runAuxiliary().run() == 1)
0033         return;
0034       else
0035         this->_dump();
0036     }
0037   }
0038   void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;
0039 
0040 protected:
0041   //    funcs
0042   void _process(edm::Event const &, edm::EventSetup const &) override;
0043   void _resetMonitors(hcaldqm::UpdateFreq) override;
0044   bool _isApplicable(edm::Event const &) override;
0045   virtual void _dump();
0046   void processLaserMon(edm::Handle<QIE10DigiCollection> &col, std::vector<int> &iLaserMonADC);
0047 
0048   //    tags and tokens
0049   edm::InputTag _tagQIE11;
0050   edm::InputTag _tagHO;
0051   edm::InputTag _tagQIE10;
0052   edm::InputTag _taguMN;
0053   edm::EDGetTokenT<QIE11DigiCollection> _tokQIE11;
0054   edm::EDGetTokenT<HODigiCollection> _tokHO;
0055   edm::EDGetTokenT<QIE10DigiCollection> _tokQIE10;
0056   edm::EDGetTokenT<HcalUMNioDigi> _tokuMN;
0057   edm::ESGetToken<HcalDbService, HcalDbRecord> hcalDbServiceToken_;
0058 
0059   enum LaserFlag { fBadTiming = 0, fMissingLaserMon = 1, nLaserFlag = 2 };
0060   std::vector<hcaldqm::flag::Flag> _vflags;
0061 
0062   //    emap
0063   hcaldqm::electronicsmap::ElectronicsMap _ehashmap;
0064   hcaldqm::filter::HashFilter _filter_uTCA;
0065   hcaldqm::filter::HashFilter _filter_VME;
0066   std::vector<uint32_t> _vhashFEDs;
0067 
0068   //    Cuts and variables
0069   int _nevents;
0070   double _lowHBHE;
0071   double _lowHE;
0072   double _lowHO;
0073   double _lowHF;
0074   uint32_t _laserType;
0075 
0076   //    Compact
0077   hcaldqm::ContainerXXX<double> _xSignalSum;
0078   hcaldqm::ContainerXXX<double> _xSignalSum2;
0079   hcaldqm::ContainerXXX<int> _xEntries;
0080   hcaldqm::ContainerXXX<double> _xTimingSum;
0081   hcaldqm::ContainerXXX<double> _xTimingSum2;
0082   hcaldqm::ContainerXXX<double> _xTimingRefLMSum;  // For computation of channel-by-channel mean timing w.r.t. lasermon
0083   hcaldqm::ContainerXXX<double> _xTimingRefLMSum2;
0084   hcaldqm::ContainerXXX<int> _xNBadTimingRefLM;  // Count channels with bad timing
0085   hcaldqm::ContainerXXX<int> _xNChs;             // number of channels per FED as in emap
0086 
0087   //    1D
0088   hcaldqm::Container1D _cSignalMean_Subdet;
0089   hcaldqm::Container1D _cSignalRMS_Subdet;
0090   hcaldqm::Container1D _cSignalMeanQIE1011_Subdet;
0091   hcaldqm::Container1D _cSignalRMSQIE1011_Subdet;
0092   hcaldqm::Container1D _cTimingMean_Subdet;
0093   hcaldqm::Container1D _cTimingRMS_Subdet;
0094 
0095   hcaldqm::Container1D _cADC_SubdetPM;
0096 
0097   //    Prof1D
0098   hcaldqm::ContainerProf1D _cShapeCut_FEDSlot;
0099   hcaldqm::ContainerProf1D _cTimingvsEvent_SubdetPM;
0100   hcaldqm::ContainerProf1D _cSignalvsEvent_SubdetPM;
0101   hcaldqm::ContainerProf1D _cTimingvsLS_SubdetPM;
0102   hcaldqm::ContainerProf1D _cSignalvsLS_SubdetPM;
0103   hcaldqm::ContainerProf1D _cSignalvsLSQIE1011_SubdetPM;
0104   hcaldqm::ContainerProf1D _cTimingvsBX_SubdetPM;
0105   hcaldqm::ContainerProf1D _cSignalvsBX_SubdetPM;
0106   hcaldqm::ContainerProf1D _cSignalvsBXQIE1011_SubdetPM;
0107 
0108   //    2D timing/signals
0109   hcaldqm::ContainerProf2D _cSignalMean_depth;
0110   hcaldqm::ContainerProf2D _cSignalRMS_depth;
0111   hcaldqm::ContainerProf2D _cSignalMeanQIE1011_depth;
0112   hcaldqm::ContainerProf2D _cSignalRMSQIE1011_depth;
0113   hcaldqm::ContainerProf2D _cTimingMean_depth;
0114   hcaldqm::ContainerProf2D _cTimingRMS_depth;
0115 
0116   hcaldqm::ContainerProf2D _cSignalMean_FEDuTCA;
0117   hcaldqm::ContainerProf2D _cTimingMean_FEDuTCA;
0118   hcaldqm::ContainerProf2D _cSignalRMS_FEDuTCA;
0119   hcaldqm::ContainerProf2D _cTimingRMS_FEDuTCA;
0120 
0121   //    Bad Quality and Missing Channels
0122   hcaldqm::Container2D _cMissing_depth;
0123   hcaldqm::Container2D _cMissing_FEDuTCA;
0124 
0125   // Things for LASERMON
0126   edm::InputTag _tagLaserMon;
0127   edm::EDGetTokenT<QIE10DigiCollection> _tokLaserMon;
0128 
0129   std::vector<int> _vLaserMonIPhi;  // Laser mon digis are assigned to CBox=5, IEta=0, IPhi=[23-index] by the emap
0130   int _laserMonIEta;
0131   int _laserMonCBox;
0132   int _laserMonDigiOverlap;
0133   int _laserMonTS0;
0134   double _laserMonThreshold;
0135   std::map<HcalSubdetector, std::pair<double, double>> _thresh_timingreflm;  // Min and max timing (ref. lasermon)
0136   double _thresh_frac_timingreflm;  // Flag threshold (BAD) on fraction of channels with bad timing
0137   double _thresh_min_lmsumq;        // Threshold on minimum SumQ from lasermon, if laser is expected
0138   int _xMissingLaserMon;            // Counter for missing lasermon events
0139 
0140   hcaldqm::ContainerSingle1D _cLaserMonSumQ;
0141   hcaldqm::ContainerSingle1D _cLaserMonTiming;
0142   hcaldqm::ContainerSingleProf1D _cLaserMonSumQ_LS;       // Online
0143   hcaldqm::ContainerSingleProf1D _cLaserMonTiming_LS;     // Online
0144   hcaldqm::ContainerSingleProf1D _cLaserMonSumQ_Event;    // Local
0145   hcaldqm::ContainerSingleProf1D _cLaserMonTiming_Event;  // Local
0146   hcaldqm::Container2D _cTiming_DigivsLaserMon_SubdetPM;
0147   hcaldqm::ContainerProf2D _cTimingDiffLS_SubdetPM;
0148   hcaldqm::ContainerProf2D _cTimingDiffEvent_SubdetPM;
0149 
0150   //    Summaries
0151   hcaldqm::Container2D _cSummaryvsLS_FED;
0152   hcaldqm::ContainerSingle2D _cSummaryvsLS;
0153 };
0154 
0155 #endif