Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:27:12

0001 #ifndef EcalBarrelSimHitsValidation_H
0002 #define EcalBarrelSimHitsValidation_H
0003 
0004 /*
0005  * \file EcalBarrelSimHitsValidation.h
0006  *
0007  * \author C.Rovelli
0008  *
0009  */
0010 
0011 #include "FWCore/Framework/interface/ConsumesCollector.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0019 
0020 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0021 
0022 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0023 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
0024 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
0025 
0026 #include <map>
0027 #include <vector>
0028 
0029 class EcalBarrelSimHitsValidation : public DQMEDAnalyzer {
0030   typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
0031 
0032 public:
0033   typedef dqm::legacy::DQMStore DQMStore;
0034   typedef dqm::legacy::MonitorElement MonitorElement;
0035 
0036   /// Constructor
0037   EcalBarrelSimHitsValidation(const edm::ParameterSet &ps);
0038 
0039 protected:
0040   void bookHistograms(DQMStore::IBooker &ib, edm::Run const &, edm::EventSetup const &c) override;
0041 
0042   /// Analyze
0043   void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0044 
0045 private:
0046   uint32_t getUnitWithMaxEnergy(MapType &themap);
0047 
0048   virtual float energyInMatrixEB(
0049       int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap);
0050 
0051   std::vector<uint32_t> getIdsAroundMax(
0052       int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap);
0053 
0054   bool fillEBMatrix(
0055       int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap);
0056 
0057   float eCluster2x2(MapType &themap);
0058   float eCluster4x4(float e33, MapType &themap);
0059 
0060   std::string g4InfoLabel;
0061   std::string EBHitsCollection;
0062   std::string ValidationCollection;
0063 
0064   edm::EDGetTokenT<edm::PCaloHitContainer> EBHitsToken;
0065   edm::EDGetTokenT<PEcalValidInfo> ValidationCollectionToken;
0066 
0067   bool verbose_;
0068 
0069   int myEntries;
0070   float eRLength[26];
0071 
0072   MonitorElement *menEBHits_;
0073 
0074   MonitorElement *menEBCrystals_;
0075 
0076   MonitorElement *meEBOccupancy_;
0077 
0078   MonitorElement *meEBLongitudinalShower_;
0079 
0080   MonitorElement *meEBhitEnergy_;
0081 
0082   MonitorElement *meEBhitLog10Energy_;
0083 
0084   MonitorElement *meEBhitLog10EnergyNorm_;
0085 
0086   MonitorElement *meEBhitLog10Energy25Norm_;
0087 
0088   MonitorElement *meEBhitEnergy2_;
0089 
0090   MonitorElement *meEBcrystalEnergy_;
0091 
0092   MonitorElement *meEBcrystalEnergy2_;
0093 
0094   MonitorElement *meEBe1_;
0095   MonitorElement *meEBe4_;
0096   MonitorElement *meEBe9_;
0097   MonitorElement *meEBe16_;
0098   MonitorElement *meEBe25_;
0099 
0100   MonitorElement *meEBe1oe4_;
0101   MonitorElement *meEBe1oe9_;
0102   MonitorElement *meEBe4oe9_;
0103   MonitorElement *meEBe9oe16_;
0104   MonitorElement *meEBe1oe25_;
0105   MonitorElement *meEBe9oe25_;
0106   MonitorElement *meEBe16oe25_;
0107 };
0108 
0109 #endif