CMS 3D CMS Logo

FastL1Region Class Reference

Description: Container class for L1 regions. More...

#include <FastSimulation/L1CaloTriggerProducer/interface/FastL1Region.h>

List of all members.

Public Member Functions

double CalcSumE ()
double CalcSumEt ()
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)
void FillTower_Scaled (const CaloTower &t, int &tid, bool doRCTTrunc=true)
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, intGetTowerNorthEtaPhi (int ieta, int iphi)
int GetWestId ()
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 (FastL1Config)
void SetRegionBits (edm::Event const &e, bool bitinfo)
void SetRegionEnergy ()
void SetTowerBits ()
double SumE ()
double SumEt ()
 ~FastL1Region ()

Public Attributes

FastL1BitInfo BitInfo

Private Member Functions

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

Private Attributes

FastL1Config 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 109 of file FastL1Region.h.


Constructor & Destructor Documentation

FastL1Region::FastL1Region (  ) 

Definition at line 25 of file FastL1Region.cc.

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

00026 {
00027   Towers = CaloTowerCollection(16);
00028 
00029   jetE = 0.;
00030   jetEt = 0.;
00031 
00032   id = 999;
00033   ieta = 999;
00034   iphi = 999;
00035 
00036   tauBit = false;
00037   quietBit = false;
00038   mipBit = false;
00039   for(int i=0;i<16;i++) {
00040     hcfgBit[i] = false;
00041     fgBit[i] = false;
00042     hOeBit[i] = false;
00043     for (int j=0;j<25;j++) {
00044       EMCrystalEnergy[i][j] = 0. ; // 16x25 Crystals
00045     }
00046   }
00047 
00048   // default values
00049   Config.EMSeedEnThreshold = 2.;
00050   Config.EMActiveLevel = 3.;
00051   Config.HadActiveLevel = 3.;
00052   Config.noTauVetoLevel = 10000.;       
00053   Config.hOeThreshold = 0.05;
00054   Config.FGEBThreshold = 0.8;
00055   Config.noFGThreshold = 50.;
00056   Config.FGEEThreshold = 0.8;
00057   Config.MuonNoiseLevel = 2.;
00058   Config.EMNoiseLevel = 2.;
00059   Config.HadNoiseLevel = 2.;
00060   Config.QuietRegionThreshold = 2.;  
00061   Config.JetSeedEtThreshold = 2.;  
00062   Config.CrystalEBThreshold = 0.09;
00063   Config.CrystalEEThreshold = 0.45;
00064 
00065   Config.TowerEMLSB = 1.;
00066   Config.TowerHadLSB = 1.;
00067   Config.EMLSB = 1.;
00068   Config.JetLSB = 1.;
00069 
00070   Config.TowerEBThreshold = 0.2;
00071   Config.TowerEEThreshold = 0.45;
00072   Config.TowerHBThreshold = 0.9;
00073   Config.TowerHEThreshold = 1.4;
00074 
00075   Config.TowerEBScale = 1.0;
00076   Config.TowerEEScale = 1.0;
00077   Config.TowerHBScale = 1.0;
00078   Config.TowerHEScale = 1.0;
00079 
00080   //Config.EmInputs;
00081   //Config.xTowerInput;
00082 
00083 }

FastL1Region::~FastL1Region (  ) 

Definition at line 86 of file FastL1Region.cc.

00087 {
00088 }


Member Function Documentation

double FastL1Region::CalcSumE (  ) 

Definition at line 618 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumE().

00619 {
00620   double sume=0;
00621   for (int i=0; i<16; i++) {
00622     sume += Towers[i].emEnergy();
00623     sume += Towers[i].hadEnergy();
00624 
00625   }
00626   return sume;
00627 }

double FastL1Region::CalcSumEt (  ) 

Definition at line 606 of file FastL1Region.cc.

References i, and Towers.

Referenced by SetRegionEnergy(), and SumEt().

00607 {
00608   double sumet=0;
00609   for (int i=0; i<16; i++) {
00610     sumet += Towers[i].emEt();
00611     sumet += Towers[i].hadEt();
00612   }
00613 
00614   return sumet;
00615 }

void FastL1Region::Dump ( void   ) 

Definition at line 649 of file FastL1Region.cc.

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

00650 {
00651 
00652   // test tower filling:
00653   /*
00654   CaloTowerCollection::const_iterator t;
00655   int count = 0;
00656   for (t=Towers.begin(); t!=Towers.end(); t++) {
00657     std::cout << count << ") " << t->energy() << " | " << t->eta()  << " | " << t->phi() << std::endl;
00658     count++;
00659   }
00660   std::cout << std::endl;
00661   */
00662 
00663   // test region neighbours:
00664   std::cout << this->GetNWId() << " "  << this->GetNorthId() << " "  << this->GetNEId() << std::endl;
00665   std::cout << this->GetWestId() << " "  << this->GetId() << " "  << this->GetEastId() << std::endl;
00666   std::cout << this->GetSWId() << " "  << this->GetSouthId() << " "  << this->GetSEId() << std::endl;
00667   std::cout << std::endl;
00668 
00669 }

