CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
FastL1Region Class Reference

#include <FastL1Region.h>

Public Member Functions

double CalcSumE ()
 
double CalcSumEmE ()
 
double CalcSumEmEt ()
 
double CalcSumEt ()
 
double CalcSumHadE ()
 
double CalcSumHadEt ()
 
void Dump ()
 
 FastL1Region ()
 
void FillEMCrystals (const CaloTowerConstituentsMap *theTowerConstituentsMap, const CaloTopology *calotopo, const CaloGeometry *cGeom, const EcalRecHitCollection *ec0, const EcalRecHitCollection *ec1, FastL1RegionMap *m_RMap)
 
void FillTower (const CaloTower &t, int &tid, edm::ESHandle< CaloGeometry > &cGeom)
 
void FillTower_Scaled (const CaloTower &t, int &tid, bool doRCTTrunc, edm::ESHandle< CaloGeometry > &cGeom)
 
void FillTowerZero (const CaloTower &t, int &tid)
 
FastL1BitInfo getBitInfo ()
 
CaloTowerCollection GetCaloTowers ()
 
int GetEastId ()
 
double GetEMCrystalEnergy (int itwr, int icell)
 
bool GetFGBit (int i)
 
bool GetHCFGBit (int i)
 
bool GetHOEBit (int i)
 
int GetId ()
 
int GetiEta ()
 
int GetiPhi ()
 
double GetJetE ()
 
double GetJetE3x3 ()
 
double GetJetEt ()
 
double GetJetEt3x3 ()
 
bool GetMIPBit ()
 
int GetNEId ()
 
int GetNorthId ()
 
int GetNWId ()
 
bool GetQuietBit ()
 
std::pair< double, double > getRegionCenterEtaPhi (const edm::EventSetup &c)
 
int GetSEId ()
 
int GetSouthId ()
 
int GetSWId ()
 
bool GetTauBit ()
 
std::pair< int, int > GetTowerNorthEtaPhi (int ieta, int iphi)
 
int GetWestId ()
 
int HighestEmEtTowerID ()
 
int HighestEtTowerID ()
 
int HighestHadEtTowerID ()
 
void SetDoBitInfo (bool doIt)
 
void SetEMCrystalEnergy (int itwr, int icell, double en)
 
void SetEtaPhiIndex (int eta, int phi, int ind)
 
void SetFGBit (int twrid, bool FGBIT)
 
void SetHCFGBit (int twrid, bool FGBIT)
 
void SetHOEBit (int twrid, bool FGBIT)
 
void SetJetE (double jE)
 
void SetJetE3x3 (double jE)
 
void SetJetEt (double jEt)
 
void SetJetEt3x3 (double jEt)
 
void SetParameters (L1Config)
 
void SetRegionBits (edm::Event const &e)
 
void SetRegionEnergy ()
 
void SetTowerBits ()
 
double SumE ()
 
double SumEmE ()
 
double SumEmEt ()
 
double SumEt ()
 
double SumHadE ()
 
double SumHadEt ()
 
 ~FastL1Region ()
 

Public Attributes

FastL1BitInfo BitInfo
 
bool doBitInfo
 

Private Member Functions

void SetFGBit ()
 
void SetHCFGBit ()
 
void SetHOEBit ()
 
void SetMIPBit ()
 
void SetQuietBit ()
 
void SetTauBit (edm::Event const &e)
 

Private Attributes

L1Config Config
 
double EMCrystalEnergy [16][25]
 
bool fgBit [16]
 
bool hcfgBit [16]
 
bool hOeBit [16]
 
int id
 
int ieta
 
int iphi
 
double jetE
 
double jetE3x3
 
double jetEt
 
double jetEt3x3
 
bool mipBit
 
bool quietBit
 
double sumE
 
double sumEt
 
bool tauBit
 
CaloTowerCollection Towers
 

Detailed Description

Description: Container class for L1 regions.

Implementation: <Notes on="" implementation>="">

Definition at line 110 of file FastL1Region.h.

Constructor & Destructor Documentation

FastL1Region::FastL1Region ( )

Definition at line 22 of file FastL1Region.cc.

References Config, L1Config::CrystalEBThreshold, L1Config::CrystalEEThreshold, L1Config::EMActiveLevel, EMCrystalEnergy, L1Config::EMLSB, L1Config::EMNoiseLevel, L1Config::EMSeedEnThreshold, fgBit, L1Config::FGEBThreshold, L1Config::FGEEThreshold, L1Config::HadActiveLevel, L1Config::HadNoiseLevel, hcfgBit, hOeBit, L1Config::hOeThreshold, i, ieta, iphi, j, jetE, jetEt, L1Config::JetLSB, L1Config::JetSeedEtThreshold, mipBit, L1Config::MuonNoiseLevel, L1Config::noFGThreshold, L1Config::noTauVetoLevel, quietBit, L1Config::QuietRegionThreshold, tauBit, L1Config::TowerEBScale, L1Config::TowerEBThreshold, L1Config::TowerEEScale, L1Config::TowerEEThreshold, L1Config::TowerEMLSB, L1Config::TowerHadLSB, L1Config::TowerHBScale, L1Config::TowerHBThreshold, L1Config::TowerHEScale, L1Config::TowerHEThreshold, and Towers.

