1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
/**
* \file InvRingCalib.h
* \class InvRingCalib
* \brief ECAL TB 2006 calibration with matrix inversion technique
* \author
*
*/
#ifndef __CINT__
#ifndef InvRingCalib_H
#define InvRingCalib_H
#include "Calibration/EcalCalibAlgos/interface/VEcalCalibBlock.h"
#include "FWCore/Framework/interface/EDLooper.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include <string>
#include <vector>
#include "Calibration/EcalCalibAlgos/interface/VFillMap.h"
class InvRingCalib : public edm::EDLooper {
public:
//! ctor
explicit InvRingCalib(const edm::ParameterSet &);
//! dtor
~InvRingCalib() override;
void beginOfJob() override;
void endOfJob() override;
void startingNewLoop(unsigned int) override;
Status duringLoop(const edm::Event &, const edm::EventSetup &) override;
Status endOfLoop(const edm::EventSetup &, unsigned int iCounter) override;
//end
private:
//!The number of regions in EE
inline int EERegionNum() const;
//!Number of regions in EB
int EBRegionNum() const;
//!Defines the regions in the barrel
void EBRegionDef();
//!Defines the rins in the endcap
void EERingDef(const edm::EventSetup &);
//!Defines the regions in the endcap
void EERegionDef();
//!Prepares the EB regions;
void RegPrepare();
//!Gives back in which region you are:
int EBRegId(const int);
//!gives back in which region of the endcap you are.
int EERegId(int);
//!The class that fills the map!
VFillMap *m_MapFiller;
private:
//! EcalBarrel Input Collection name
const edm::InputTag m_barrelAlCa;
//! EcalEndcap Input Collection name
const edm::InputTag m_endcapAlCa;
//! To take the electrons
const edm::InputTag m_ElectronLabel;
//! reconstruction window size
const int m_recoWindowSidex;
const int m_recoWindowSidey;
//! minimum energy per crystal cut
const double m_minEnergyPerCrystal;
//! maximum energy per crystal cut
const double m_maxEnergyPerCrystal;
//! eta start of the zone of interest
const int m_etaStart;
//! eta end of the zone of interest
const int m_etaEnd;
//! eta size of the regions
const int m_etaWidth;
// std::map<int,float> m_eta;
//! maximum number of events per Ring
const int m_maxSelectedNumPerRing;
//! number of events already read per Ring
std::map<int, int> m_RingNumOfHits;
//! single blocks calibrators
std::vector<VEcalCalibBlock *> m_IMACalibBlocks;
//! minimum coefficient accepted (RAW)
const double m_minCoeff;
//! maximum coefficient accepted (RAW)
const double m_maxCoeff;
//! to exclude the blocksolver
const int m_usingBlockSolver;
//!position of the cell, borders, coords etc...
std::map<int, GlobalPoint> m_cellPos;
std::map<int, int> m_cellPhi;
//!association map between coeff and ring
//!coeffs for the single xtals
EcalIntercalibConstantMap m_barrelMap;
EcalIntercalibConstantMap m_endcapMap;
//! LP sets the number of loops to do
unsigned int m_loops;
//! LP define the EE region to calibrate
const int m_startRing;
const int m_endRing;
//!association map between Raw detIds and Rings
std::map<int, int> m_xtalRing;
//!association map between raw detIds and Region
std::map<int, int> m_xtalRegionId;
//!association map between raw detIds and the number of the ring inside the region
std::map<int, int> m_RinginRegion;
//! geometry things used all over the file
std::vector<DetId> m_barrelCells;
std::vector<DetId> m_endcapCells;
//!coeffs filenames
const std::string m_EBcoeffFile;
const std::string m_EEcoeffFile;
//!endcap zone to be calibrated
const int m_EEZone;
//!EB regions vs. eta index
std::map<int, int> m_Reg;
std::string m_mapFillerType;
bool isfirstcall_;
//! ED token
const edm::EDGetTokenT<EBRecHitCollection> m_ebRecHitToken;
const edm::EDGetTokenT<EERecHitCollection> m_eeRecHitToken;
const edm::EDGetTokenT<reco::GsfElectronCollection> m_gsfElectronToken;
//! ES token
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_geometryToken;
};
#endif
#endif
|