Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-25 03:21:55

0001 // $Id: EcalStatusAnalyzer.h
0002 
0003 #include <vector>
0004 #include <map>
0005 
0006 #include <memory>
0007 #include <FWCore/Framework/interface/one/EDAnalyzer.h>
0008 #include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
0009 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
0010 #include <TBDataFormats/EcalTBObjects/interface/EcalTBEventHeader.h>
0011 
0012 class Timestamp;
0013 
0014 class EcalStatusAnalyzer : public edm::one::EDAnalyzer<> {
0015 public:
0016   explicit EcalStatusAnalyzer(const edm::ParameterSet& iConfig);
0017   ~EcalStatusAnalyzer() override = default;
0018 
0019   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0020   void beginJob() override;
0021   void endJob() override;
0022 
0023   enum EcalLaserColorType {
0024     iBLUE = 0,
0025     iGREEN = 1,
0026     iRED = 3,  // in fact should be 2
0027     iIR = 2    // in fact should be 3
0028   };
0029 
0030 private:
0031   int iEvent;
0032 
0033   const std::string _dataType;
0034 
0035   const std::string resdir_;
0036   const std::string statusfile_;
0037   const std::string eventHeaderCollection_;
0038   const std::string eventHeaderProducer_;
0039   const edm::EDGetTokenT<EcalRawDataCollection> dccToken_;
0040   const edm::EDGetTokenT<EcalTBEventHeader> headToken_;
0041 
0042   std::map<int, int> isFedLasCreated;
0043   std::map<int, int> isFedTPCreated;
0044   std::map<int, int> isFedPedCreated;
0045 
0046   std::vector<int> fedIDsLas;
0047   std::vector<int> fedIDsTP;
0048   std::vector<int> fedIDsPed;
0049   std::vector<int> dccIDsLas;
0050   std::vector<int> dccIDsTP;
0051   std::vector<int> dccIDsPed;
0052 
0053   // Identify run type
0054 
0055   int runType;
0056   int runNum;
0057   int event;
0058   int nSM;
0059   int fedID;
0060   int dccID;
0061 
0062   unsigned long long timeStampCur;
0063 
0064   std::map<int, unsigned long long> timeStampBegLas;
0065   std::map<int, unsigned long long> timeStampEndLas;
0066 
0067   std::map<int, unsigned long long> timeStampBegTP;
0068   std::map<int, unsigned long long> timeStampEndTP;
0069 
0070   std::map<int, unsigned long long> timeStampBegPed;
0071   std::map<int, unsigned long long> timeStampEndPed;
0072 
0073   std::map<int, short> MGPAGainLas;
0074   std::map<int, short> MEMGainLas;
0075 
0076   std::map<int, short> MGPAGainTP;
0077   std::map<int, short> MEMGainTP;
0078 
0079   std::map<int, short> MGPAGainPed;
0080   std::map<int, short> MEMGainPed;
0081 
0082   std::map<int, int> laserPowerBlue;
0083   std::map<int, int> laserFilterBlue;
0084   std::map<int, int> laserDelayBlue;
0085 
0086   std::map<int, int> laserPowerRed;
0087   std::map<int, int> laserFilterRed;
0088   std::map<int, int> laserDelayRed;
0089 
0090   std::map<int, int> nEvtsLas;
0091   std::map<int, int> nBlueLas;
0092   std::map<int, int> nRedLas;
0093   std::map<int, int> runTypeLas;
0094 
0095   std::map<int, int> nEvtsTP;
0096   std::map<int, int> runTypeTP;
0097 
0098   std::map<int, int> nEvtsPed;
0099   std::map<int, int> runTypePed;
0100 };