void FastL1Region::FillEMCrystals ( const CaloTowerConstituentsMap theTowerConstituentsMap,
const CaloTopology calotopo,
const CaloGeometry cGeom,
const EcalRecHitCollection ec0,
const EcalRecHitCollection ec1,
FastL1RegionMap m_RMap 
)

Definition at line 122 of file FastL1Region.cc.

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

00128 {
00129   //std::vector< std::pair <std::string,std::string> > la;
00130   //la.resize(2);
00132   //la[0].first = "ecalRecHit";
00133   //la[0].second = "EcalRecHitsEB";
00135   //la[1].first = "ecalRecHit";
00136   //la[1].second = "EcalRecHitsEE";
00137 
00138 
00139   double ethres = Config.CrystalEBThreshold;
00140 
00141   // EB
00142   //e.getByLabel(la[0].first,la[0].second,ec);
00143   //e.getByLabel(Config.EmInputs.at(0),ec);
00144 
00145   ethres = Config.CrystalEBThreshold;
00146   for(EcalRecHitCollection::const_iterator ecItr = ec0->begin();
00147       ecItr != ec0->end(); ++ecItr) {
00148     //CaloRecHit recHit = (CaloRecHit)(*ecItr);
00149     if (ecItr->energy()<ethres) continue;
00150 
00151     EBDetId detId = ecItr->detid();
00152 
00153     int hiphi = detId.tower_iphi();
00154     int hieta = detId.tower_ieta();
00155     int eieta = detId.ieta();
00156     int eiphi = detId.iphi();
00157     int crIeta = 999;
00158     if (hieta>0)
00159       crIeta = (eieta-1)%5;
00160     else
00161       crIeta = 4 + (eieta+1)%5;
00162     int crIphi = (eiphi - 1)%5;
00163     
00164     //const GlobalPoint gP = cGeom->getPosition(detId);
00165 
00166     //CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
00167     // loop over towers
00168     for(int i=0;i<16;i++) {
00169       //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(detId.tower_iphi());
00170       //int hiphi = m_RMap->convertFromHCal_to_ECal_iphi(detId.tower_iphi());
00171       int hiphi = detId.tower_iphi();
00172       if ( !Towers[i].id().iphi()==hiphi ||  !Towers[i].id().ieta()==hieta ) continue;
00173       EMCrystalEnergy[i][crIeta + 5*crIphi] = ecItr->energy();
00174     }  
00175   }
00176   
00177   // After having filled crsystal info set all veto bits
00178   SetTowerBits();
00179  
00180   // EE FG bits are filled here!!!
00181   //e.getByLabel(la[1].first,la[1].second,ec);
00182 
00183   if (GetiEta()==4 || GetiEta()==5 ||  GetiEta()==6 ||  
00184       GetiEta()==15 || GetiEta()==16 || GetiEta()==17 ) {
00185     
00186     //e.getByLabel(Config.EmInputs.at(1),ec);
00187     ethres = Config.CrystalEEThreshold;
00188     double towerEnergy[16];
00189     // loop over towers
00190     for(int i=0;i<16;i++) {
00191       fgBit[i] = false; // re-iniate
00192             
00193       //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
00194       if (Towers[i].emEt()>=Config.EMNoiseLevel ) {
00195       //if (Towers[i].emEnergy()>Config.EMNoiseLevel ) {
00196         //towerEnergy[i]  = Towers[i].hadEt() + Towers[i].emEt(); 
00197         towerEnergy[i]  = Towers[i].hadEnergy() + Towers[i].emEnergy(); 
00198       } else {
00199         fgBit[i] = false;
00200         continue;
00201       }
00202 
00203       // EB/EE transition area: unset fg bits
00204       // if (std::abs(Towers[i].id().ieta())==16 || std::abs(Towers[i].id().ieta())==17) {
00205       // fgBit[i] = false;
00206       // continue;
00207       // }
00208       if (Towers[i].emEt()>Config.noFGThreshold) {
00209         fgBit[i] = false;
00210         continue;
00211       }
00212       
00213       //CaloRecHit maxRecHit;
00214       //CaloRecHit maxRecHit2;
00215       double maxRecHit=-1.;
00216       double maxRecHit2=-1.;
00217       DetId maxDetId;
00218 
00219       double max2En = 0.;
00220       
00221       for(EcalRecHitCollection::const_iterator ecItr = ec1->begin();
00222           ecItr != ec1->end(); ++ecItr) {
00223         //CaloRecHit recHit = (CaloRecHit)(*ecItr);
00224         if (ecItr->energy()<ethres) continue;
00225         
00226         EEDetId detId = ecItr->detid();
00227         
00228         CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
00229         //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(towerDetId.iphi());
00230         int hiphi = towerDetId.iphi();
00231         if (Towers[i].id().iphi()==hiphi && 
00232             Towers[i].id().ieta()==towerDetId.ieta() ) {        
00233           if (maxRecHit<ecItr->energy()) {
00234             maxRecHit = ecItr->energy();
00235             maxDetId = detId;
00236           }     
00237         }
00238       } 
00239 
00240       std::vector<DetId> westV = calotopo->west(maxDetId);
00241       std::vector<DetId> eastV = calotopo->east(maxDetId);
00242       std::vector<DetId> southV = calotopo->south(maxDetId);
00243       std::vector<DetId> northV = calotopo->north(maxDetId);
00244       for(EcalRecHitCollection::const_iterator ecItr = ec1->begin();
00245           ecItr != ec1->end(); ++ecItr) {
00246         //CaloRecHit recHit = (CaloRecHit)(*ecItr);
00247         if (ecItr->energy()<ethres) continue;
00248         
00249         EEDetId detId = ecItr->detid();
00250         
00251         CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
00252         //int hiphi = m_RMap->convertFromECal_to_HCal_iphi(towerDetId.iphi());
00253         int hiphi = towerDetId.iphi();
00254         if (Towers[i].id().iphi()==hiphi && 
00255             Towers[i].id().ieta()==towerDetId.ieta() ) {
00256           if ( 
00257               (!westV.empty() && detId==westV[0]) || 
00258               (!eastV.empty() && detId==eastV[0]) || 
00259               (!northV.empty() && detId==northV[0]) || 
00260               (!southV.empty() && detId==southV[0]) 
00261               ) {
00262             if (maxRecHit2<ecItr->energy()) {
00263               maxRecHit2 = ecItr->energy();
00264             }   
00265             max2En += ecItr->energy();
00266           }
00267         }
00268       }  
00269       
00270       double eeThres = Config.FGEEThreshold;
00271       //double totE = maxRecHit.energy() + max2En;
00272       double totE = maxRecHit + maxRecHit2;
00273       if (towerEnergy[i]>(Config.TowerEEThreshold)) {
00274         //double totE = maxRecHit.energy() + maxRecHit2.energy();
00275         //if (totE/towerEnergy[i]<Config.FGEBThreshold) fgBit[i] = true;    
00276         if (totE/towerEnergy[i]<eeThres) fgBit[i] = true;    
00277       }
00278             
00279     }
00280   }
00281    
00282  
00283 }