23 {
25 
26  jetE = 0.;
27  jetEt = 0.;
28 
29  id = 999;
30  ieta = 999;
31  iphi = 999;
32 
33  tauBit = false;
34  quietBit = false;
35  mipBit = false;
36  for(int i=0;i<16;i++) {
37  hcfgBit[i] = false;
38  fgBit[i] = false;
39  hOeBit[i] = false;
40  for (int j=0;j<25;j++) {
41  EMCrystalEnergy[i][j] = 0. ; // 16x25 Crystals
42  }
43  }
44 
45  // default values
47  Config.EMActiveLevel = 3.;
49  Config.noTauVetoLevel = 10000.;
50  Config.hOeThreshold = 0.05;
51  Config.FGEBThreshold = 0.8;
52  Config.noFGThreshold = 50.;
53  Config.FGEEThreshold = 0.8;
55  Config.EMNoiseLevel = 2.;
56  Config.HadNoiseLevel = 2.;
61 
62  Config.TowerEMLSB = 1.;
63  Config.TowerHadLSB = 1.;
64  Config.EMLSB = 1.;
65  Config.JetLSB = 1.;
66 
68  Config.TowerEEThreshold = 0.45;
71 
72  Config.TowerEBScale = 1.0;
73  Config.TowerEEScale = 1.0;
74  Config.TowerHBScale = 1.0;
75  Config.TowerHEScale = 1.0;
76 
77 
78  //Config.EmInputs;
79  //Config.xTowerInput;
80 
81 }
double FGEBThreshold
Definition: FastL1Region.h:67
double FGEEThreshold
Definition: FastL1Region.h:68
int i
Definition: DBlmapReader.cc:9
double TowerEEScale
Definition: FastL1Region.h:86
double HadActiveLevel
Definition: FastL1Region.h:61
double noTauVetoLevel
Definition: FastL1Region.h:65
double QuietRegionThreshold
Definition: FastL1Region.h:70
double hOeThreshold
Definition: FastL1Region.h:66
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
bool fgBit[16]
Definition: FastL1Region.h:235
double HadNoiseLevel
Definition: FastL1Region.h:63
double TowerHEScale
Definition: FastL1Region.h:88
double TowerHBScale
Definition: FastL1Region.h:87
double TowerEMLSB
Definition: FastL1Region.h:75
double TowerHBThreshold
Definition: FastL1Region.h:82
double CrystalEBThreshold
Definition: FastL1Region.h:72
double JetSeedEtThreshold
Definition: FastL1Region.h:57
double noFGThreshold
Definition: FastL1Region.h:69
int j
Definition: DBlmapReader.cc:9
double TowerEEThreshold
Definition: FastL1Region.h:81
double EMNoiseLevel
Definition: FastL1Region.h:62
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
double TowerHadLSB
Definition: FastL1Region.h:76
double EMLSB
Definition: FastL1Region.h:77
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerFwd.h:15
double JetLSB
Definition: FastL1Region.h:78
double CrystalEEThreshold
Definition: FastL1Region.h:73
double MuonNoiseLevel
Definition: FastL1Region.h:71
L1Config Config
Definition: FastL1Region.h:242
double EMSeedEnThreshold
Definition: FastL1Region.h:58
bool hcfgBit[16]
Definition: FastL1Region.h:237
double TowerEBThreshold
Definition: FastL1Region.h:80
FastL1Region::~FastL1Region ( )

Definition at line 84 of file FastL1Region.cc.

85 {
86 }

Member Function Documentation

double FastL1Region::CalcSumE ( )

Definition at line 690 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumE().

