Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:39

0001 // -*- C++ -*-
0002 //
0003 // Package:    Calibration/EcalCalibAlgos
0004 // Class:      ECALpedestalPCLworker
0005 //
0006 /**\class ECALpedestalPCLworker ECALpedestalPCLworker.cc 
0007 
0008    Description: Fill DQM histograms with pedestals. Intended to be used on laser data from the TestEnablesEcalHcal dataset
0009 
0010  
0011 */
0012 //
0013 // Original Author:  Stefano Argiro
0014 //         Created:  Wed, 22 Mar 2017 14:46:48 GMT
0015 //
0016 //
0017 
0018 #include "FWCore/Framework/interface/Frameworkfwd.h"
0019 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0020 #include "DQMServices/Core/interface/DQMStore.h"
0021 
0022 #include "FWCore/Framework/interface/Event.h"
0023 #include "FWCore/Framework/interface/MakerMacros.h"
0024 
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
0027 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
0028 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0029 #include "DataFormats/TCDS/interface/BSTRecord.h"
0030 #include "DataFormats/TCDS/interface/TCDSRecord.h"
0031 //
0032 // class declaration
0033 //
0034 
0035 class ECALpedestalPCLworker : public DQMEDAnalyzer {
0036 public:
0037   explicit ECALpedestalPCLworker(const edm::ParameterSet &);
0038 
0039   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
0040 
0041 private:
0042   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0043   void analyze(const edm::Event &, const edm::EventSetup &) override;
0044 
0045   edm::EDGetTokenT<EBDigiCollection> digiTokenEB_;
0046   edm::EDGetTokenT<EEDigiCollection> digiTokenEE_;
0047   edm::EDGetTokenT<TCDSRecord> tcdsToken_;
0048   const edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> pedestalToken_;
0049 
0050   std::vector<MonitorElement *> meEB_;
0051   std::vector<MonitorElement *> meEE_;
0052 
0053   uint32_t pedestalSamples_;  // number of presamples to be used for pedestal determination
0054   bool checkSignal_;          // avoid frames containing a signal
0055   uint32_t sThresholdEB_;     // if checkSignal = true threshold (in adc count) above which we'll assume
0056                               // there's signal and not just pedestal
0057 
0058   uint32_t sThresholdEE_;
0059 
0060   bool dynamicBooking_;        // use old pedestal to book histograms
0061   int fixedBookingCenterBin_;  // if dynamicBooking_ = false, use this as bin center
0062   int nBins_;                  // number of bins per histogram
0063   std::string dqmDir_;         // DQM directory where histograms are stored
0064 
0065   bool requireStableBeam_;
0066 
0067   // compare ADC values
0068   static bool adc_compare(uint16_t a, uint16_t b) { return (a & 0xFFF) < (b & 0xFFF); }
0069 };