File indexing completed on 2024-04-06 11:58:39
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __CINT__
0009 #ifndef EcalEleCalibLooper_H
0010 #define EcalEleCalibLooper_H
0011 #include "Calibration/EcalCalibAlgos/interface/VEcalCalibBlock.h"
0012 #include "FWCore/Framework/interface/EDLooper.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "Calibration/EcalCalibAlgos/interface/VFillMap.h"
0015 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0016 #include <string>
0017 #include <vector>
0018
0019 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0020 #include "DataFormats/DetId/interface/DetId.h"
0021 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0022 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0023 #include "DataFormats/EgammaReco/interface/BasicClusterShapeAssociation.h"
0024 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
0025 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0026 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0027 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0028 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0029 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0030
0031 #include "CLHEP/Matrix/GenMatrix.h"
0032 #include "CLHEP/Matrix/Matrix.h"
0033 #include "CLHEP/Matrix/Vector.h"
0034 class EcalEleCalibLooper : public edm::EDLooper {
0035 public:
0036
0037 explicit EcalEleCalibLooper(const edm::ParameterSet &);
0038
0039 ~EcalEleCalibLooper() override;
0040 void beginOfJob() override;
0041 void endOfJob() override;
0042 void startingNewLoop(unsigned int) override;
0043 Status duringLoop(const edm::Event &, const edm::EventSetup &) override;
0044 Status endOfLoop(const edm::EventSetup &, unsigned int iCounter) override;
0045
0046 private:
0047
0048 int EBRegionId(const int, const int) const;
0049 int EERegionId(const int, const int) const;
0050
0051 void EBRegionDefinition();
0052 void EERegionDefinition();
0053
0054 double giveLimit(int);
0055
0056
0057 int EEregionCheck(const int, const int) const;
0058 int EBregionCheck(const int eta, const int phi) const;
0059
0060
0061 int etaShifter(const int) const;
0062
0063 private:
0064
0065 const edm::InputTag m_barrelAlCa;
0066
0067 const edm::InputTag m_endcapAlCa;
0068
0069 edm::InputTag m_ElectronLabel;
0070
0071
0072 const int m_recoWindowSidex;
0073 const int m_recoWindowSidey;
0074
0075
0076 const int m_etaWidth;
0077
0078
0079
0080 const int m_phiWidthEB;
0081
0082
0083
0084
0085 const int m_etaStart;
0086
0087 const int m_etaEnd;
0088
0089 const int m_phiStartEB;
0090
0091 const int m_phiEndEB;
0092
0093 const int m_radStart;
0094 const int m_radEnd;
0095 const int m_radWidth;
0096
0097 const int m_phiStartEE;
0098 const int m_phiEndEE;
0099 const int m_phiWidthEE;
0100
0101
0102 const int m_maxSelectedNumPerXtal;
0103
0104
0105 std::vector<VEcalCalibBlock *> m_EcalCalibBlocks;
0106
0107 const double m_minEnergyPerCrystal;
0108
0109 const double m_maxEnergyPerCrystal;
0110
0111 const double m_minCoeff;
0112
0113 const double m_maxCoeff;
0114
0115 const int m_usingBlockSolver;
0116
0117
0118 EcalIntercalibConstantMap m_barrelMap;
0119 EcalIntercalibConstantMap m_endcapMap;
0120
0121
0122 const unsigned int m_loops;
0123
0124 VFillMap *m_MapFiller;
0125
0126
0127 inline int EEregionsNum() const;
0128
0129 inline int EBregionsNum() const;
0130
0131 std::vector<int> m_regions;
0132
0133 std::vector<DetId> m_barrelCells;
0134 std::vector<DetId> m_endcapCells;
0135
0136 std::map<int, int> m_xtalRegionId;
0137 std::map<int, int> m_xtalPositionInRegion;
0138 std::map<int, int> m_xtalNumOfHits;
0139
0140 bool isfirstcall_;
0141
0142
0143 const edm::EDGetTokenT<EBRecHitCollection> m_ebRecHitToken;
0144 const edm::EDGetTokenT<EERecHitCollection> m_eeRecHitToken;
0145 const edm::EDGetTokenT<reco::GsfElectronCollection> m_gsfElectronToken;
0146
0147 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_geometryToken;
0148 };
0149 #endif
0150 #endif