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 SetHOEBit (int twrid, bool FGBIT)
 
void SetJetE (double jE)
 
void SetJetE3x3 (double jE)
 
void SetJetEt (double jEt)
 
void SetJetEt3x3 (double jEt)
 
void SetParameters (const 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 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:234
double TowerEBScale
Definition: FastL1Region.h:85
double TowerHEThreshold
Definition: FastL1Region.h:83
bool fgBit[16]
Definition: FastL1Region.h:233
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:214
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:216
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:240
double EMSeedEnThreshold
Definition: FastL1Region.h:58
bool hcfgBit[16]
Definition: FastL1Region.h:235
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 660 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumE().

661 {
662  double sume=0;
663  for (int i=0; i<16; i++) {
664  sume += Towers[i].emEnergy();
665  sume += Towers[i].hadEnergy();
666 
667  }
668  return sume;
669 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double FastL1Region::CalcSumEmE ( )

Definition at line 672 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumEmE().

673 {
674  double sume=0;
675  for (int i=0; i<16; i++) {
676  sume += Towers[i].emEnergy();
677  }
678  return sume;
679 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double FastL1Region::CalcSumEmEt ( )

Definition at line 638 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumEmEt().

639 {
640  double sumet=0;
641  for (int i=0; i<16; i++) {
642  sumet += Towers[i].emEt();
643  }
644 
645  return sumet;
646 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double FastL1Region::CalcSumEt ( )

Definition at line 626 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumEt().

627 {
628  double sumet=0;
629  for (int i=0; i<16; i++) {
630  sumet += Towers[i].emEt();
631  sumet += Towers[i].hadEt();
632  }
633 
634  return sumet;
635 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double FastL1Region::CalcSumHadE ( )

Definition at line 682 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumHadE().

683 {
684  double sume=0;
685  for (int i=0; i<16; i++) {
686  sume += Towers[i].hadEnergy();
687  }
688  return sume;
689 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double FastL1Region::CalcSumHadEt ( )

Definition at line 649 of file FastL1Region.cc.

References i, and Towers.

Referenced by SumHadEt().

650 {
651  double sumet=0;
652  for (int i=0; i<16; i++) {
653  sumet += Towers[i].hadEt();
654  }
655 
656  return sumet;
657 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
void FastL1Region::Dump ( void  )

Definition at line 712 of file FastL1Region.cc.

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

713 {
714 
715  // test tower filling:
716  /*
717  CaloTowerCollection::const_iterator t;
718  int count = 0;
719  for (t=Towers.begin(); t!=Towers.end(); t++) {
720  std::cout << count << ") " << t->energy() << " | " << t->eta() << " | " << t->phi() << std::endl;
721  count++;
722  }
723  std::cout << std::endl;
724  */
725 
726  // test region neighbours:
727  std::cout << this->GetNWId() << " " << this->GetNorthId() << " " << this->GetNEId() << std::endl;
728  std::cout << this->GetWestId() << " " << this->GetId() << " " << this->GetEastId() << std::endl;
729  std::cout << this->GetSWId() << " " << this->GetSouthId() << " " << this->GetSEId() << std::endl;
730  std::cout << std::endl;
731 
732 }
tuple cout
Definition: gather_cfg.py:121
void FastL1Region::FillEMCrystals ( const CaloTowerConstituentsMap theTowerConstituentsMap,
const CaloTopology calotopo,
const CaloGeometry cGeom,
const EcalRecHitCollection ec0,
const EcalRecHitCollection ec1,
FastL1RegionMap m_RMap 
)

Definition at line 119 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().

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

Definition at line 290 of file FastL1Region.cc.

References funct::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.

291 {
292  double EThres = 0.;
293  double HThres = 0.;
294  double EBthres = Config.TowerEBThreshold;
295  double HBthres = Config.TowerHBThreshold;
296  double EEthres = Config.TowerEEThreshold;
297  double HEthres = Config.TowerHEThreshold;
298 
299  if(std::abs(t.eta())<2.322) {
300  EThres = EBthres;
301  } else {
302  EThres = EEthres;
303  }
304  if(std::abs(t.eta())<2.322) {
305  HThres = HBthres;
306  } else {
307  HThres = HEthres;
308  }
309 
310  double upperThres = 1024.;
311  double emet = RCTEnergyTrunc(t.emEt(),Config.TowerEMLSB,upperThres);
312  double hadet = RCTEnergyTrunc(t.hadEt(),Config.TowerHadLSB,upperThres);
313  //double eme = RCTEnergyTrunc(t.emEnergy(),Config.TowerEMLSB,upperThres);
314  //double hade = RCTEnergyTrunc(t.hadEnergy(),Config.TowerHadLSB,upperThres);
315 
316  if ( emet<EThres) emet = 0.;
317  if ( hadet<HThres) hadet = 0.;
318  //if ( eme<EThres) emet = 0.;
319  //if ( hade<HThres) hadet = 0.;
320 
321  GlobalPoint gP = cGeom->getPosition(t.id());
322  math::XYZTLorentzVector lvec(t.px(),t.py(),t.px(),t.energy());
323  //Towers[tid] = CaloTower(t);
324  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,t.outerEt(),0,0);
325  Towers[tid] = CaloTower(t.id(),emet,hadet,t.outerEt(),0,0,lvec,gP,gP);
326 }
double hadEt() const
Definition: CaloTower.h:100
double outerEt() const
Definition: CaloTower.h:101
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:29
double TowerEMLSB
Definition: FastL1Region.h:75
virtual double energy() const
energy
double TowerHBThreshold
Definition: FastL1Region.h:82
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double TowerEEThreshold
Definition: FastL1Region.h:81
CaloTowerDetId id() const
Definition: CaloTower.h:87
CaloTowerCollection Towers
Definition: FastL1Region.h:214
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:240
double TowerEBThreshold
Definition: FastL1Region.h:80
double emEt() const
Definition: CaloTower.h:99
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 331 of file FastL1Region.cc.

References funct::abs(), Config, CaloTower::emEt(), reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), 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.

332 {
333 
334  double EThres = 0.;
335  double HThres = 0.;
336  double EBthres = Config.TowerEBThreshold;
337  double HBthres = Config.TowerHBThreshold;
338  double EEthres = Config.TowerEEThreshold;
339  double HEthres = Config.TowerHEThreshold;
340 
341  if(std::abs(t.eta())<2.322) {
342  EThres = EBthres;
343  } else {
344  EThres = EEthres;
345  }
346  if(std::abs(t.eta())<2.322) {
347  HThres = HBthres;
348  } else {
349  HThres = HEthres;
350  }
351 
352  double emScale = 1.0;
353  double hadScale = 1.0;
354  //double outerScale = 1.0;
355 
356  if ((std::abs(t.eta()) > 1.3050) && (std::abs(t.eta()) < 3.0)) {
357  hadScale = Config.TowerHEScale;
358  emScale = Config.TowerEEScale;
359  }
360  if (std::abs(t.eta()) < 1.3050) {
361  hadScale = Config.TowerHBScale;
362  emScale = Config.TowerEBScale;
363  }
364 
365  double emet = emScale * t.emEt();
366  double hadet = hadScale * t.hadEt();
367 
368  if (doRCTTrunc) {
369  double upperThres = 1024.;
370  emet = RCTEnergyTrunc(emet,Config.TowerEMLSB,upperThres);
371  hadet = RCTEnergyTrunc(hadet,Config.TowerHadLSB,upperThres);
372  }
373  if ( emet<EThres) emet = 0.;
374  if ( hadet<HThres) hadet = 0.;
375  //if ( eme<EThres) emet = 0.;
376  //if ( hade<HThres) hadet = 0.;
377 
378  /*
379  if (t.emEt()>0. || t.hadEt()>0.) {
380  std::cout<<"+++ "
381  <<t.emEt()<<" "<<t.hadEt()<<" "
382  <<t.eta()<<" "<<t.phi()<<" "
383  <<std::endl;
384  }
385  */
386 
387  //Towers[tid] = CaloTower(t);
388  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,0.,0,0);
389  //edm::ESHandle<CaloGeometry> cGeom;
390  //c.get<CaloGeometryRecord>().get(cGeom);
391  GlobalPoint gP = cGeom->getPosition(t.id());
392  math::XYZTLorentzVector lvec(t.px(),t.py(),t.px(),t.energy());
393  //Towers[tid] = CaloTower(t);
394  //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,t.outerEt(),0,0);
395  Towers[tid] = CaloTower(t.id(),emet,hadet,t.outerEt(),0,0,lvec,gP,gP);
396 
397  //std::cout<<tid<<" "<<Towers[tid].emEt()<< " " <<Towers[tid].hadEt()<< std::endl;
398 
399 }
double TowerEEScale
Definition: FastL1Region.h:86
double hadEt() const
Definition: CaloTower.h:100
double outerEt() const
Definition: CaloTower.h:101
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:29
double TowerHBScale
Definition: FastL1Region.h:87
double TowerEMLSB
Definition: FastL1Region.h:75
virtual double energy() const
energy
double TowerHBThreshold
Definition: FastL1Region.h:82
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double TowerEEThreshold
Definition: FastL1Region.h:81
CaloTowerDetId id() const
Definition: CaloTower.h:87
CaloTowerCollection Towers
Definition: FastL1Region.h:214
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:240
double TowerEBThreshold
Definition: FastL1Region.h:80
double emEt() const
Definition: CaloTower.h:99
virtual double py() const
y coordinate of momentum vector
void FastL1Region::FillTowerZero ( const CaloTower t,
int &  tid 
)

Definition at line 283 of file FastL1Region.cc.

References Towers.

284 {
285  Towers[tid] = CaloTower(t);
286  //std::cout<<"--- "<<Towers[tid].emEt()<<" "<<Towers[tid].hadEt()<<std::endl;
287 }
CaloTowerCollection Towers
Definition: FastL1Region.h:214
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:214
int FastL1Region::GetEastId ( )

Definition at line 748 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

749 { 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:216
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:233
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:235
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:234
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:222
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:223
bool FastL1Region::GetMIPBit ( )
inline

Definition at line 151 of file FastL1Region.h.

References mipBit.

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

Definition at line 777 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

778 {
779  if (ieta != 21) {
780  if (iphi != 17)
781  return ((iphi+1)*22 + ieta+1);
782  else
783  return (ieta+1);
784  } else {
785  return 999;
786  }
787 }
int FastL1Region::GetNorthId ( )

Definition at line 735 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

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

Definition at line 752 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

753 {
754  if (ieta != 0) {
755  if (iphi != 17)
756  return ((iphi+1)*22 + ieta-1);
757  else
758  return (ieta-1);
759  } else {
760  return 999;
761  }
762 }
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 693 of file FastL1Region.cc.

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

694 {
696  //c.get<IdealGeometryRecord>().get(cGeom);
697  c.get<CaloGeometryRecord>().get(cGeom);
698 
699  const GlobalPoint gP1 = cGeom->getPosition(Towers[5].id());
700  //const GlobalPoint gP2 = cGeom->getPosition(Towers[6].id());
701  //const GlobalPoint gP3 = cGeom->getPosition(Towers[10].id());
702 
703  double eta = gP1.eta();
704  double phi = gP1.phi();
705 
706  return std::pair<double, double>(eta, phi);
707 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
CaloTowerCollection Towers
Definition: FastL1Region.h:214
const T & get() const
Definition: EventSetup.h:55
T eta() const
Definition: PV3DBase.h:76
Definition: DDAxes.h:10
int FastL1Region::GetSEId ( )

Definition at line 790 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

791 {
792  if (ieta != 21) {
793  if (iphi != 0)
794  return ((iphi-1)*22 + ieta+1);
795  else
796  return (17*22 + ieta+1);
797  } else {
798  return 999;
799  }
800 }
int FastL1Region::GetSouthId ( )

Definition at line 740 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

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

Definition at line 765 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

766 {
767  if (ieta != 0) {
768  if (iphi != 0)
769  return ((iphi-1)*22 + ieta-1);
770  else
771  return (17*22 + ieta-1);
772  } else {
773  return 999;
774  }
775 }
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 744 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

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

Definition at line 594 of file FastL1Region.cc.

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

595 {
596  int hid = -1;
597  double tmpet=0.;
598  for (int i=0; i<16; i++) {
599  if ( (Towers[i].emEt()) > tmpet) {
600  tmpet = (Towers[i].emEt());
601  hid = i;
602  }
603  }
604 
606  return hid;
607 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
void setHighestEmEtTowerID(int id)
Definition: FastL1BitInfo.h:36
int FastL1Region::HighestEtTowerID ( )

Definition at line 577 of file FastL1Region.cc.

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

578 {
579  int hid = -1;
580  double tmpet=0.;
581  for (int i=0; i<16; i++) {
582  if ( (Towers[i].emEt()+Towers[i].hadEt()) > tmpet) {
583  tmpet = (Towers[i].emEt()+Towers[i].hadEt());
584  hid = i;
585  }
586  }
587 
589 
590  return hid;
591 }
int i
Definition: DBlmapReader.cc:9
void setHighestEtTowerID(int id)
Definition: FastL1BitInfo.h:35
CaloTowerCollection Towers
Definition: FastL1Region.h:214
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
int FastL1Region::HighestHadEtTowerID ( )

Definition at line 610 of file FastL1Region.cc.

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

611 {
612  int hid = -1;
613  double tmpet=0.;
614  for (int i=0; i<16; i++) {
615  if ( (Towers[i].hadEt()) > tmpet) {
616  tmpet = (Towers[i].hadEt());
617  hid = i;
618  }
619  }
620 
622  return hid;
623 }
int i
Definition: DBlmapReader.cc:9
CaloTowerCollection Towers
Definition: FastL1Region.h:214
void setHighestHadEtTowerID(int id)
Definition: FastL1BitInfo.h:37
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:216
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 437 of file FastL1Region.cc.

References fgBit.

438 {
439  fgBit[twrid] = FGBIT;
440 }
bool fgBit[16]
Definition: FastL1Region.h:233
void FastL1Region::SetFGBit ( )
private

Definition at line 449 of file FastL1Region.cc.

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

Referenced by SetTowerBits().

450 {
451  double ratioCut = Config.FGEBThreshold;
452 
453  double stripEnergy[16][5];
454  double duostripEnergy[16][4];
455  double towerEnergy[16];
456 
457  if (GetiEta()>=7 && GetiEta()<=14) {
458  //Barrel
459  for (int i=0; i<16; i++) {
460  //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
461  if (Towers[i].emEt()>Config.EMNoiseLevel ) {
462  //towerEnergy[i] = Towers[i].hadEt() + Towers[i].emEt();
463  towerEnergy[i] = Towers[i].hadEnergy() + Towers[i].emEnergy();
464  } else {
465  fgBit[i] = false;
466  continue;
467  }
468 
469  // EB/EE transition area: unset fg bits
470  //if (std::abs(Towers[i].id().ieta())==16 || std::abs(Towers[i].id().ieta())==17) {
471  //fgBit[i] = false;
472  //continue;
473  //}
474  if (Towers[i].emEt()>Config.noFGThreshold) {
475  fgBit[i] = false;
476  continue;
477  }
478 
479  bool fgflag = false;
480  for (int j=0; j<5; j++) {
481  stripEnergy[i][j] = EMCrystalEnergy[i][j] + EMCrystalEnergy[i][j+5] + EMCrystalEnergy[i][j+10] +
482  EMCrystalEnergy[i][j+15] + EMCrystalEnergy[i][j+20];
483  }
484  for (int j=0; j<4; j++) {
485  duostripEnergy[i][j] = stripEnergy[i][j] + stripEnergy[i][j+1];
486  if (towerEnergy[i]>(Config.TowerEBThreshold)) {
487  //std::cout<<duostripEnergy[i][j]<<" |"<<towerEnergy[i]<<" |"<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;
488  if ( (duostripEnergy[i][j] / towerEnergy[i]) > ratioCut) {
489  fgflag = true;
490  }
491  //std::cout<<duostripEnergy[i][j]<<" | "<<towerEnergy[i]<<": "<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;
492  }
493  }
494 
495  if (fgflag) {
496  fgBit[i] = false;
497  } else {
498  fgBit[i] = true;
499  }
500  //std::cout<<GetiEta()<<" | "<<i<<": "<<fgBit[i]<<std::endl;
501  //std::cout<<"********************************************"<<std::endl;
502  }
503  } else {
504  // Endcap FG bit is already filled in fillEMCrystals()!!!
505  }
506 
507 }
double FGEBThreshold
Definition: FastL1Region.h:67
int i
Definition: DBlmapReader.cc:9
bool fgBit[16]
Definition: FastL1Region.h:233
double noFGThreshold
Definition: FastL1Region.h:69
int j
Definition: DBlmapReader.cc:9
double EMNoiseLevel
Definition: FastL1Region.h:62
CaloTowerCollection Towers
Definition: FastL1Region.h:214
double EMCrystalEnergy[16][25]
Definition: FastL1Region.h:216
L1Config Config
Definition: FastL1Region.h:240
double TowerEBThreshold
Definition: FastL1Region.h:80
void FastL1Region::SetHOEBit ( int  twrid,
bool  FGBIT 
)

Definition at line 443 of file FastL1Region.cc.

References hOeBit.

444 {
445  hOeBit[twrid] = FGBIT;
446 }
bool hOeBit[16]
Definition: FastL1Region.h:234
void FastL1Region::SetHOEBit ( )
private

Definition at line 402 of file FastL1Region.cc.

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

Referenced by SetTowerBits().

403 {
404  double fracThres = Config.hOeThreshold;
405 
406  for (int i=0; i<16; i++) {
407  //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
408  if (Towers[i].hadEnergy()>Config.HadNoiseLevel && Towers[i].emEnergy()>Config.EMNoiseLevel ) {
409  if((Towers[i].hadEt()/Towers[i].emEt()) > fracThres) {
410  hOeBit[i] = true;
411  }
412  }
413  }
414 }
int i
Definition: DBlmapReader.cc:9
double hOeThreshold
Definition: FastL1Region.h:66
bool hOeBit[16]
Definition: FastL1Region.h:234
double HadNoiseLevel
Definition: FastL1Region.h:63
double EMNoiseLevel
Definition: FastL1Region.h:62
CaloTowerCollection Towers
Definition: FastL1Region.h:214
L1Config Config
Definition: FastL1Region.h:240
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:222
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:223
void FastL1Region::SetMIPBit ( )
private

Definition at line 424 of file FastL1Region.cc.

References hcfgBit, i, mipBit, and quietBit.

Referenced by SetRegionBits().

425 {
426  if (quietBit) {
427  for (unsigned int i = 0U; i < 16; i++) {
428  if (hcfgBit[i]) {
429  mipBit = true;
430  return;
431  }
432  }
433  }
434 }
int i
Definition: DBlmapReader.cc:9
bool hcfgBit[16]
Definition: FastL1Region.h:235
void FastL1Region::SetParameters ( const L1Config iconfig)

Definition at line 90 of file FastL1Region.cc.

References Config.

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

Definition at line 417 of file FastL1Region.cc.

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

Referenced by SetRegionBits().

418 {
420  quietBit = true;
421 }
double SumEt()
Definition: FastL1Region.h:161
double QuietRegionThreshold
Definition: FastL1Region.h:70
L1Config Config
Definition: FastL1Region.h:240
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 516 of file FastL1Region.cc.

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

Referenced by SetRegionBits().

517 {
518  float emThres = Config.EMActiveLevel;
519  float hadThres = Config.HadActiveLevel;
520 
521  if (doBitInfo) BitInfo.setIsolationVeto(false);
522  if (doBitInfo) BitInfo.setTauVeto(false);
523  if (doBitInfo) BitInfo.setEmTauVeto(false);
524  if (doBitInfo) BitInfo.setHadTauVeto(false);
525 
526  // init pattern containers
527  unsigned emEtaPat = 0;
528  unsigned emPhiPat = 0;
529  unsigned hadEtaPat = 0;
530  unsigned hadPhiPat = 0;
531  unsigned one = 1;
532 
533 
534  // fill hits as bit pattern
535  for (int i=0; i<16; i++) {
536  if(Towers[i].emEt() > emThres) {
537  emEtaPat |= (one << (unsigned)(i%4));
538  emPhiPat |= (one << (unsigned)(i/4));
539  }
540 
541  if( Towers[i].hadEt() > hadThres) {
542  hadEtaPat |= (one << (unsigned)(i%4));
543  hadPhiPat |= (one << (unsigned)(i/4));
544  }
545 
546  }
547 
548  for(std::vector<unsigned>::const_iterator i = vetoPatterns.begin();
549  i != vetoPatterns.end(); i++) {
550  unsigned etaPattern = emEtaPat | hadEtaPat;
551  unsigned phiPattern = emPhiPat | hadPhiPat;
552 
553  // em pattern
554  if(emEtaPat == *i || emPhiPat == *i) {
555  if (doBitInfo) BitInfo.setEmTauVeto(true);
556  }
557  // had pattern
558  if(hadEtaPat == *i || hadPhiPat == *i) {
559  if (doBitInfo) BitInfo.setHadTauVeto(true);
560  }
561 
562  if(etaPattern == *i || phiPattern == *i) // combined pattern
563  //if(emEtaPat == *i || emPhiPat == *i || hadEtaPat == *i || hadPhiPat == *i)
564  {
565  tauBit = true;
566  if (doBitInfo) BitInfo.setTauVeto(true);
567  return;
568  }
569  }
570 
571  tauBit = false;
572 
573 }
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:214
void setEmTauVeto(bool emTauVeto)
Definition: FastL1BitInfo.h:25
FastL1BitInfo BitInfo
Definition: FastL1Region.h:196
L1Config Config
Definition: FastL1Region.h:240
static const std::vector< unsigned > vetoPatterns
void FastL1Region::SetTowerBits ( )

Definition at line 111 of file FastL1Region.cc.

References SetFGBit(), and SetHOEBit().

Referenced by FillEMCrystals().

112 {
113  SetFGBit();
114  SetHOEBit();
115 }
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 233 of file FastL1Region.h.

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

bool FastL1Region::hcfgBit[16]
private

Definition at line 235 of file FastL1Region.h.

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

bool FastL1Region::hOeBit[16]
private

Definition at line 234 of file FastL1Region.h.

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

int FastL1Region::id
private

Definition at line 225 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 220 of file FastL1Region.h.

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

double FastL1Region::jetE3x3
private

Definition at line 222 of file FastL1Region.h.

Referenced by GetJetE3x3(), and SetJetE3x3().

double FastL1Region::jetEt
private

Definition at line 221 of file FastL1Region.h.

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

double FastL1Region::jetEt3x3
private

Definition at line 223 of file FastL1Region.h.

Referenced by GetJetEt3x3(), and SetJetEt3x3().

bool FastL1Region::mipBit
private

Definition at line 231 of file FastL1Region.h.

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

bool FastL1Region::quietBit
private

Definition at line 230 of file FastL1Region.h.

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

double FastL1Region::sumE
private

Definition at line 238 of file FastL1Region.h.

Referenced by SetRegionEnergy().

double FastL1Region::sumEt
private

Definition at line 237 of file FastL1Region.h.

Referenced by SetRegionEnergy().

bool FastL1Region::tauBit
private

Definition at line 229 of file FastL1Region.h.

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

CaloTowerCollection FastL1Region::Towers
private