void FastL1Region::FillTower ( const CaloTower t,
int tid 
)

Definition at line 294 of file FastL1Region.cc.

References funct::abs(), Config, CaloTower::emEt(), reco::Particle::eta(), funct::exp(), CaloTower::hadEt(), CaloTower::id(), CaloTower::outerEt(), reco::Particle::p4(), RCTEnergyTrunc(), funct::sin(), theta, FastL1Config::TowerEBThreshold, FastL1Config::TowerEEThreshold, FastL1Config::TowerEMLSB, FastL1Config::TowerHadLSB, FastL1Config::TowerHBThreshold, FastL1Config::TowerHEThreshold, and Towers.

00295 {
00296   double EThres = 0.;
00297   double HThres = 0.;
00298   double EBthres = Config.TowerEBThreshold;
00299   double HBthres = Config.TowerHBThreshold;
00300   double EEthres = Config.TowerEEThreshold;
00301   double HEthres = Config.TowerHEThreshold;
00302   
00303   if(std::abs(t.eta())<2.322) {
00304     EThres = EBthres;
00305   } else {
00306     EThres = EEthres;
00307   }
00308   if(std::abs(t.eta())<2.322) {
00309     HThres = HBthres;
00310   } else {
00311     HThres = HEthres;
00312   }
00313 
00314   double upperThres = 1024.;
00315   double emet = RCTEnergyTrunc(t.emEt(),Config.TowerEMLSB,upperThres);
00316   double hadet = RCTEnergyTrunc(t.hadEt(),Config.TowerHadLSB,upperThres);
00317   //double eme = RCTEnergyTrunc(t.emEnergy(),Config.TowerEMLSB,upperThres);
00318   //double hade = RCTEnergyTrunc(t.hadEnergy(),Config.TowerHadLSB,upperThres);
00319 
00320   if ( emet<EThres) emet = 0.;
00321   if ( hadet<HThres) hadet = 0.;
00322   //if ( eme<EThres) emet = 0.;
00323   //if ( hade<HThres) hadet = 0.;
00324  
00325   //Towers[tid] = CaloTower(t);
00326   //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,t.outerEt(),0,0);
00327   // New Dataformat in 2_1_X
00328   GlobalPoint emPosition,hadPosition;
00329   double theta = 2.*atan(exp(-t.eta()));
00330   Towers[tid] = CaloTower(t.id(),emet/sin(theta),hadet/sin(theta),t.outerEt(),0,0,t.p4(),emPosition,hadPosition);
00331 }

