Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:23

0001 #ifndef EcalEBTrigPrimProducer_h
0002 #define EcalEBTrigPrimProducer_h
0003 
0004 /** \class EcalEBTrigPrimProducer
0005  *  For Phase II 
0006  *
0007  ************************************************************/
0008 
0009 #include <memory>
0010 
0011 #include "FWCore/Framework/interface/stream/EDProducer.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/Utilities/interface/EDGetToken.h"
0015 #include "FWCore/Utilities/interface/ESGetToken.h"
0016 
0017 #include "DataFormats/Common/interface/Handle.h"
0018 
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0021 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
0022 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
0023 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
0024 
0025 #include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
0026 #include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
0027 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
0028 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
0029 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
0030 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
0031 #include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
0032 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
0033 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
0034 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
0035 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
0036 #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
0037 #include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
0038 #include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
0039 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
0040 #include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
0041 #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
0042 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0043 #include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h"
0044 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0045 
0046 class EcalEBTrigPrimTestAlgo;
0047 
0048 class EcalEBTrigPrimProducer : public edm::stream::EDProducer<> {
0049 public:
0050   explicit EcalEBTrigPrimProducer(const edm::ParameterSet& conf);
0051 
0052   ~EcalEBTrigPrimProducer() override;
0053 
0054   void beginRun(const edm::Run& run, const edm::EventSetup& es) override;
0055   void endRun(const edm::Run&, const edm::EventSetup&) override;
0056   void produce(edm::Event& e, const edm::EventSetup& c) override;
0057 
0058 private:
0059   std::unique_ptr<EcalEBTrigPrimTestAlgo> algo_;
0060   bool barrelOnly_;
0061   bool tcpFormat_;
0062   bool debug_;
0063   bool famos_;
0064   int nSamples_;
0065   int nEvent_;
0066 
0067   edm::EDGetTokenT<EBDigiCollection> tokenEBdigi_;
0068   edm::ESGetToken<EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd> theEcalTPGLinearization_Token_;
0069   edm::ESGetToken<EcalTPGPedestals, EcalTPGPedestalsRcd> theEcalTPGPedestals_Token_;
0070   edm::ESGetToken<EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd> theEcalTPGCrystalStatus_Token_;
0071   edm::ESGetToken<EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd> theEcalTPGWEightIdMap_Token_;
0072   edm::ESGetToken<EcalTPGWeightGroup, EcalTPGWeightGroupRcd> theEcalTPGWEightGroup_Token_;
0073   edm::ESGetToken<EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd> theEcalTPGSlidingWindow_Token_;
0074   edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> theEcalTPGLutGroup_Token_;
0075   edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> theEcalTPGLutIdMap_Token_;
0076   edm::ESGetToken<EcalTPGTowerStatus, EcalTPGTowerStatusRcd> theEcalTPGTowerStatus_Token_;
0077   edm::ESGetToken<EcalTPGSpike, EcalTPGSpikeRcd> theEcalTPGSpike_Token_;
0078   //these are only used if we also handle the endcap
0079   edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> eTTmapToken_;
0080   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> theGeometryToken_;
0081 
0082   int binOfMaximum_;
0083   bool fillBinOfMaximumFromHistory_;
0084 
0085   unsigned long long getRecords(edm::EventSetup const& setup);
0086   unsigned long long cacheID_;
0087 };
0088 
0089 #endif