691 {
692  double sume=0;
693  for (int i=0; i<16; i++) {
694  sume += Towers[i].emEnergy();
695  sume += Towers[i].hadEnergy();
696 
697  }
698  return sume;
699 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double FastL1Region::CalcSumEmE ( )

Definition at line 702 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumEmE().

703 {
704  double sume=0;
705  for (int i=0; i<16; i++) {
706  sume += Towers[i].emEnergy();
707  }
708  return sume;
709 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double FastL1Region::CalcSumEmEt ( )

Definition at line 668 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumEmEt().

669 {
670  double sumet=0;
671  for (int i=0; i<16; i++) {
672  sumet += Towers[i].emEt();
673  }
674 
675  return sumet;
676 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double FastL1Region::CalcSumEt ( )

Definition at line 656 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumEt().

657 {
658  double sumet=0;
659  for (int i=0; i<16; i++) {
660  sumet += Towers[i].emEt();
661  sumet += Towers[i].hadEt();
662  }
663 
664  return sumet;
665 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double FastL1Region::CalcSumHadE ( )

Definition at line 712 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumHadE().

713 {
714  double sume=0;
715  for (int i=0; i<16; i++) {
716  sume += Towers[i].hadEnergy();
717  }
718  return sume;
719 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double FastL1Region::CalcSumHadEt ( )

Definition at line 679 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumHadEt().

680 {
681  double sumet=0;
682  for (int i=0; i<16; i++) {
683  sumet += Towers[i].hadEt();
684  }
685 
686  return sumet;
687 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
void FastL1Region::Dump ( void  )

Definition at line 742 of file FastL1Region.cc.

References gather_cfg::cout, GetEastId(), GetId(), GetNEId(), GetNorthId(), GetNWId(), GetSEId(), GetSouthId(), GetSWId(), and GetWestId().

743 {
744 
745  // test tower filling:
746  /*
747  CaloTowerCollection::const_iterator t;
748  int count = 0;
749  for (t=Towers.begin(); t!=Towers.end(); t++) {
750  std::cout << count << ") " << t->energy() << " | " << t->eta() << " | " << t->phi() << std::endl;
751  count++;
752  }
753  std::cout << std::endl;
754  */
755 
756  // test region neighbours:
757  std::cout << this->GetNWId() << " " << this->GetNorthId() << " " << this->GetNEId() << std::endl;
758  std::cout << this->GetWestId() << " " << this->GetId() << " " << this->GetEastId() << std::endl;
759  std::cout << this->GetSWId() << " " << this->GetSouthId() << " " << this->GetSEId() << std::endl;
760  std::cout << std::endl;
761 
762 }
tuple cout
Definition: gather_cfg.py:41
void FastL1Region::FillEMCrystals ( const CaloTowerConstituentsMap theTowerConstituentsMap,
const CaloTopology calotopo,
const CaloGeometry cGeom,
const EcalRecHitCollection ec0,
const EcalRecHitCollection ec1,
FastL1RegionMap m_RMap 
)

Definition at line 120 of file FastL1Region.cc.

References edm::SortedCollection< T, SORT >::begin(), Config, L1Config::CrystalEBThreshold, L1Config::CrystalEEThreshold, CaloTopology::east(), EMCrystalEnergy, L1Config::EMNoiseLevel, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, fgBit, L1Config::FGEEThreshold, GetiEta(), i, CaloTowerDetId::ieta(), EBDetId::ieta(), ieta, CaloTowerDetId::iphi(), EBDetId::iphi(), iphi, L1Config::noFGThreshold, CaloTopology::north(), SetTowerBits(), CaloTopology::south(), EBDetId::tower_ieta(), EBDetId::tower_iphi(), L1Config::TowerEEThreshold, CaloTowerConstituentsMap::towerOf(), Towers, and CaloTopology::west().

126 {
127  //std::vector< std::pair <std::string,std::string> > la;
128  //la.resize(2);
130  //la[0].first = "ecalRecHit";
131  //la[0].second = "EcalRecHitsEB";
133  //la[1].first = "ecalRecHit";
134  //la[1].second = "EcalRecHitsEE";
135 
136 
137  double ethres = Config.CrystalEBThreshold;
138 
139  // EB
140  //e.getByLabel(la[0].first,la[0].second,ec);
141  //e.getByLabel(Config.EmInputs.at(0),ec);
142 
143  ethres = Config.CrystalEBThreshold;
144  for(EcalRecHitCollection::const_iterator ecItr = ec0->begin();
145  ecItr != ec0->end(); ++ecItr) {
146  //CaloRecHit recHit = (CaloRecHit)(*ecItr);
147  if (ecItr->energy()<ethres) continue;
148 
149  EBDetId detId = ecItr->detid();
150 
151  //int hiphi = detId.tower_iphi();
152  int hieta = detId.tower_ieta();
153  int eieta = detId.ieta();
154  int eiphi = detId.iphi();
155  int crIeta = 999;
156  if (hieta>0)
157  crIeta = (eieta-1)%5;
158  else
159  crIeta = 4 + (eieta+1)%5;
160  int crIphi = (eiphi - 1)%5;
161 
162  //const GlobalPoint gP = cGeom->getPosition(detId);
163 
164  //CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
165  // loop over towers
166  for(int i=0;i<16;i++) {
167  //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(detId.tower_iphi());
168  //int hiphi = m_RMap->convertFromHCal_to_ECal_iphi(detId.tower_iphi());
169  int hiphi = detId.tower_iphi();
170  if ( !Towers[i].id().iphi()==hiphi || !Towers[i].id().ieta()==hieta ) continue;
171  EMCrystalEnergy[i][crIeta + 5*crIphi] = ecItr->energy();
172  }
173  }
174 
175  // After having filled crsystal info set all veto bits
176  SetTowerBits();
177 
178  // EE FG bits are filled here!!!
179  //e.getByLabel(la[1].first,la[1].second,ec);
180 
181  if (GetiEta()==4 || GetiEta()==5 || GetiEta()==6 ||
182  GetiEta()==15 || GetiEta()==16 || GetiEta()==17 ) {
183 
184  //e.getByLabel(Config.EmInputs.at(1),ec);
185  ethres = Config.CrystalEEThreshold;
186  double towerEnergy[16];
187  // loop over towers
188  for(int i=0;i<16;i++) {
189  fgBit[i] = false; // re-iniate
190 
191  //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
192  if (Towers[i].emEt()>=Config.EMNoiseLevel ) {
193  //if (Towers[i].emEnergy()>Config.EMNoiseLevel ) {
194  //towerEnergy[i] = Towers[i].hadEt() + Towers[i].emEt();
195  towerEnergy[i] = Towers[i].hadEnergy() + Towers[i].emEnergy();
196  } else {
197  fgBit[i] = false;
198  continue;
199  }
200 
201  // EB/EE transition area: unset fg bits
202  // if (std::abs(Towers[i].id().ieta())==16 || std::abs(Towers[i].id().ieta())==17) {
203  // fgBit[i] = false;
204  // continue;
205  // }
206  if (Towers[i].emEt()>Config.noFGThreshold) {
207  fgBit[i] = false;
208  continue;
209  }
210 
211  //CaloRecHit maxRecHit;
212  //CaloRecHit maxRecHit2;
213  double maxRecHit=-1.;
214  double maxRecHit2=-1.;
215  DetId maxDetId;
216 
217  double max2En = 0.;
218 
219  for(EcalRecHitCollection::const_iterator ecItr = ec1->begin();
220  ecItr != ec1->end(); ++ecItr) {
221  //CaloRecHit recHit = (CaloRecHit)(*ecItr);
222  if (ecItr->energy()<ethres) continue;
223 
224  EEDetId detId = ecItr->detid();
225 
226  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
227  //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(towerDetId.iphi());
228  int hiphi = towerDetId.iphi();
229  if (Towers[i].id().iphi()==hiphi &&
230  Towers[i].id().ieta()==towerDetId.ieta() ) {
231  if (maxRecHit<ecItr->energy()) {
232  maxRecHit = ecItr->energy();
233  maxDetId = detId;
234  }
235  }
236  }
237 
238  std::vector<DetId> westV = calotopo->west(maxDetId);
239  std::vector<DetId> eastV = calotopo->east(maxDetId);
240  std::vector<DetId> southV = calotopo->south(maxDetId);
241  std::vector<DetId> northV = calotopo->north(maxDetId);
242  for(EcalRecHitCollection::const_iterator ecItr = ec1->begin();
243  ecItr != ec1->end(); ++ecItr) {
244  //CaloRecHit recHit = (CaloRecHit)(*ecItr);
245  if (ecItr->energy()<ethres) continue;
246 
247  EEDetId detId = ecItr->detid();
248 
249  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
250  //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(towerDetId.iphi());
251  int hiphi = towerDetId.iphi();
252  if (Towers[i].id().iphi()==hiphi &&
253  Towers[i].id().ieta()==towerDetId.ieta() ) {
254  if (
255  (!westV.empty() && detId==westV[0]) ||
256  (!eastV.empty() && detId==eastV[0]) ||
257  (!northV.empty() && detId==northV[0]) ||
258  (!southV.empty() && detId==southV[0])
259  ) {
260  if (maxRecHit2<ecItr->energy()) {
261  maxRecHit2 = ecItr->energy();
262  }
263  max2En += ecItr->energy();
264  }
265  }
266  }
267 
268  double eeThres = Config.FGEEThreshold;
269  //double totE = maxRecHit.energy() + max2En;
270  double totE = maxRecHit + maxRecHit2;
271  if (towerEnergy[i]>(Config.TowerEEThreshold)) {
272  //double totE = maxRecHit.energy() + maxRecHit2.energy();
273  //if (totE/towerEnergy[i]<Config.FGEBThreshold) fgBit[i] = true;
274  if (totE/towerEnergy[i]<eeThres) fgBit[i] = true;
275  }
276 
277  }
278  }
279 
280 
281 }
double FGEEThreshold
Definition: FastL1Region.h:68
int i
Definition: DBlmapReader.cc:9
int tower_ieta() const
get the HCAL/trigger ieta of this crystal
Definition: EBDetId.h:48
int tower_iphi() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.cc:164
void SetTowerBits()
std::vector< T >::const_iterator const_iterator
bool fgBit[16]
Definition: FastL1Region.h:235
int iphi() const
get the crystal iphi
Definition: EBDetId.h:46
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
double CrystalEBThreshold
Definition: FastL1Region.h:72
int iphi() const
get the tower iphi
double noFGThreshold
Definition: FastL1Region.h:69
std::vector< DetId > east(const DetId &id) const
Definition: CaloTopology.cc:38
int ieta() const
get the crystal ieta
Definition: EBDetId.h:44
std::vector< DetId > north(const DetId &id) const
Definition: CaloTopology.cc:48
double TowerEEThreshold
Definition: FastL1Region.h:81
const_iterator end() const
double EMNoiseLevel
Definition: FastL1Region.h:62
Definition: DetId.h:20
CaloTowerCollection Towers
Definition: FastL1Region.h:216
std::vector< DetId > west(const DetId &id) const
Definition: CaloTopology.cc:43
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
double CrystalEEThreshold
Definition: FastL1Region.h:73
L1Config Config
Definition: FastL1Region.h:242
int ieta() const
get the tower ieta
std::vector< DetId > south(const DetId &id) const
Definition: CaloTopology.cc:53
const_iterator begin() const
void FastL1Region::FillTower ( const CaloTower t,
int &  tid,
edm::ESHandle< CaloGeometry > &  cGeom 
)

Definition at line 292 of file FastL1Region.cc.

References abs, Config, CaloTower::emEt(), reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), CaloTower::hadEt(), CaloTower::id(), CaloTower::outerEt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), RCTEnergyTrunc(), L1Config::TowerEBThreshold, L1Config::TowerEEThreshold, L1Config::TowerEMLSB, L1Config::TowerHadLSB, L1Config::TowerHBThreshold, L1Config::TowerHEThreshold, and Towers.

293 {
294  double EThres = 0.;
295  double HThres = 0.;
296  double EBthres = Config.TowerEBThreshold;
297  double HBthres = Config.TowerHBThreshold;
298  double EEthres = Config.TowerEEThreshold;
299  double HEthres = Config.TowerHEThreshold;
300 
301  if(std::abs(t.eta())<2.322) {
302  EThres = EBthres;
303  } else {
304  EThres = EEthres;
305  }
306  if(std::abs(t.eta())<2.322) {
307  HThres = HBthres;
308  } else {
309  HThres = HEthres;
310  }
311 
312  double upperThres = 1024.;
313  double emet = RCTEnergyTrunc(t.emEt(),Config.TowerEMLSB,upperThres);
314  double hadet = RCTEnergyTrunc(t.hadEt(),Config.TowerHadLSB,upperThres);
315  //double eme = RCTEnergyTrunc(t.emEnergy(),Config.TowerEMLSB,upperThres);
316  //double hade = RCTEnergyTrunc(t.hadEnergy(),Config.TowerHadLSB,upperThres);
317 
318  if ( emet<EThres) emet = 0.;
319  if ( hadet<HThres) hadet = 0.;
320  //if ( eme<EThres) emet = 0.;
321  //if ( hade<HThres) hadet = 0.;
322 
323  GlobalPoint gP = cGeom->getPosition(t.id());
324  math::XYZTLorentzVector lvec(t.px(),t.py(),t.px(),t.energy());
325  //Towers[tid] = CaloTower(t);
326  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,t.outerEt(),0,0);
327  Towers[tid] = CaloTower(t.id(),emet,hadet,t.outerEt(),0,0,lvec,gP,gP);
328 }
double hadEt() const
Definition: CaloTower.h:85
double outerEt() const
Definition: CaloTower.h:86
#define abs(x)
Definition: mlp_lapack.h:159
double TowerHEThreshold
Definition: FastL1Region.h:83
virtual double eta() const
momentum pseudorapidity
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double TowerEMLSB
Definition: FastL1Region.h:75
virtual double energy() const
energy
double TowerHBThreshold
Definition: FastL1Region.h:82
double TowerEEThreshold
Definition: FastL1Region.h:81
CaloTowerDetId id() const
Definition: CaloTower.h:72
CaloTowerCollection Towers
Definition: FastL1Region.h:216
virtual double px() const
x coordinate of momentum vector
double TowerHadLSB
Definition: FastL1Region.h:76
double RCTEnergyTrunc(double et, double Resol=1., double thres=1024.)
L1Config Config
Definition: FastL1Region.h:242
double TowerEBThreshold
Definition: FastL1Region.h:80
double emEt() const
Definition: CaloTower.h:84
virtual double py() const
y coordinate of momentum vector
void FastL1Region::FillTower_Scaled ( const CaloTower t,
int &  tid,
bool  doRCTTrunc,
edm::ESHandle< CaloGeometry > &  cGeom 
)

Definition at line 333 of file FastL1Region.cc.

References abs, Config, CaloTower::emEnergy(), CaloTower::emEt(), reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), CaloTower::hadEnergy(), CaloTower::hadEt(), CaloTower::id(), CaloTower::outerEt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), RCTEnergyTrunc(), L1Config::TowerEBScale, L1Config::TowerEBThreshold, L1Config::TowerEEScale, L1Config::TowerEEThreshold, L1Config::TowerEMLSB, L1Config::TowerHadLSB, L1Config::TowerHBScale, L1Config::TowerHBThreshold, L1Config::TowerHEScale, L1Config::TowerHEThreshold, and Towers.

334 {
335 
336  double EThres = 0.;
337  double HThres = 0.;
338  double EBthres = Config.TowerEBThreshold;
339  double HBthres = Config.TowerHBThreshold;
340  double EEthres = Config.TowerEEThreshold;
341  double HEthres = Config.TowerHEThreshold;
342 
343  if(std::abs(t.eta())<2.322) {
344  EThres = EBthres;
345  } else {
346  EThres = EEthres;
347  }
348  if(std::abs(t.eta())<2.322) {
349  HThres = HBthres;
350  } else {
351  HThres = HEthres;
352  }
353 
354  double emScale = 1.0;
355  double hadScale = 1.0;
356  //double outerScale = 1.0;
357 
358  if (std::abs(t.eta()>1.3050) && std::abs(t.eta())<3.0) {
359  hadScale = Config.TowerHEScale;
360  emScale = Config.TowerEEScale;
361  }
362  if (std::abs(t.eta()<1.3050)) {
363  hadScale = Config.TowerHBScale;
364  emScale = Config.TowerEBScale;
365  }
366 
367  double emet = emScale * t.emEt();
368  double hadet = hadScale * t.hadEt();
369  double eme = emScale * t.emEnergy();
370  double hade = hadScale * t.hadEnergy();
371 
372  if (doRCTTrunc) {
373  double upperThres = 1024.;
374  emet = RCTEnergyTrunc(emet,Config.TowerEMLSB,upperThres);
375  hadet = RCTEnergyTrunc(hadet,Config.TowerHadLSB,upperThres);
376  eme = RCTEnergyTrunc(eme,Config.TowerEMLSB,upperThres);
377  hade = RCTEnergyTrunc(hade,Config.TowerHadLSB,upperThres);
378  }
379  if ( emet<EThres) emet = 0.;
380  if ( hadet<HThres) hadet = 0.;
381  //if ( eme<EThres) emet = 0.;
382  //if ( hade<HThres) hadet = 0.;
383 
384  /*
385  if (t.emEt()>0. || t.hadEt()>0.) {
386  std::cout<<"+++ "
387  <<t.emEt()<<" "<<t.hadEt()<<" "
388  <<t.eta()<<" "<<t.phi()<<" "
389  <<std::endl;
390  }
391  */
392 
393  //Towers[tid] = CaloTower(t);
394  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,0.,0,0);
395  //edm::ESHandle<CaloGeometry> cGeom;
396  //c.get<CaloGeometryRecord>().get(cGeom);
397  GlobalPoint gP = cGeom->getPosition(t.id());
398  math::XYZTLorentzVector lvec(t.px(),t.py(),t.px(),t.energy());
399  //Towers[tid] = CaloTower(t);
400  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,t.outerEt(),0,0);
401  Towers[tid] = CaloTower(t.id(),emet,hadet,t.outerEt(),0,0,lvec,gP,gP);
402 
403  //std::cout<<tid<<" "<<Towers[tid].emEt()<< " " <<Towers[tid].hadEt()<< std::endl;
404 
405 }
double TowerEEScale
Definition: FastL1Region.h:86
double hadEt() const
Definition: CaloTower.h:85
double outerEt() const
Definition: CaloTower.h:86
#define abs(x)
Definition: mlp_lapack.h:159
double TowerEBScale
Definition: FastL1Region.h:85
double TowerHEThreshold
Definition: FastL1Region.h:83
virtual double eta() const
momentum pseudorapidity
double TowerHEScale
Definition: FastL1Region.h:88
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double TowerHBScale
Definition: FastL1Region.h:87
double TowerEMLSB
Definition: FastL1Region.h:75
virtual double energy() const
energy
double emEnergy() const
Definition: CaloTower.h:79
double TowerHBThreshold
Definition: FastL1Region.h:82
double TowerEEThreshold
Definition: FastL1Region.h:81
double hadEnergy() const
Definition: CaloTower.h:80
CaloTowerDetId id() const
Definition: CaloTower.h:72
CaloTowerCollection Towers
Definition: FastL1Region.h:216
virtual double px() const
x coordinate of momentum vector
double TowerHadLSB
Definition: FastL1Region.h:76
double RCTEnergyTrunc(double et, double Resol=1., double thres=1024.)
L1Config Config
Definition: FastL1Region.h:242
double TowerEBThreshold
Definition: FastL1Region.h:80
double emEt() const
Definition: CaloTower.h:84
virtual double py() const
y coordinate of momentum vector
void FastL1Region::FillTowerZero ( const CaloTower t,
int &  tid 
)