void FastL1Region::FillTower_Scaled ( const CaloTower t,
int tid,
bool  doRCTTrunc = true 
)

Definition at line 336 of file FastL1Region.cc.

References funct::abs(), Config, CaloTower::emEnergy(), CaloTower::emEt(), reco::Particle::eta(), funct::exp(), CaloTower::hadEnergy(), CaloTower::hadEt(), CaloTower::id(), CaloTower::outerEt(), reco::Particle::p4(), RCTEnergyTrunc(), funct::sin(), theta, FastL1Config::TowerEBScale, FastL1Config::TowerEBThreshold, FastL1Config::TowerEEScale, FastL1Config::TowerEEThreshold, FastL1Config::TowerEMLSB, FastL1Config::TowerHadLSB, FastL1Config::TowerHBScale, FastL1Config::TowerHBThreshold, FastL1Config::TowerHEScale, FastL1Config::TowerHEThreshold, and Towers.

00337 {
00338 
00339   double EThres = 0.;
00340   double HThres = 0.;
00341   double EBthres = Config.TowerEBThreshold;
00342   double HBthres = Config.TowerHBThreshold;
00343   double EEthres = Config.TowerEEThreshold;
00344   double HEthres = Config.TowerHEThreshold;
00345   
00346   if(std::abs(t.eta())<2.322) {
00347     EThres = EBthres;
00348   } else {
00349     EThres = EEthres;
00350   }
00351   if(std::abs(t.eta())<2.322) {
00352     HThres = HBthres;
00353   } else {
00354     HThres = HEthres;
00355   }
00356 
00357   double emScale = 1.0;
00358   double hadScale = 1.0;
00359   //double outerScale = 1.0;
00360 
00361   if (std::abs(t.eta()>1.3050) && std::abs(t.eta())<3.0) {
00362     hadScale = Config.TowerHEScale;
00363     emScale = Config.TowerEEScale;
00364   }
00365   if (std::abs(t.eta()<1.3050)) {
00366     hadScale = Config.TowerHBScale;
00367     emScale = Config.TowerEBScale;
00368   }
00369 
00370   double emet = emScale * t.emEt();
00371   double hadet = hadScale * t.hadEt();
00372   double eme = emScale * t.emEnergy();
00373   double hade = hadScale * t.hadEnergy();
00374 
00375   if (doRCTTrunc) {
00376     double upperThres = 1024.;
00377     emet = RCTEnergyTrunc(emet,Config.TowerEMLSB,upperThres);
00378     hadet = RCTEnergyTrunc(hadet,Config.TowerHadLSB,upperThres);
00379     eme = RCTEnergyTrunc(eme,Config.TowerEMLSB,upperThres);
00380     hade = RCTEnergyTrunc(hade,Config.TowerHadLSB,upperThres);
00381   }
00382   if ( emet<EThres) emet = 0.;
00383   if ( hadet<HThres) hadet = 0.;
00384   //if ( eme<EThres) emet = 0.;
00385   //if ( hade<HThres) hadet = 0.;
00386 
00387   /* 
00388   if (t.emEt()>0. || t.hadEt()>0.) {
00389     std::cout<<"+++ "
00390              <<t.emEt()<<" "<<t.hadEt()<<" "
00391              <<t.eta()<<" "<<t.phi()<<" "
00392              <<std::endl;
00393   }
00394   */
00395 
00396   //Towers[tid] = CaloTower(t);
00397   //Towers[tid] = CaloTower(t.id(),t.momentum(),emet,hadet,0.,0,0);
00398   // New Dataformat in 2_1_X
00399   GlobalPoint emPosition,hadPosition;
00400   double theta = 2.*atan(exp(-t.eta()));
00401   Towers[tid] = CaloTower(t.id(),emet/sin(theta),hadet/sin(theta),t.outerEt(),0,0,t.p4(),emPosition,hadPosition);
00402 
00403 }

void FastL1Region::FillTowerZero ( const CaloTower t,
int tid 
)

Definition at line 287 of file FastL1Region.cc.

References Towers.

00288 {
00289   Towers[tid] = CaloTower(t);
00290   //std::cout<<"--- "<<Towers[tid].emEt()<<" "<<Towers[tid].hadEt()<<std::endl;
00291 }

FastL1BitInfo FastL1Region::getBitInfo (  )  [inline]

Definition at line 177 of file FastL1Region.h.

References BitInfo.

00177 { return BitInfo; }

CaloTowerCollection FastL1Region::GetCaloTowers (  )  [inline]

Definition at line 155 of file FastL1Region.h.

References Towers.

00155 { return Towers; };

int FastL1Region::GetEastId (  ) 

Definition at line 685 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00686 { if (ieta != 21) return (iphi*22 + ieta+1); else return 999; }

double FastL1Region::GetEMCrystalEnergy ( int  itwr,
int  icell 
) [inline]

Definition at line 157 of file FastL1Region.h.

References EMCrystalEnergy.

