CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastL1Region.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_FastL1Region_h
2 #define RecoTauTag_FastL1Region_h
3 // -*- C++ -*-
4 //
5 // Package: L1CaloSim
6 // Class: FastL1Region
7 //
15 //
16 // Original Author: Chi Nhan Nguyen
17 // Created: Mon Feb 19 13:25:24 CST 2007
18 // $Id: FastL1Region.h,v 1.17 2009/03/23 11:41:27 chinhan Exp $
19 //
20 
21 // user include files
27 
28 #include <string>
29 #include <iostream>
30 #include <iomanip>
31 #include <vector>
32 #include <list>
33 
41 
46 
48 
50 // No BitInfos for release versions
51 #include "FastSimDataFormats/External/interface/FastL1BitInfo.h" // FastL1BitInfo is not yet for publication
52 
53 struct L1Config {
54  bool DoJetCorr;
55  bool DoEMCorr;
56 
59 
60  double EMActiveLevel;
61  double HadActiveLevel;
62  double EMNoiseLevel;
63  double HadNoiseLevel;
64 
65  double noTauVetoLevel;
66  double hOeThreshold;
67  double FGEBThreshold;
68  double FGEEThreshold;
69  double noFGThreshold;
71  double MuonNoiseLevel;
74 
75  double TowerEMLSB;
76  double TowerHadLSB;
77  double EMLSB;
78  double JetLSB;
79 
84 
85  double TowerEBScale;
86  double TowerEEScale;
87  double TowerHBScale;
88  double TowerHEScale;
89 
90  std::vector<edm::InputTag> EmInputs;
92 
95 
97 };
98 
99 
101 class CaloTopology;
102 class CaloGeometry;
103 //class EcalRecHitCollection;
104 
105 //
106 //
107 // This Class is container for region data like
108 // towers and algorithms for veto bits.
109 //
111 
112  public:
113  FastL1Region();
114  ~FastL1Region();
115 
116  void SetParameters(L1Config);
117  void FillTower(const CaloTower& t,int& tid,edm::ESHandle<CaloGeometry> &cGeom);
118  void FillTowerZero(const CaloTower& t,int& tid);
119  void FillTower_Scaled(const CaloTower& t,int& tid,bool doRCTTrunc,edm::ESHandle<CaloGeometry> &cGeom);
120  void FillEMCrystals(const CaloTowerConstituentsMap* theTowerConstituentsMap,
121  const CaloTopology* calotopo,
122  const CaloGeometry* cGeom,
123  const EcalRecHitCollection* ec0,
124  const EcalRecHitCollection* ec1,
125  FastL1RegionMap* m_RMap);
126 
127 
128  void Dump();
129  void SetEtaPhiIndex(int eta,int phi,int ind)
130  { ieta=eta; iphi=phi; id=ind; };
131 
132  int GetiEta() { return ieta; };
133  int GetiPhi() { return iphi; };
134  int GetId() { return id; };
135 
136  int GetNorthId();
137  int GetSouthId();
138  int GetWestId();
139  int GetEastId();
140  int GetNWId();
141  int GetSWId();
142  int GetNEId();
143  int GetSEId();
144 
145  void SetRegionBits(edm::Event const& e);
146  void SetTowerBits();
147  void SetRegionEnergy();
148 
149  bool GetTauBit() { return tauBit; };
150  bool GetQuietBit() { return quietBit; };
151  bool GetMIPBit() { return mipBit; };
152  bool GetFGBit(int i) { if(i>=0 && i<16) {return fgBit[i];} else { return false; } };
153  bool GetHOEBit(int i) { if(i>=0 && i<16) { return hOeBit[i]; } else { return false; } };
154  bool GetHCFGBit(int i) { if(i>=0 && i<16) return hcfgBit[i]; else return false; };
155 
157  void SetEMCrystalEnergy(int itwr, int icell, double en) { EMCrystalEnergy[itwr][icell] = en; };
158  double GetEMCrystalEnergy(int itwr, int icell) { return EMCrystalEnergy[itwr][icell]; };
159 
160  double SumE() { return CalcSumE(); };
161  double SumEt() { return CalcSumEt(); };
162  double SumEmE() { return CalcSumEmE(); };
163  double SumEmEt() { return CalcSumEmEt(); };
164  double SumHadE() { return CalcSumHadE(); };
165  double SumHadEt() { return CalcSumHadEt(); };
166  double CalcSumE();
167  double CalcSumEt();
168  double CalcSumEmE();
169  double CalcSumEmEt();
170  double CalcSumHadE();
171  double CalcSumHadEt();
172  double GetJetE() { return jetE; };
173  double GetJetEt() { return jetEt; };
174  void SetJetE(double jE) { jetE = jE; };
175  void SetJetEt(double jEt) { jetEt = jEt; };
176 
177  void SetDoBitInfo(bool doIt) {doBitInfo = doIt;}
178 
179  int HighestEtTowerID();
180  int HighestEmEtTowerID();
181  int HighestHadEtTowerID();
182 
183  double GetJetE3x3() { return jetE3x3; };
184  double GetJetEt3x3() { return jetEt3x3; };
185  void SetJetE3x3(double jE) { jetE3x3 = jE; };
186  void SetJetEt3x3(double jEt) { jetEt3x3 = jEt; };
187 
188  std::pair<double, double> getRegionCenterEtaPhi(const edm::EventSetup& c);
189 
190  std::pair<int, int> GetTowerNorthEtaPhi(int ieta, int iphi);
191 
193 
194  // public - has to bechanged!!!
195  bool doBitInfo;
197 
198  void SetFGBit(int twrid,bool FGBIT);
199  void SetHCFGBit(int twrid,bool FGBIT);
200  void SetHOEBit(int twrid,bool FGBIT);
201 
202  private:
203  void SetTauBit(edm::Event const& e);
204  void SetFGBit();
205  void SetHOEBit();
206  void SetQuietBit();
207  void SetMIPBit();
208  void SetHCFGBit();
209 
210  // Save Tower info
211  // 4x4 matrices (rows,columns):
212  // 0 1 2 3
213  // 4 5 6 7
214  // 8 9 10 11
215  // 10 13 14 15
217  // Save only Crystal Energies
218  double EMCrystalEnergy[16][25];
219 
220  // if region is central: jet energy is sum of 12x12 tower
221  // surrounding the central region
222  double jetE;
223  double jetEt;
224  double jetE3x3;
225  double jetEt3x3;
226 
227  int id;
228  int ieta;
229  int iphi;
230 
231  bool tauBit;
232  bool quietBit;
233  bool mipBit;
234 
235  bool fgBit[16];
236  bool hOeBit[16];
237  bool hcfgBit[16];
238 
239  double sumEt;
240  double sumE;
241 
243 };
244 
245 
246 double
247 corrJetEt(double et, double eta);
248 
249 // Jet Calibration from Frederick(Helsinki), Monika/Creighton (Wisconsin)
250 double
251 corrJetEt1(double et, double eta);
252 
253 // Jet Calibration from CMSSW_1_3_0
254 double
255 corrJetEt2(double et, double eta);
256 
257 // EM correction from ORCA for cmsim 133
258 double
259 corrEmEt(double et, int eta);
260 //corrEmEt(double et, double eta);
261 
262 double
263 RCTEnergyTrunc(double et, double Resol = 1., double thres = 1024.);
264 
265 double
266 GCTEnergyTrunc(double et, double LSB = 1., bool doEM=false);
267 
268 #endif
double FGEBThreshold
Definition: FastL1Region.h:67
double FGEEThreshold
Definition: FastL1Region.h:68
int i
Definition: DBlmapReader.cc:9
double corrJetEt(double et, double eta)
void SetRegionBits(edm::Event const &e)
double TowerEEScale
Definition: FastL1Region.h:86
double SumEmEt()
Definition: FastL1Region.h:163
std::pair< double, double > getRegionCenterEtaPhi(const edm::EventSetup &c)
double HadActiveLevel
Definition: FastL1Region.h:61
void SetJetEt(double jEt)
Definition: FastL1Region.h:175
double SumEt()
Definition: FastL1Region.h:161
double corrJetEt2(double et, double eta)
double noTauVetoLevel
Definition: FastL1Region.h:65
void SetEtaPhiIndex(int eta, int phi, int ind)
Definition: FastL1Region.h:129
double QuietRegionThreshold
Definition: FastL1Region.h:70
double GetJetEt3x3()
Definition: FastL1Region.h:184
double hOeThreshold
Definition: FastL1Region.h:66
std::vector< edm::InputTag > EmInputs
Definition: FastL1Region.h:90
double CalcSumHadE()
void SetHCFGBit()
void SetTowerBits()
void SetJetE3x3(double jE)
Definition: FastL1Region.h:185
double CalcSumEmE()
double EMActiveLevel
Definition: FastL1Region.h:60
bool hOeBit[16]
Definition: FastL1Region.h:236
double TowerEBScale
Definition: FastL1Region.h:85
double TowerHEThreshold
Definition: FastL1Region.h:83
double GetJetEt()
Definition: FastL1Region.h:173
edm::InputTag TowerInput
Definition: FastL1Region.h:91
void SetJetEt3x3(double jEt)
Definition: FastL1Region.h:186
T eta() const
bool fgBit[16]
Definition: FastL1Region.h:235
FastL1BitInfo getBitInfo()
Definition: FastL1Region.h:192
double HadNoiseLevel
Definition: FastL1Region.h:63
int HighestEmEtTowerID()
void FillEMCrystals(const CaloTowerConstituentsMap *theTowerConstituentsMap, const CaloTopology *calotopo, const CaloGeometry *cGeom, const EcalRecHitCollection *ec0, const EcalRecHitCollection *ec1, FastL1RegionMap *m_RMap)
void SetQuietBit()
double TowerHEScale
Definition: FastL1Region.h:88
double CalcSumHadEt()
bool GetHCFGBit(int i)
Definition: FastL1Region.h:154
double TowerHBScale
Definition: FastL1Region.h:87
double TowerEMLSB
Definition: FastL1Region.h:75
double SumEmE()
Definition: FastL1Region.h:162
void SetEMCrystalEnergy(int itwr, int icell, double en)
Definition: FastL1Region.h:157
bool GetFGBit(int i)
Definition: FastL1Region.h:152
double TowerHBThreshold
Definition: FastL1Region.h:82
double CalcSumEt()
std::pair< int, int > GetTowerNorthEtaPhi(int ieta, int iphi)
double CrystalEBThreshold
Definition: FastL1Region.h:72
double GetJetE3x3()
Definition: FastL1Region.h:183
double JetSeedEtThreshold
Definition: FastL1Region.h:57
double SumE()
Definition: FastL1Region.h:160
bool GetMIPBit()
Definition: FastL1Region.h:151
double CalcSumEmEt()
double noFGThreshold
Definition: FastL1Region.h:69
edm::InputTag HcalTPInput
Definition: FastL1Region.h:94
double GCTEnergyTrunc(double et, double LSB=1., bool doEM=false)
double jetEt3x3
Definition: FastL1Region.h:225
void SetHOEBit()
void FillTowerZero(const CaloTower &t, int &tid)
edm::InputTag EcalTPInput
Definition: FastL1Region.h:93
bool GetQuietBit()
Definition: FastL1Region.h:150
double TowerEEThreshold
Definition: FastL1Region.h:81
double EMNoiseLevel
Definition: FastL1Region.h:62
double corrEmEt(double et, int eta)
CaloTowerCollection GetCaloTowers()
Definition: FastL1Region.h:156
bool DoJetCorr
Definition: FastL1Region.h:54
void SetParameters(L1Config)
Definition: FastL1Region.cc:90
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double SumHadE()
Definition: FastL1Region.h:164
int HighestEtTowerID()
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
double TowerHadLSB
Definition: FastL1Region.h:76
double SumHadEt()
Definition: FastL1Region.h:165
double corrJetEt1(double et, double eta)
bool GetHOEBit(int i)
Definition: FastL1Region.h:153
double EMLSB
Definition: FastL1Region.h:77
double JetLSB
Definition: FastL1Region.h:78
double CrystalEEThreshold
Definition: FastL1Region.h:73
void SetRegionEnergy()
Definition: FastL1Region.cc:96
double MuonNoiseLevel
Definition: FastL1Region.h:71
void SetTauBit(edm::Event const &e)
double RCTEnergyTrunc(double et, double Resol=1., double thres=1024.)
double GetEMCrystalEnergy(int itwr, int icell)
Definition: FastL1Region.h:158
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
L1Config Config
Definition: FastL1Region.h:242
void FillTower(const CaloTower &t, int &tid, edm::ESHandle< CaloGeometry > &cGeom)
double EMSeedEnThreshold
Definition: FastL1Region.h:58
void SetMIPBit()
bool hcfgBit[16]
Definition: FastL1Region.h:237
void FillTower_Scaled(const CaloTower &t, int &tid, bool doRCTTrunc, edm::ESHandle< CaloGeometry > &cGeom)
double TowerEBThreshold
Definition: FastL1Region.h:80
edm::FileInPath HcalLUT
Definition: FastL1Region.h:96
int HighestHadEtTowerID()
bool DoEMCorr
Definition: FastL1Region.h:55
void SetJetE(double jE)
Definition: FastL1Region.h:174
void SetDoBitInfo(bool doIt)
Definition: FastL1Region.h:177
double jetE3x3
Definition: FastL1Region.h:224
double GetJetE()
Definition: FastL1Region.h:172
bool GetTauBit()
Definition: FastL1Region.h:149
double CalcSumE()
Definition: DDAxes.h:10