Definition at line 285 of file FastL1Region.cc.

References Towers.

286 {
287  Towers[tid] = CaloTower(t);
288  //std::cout<<"--- "<<Towers[tid].emEt()<<" "<<Towers[tid].hadEt()<<std::endl;
289 }
CaloTowerCollection Towers
Definition: FastL1Region.h:216
FastL1BitInfo FastL1Region::getBitInfo ( )
inline

Definition at line 192 of file FastL1Region.h.

References BitInfo.

192 { return BitInfo; }
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
CaloTowerCollection FastL1Region::GetCaloTowers ( )
inline

Definition at line 156 of file FastL1Region.h.

References Towers.

156 { return Towers; };
CaloTowerCollection Towers
Definition: FastL1Region.h:216
int FastL1Region::GetEastId ( )

Definition at line 778 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

779 { if (ieta != 21) return (iphi*22 + ieta+1); else return 999; }
double FastL1Region::GetEMCrystalEnergy ( int  itwr,
int  icell 
)
inline

Definition at line 158 of file FastL1Region.h.

References EMCrystalEnergy.

158 { return EMCrystalEnergy[itwr][icell]; };
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
bool FastL1Region::GetFGBit ( int  i)
inline

Definition at line 152 of file FastL1Region.h.

References fgBit, and i.