00157 { return EMCrystalEnergy[itwr][icell]; };

bool FastL1Region::GetFGBit ( int  i  )  [inline]

Definition at line 151 of file FastL1Region.h.

References fgBit.

00151 { if(i>=0 && i<16) {return fgBit[i];} else { return false; } };

bool FastL1Region::GetHCFGBit ( int  i  )  [inline]

Definition at line 153 of file FastL1Region.h.

References hcfgBit.

00153 {  if(i>=0 && i<16) return hcfgBit[i]; else return false; };

bool FastL1Region::GetHOEBit ( int  i  )  [inline]

Definition at line 152 of file FastL1Region.h.

References hOeBit.

00152 { if(i>=0 && i<16) { return hOeBit[i]; } else { return false; } };

int FastL1Region::GetId (  )  [inline]

Definition at line 133 of file FastL1Region.h.

References id.

Referenced by Dump().

00133 { return id; };

int FastL1Region::GetiEta (  )  [inline]

Definition at line 131 of file FastL1Region.h.

References ieta.

Referenced by FillEMCrystals(), and SetFGBit().

00131 { return ieta; };

int FastL1Region::GetiPhi (  )  [inline]

Definition at line 132 of file FastL1Region.h.

References iphi.

00132 { return iphi; };

double FastL1Region::GetJetE (  )  [inline]

Definition at line 163 of file FastL1Region.h.

References jetE.

00163 { return jetE; };

double FastL1Region::GetJetE3x3 (  )  [inline]

Definition at line 168 of file FastL1Region.h.

References jetE3x3.

00168 { return jetE3x3; };

double FastL1Region::GetJetEt (  )  [inline]

Definition at line 164 of file FastL1Region.h.

References jetEt.

00164 { return jetEt; };

double FastL1Region::GetJetEt3x3 (  )  [inline]

Definition at line 169 of file FastL1Region.h.

References jetEt3x3.

00169 { return jetEt3x3; };

bool FastL1Region::GetMIPBit (  )  [inline]

Definition at line 150 of file FastL1Region.h.

References mipBit.

00150 { return mipBit; };

int FastL1Region::GetNEId (  ) 

Definition at line 714 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00715 { 
00716   if (ieta != 21) {
00717     if (iphi != 17) 
00718       return ((iphi+1)*22 + ieta+1); 
00719     else
00720       return (ieta+1);  
00721   } else {
00722     return 999; 
00723   }
00724 }

int FastL1Region::GetNorthId (  ) 

Definition at line 672 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00673 { if (iphi != 17) return ((iphi+1)*22 + ieta); else return ieta; }

int FastL1Region::GetNWId (  ) 

Definition at line 689 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00690 { 
00691   if (ieta != 0) {
00692     if (iphi != 17) 
00693       return ((iphi+1)*22 + ieta-1); 
00694     else
00695       return (ieta-1);  
00696   } else {
00697     return 999; 
00698   }
00699 }

bool FastL1Region::GetQuietBit (  )  [inline]

Definition at line 149 of file FastL1Region.h.

References quietBit.

00149 { return quietBit; };

std::pair< double, double > FastL1Region::getRegionCenterEtaPhi ( const edm::EventSetup c  ) 

Definition at line 631 of file FastL1Region.cc.

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

00632 {
00633   edm::ESHandle<CaloGeometry> cGeom; 
00634   c.get<CaloGeometryRecord>().get(cGeom);    
00635 
00636   const GlobalPoint gP1 = cGeom->getPosition(Towers[5].id());
00637   //const GlobalPoint gP2 = cGeom->getPosition(Towers[6].id());
00638   //const GlobalPoint gP3 = cGeom->getPosition(Towers[10].id());
00639 
00640   double eta = gP1.eta();  
00641   double phi = gP1.phi();
00642   
00643   return std::pair<double, double>(eta, phi);
00644 }

int FastL1Region::GetSEId (  ) 

Definition at line 727 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00728 { 
00729   if (ieta != 21) {
00730     if (iphi != 0) 
00731       return ((iphi-1)*22 + ieta+1); 
00732     else
00733       return (17*22 + ieta+1);  
00734   } else {
00735     return 999; 
00736   }
00737 }

int FastL1Region::GetSouthId (  ) 

Definition at line 677 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00678 { if (iphi != 0) return ((iphi-1)*22 + ieta); else return (17*22 + ieta); }

int FastL1Region::GetSWId (  ) 

Definition at line 702 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00703 { 
00704   if (ieta != 0) {
00705     if (iphi != 0) 
00706       return ((iphi-1)*22 + ieta-1); 
00707     else
00708       return (17*22 + ieta-1);  
00709   } else {
00710     return 999; 
00711   }
00712 }

bool FastL1Region::GetTauBit (  )  [inline]

Definition at line 148 of file FastL1Region.h.

References tauBit.

00148 { return tauBit; };

