Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:03

0001 #ifndef EcalDigisValidation_H
0002 #define EcalDigisValidation_H
0003 
0004 /*
0005  * \file EcalDigisValidation.h
0006  *
0007  * \author F. Cossutti
0008  *
0009 */
0010 
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/Framework/interface/ESHandle.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017 
0018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 #include "FWCore/ServiceRegistry/interface/Service.h"
0023 
0024 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0025 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
0026 #include "SimDataFormats/Track/interface/SimTrack.h"
0027 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0028 #include "SimDataFormats/Vertex/interface/SimVertex.h"
0029 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0030 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0031 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
0032 
0033 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
0034 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
0035 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
0036 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0037 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
0038 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
0039 #include "CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialConditionRetriever.h"
0040 
0041 #include <iostream>
0042 #include <fstream>
0043 #include <vector>
0044 #include <map>
0045 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0046 
0047 class EcalDigisValidation : public DQMEDAnalyzer {
0048   typedef std::map<uint32_t, float, std::less<uint32_t> > MapType;
0049 
0050 public:
0051   /// Constructor
0052   EcalDigisValidation(const edm::ParameterSet& ps);
0053 
0054   /// Destructor
0055   ~EcalDigisValidation() override;
0056 
0057   void bookHistograms(DQMStore::IBooker& i, edm::Run const&, edm::EventSetup const&) override;
0058 
0059 protected:
0060   /// Analyze
0061   void analyze(edm::Event const& e, edm::EventSetup const& c) override;
0062   void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
0063 
0064 private:
0065   void checkCalibrations(edm::EventSetup const& c);
0066 
0067   bool verbose_;
0068 
0069   std::string outputFile_;
0070 
0071   edm::EDGetTokenT<edm::HepMCProduct> HepMCToken_;
0072   edm::EDGetTokenT<edm::SimTrackContainer> g4TkInfoToken_;
0073   edm::EDGetTokenT<edm::SimVertexContainer> g4VtxInfoToken_;
0074 
0075   edm::EDGetTokenT<EBDigiCollection> EBdigiCollectionToken_;
0076   edm::EDGetTokenT<EEDigiCollection> EEdigiCollectionToken_;
0077   edm::EDGetTokenT<ESDigiCollection> ESdigiCollectionToken_;
0078   edm::ESGetToken<EcalADCToGeVConstant, EcalADCToGeVConstantRcd> pAgc;
0079 
0080   edm::EDGetTokenT<CrossingFrame<PCaloHit> > crossingFramePCaloHitEBToken_, crossingFramePCaloHitEEToken_,
0081       crossingFramePCaloHitESToken_;
0082 
0083   std::map<int, double, std::less<int> > gainConv_;
0084 
0085   double barrelADCtoGeV_;
0086   double endcapADCtoGeV_;
0087 
0088   MonitorElement* meGunEnergy_;
0089   MonitorElement* meGunEta_;
0090   MonitorElement* meGunPhi_;
0091 
0092   MonitorElement* meEBDigiSimRatio_;
0093   MonitorElement* meEEDigiSimRatio_;
0094 
0095   MonitorElement* meEBDigiSimRatiogt10ADC_;
0096   MonitorElement* meEEDigiSimRatiogt20ADC_;
0097 
0098   MonitorElement* meEBDigiSimRatiogt100ADC_;
0099   MonitorElement* meEEDigiSimRatiogt100ADC_;
0100 };
0101 
0102 #endif