152 { if(i>=0 && i<16) {return fgBit[i];} else { return false; } };
int i
Definition: DBlmapReader.cc:9
bool fgBit[16]
Definition: FastL1Region.h:235
bool FastL1Region::GetHCFGBit ( int  i)
inline

Definition at line 154 of file FastL1Region.h.

References hcfgBit, and i.

154 { if(i>=0 && i<16) return hcfgBit[i]; else return false; };
int i
Definition: DBlmapReader.cc:9
bool hcfgBit[16]
Definition: FastL1Region.h:237
bool FastL1Region::GetHOEBit ( int  i)
inline

Definition at line 153 of file FastL1Region.h.

References hOeBit, and i.

153 { if(i>=0 && i<16) { return hOeBit[i]; } else { return false; } };
int i
Definition: DBlmapReader.cc:9
bool hOeBit[16]
Definition: FastL1Region.h:236
int FastL1Region::GetId ( )
inline

Definition at line 134 of file FastL1Region.h.

References id.

Referenced by Dump().

134 { return id; };
int FastL1Region::GetiEta ( )
inline

Definition at line 132 of file FastL1Region.h.

References ieta.

Referenced by FillEMCrystals(), and SetFGBit().

132 { return ieta; };
int FastL1Region::GetiPhi ( )
inline

Definition at line 133 of file FastL1Region.h.

References iphi.

133 { return iphi; };
double FastL1Region::GetJetE ( )
inline

Definition at line 172 of file FastL1Region.h.

References jetE.

172 { return jetE; };
double FastL1Region::GetJetE3x3 ( )
inline

Definition at line 183 of file FastL1Region.h.

References jetE3x3.

183 { return jetE3x3; };
double jetE3x3
Definition: FastL1Region.h:224
double FastL1Region::GetJetEt ( )
inline

Definition at line 173 of file FastL1Region.h.

References jetEt.

173 { return jetEt; };
double FastL1Region::GetJetEt3x3 ( )
inline

Definition at line 184 of file FastL1Region.h.

References jetEt3x3.

184 { return jetEt3x3; };
double jetEt3x3
Definition: FastL1Region.h:225
bool FastL1Region::GetMIPBit ( )
inline

Definition at line 151 of file FastL1Region.h.

References mipBit.

151 { return mipBit; };
int FastL1Region::GetNEId ( )

Definition at line 807 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

808 {
809  if (ieta != 21) {
810  if (iphi != 17)
811  return ((iphi+1)*22 + ieta+1);
812  else
813  return (ieta+1);
814  } else {
815  return 999;
816  }
817 }
int FastL1Region::GetNorthId ( )

Definition at line 765 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

766 { if (iphi != 17) return ((iphi+1)*22 + ieta); else return ieta; }
int FastL1Region::GetNWId ( )

Definition at line 782 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

783 {
784  if (ieta != 0) {
785  if (iphi != 17)
786  return ((iphi+1)*22 + ieta-1);
787  else
788  return (ieta-1);
789  } else {
790  return 999;
791  }
792 }
bool FastL1Region::GetQuietBit ( )
inline

Definition at line 150 of file FastL1Region.h.

References quietBit.

150 { return quietBit; };
std::pair< double, double > FastL1Region::getRegionCenterEtaPhi ( const edm::EventSetup c)

Definition at line 723 of file FastL1Region.cc.

References PV3DBase< T, PVType, FrameType >::eta(), eta(), edm::EventSetup::get(), phi, PV3DBase< T, PVType, FrameType >::phi(), and Towers.