std::pair<int, int> FastL1Region::GetTowerNorthEtaPhi ( int  ieta,
int  iphi 
)

int FastL1Region::GetWestId (  ) 

Definition at line 681 of file FastL1Region.cc.

References ieta, and iphi.

Referenced by Dump().

00682 { if (ieta != 0) return (iphi*22 + ieta-1); else return 999; }

void FastL1Region::SetEMCrystalEnergy ( int  itwr,
int  icell,
double  en 
) [inline]

Definition at line 156 of file FastL1Region.h.

References EMCrystalEnergy.

00156 { EMCrystalEnergy[itwr][icell] = en; };

void FastL1Region::SetEtaPhiIndex ( int  eta,
int  phi,
int  ind 
) [inline]

Definition at line 128 of file FastL1Region.h.

References ieta, and iphi.

00129   { ieta=eta; iphi=phi; id=ind; };

void FastL1Region::SetFGBit (  )  [private]

Definition at line 465 of file FastL1Region.cc.

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

Referenced by SetTowerBits().

00466 {
00467   double ratioCut = Config.FGEBThreshold;
00468 
00469   double stripEnergy[16][5];
00470   double duostripEnergy[16][4];
00471   double towerEnergy[16];
00472 
00473   if (GetiEta()>=7 && GetiEta()<=14) {
00474     //Barrel
00475     for (int i=0; i<16; i++) {
00476       //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
00477       if (Towers[i].emEt()>Config.EMNoiseLevel ) {
00478         //towerEnergy[i]  = Towers[i].hadEt() + Towers[i].emEt(); 
00479         towerEnergy[i]  = Towers[i].hadEnergy() + Towers[i].emEnergy(); 
00480       } else {
00481         fgBit[i] = false;
00482         continue;
00483       }
00484 
00485       // EB/EE transition area: unset fg bits
00486       //if (std::abs(Towers[i].id().ieta())==16 || std::abs(Towers[i].id().ieta())==17) {
00487       //fgBit[i] = false;
00488       //continue;
00489       //}
00490       if (Towers[i].emEt()>Config.noFGThreshold) {
00491         fgBit[i] = false;
00492         continue;
00493       }
00494 
00495       bool fgflag = false;
00496         for (int j=0; j<5; j++) {
00497         stripEnergy[i][j] = EMCrystalEnergy[i][j] + EMCrystalEnergy[i][j+5] + EMCrystalEnergy[i][j+10] + 
00498           EMCrystalEnergy[i][j+15] + EMCrystalEnergy[i][j+20];
00499       }
00500       for (int j=0; j<4; j++) {
00501         duostripEnergy[i][j] = stripEnergy[i][j] + stripEnergy[i][j+1];
00502         if (towerEnergy[i]>(Config.TowerEBThreshold)) {
00503           //std::cout<<duostripEnergy[i][j]<<" |"<<towerEnergy[i]<<" |"<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;
00504           if ( (duostripEnergy[i][j] / towerEnergy[i]) > ratioCut) {
00505             fgflag = true;
00506           } 
00507           //std::cout<<duostripEnergy[i][j]<<" | "<<towerEnergy[i]<<": "<<duostripEnergy[i][j]/towerEnergy[i]<<std::endl;       
00508         }
00509       }
00510 
00511       if (fgflag) { 
00512         fgBit[i] = false;
00513       } else {
00514         fgBit[i] = true;
00515       }
00516       //std::cout<<GetiEta()<<" | "<<i<<": "<<fgBit[i]<<std::endl;
00517       //std::cout<<"********************************************"<<std::endl;
00518     }
00519   } else {
00520     // Endcap FG bit is already filled in fillEMCrystals()!!! 
00521   }
00522   
00523 }

void FastL1Region::SetFGBit ( int  twrid,
bool  FGBIT 
)

Definition at line 449 of file FastL1Region.cc.

References fgBit.

00450 {
00451   fgBit[twrid] = FGBIT;
00452 }

void FastL1Region::SetHCFGBit (  )  [private]

Definition at line 428 of file FastL1Region.cc.

Referenced by SetTowerBits().

00429 {
00430   // temporary: check definition 
00431   // if (Tower->hadEt>100GeV) hcfgBit = true; ????
00432   //for (int i=0; i<16; i++) {
00433   //}
00434 }

void FastL1Region::SetHCFGBit ( int  twrid,
bool  FGBIT 
)

Definition at line 454 of file FastL1Region.cc.

00455 {
00456   ;
00457 }

void FastL1Region::SetHOEBit (  )  [private]

Definition at line 406 of file FastL1Region.cc.

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

Referenced by SetTowerBits().

00407 {
00408   double fracThres = Config.hOeThreshold;
00409 
00410   for (int i=0; i<16; i++) {
00411     //if (Towers[i].hadEt()>Config.HadNoiseLevel && Towers[i].emEt()>Config.EMNoiseLevel ) {
00412     if (Towers[i].hadEnergy()>Config.HadNoiseLevel && Towers[i].emEnergy()>Config.EMNoiseLevel ) {
00413       if((Towers[i].hadEt()/Towers[i].emEt()) > fracThres) {
00414         hOeBit[i] = true;
00415       }
00416     }
00417   }
00418 }

