Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EcalEndcapSimHitsValidation_H
0002 #define EcalEndcapSimHitsValidation_H
0003 
0004 /*
0005  * \file EcalEndcapSimHitsValidation.h
0006  *
0007  * \author C.Rovelli
0008  *
0009  */
0010 
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 
0013 #include "FWCore/Framework/interface/ConsumesCollector.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/EventSetup.h"
0017 #include "FWCore/Framework/interface/MakerMacros.h"
0018 
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0023 
0024 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0025 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
0026 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
0027 
0028 #include <fstream>
0029 #include <iostream>
0030 #include <map>
0031 #include <vector>
0032 
0033 class EcalEndcapSimHitsValidation : public DQMEDAnalyzer {
0034   typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
0035 
0036 public:
0037   /// Constructor
0038   EcalEndcapSimHitsValidation(const edm::ParameterSet &ps);
0039 
0040 protected:
0041   void bookHistograms(DQMStore::IBooker &ib, edm::Run const &, edm::EventSetup const &c) override;
0042 
0043   /// Analyze
0044   void analyze(const edm::Event &e, const edm::EventSetup &c) override;
0045 
0046 private:
0047   uint32_t getUnitWithMaxEnergy(MapType &themap);
0048 
0049   virtual float energyInMatrixEE(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap);
0050 
0051   std::vector<uint32_t> getIdsAroundMax(
0052       int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap);
0053 
0054   bool fillEEMatrix(
0055       int nCellInX, int nCellInY, int CentralX, int CentralY, 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 EEHitsCollection;
0062   std::string ValidationCollection;
0063 
0064   edm::EDGetTokenT<edm::PCaloHitContainer> EEHitsToken;
0065   edm::EDGetTokenT<PEcalValidInfo> ValidationCollectionToken;
0066 
0067   bool verbose_;
0068 
0069   int myEntries;
0070   float eRLength[26];
0071 
0072   MonitorElement *meEEzpHits_;
0073   MonitorElement *meEEzmHits_;
0074 
0075   MonitorElement *meEEzpCrystals_;
0076   MonitorElement *meEEzmCrystals_;
0077 
0078   MonitorElement *meEEzpOccupancy_;
0079   MonitorElement *meEEzmOccupancy_;
0080 
0081   MonitorElement *meEELongitudinalShower_;
0082 
0083   MonitorElement *meEEHitEnergy_;
0084 
0085   MonitorElement *meEEhitLog10Energy_;
0086 
0087   MonitorElement *meEEhitLog10EnergyNorm_;
0088 
0089   MonitorElement *meEEhitLog10Energy25Norm_;
0090 
0091   MonitorElement *meEEHitEnergy2_;
0092 
0093   MonitorElement *meEEcrystalEnergy_;
0094   MonitorElement *meEEcrystalEnergy2_;
0095 
0096   MonitorElement *meEEe1_;
0097   MonitorElement *meEEe4_;
0098   MonitorElement *meEEe9_;
0099   MonitorElement *meEEe16_;
0100   MonitorElement *meEEe25_;
0101 
0102   MonitorElement *meEEe1oe4_;
0103   MonitorElement *meEEe1oe9_;
0104   MonitorElement *meEEe4oe9_;
0105   MonitorElement *meEEe9oe16_;
0106   MonitorElement *meEEe1oe25_;
0107   MonitorElement *meEEe9oe25_;
0108   MonitorElement *meEEe16oe25_;
0109 };
0110 
0111 #endif