724 {
726  //c.get<IdealGeometryRecord>().get(cGeom);
727  c.get<CaloGeometryRecord>().get(cGeom);
728 
729  const GlobalPoint gP1 = cGeom->getPosition(Towers[5].id());
730  //const GlobalPoint gP2 = cGeom->getPosition(Towers[6].id());
731  //const GlobalPoint gP3 = cGeom->getPosition(Towers[10].id());
732 
733  double eta = gP1.eta();
734  double phi = gP1.phi();
735 
736  return std::pair<double, double>(eta, phi);
737 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T eta() const
CaloTowerCollection Towers
Definition: FastL1Region.h:216
const T & get() const
Definition: EventSetup.h:55
T eta() const
Definition: PV3DBase.h:70
Definition: DDAxes.h:10
int FastL1Region::GetSEId ( )

Definition at line 820 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

821 {
822  if (ieta != 21) {
823  if (iphi != 0)
824  return ((iphi-1)*22 + ieta+1);
825  else
826  return (17*22 + ieta+1);
827  } else {
828  return 999;
829  }
830 }
int FastL1Region::GetSouthId ( )

Definition at line 770 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

771 { if (iphi != 0) return ((iphi-1)*22 + ieta); else return (17*22 + ieta); }
int FastL1Region::GetSWId ( )

Definition at line 795 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

796 {
797  if (ieta != 0) {
798  if (iphi != 0)
799  return ((iphi-1)*22 + ieta-1);
800  else
801  return (17*22 + ieta-1);
802  } else {
803  return 999;
804  }
805 }
bool FastL1Region::GetTauBit ( )
inline

Definition at line 149 of file FastL1Region.h.

References tauBit.

149 { return tauBit; };
std::pair<int, int> FastL1Region::GetTowerNorthEtaPhi ( int  ieta,
int  iphi 
)
int FastL1Region::GetWestId ( )

Definition at line 774 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

775 { if (ieta != 0) return (iphi*22 + ieta-1); else return 999; }
int FastL1Region::HighestEmEtTowerID ( )

Definition at line 624 of file FastL1Region.cc.

References BitInfo, doBitInfo, i, FastL1BitInfo::setHighestEmEtTowerID(), and Towers.

625 {
626  int hid = -1;
627  double tmpet=0.;
628  for (int i=0; i<16; i++) {
629  if ( (Towers[i].emEt()) > tmpet) {
630  tmpet = (Towers[i].emEt());
631  hid = i;
632  }
633  }
634 
636  return hid;
637 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
void setHighestEmEtTowerID(int id)
Definition: FastL1BitInfo.h:34
int FastL1Region::HighestEtTowerID ( )

Definition at line 607 of file FastL1Region.cc.

References BitInfo, doBitInfo, i, FastL1BitInfo::setHighestEtTowerID(), and Towers.

608 {
609  int hid = -1;
610  double tmpet=0.;
611  for (int i=0; i<16; i++) {
612  if ( (Towers[i].emEt()+Towers[i].hadEt()) > tmpet) {
613  tmpet = (Towers[i].emEt()+Towers[i].hadEt());
614  hid = i;
615  }
616  }
617 
619 
620  return hid;
621 }
int i
Definition: DBlmapReader.cc:9
void setHighestEtTowerID(int id)
Definition: FastL1BitInfo.h:33
CaloTowerCollection Towers
Definition: FastL1Region.h:216
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
int FastL1Region::HighestHadEtTowerID ( )

Definition at line 640 of file FastL1Region.cc.

References BitInfo, doBitInfo, i, FastL1BitInfo::setHighestHadEtTowerID(), and Towers.

641 {
642  int hid = -1;
643  double tmpet=0.;
644  for (int i=0; i<16; i++) {
645  if ( (Towers[i].hadEt()) > tmpet) {
646  tmpet = (Towers[i].hadEt());
647  hid = i;
648  }
649  }
650 
652  return hid;
653 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:216
void setHighestHadEtTowerID(int id)
Definition: FastL1BitInfo.h:35
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
void FastL1Region::SetDoBitInfo ( bool  doIt)
inline

Definition at line 177 of file FastL1Region.h.

References doBitInfo.

177 {doBitInfo = doIt;}
void FastL1Region::SetEMCrystalEnergy ( int  itwr,
int  icell,
double  en 
)
inline

Definition at line 157 of file FastL1Region.h.

References EMCrystalEnergy.

157 { EMCrystalEnergy[itwr][icell] = en; };
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
void FastL1Region::SetEtaPhiIndex ( int  eta,
int  phi,
int  ind 
)
inline

Definition at line 129 of file FastL1Region.h.

References eta(), ieta, iphi, and phi.

130  { ieta=eta; iphi=phi; id=ind; };
T eta() const
Definition: DDAxes.h:10
void FastL1Region::SetFGBit ( int  twrid,
bool  FGBIT 
)

Definition at line 451 of file FastL1Region.cc.

References fgBit.

452 {
453  fgBit[twrid] = FGBIT;
454 }
bool fgBit[16]
Definition: FastL1Region.h:235
void FastL1Region::SetFGBit ( )
private

Definition at line 467 of file FastL1Region.cc.

References Config, EMCrystalEnergy, L1Config::EMNoiseLevel, fgBit, L1Config::FGEBThreshold, GetiEta(), i, j, L1Config::noFGThreshold, L1Config::TowerEBThreshold, and Towers.

Referenced by SetTowerBits().

468 {
469  double ratioCut = Config.FGEBThreshold;
470 
471  double stripEnergy[16][5];
472  double duostripEnergy[16][4];
473  double towerEnergy[16];
474 
475  if (GetiEta()>=7 && GetiEta()<=14) {
476  //Barrel
477  for (int i=0; i<16; i++) {
478  //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
479  if (Towers[i].emEt()>Config.EMNoiseLevel ) {
480  //towerEnergy[i] = Towers[i].hadEt() + Towers[i].emEt();
481  towerEnergy[i] = Towers[i].hadEnergy() + Towers[i].emEnergy();
482  } else {
483  fgBit[i] = false;
484  continue;
485  }
486 
487  // EB/EE transition area: unset fg bits
488  //if (std::abs(Towers[i].id().ieta())==16 || std::abs(Towers[i].id().ieta())==17) {
489  //fgBit[i] = false;
490  //continue;
491  //}
492  if (Towers[i].emEt()>Config.noFGThreshold) {
493  fgBit[i] = false;
494  continue;
495  }
496 
497  bool fgflag = false;
498  for (int j=0; j<5; j++) {
499  stripEnergy[i][j] = EMCrystalEnergy[i][j] + EMCrystalEnergy[i][j+5] + EMCrystalEnergy[i][j+10] +
500  EMCrystalEnergy[i][j+15] + EMCrystalEnergy[i][j+20];
501  }
502  for (int j=0; j<4; j++) {
503  duostripEnergy[i][j] = stripEnergy[i][j] + stripEnergy[i][j+1];
504  if (towerEnergy[i]>(Config.TowerEBThreshold)) {
505  //std::cout<<duostripEnergy[i][j]<<" |"<<towerEnergy[i]<<" |"<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;
506  if ( (duostripEnergy[i][j] / towerEnergy[i]) > ratioCut) {
507  fgflag = true;
508  }
509  //std::cout<<duostripEnergy[i][j]<<" | "<<towerEnergy[i]<<": "<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;
510  }
511  }
512 
513  if (fgflag) {
514  fgBit[i] = false;
515  } else {
516  fgBit[i] = true;
517  }
518  //std::cout<<GetiEta()<<" | "<<i<<": "<<fgBit[i]<<std::endl;
519  //std::cout<<"********************************************"<<std::endl;
520  }
521  } else {
522  // Endcap FG bit is already filled in fillEMCrystals()!!!
523  }
524 
525 }
double FGEBThreshold
Definition: FastL1Region.h:67
int i
Definition: DBlmapReader.cc:9
bool fgBit[16]
Definition: FastL1Region.h:235
double noFGThreshold
Definition: FastL1Region.h:69
int j
Definition: DBlmapReader.cc:9
double EMNoiseLevel
Definition: FastL1Region.h:62
CaloTowerCollection Towers
Definition: FastL1Region.h:216
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:218
L1Config Config
Definition: FastL1Region.h:242
double TowerEBThreshold
Definition: FastL1Region.h:80
void FastL1Region::SetHCFGBit ( int  twrid,
bool  FGBIT 
)

Definition at line 456 of file FastL1Region.cc.

457 {
458  ;
459 }
void FastL1Region::SetHCFGBit ( )
private

Definition at line 430 of file FastL1Region.cc.

Referenced by SetTowerBits().

431 {
432  // temporary: check definition
433  // if (Tower->hadEt>100GeV) hcfgBit = true; ????
434  //for (int i=0; i<16; i++) {
435  //}
436 }
void FastL1Region::SetHOEBit ( int  twrid,
bool  FGBIT 
)

Definition at line 461 of file FastL1Region.cc.

References hOeBit.

462 {
463  hOeBit[twrid] = FGBIT;
464 }
bool hOeBit[16]
Definition: FastL1Region.h:236
void FastL1Region::SetHOEBit ( )
private

Definition at line 408 of file FastL1Region.cc.

References Config, L1Config::EMNoiseLevel, L1Config::HadNoiseLevel, hOeBit, L1Config::hOeThreshold, i, and Towers.

Referenced by SetTowerBits().

409 {
410  double fracThres = Config.hOeThreshold;
411 
412  for (int i=0; i<16; i++) {
413  //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
414  if (Towers[i].hadEnergy()>Config.HadNoiseLevel && Towers[i].emEnergy()>Config.EMNoiseLevel ) {
415  if((Towers[i].hadEt()/Towers[i].emEt()) > fracThres) {
416  hOeBit[i] = true;
417  }
418  }
419  }
420 }
int i
Definition: DBlmapReader.cc:9
double hOeThreshold
Definition: FastL1Region.h:66
bool hOeBit[16]
Definition: FastL1Region.h:236
double HadNoiseLevel
Definition: FastL1Region.h:63
double EMNoiseLevel
Definition: FastL1Region.h:62
CaloTowerCollection Towers
Definition: FastL1Region.h:216
L1Config Config
Definition: FastL1Region.h:242
void FastL1Region::SetJetE ( double  jE)
inline

Definition at line 174 of file FastL1Region.h.

References jetE.

174 { jetE = jE; };
void FastL1Region::SetJetE3x3 ( double  jE)
inline

Definition at line 185 of file FastL1Region.h.

References jetE3x3.

185 { jetE3x3 = jE; };
double jetE3x3
Definition: FastL1Region.h:224
void FastL1Region::SetJetEt ( double  jEt)
inline

Definition at line 175 of file FastL1Region.h.

References jetEt.

175 { jetEt = jEt; };
void FastL1Region::SetJetEt3x3 ( double  jEt)
inline

Definition at line 186 of file FastL1Region.h.

References jetEt3x3.

186 { jetEt3x3 = jEt; };
double jetEt3x3
Definition: FastL1Region.h:225
void FastL1Region::SetMIPBit ( )
private

Definition at line 439 of file FastL1Region.cc.

References hcfgBit, i, mipBit, and quietBit.

Referenced by SetRegionBits().

440 {
441  if (quietBit)
442  for (int i=0; i<16; i++) {
443  if (hcfgBit) {
444  mipBit = true;
445  return;
446  }
447  }
448 }
int i
Definition: DBlmapReader.cc:9
bool hcfgBit[16]
Definition: FastL1Region.h:237
void FastL1Region::SetParameters ( L1Config  iconfig)

Definition at line 90 of file FastL1Region.cc.

References Config.

91 {
92  Config = iconfig;
93 }
L1Config Config
Definition: FastL1Region.h:242
void FastL1Region::SetQuietBit ( )
private

Definition at line 423 of file FastL1Region.cc.

References Config, quietBit, L1Config::QuietRegionThreshold, and SumEt().

Referenced by SetRegionBits().

424 {
426  quietBit = true;
427 }
double SumEt()
Definition: FastL1Region.h:161
double QuietRegionThreshold
Definition: FastL1Region.h:70
L1Config Config
Definition: FastL1Region.h:242
void FastL1Region::SetRegionBits ( edm::Event const &  e)

Definition at line 103 of file FastL1Region.cc.

References SetMIPBit(), SetQuietBit(), and SetTauBit().

104 {
105  SetTauBit(e);
106  SetQuietBit();
107  SetMIPBit();
108 }
void SetQuietBit()
void SetTauBit(edm::Event const &e)
void SetMIPBit()
void FastL1Region::SetRegionEnergy ( )

Definition at line 96 of file FastL1Region.cc.

References CalcSumE(), CalcSumEt(), sumE, and sumEt.

97 {
98  sumE = CalcSumE();
99  sumEt = CalcSumEt();
100 }
double CalcSumEt()
double CalcSumE()
void FastL1Region::SetTauBit ( edm::Event const &  e)
private

Definition at line 529 of file FastL1Region.cc.

References BitInfo, Config, doBitInfo, L1Config::EMActiveLevel, L1Config::HadActiveLevel, i, FastL1BitInfo::setEmTauVeto(), FastL1BitInfo::setHadTauVeto(), FastL1BitInfo::setIsolationVeto(), FastL1BitInfo::setTauVeto(), tauBit, and Towers.

Referenced by SetRegionBits().

530 {
531  float emThres = Config.EMActiveLevel;
532  float hadThres = Config.HadActiveLevel;
533 
534  if (doBitInfo) BitInfo.setIsolationVeto(false);
535  if (doBitInfo) BitInfo.setTauVeto(false);
536  if (doBitInfo) BitInfo.setEmTauVeto(false);
537  if (doBitInfo) BitInfo.setHadTauVeto(false);
538 
539  // init pattern containers
540  unsigned emEtaPat = 0;
541  unsigned emPhiPat = 0;
542  unsigned hadEtaPat = 0;
543  unsigned hadPhiPat = 0;
544  unsigned one = 1;
545 
546 
547  // fill hits as bit pattern
548  for (int i=0; i<16; i++) {
549  if(Towers[i].emEt() > emThres) {
550  emEtaPat |= (one << (unsigned)(i%4));
551  emPhiPat |= (one << (unsigned)(i/4));
552  }
553 
554  if( Towers[i].hadEt() > hadThres) {
555  hadEtaPat |= (one << (unsigned)(i%4));
556  hadPhiPat |= (one << (unsigned)(i/4));
557  }
558 
559  }
560 
561  // Patterns with two or less contiguous bits set are passed
562  // rest are vetoed; 5=0101;7=0111;9=1001;10=1010;11=1011;13=1101;14=1110;15=1111
563  // --- Alternate patterns
564  // --- 9=1001;15=1111
565  static std::vector<unsigned> vetoPatterns;
566  if(vetoPatterns.size() == 0) {
567  vetoPatterns.push_back(5);
568  vetoPatterns.push_back(7);
569  vetoPatterns.push_back(9);
570  vetoPatterns.push_back(10);
571  vetoPatterns.push_back(11);
572  vetoPatterns.push_back(13);
573  vetoPatterns.push_back(14);
574  vetoPatterns.push_back(15);
575  }
576 
577 
578  for(std::vector<unsigned>::iterator i = vetoPatterns.begin();
579  i != vetoPatterns.end(); i++) {
580  unsigned etaPattern = emEtaPat | hadEtaPat;
581  unsigned phiPattern = emPhiPat | hadPhiPat;
582 
583  // em pattern
584  if(emEtaPat == *i || emPhiPat == *i) {
585  if (doBitInfo) BitInfo.setEmTauVeto(true);
586  }
587  // had pattern
588  if(hadEtaPat == *i || hadPhiPat == *i) {
589  if (doBitInfo) BitInfo.setHadTauVeto(true);
590  }
591 
592  if(etaPattern == *i || phiPattern == *i) // combined pattern
593  //if(emEtaPat == *i || emPhiPat == *i || hadEtaPat == *i || hadPhiPat == *i)
594  {
595  tauBit = true;
596  if (doBitInfo) BitInfo.setTauVeto(true);
597  return;
598  }
599  }
600 
601  tauBit = false;
602 
603 }
int i
Definition: DBlmapReader.cc:9
void setTauVeto(bool tauVeto)
Definition: FastL1BitInfo.h:24
double HadActiveLevel
Definition: FastL1Region.h:61
double EMActiveLevel
Definition: FastL1Region.h:60
void setHadTauVeto(bool hadTauVeto)
Definition: FastL1BitInfo.h:26
void setIsolationVeto(bool isolationVeto)
Definition: FastL1BitInfo.h:27
CaloTowerCollection Towers
Definition: FastL1Region.h:216
void setEmTauVeto(bool emTauVeto)
Definition: FastL1BitInfo.h:25
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
L1Config Config
Definition: FastL1Region.h:242
void FastL1Region::SetTowerBits ( )

Definition at line 111 of file FastL1Region.cc.

References SetFGBit(), SetHCFGBit(), and SetHOEBit().

Referenced by FillEMCrystals().

112 {
113  SetFGBit();
114  SetHOEBit();
115  SetHCFGBit();
116 }
void SetHCFGBit()
void SetHOEBit()
double FastL1Region::SumE ( )
inline

Definition at line 160 of file FastL1Region.h.

References CalcSumE().

160 { return CalcSumE(); };
double CalcSumE()
double FastL1Region::SumEmE ( )
inline

Definition at line 162 of file FastL1Region.h.

References CalcSumEmE().

162 { return CalcSumEmE(); };
double CalcSumEmE()
double FastL1Region::SumEmEt ( )
inline

Definition at line 163 of file FastL1Region.h.

References CalcSumEmEt().

163 { return CalcSumEmEt(); };
double CalcSumEmEt()
double FastL1Region::SumEt ( )
inline

Definition at line 161 of file FastL1Region.h.

References CalcSumEt().

Referenced by SetQuietBit().

161 { return CalcSumEt(); };
double CalcSumEt()
double FastL1Region::SumHadE ( )
inline

Definition at line 164 of file FastL1Region.h.

References CalcSumHadE().

164 { return CalcSumHadE(); };
double CalcSumHadE()
double FastL1Region::SumHadEt ( )
inline

Definition at line 165 of file FastL1Region.h.

References CalcSumHadEt().

165 { return CalcSumHadEt(); };
double CalcSumHadEt()

Member Data Documentation

FastL1BitInfo FastL1Region::BitInfo
L1Config FastL1Region::Config
private
bool FastL1Region::doBitInfo
double FastL1Region::EMCrystalEnergy[16][25]
private
bool FastL1Region::fgBit[16]
private

Definition at line 235 of file FastL1Region.h.

Referenced by FastL1Region(), FillEMCrystals(), GetFGBit(), and SetFGBit().

bool FastL1Region::hcfgBit[16]
private

Definition at line 237 of file FastL1Region.h.

Referenced by FastL1Region(), GetHCFGBit(), and SetMIPBit().

bool FastL1Region::hOeBit[16]
private

Definition at line 236 of file FastL1Region.h.

Referenced by FastL1Region(), GetHOEBit(), and SetHOEBit().

int FastL1Region::id
private

Definition at line 227 of file FastL1Region.h.

Referenced by GetId(), and NodeCut.MatchId::match().

int FastL1Region::ieta
private
int FastL1Region::iphi
private
double FastL1Region::jetE
private

Definition at line 222 of file FastL1Region.h.

Referenced by FastL1Region(), GetJetE(), and SetJetE().

double FastL1Region::jetE3x3
private

Definition at line 224 of file FastL1Region.h.

Referenced by GetJetE3x3(), and SetJetE3x3().

double FastL1Region::jetEt
private

Definition at line 223 of file FastL1Region.h.

Referenced by FastL1Region(), GetJetEt(), and SetJetEt().

double FastL1Region::jetEt3x3
private

Definition at line 225 of file FastL1Region.h.

Referenced by GetJetEt3x3(), and SetJetEt3x3().

bool FastL1Region::mipBit
private

Definition at line 233 of file FastL1Region.h.

Referenced by FastL1Region(), GetMIPBit(), and SetMIPBit().

bool FastL1Region::quietBit
private

Definition at line 232 of file FastL1Region.h.

Referenced by FastL1Region(), GetQuietBit(), SetMIPBit(), and SetQuietBit().

double FastL1Region::sumE
private

Definition at line 240 of file FastL1Region.h.

Referenced by SetRegionEnergy().

double FastL1Region::sumEt
private

Definition at line 239 of file FastL1Region.h.

Referenced by SetRegionEnergy().

bool FastL1Region::tauBit
private

Definition at line 231 of file FastL1Region.h.

Referenced by FastL1Region(), GetTauBit(), and SetTauBit().

CaloTowerCollection FastL1Region::Towers
private