void FastL1Region::SetHOEBit ( int  twrid,
bool  FGBIT 
)

Definition at line 459 of file FastL1Region.cc.

References hOeBit.

00460 {
00461   hOeBit[twrid] = FGBIT;
00462 }

void FastL1Region::SetJetE ( double  jE  )  [inline]

Definition at line 165 of file FastL1Region.h.

References jetE.

00165 { jetE = jE; };

void FastL1Region::SetJetE3x3 ( double  jE  )  [inline]

Definition at line 170 of file FastL1Region.h.

References jetE3x3.

00170 { jetE3x3 = jE; };

void FastL1Region::SetJetEt ( double  jEt  )  [inline]

Definition at line 166 of file FastL1Region.h.

References jetEt.

00166 { jetEt = jEt; };

void FastL1Region::SetJetEt3x3 ( double  jEt  )  [inline]

Definition at line 171 of file FastL1Region.h.

References jetEt3x3.

00171 { jetEt3x3 = jEt; };

void FastL1Region::SetMIPBit (  )  [private]

Definition at line 437 of file FastL1Region.cc.

References hcfgBit, i, mipBit, and quietBit.

Referenced by SetRegionBits().

00438 {
00439   if (quietBit)
00440   for (int i=0; i<16; i++) {
00441     if (hcfgBit) {
00442       mipBit = true;
00443       return;
00444     }
00445   }
00446 }

void FastL1Region::SetParameters ( FastL1Config  iconfig  ) 

Definition at line 92 of file FastL1Region.cc.

References Config.

00093 { 
00094   Config = iconfig;
00095 }

void FastL1Region::SetQuietBit (  )  [private]

Definition at line 421 of file FastL1Region.cc.

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

Referenced by SetRegionBits().

00422 {
00423   if (SumEt()<Config.QuietRegionThreshold)
00424     quietBit = true;
00425 }

void FastL1Region::SetRegionBits ( edm::Event const &  e,
bool  bitinfo 
)

Definition at line 105 of file FastL1Region.cc.

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

00106 {
00107   SetTauBit(e,bitinfo);
00108   SetQuietBit();
00109   SetMIPBit();
00110 }

void FastL1Region::SetRegionEnergy (  ) 

Definition at line 98 of file FastL1Region.cc.

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

00099 {
00100   sumE = CalcSumE();
00101   sumEt = CalcSumEt();
00102 }

void FastL1Region::SetTauBit ( edm::Event const &  e,
bool  bitinfo 
) [private]

Definition at line 527 of file FastL1Region.cc.

References BitInfo, Config, FastL1Config::EMActiveLevel, FastL1Config::HadActiveLevel, i, FastL1BitInfo::setTauVeto(), tauBit, and Towers.

Referenced by SetRegionBits().

00528 {
00529   float emThres = Config.EMActiveLevel;
00530   float hadThres = Config.HadActiveLevel;
00531 
00532   // init pattern containers
00533   unsigned emEtaPat = 0;
00534   unsigned emPhiPat = 0;
00535   unsigned hadEtaPat = 0;
00536   unsigned hadPhiPat = 0;
00537   unsigned one = 1;
00538 
00539 
00540   // fill hits as bit pattern
00541   for (int i=0; i<16; i++) {
00542     if(Towers[i].emEt() > emThres) {
00543       emEtaPat |= (one << (unsigned)(i%4));
00544       emPhiPat |= (one << (unsigned)(i/4));
00545     }
00546 
00547     if( Towers[i].hadEt() > hadThres) {
00548       hadEtaPat |= (one << (unsigned)(i%4));
00549       hadPhiPat |= (one << (unsigned)(i/4));
00550     }
00551 
00552   }
00553 
00554   // Patterns with two or less contiguous bits set are passed
00555   // rest are vetoed; 5=0101;7=0111;9=1001;10=1010;11=1011;13=1101;14=1110;15=1111
00556   //  --- Alternate patterns
00557   //  --- 9=1001;15=1111
00558   static std::vector<unsigned> vetoPatterns;
00559   if(vetoPatterns.size() == 0) {
00560     vetoPatterns.push_back(5);
00561     vetoPatterns.push_back(7);
00562     vetoPatterns.push_back(9);
00563     vetoPatterns.push_back(10);
00564     vetoPatterns.push_back(11);
00565     vetoPatterns.push_back(13);
00566     vetoPatterns.push_back(14);
00567     vetoPatterns.push_back(15);
00568   }
00569 
00570 
00571   for(std::vector<unsigned>::iterator i = vetoPatterns.begin();
00572       i != vetoPatterns.end();  i++) {
00573     unsigned etaPattern = emEtaPat | hadEtaPat;
00574     unsigned phiPattern = emPhiPat | hadPhiPat;
00575 
00576     /*
00577     //  em pattern
00578     if(emEtaPat == *i || emPhiPat == *i) {
00579       BitInfo.EmTauVeto = true;
00580     }
00581     //  had pattern
00582     if(hadEtaPat == *i || hadPhiPat == *i) {
00583       BitInfo.HadTauVeto = true;
00584     }
00585     */
00586 
00587     if(etaPattern == *i || phiPattern == *i) // combined pattern
00588       //if(emEtaPat == *i || emPhiPat == *i || hadEtaPat == *i || hadPhiPat == *i)
00589       {
00590         tauBit = true;
00591 if (bitinfo) BitInfo.setTauVeto( true);
00592         
00593         return;
00594       }  
00595     
00596   }
00597 
00598   tauBit = false;
00599   
00600 }

