Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-17 02:47:09

0001 // -*- C++ -*-
0002 //
0003 // Class:      EcalTPCondAnalyzer
0004 //
0005 /**\class EcalTPCondAnalyzer
0006 
0007  Description: prints the TPG conditions coming from the conditions DB
0008  Prints in exactly the same format as TPG.txt, such that a "diff" is possible.
0009 
0010 */
0011 //
0012 // Original Author:  Ursula Berthon
0013 //         Created:  Wed Oct 15  11:38:38 CEST 2008
0014 //
0015 //
0016 
0017 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0018 #include "FWCore/Utilities/interface/InputTag.h"
0019 
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/EventSetup.h"
0022 #include "FWCore/Framework/interface/MakerMacros.h"
0023 
0024 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0025 
0026 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
0027 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
0028 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
0029 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
0030 #include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
0031 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
0032 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
0033 #include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
0034 #include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
0035 #include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
0036 #include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
0037 #include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
0038 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
0039 
0040 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
0041 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
0042 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
0043 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
0044 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
0045 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
0046 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
0047 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
0048 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
0049 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
0050 #include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
0051 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
0052 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
0053 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0054 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0055 
0056 //
0057 // class declaration
0058 //
0059 
0060 class EcalTPCondAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0061 public:
0062   explicit EcalTPCondAnalyzer(const edm::ParameterSet &);
0063   ~EcalTPCondAnalyzer() override;
0064 
0065   void analyze(const edm::Event &, const edm::EventSetup &) override;
0066   void beginJob() override;
0067   void beginRun(const edm::Run &run, const edm::EventSetup &evtSetup) override;
0068   void endJob() override;
0069   void endRun(edm::Run const &, edm::EventSetup const &) override;
0070 
0071 private:
0072   unsigned long long getRecords(edm::EventSetup const &setup);
0073   unsigned long long cacheID_;
0074 
0075   edm::ESGetToken<CaloSubdetectorGeometry, EcalEndcapGeometryRecord> tokenEndcapGeom_;
0076   edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> tokenBarrelGeom_;
0077   edm::ESGetToken<EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd> tokenEcalTPGPhysics_;
0078   edm::ESGetToken<EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd> tokenEcalTPGLinearization_;
0079   edm::ESGetToken<EcalTPGPedestals, EcalTPGPedestalsRcd> tokenEcalTPGPedestals_;
0080   edm::ESGetToken<EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd> tokenEcalTPGWeightIdMap_;
0081   edm::ESGetToken<EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd> tokenEcalTPGFineGrainEBIdMap_;
0082   edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> tokenEcalTPGLutIdMap_;
0083   edm::ESGetToken<EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd> tokenEcalTPGSlidingWindow_;
0084   edm::ESGetToken<EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd> tokenEcalTPGFineGrainStripEE_;
0085   edm::ESGetToken<EcalTPGWeightGroup, EcalTPGWeightGroupRcd> tokenEcalTPGWeightGroup_;
0086   edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> tokenEcalTPGLutGroup_;
0087   edm::ESGetToken<EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd> tokenEcalTPGFineGrainEBGroup_;
0088   edm::ESGetToken<EcalTPGSpike, EcalTPGSpikeRcd> tokenEcalTPGSpike_;
0089   edm::ESGetToken<EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd> tokenEcalTPGFineGrainTowerEE_;
0090 
0091   const CaloSubdetectorGeometry *theEndcapGeometry_;
0092   const CaloSubdetectorGeometry *theBarrelGeometry_;
0093 
0094   void printComment() const;
0095   void printEcalTPGPhysicsConst(const EcalTPGPhysicsConst *) const;
0096   void printCRYSTAL(const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin);
0097   void printSTRIP(const EcalTPGSlidingWindow *ecaltpgSlidW,
0098                   const EcalTPGWeightGroup *ecaltpgWeightGroup,
0099                   const EcalTPGFineGrainStripEE *ecaltpgFgStripEE) const;
0100   void printWEIGHT(const EcalTPGWeightIdMap *ecaltpgWeightMap) const;
0101   void printTOWEREB(const EcalTPGSpike *ecaltpgSpike,
0102                     const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup,
0103                     const EcalTPGLutGroup *ecaltpgLutGroup) const;
0104   void printEcalTPGLutIdMap(const EcalTPGLutIdMap *ecaltpgLut) const;
0105   void printEcalTPGFineGrainEBIdMap(const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB) const;
0106   void printTOWEREE(const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE,
0107                     const EcalTPGLutGroup *ecaltpgLutGroup) const;
0108 };