void FastL1Region::SetTowerBits (  ) 

Definition at line 113 of file FastL1Region.cc.

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

Referenced by FillEMCrystals().

00114 {
00115   SetFGBit();
00116   SetHOEBit();
00117   SetHCFGBit();
00118 }

double FastL1Region::SumE (  )  [inline]

Definition at line 159 of file FastL1Region.h.

References CalcSumE().

00159 { return CalcSumE(); };

double FastL1Region::SumEt (  )  [inline]

Definition at line 160 of file FastL1Region.h.

References CalcSumEt().

Referenced by SetQuietBit().

00160 { return CalcSumEt(); };


Member Data Documentation

FastL1BitInfo FastL1Region::BitInfo

Definition at line 180 of file FastL1Region.h.

Referenced by getBitInfo(), and SetTauBit().

FastL1Config FastL1Region::Config [private]

Definition at line 226 of file FastL1Region.h.

Referenced by FastL1Region(), FillEMCrystals(), FillTower(), FillTower_Scaled(), SetFGBit(), SetHOEBit(), SetParameters(), SetQuietBit(), and SetTauBit().

double FastL1Region::EMCrystalEnergy[16][25] [private]

Definition at line 202 of file FastL1Region.h.

Referenced by FastL1Region(), FillEMCrystals(), GetEMCrystalEnergy(), SetEMCrystalEnergy(), and SetFGBit().

bool FastL1Region::fgBit[16] [private]

Definition at line 219 of file FastL1Region.h.

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

bool FastL1Region::hcfgBit[16] [private]

Definition at line 221 of file FastL1Region.h.

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

bool FastL1Region::hOeBit[16] [private]

Definition at line 220 of file FastL1Region.h.

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

int FastL1Region::id [private]

Definition at line 211 of file FastL1Region.h.

Referenced by GetId().

int FastL1Region::ieta [private]

Definition at line 212 of file FastL1Region.h.

Referenced by FastL1Region(), FillEMCrystals(), GetEastId(), GetiEta(), GetNEId(), GetNorthId(), GetNWId(), GetSEId(), GetSouthId(), GetSWId(), GetWestId(), and SetEtaPhiIndex().

int FastL1Region::iphi [private]

Definition at line 213 of file FastL1Region.h.

Referenced by FastL1Region(), FillEMCrystals(), GetEastId(), GetiPhi(), GetNEId(), GetNorthId(), GetNWId(), GetSEId(), GetSouthId(), GetSWId(), GetWestId(), and SetEtaPhiIndex().

double FastL1Region::jetE [private]

Definition at line 206 of file FastL1Region.h.

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

double FastL1Region::jetE3x3 [private]

Definition at line 208 of file FastL1Region.h.

Referenced by GetJetE3x3(), and SetJetE3x3().

double FastL1Region::jetEt [private]

Definition at line 207 of file FastL1Region.h.

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

double FastL1Region::jetEt3x3 [private]

Definition at line 209 of file FastL1Region.h.

Referenced by GetJetEt3x3(), and SetJetEt3x3().

bool FastL1Region::mipBit [private]

Definition at line 217 of file FastL1Region.h.

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

bool FastL1Region::quietBit [private]

Definition at line 216 of file FastL1Region.h.

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

double FastL1Region::sumE [private]

Definition at line 224 of file FastL1Region.h.

Referenced by SetRegionEnergy().

double FastL1Region::sumEt [private]

Definition at line 223 of file FastL1Region.h.

Referenced by SetRegionEnergy().

bool FastL1Region::tauBit [private]

Definition at line 215 of file FastL1Region.h.

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

CaloTowerCollection FastL1Region::Towers [private]

Definition at line 200 of file FastL1Region.h.

Referenced by CalcSumE(), CalcSumEt(), FastL1Region(), FillEMCrystals(), FillTower(), FillTower_Scaled(), FillTowerZero(), GetCaloTowers(), getRegionCenterEtaPhi(), SetFGBit(), SetHOEBit(), and SetTauBit().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:43 2009 for CMSSW by  doxygen 1.5.4