#include <FastSimulation/L1CaloTriggerProducer/interface/FastL1GlobalAlgo.h>
Implementation: <Notes on="" implementation>="">
Implementation: <Notes on="" implementation>="">
Definition at line 70 of file FastL1GlobalAlgo.h.
FastL1GlobalAlgo::FastL1GlobalAlgo | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 29 of file FastL1GlobalAlgo.cc.
References FastL1Config::CrystalEBThreshold, FastL1Config::CrystalEEThreshold, FastL1Config::DoEMCorr, FastL1Config::DoJetCorr, FastL1Config::EcalTPInput, FastL1Config::EMActiveLevel, FastL1Config::EmInputs, FastL1Config::EMLSB, FastL1Config::EMNoiseLevel, FastL1Config::EMSeedEnThreshold, FastL1Config::FGEBThreshold, FastL1Config::FGEEThreshold, edm::FileInPath::fullPath(), FastL1RegionMap::getL1RegionMap(), edm::ParameterSet::getParameter(), FastL1Config::HadActiveLevel, FastL1Config::HadNoiseLevel, FastL1Config::HcalLUT, FastL1Config::HcalTPInput, FastL1Config::hOeThreshold, i, j, FastL1Config::JetLSB, FastL1Config::JetSeedEtThreshold, m_DoBitInfo, m_GctIso, m_hcaluncomp, m_IsolationEt, m_L1Config, m_RMap, FastL1Config::MuonNoiseLevel, FastL1Config::noFGThreshold, FastL1Config::noTauVetoLevel, FastL1Config::QuietRegionThreshold, FastL1Config::TowerEBScale, FastL1Config::TowerEBThreshold, FastL1Config::TowerEEScale, FastL1Config::TowerEEThreshold, FastL1Config::TowerEMLSB, FastL1Config::TowerHadLSB, FastL1Config::TowerHBScale, FastL1Config::TowerHBThreshold, FastL1Config::TowerHEScale, FastL1Config::TowerHEThreshold, and FastL1Config::TowerInput.
00030 { 00031 m_RMap = FastL1RegionMap::getL1RegionMap(); 00032 00033 // Get L1 config 00034 m_L1Config.DoEMCorr = iConfig.getParameter<bool>("DoEMCorr"); 00035 m_L1Config.DoJetCorr = iConfig.getParameter<bool>("DoJetCorr"); 00036 m_DoBitInfo = iConfig.getParameter<bool>("DoBitInfo"); 00037 m_GctIso = iConfig.getParameter<bool>("GctIso"); 00038 m_IsolationEt = iConfig.getParameter<double>("IsolationEt"); 00039 00040 // get uncompressed hcal et 00041 m_L1Config.HcalLUT = iConfig.getParameter<edm::FileInPath>("HcalLUT"); 00042 00043 m_L1Config.EMSeedEnThreshold = iConfig.getParameter<double>("EMSeedEnThreshold"); 00044 m_L1Config.EMActiveLevel = iConfig.getParameter<double>("EMActiveLevel"); 00045 m_L1Config.HadActiveLevel = iConfig.getParameter<double>("HadActiveLevel"); 00046 m_L1Config.noTauVetoLevel = iConfig.getParameter<double>("noTauVetoLevel"); 00047 m_L1Config.hOeThreshold = iConfig.getParameter<double>("hOeThreshold"); 00048 m_L1Config.FGEBThreshold = iConfig.getParameter<double>("FGEBThreshold"); 00049 m_L1Config.FGEEThreshold = iConfig.getParameter<double>("FGEEThreshold"); 00050 00051 m_L1Config.MuonNoiseLevel = iConfig.getParameter<double>("MuonNoiseLevel"); 00052 m_L1Config.EMNoiseLevel = iConfig.getParameter<double>("EMNoiseLevel"); 00053 m_L1Config.HadNoiseLevel = iConfig.getParameter<double>("HadNoiseLevel"); 00054 m_L1Config.QuietRegionThreshold = iConfig.getParameter<double>("QuietRegionThreshold"); 00055 m_L1Config.JetSeedEtThreshold = iConfig.getParameter<double>("JetSeedEtThreshold"); 00056 00057 m_L1Config.TowerEMLSB = iConfig.getParameter<double>("TowerEMLSB"); 00058 m_L1Config.TowerHadLSB = iConfig.getParameter<double>("TowerHadLSB"); 00059 m_L1Config.EMLSB = iConfig.getParameter<double>("EMLSB"); 00060 m_L1Config.JetLSB = iConfig.getParameter<double>("JetLSB"); 00061 00062 m_L1Config.CrystalEBThreshold = iConfig.getParameter<double>("CrystalEBThreshold"); 00063 m_L1Config.CrystalEEThreshold = iConfig.getParameter<double>("CrystalEEThreshold"); 00064 00065 m_L1Config.TowerEBThreshold = iConfig.getParameter<double>("TowerEBThreshold"); 00066 m_L1Config.TowerEEThreshold = iConfig.getParameter<double>("TowerEEThreshold"); 00067 m_L1Config.TowerHBThreshold = iConfig.getParameter<double>("TowerHBThreshold"); 00068 m_L1Config.TowerHEThreshold = iConfig.getParameter<double>("TowerHEThreshold"); 00069 00070 m_L1Config.TowerEBScale = iConfig.getParameter<double>("TowerEBScale"); 00071 m_L1Config.TowerEEScale = iConfig.getParameter<double>("TowerEEScale"); 00072 m_L1Config.TowerHBScale = iConfig.getParameter<double>("TowerHBScale"); 00073 m_L1Config.TowerHEScale = iConfig.getParameter<double>("TowerHEScale"); 00074 00075 m_L1Config.noFGThreshold = iConfig.getParameter<double>("noFGThreshold"); 00076 00077 m_L1Config.EmInputs = iConfig.getParameter <std::vector<edm::InputTag> >("EmInputs"); 00078 m_L1Config.TowerInput = iConfig.getParameter<edm::InputTag>("TowerInput"); 00079 00080 m_L1Config.EcalTPInput = iConfig.getParameter<edm::InputTag>("EcalTPInput"); 00081 m_L1Config.HcalTPInput = iConfig.getParameter<edm::InputTag>("HcalTPInput"); 00082 00083 00084 //Load Hcal LUT file 00085 std::ifstream userfile; 00086 const std::string userfileName = m_L1Config.HcalLUT.fullPath(); 00087 userfile.open(userfileName.c_str()); 00088 static const int etabound = 32; 00089 static const int tpgmax = 256; 00090 for (int i=0; i<tpgmax; i++) { 00091 for(int j = 1; j <=etabound; j++) { 00092 userfile >> m_hcaluncomp[j][i]; 00093 //std::cout<<"+++ "<<m_hcaluncomp[j][i]<<std::endl; 00094 } 00095 } 00096 userfile.close(); 00097 00098 00099 }
FastL1GlobalAlgo::~FastL1GlobalAlgo | ( | ) |
Definition at line 101 of file FastL1GlobalAlgo.cc.
00102 { 00103 // do anything here that needs to be done at desctruction time 00104 // (e.g. close files, deallocate resources etc.) 00105 }
Definition at line 209 of file FastL1GlobalAlgo.cc.
References funct::abs(), corrJetEt(), funct::cos(), FastL1Config::DoJetCorr, e, eta, funct::exp(), GCTEnergyTrunc(), FastL1RegionMap::getRegionCenterEtaPhi(), myspace::greaterEt(), FastL1Config::JetLSB, m_CenJets, m_DoBitInfo, m_ForJets, m_L1Config, m_Regions, m_RMap, m_TauJets, FastL1Config::noTauVetoLevel, p, phi, rp4, funct::sin(), python::multivaluedict::sort(), and theta.
Referenced by findJets().
00209 { 00210 std::pair<double, double> p = m_RMap->getRegionCenterEtaPhi(iRgn); 00211 00212 //double e = m_Regions.at(iRgn).GetJetE(); 00213 //double et = GCTEnergyTrunc(m_Regions.at(iRgn).GetJetEt(), m_L1Config.JetLSB, false); 00214 double et = m_Regions.at(iRgn).GetJetEt(); 00215 00216 double eta = p.first; 00217 double phi = p.second; 00218 00219 /* 00220 if (std::abs(eta)>4.4) { 00221 std::cout<<">>> "<<et<<" "<<eta<<" "<<phi<<std::endl; 00222 } 00223 */ 00224 00225 if (m_L1Config.DoJetCorr) { 00226 et = GCTEnergyTrunc(corrJetEt(et,eta), m_L1Config.JetLSB, false); 00227 } else { 00228 et = GCTEnergyTrunc(et, m_L1Config.JetLSB, false); 00229 } 00230 /* 00231 if (et>0.) { 00232 std::cout<<"*** "<<et<<" "<<eta<<" "<<phi<<std::endl; 00233 } 00234 */ 00235 00236 double theta = 2.*atan(exp(-eta)); 00237 double ex = et*cos(phi); 00238 double ey = et*sin(phi); 00239 //double ex = e*sin(theta)*cos(phi); 00240 //double ey = e*sin(theta)*sin(phi); 00241 double e = ex/sin(theta)/cos(phi); 00242 double ez = e*cos(theta); 00243 00244 //sm 00245 if (m_DoBitInfo){ 00246 m_Regions[iRgn].BitInfo.setEt ( et); 00247 m_Regions[iRgn].BitInfo.setEnergy ( e); 00248 } 00249 //ms 00250 00251 reco::Particle::LorentzVector rp4(ex,ey,ez,e); 00252 l1extra::L1JetParticle tjet(rp4); 00253 00254 //if (et>0.) { 00255 // std::cout << "region et, eta, phi: "<< et << " "<< eta << " "<< phi << " " << std::endl; 00256 // std::cout << "reg lv et, eta, phi: "<< tjet.et()<<" "<< tjet.eta()<<" "<< tjet.phi()<<" " << std::endl; 00257 //} 00258 00259 if (et>=1.) { // set from 5. by hands 00260 if ((taubit || et>m_L1Config.noTauVetoLevel) && (std::abs(eta)<3.0) ) { 00261 m_TauJets.push_back(tjet); 00262 // sort by et 00263 std::sort(m_TauJets.begin(),m_TauJets.end(), myspace::greaterEt); 00264 } else { 00265 //sm 00266 if (m_DoBitInfo) m_Regions[iRgn].BitInfo.setHard ( true); 00267 //ms 00268 if (std::abs(eta)<3.0) { 00269 m_CenJets.push_back(tjet); 00270 std::sort(m_CenJets.begin(),m_CenJets.end(), myspace::greaterEt); 00271 } else { 00272 m_ForJets.push_back(tjet); 00273 std::sort(m_ForJets.begin(),m_ForJets.end(), myspace::greaterEt); 00274 } 00275 } 00276 } 00277 else{ if (m_DoBitInfo) m_Regions[iRgn].BitInfo.setSoft ( true);} 00278 }
void FastL1GlobalAlgo::CaloTowersDump | ( | edm::Event const & | e | ) |
Definition at line 114 of file FastL1GlobalAlgo.cc.
References edm::Event::getByLabel(), iggi_31X_cfg::input, j, m_L1Config, and FastL1Config::TowerInput.
00114 { 00115 /* 00116 std::vector<edm::Handle<CaloTowerCollection> > prods; 00117 00118 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << "Start!"; 00119 e.getManyByType(prods); 00120 00121 std::vector<edm::Handle<CaloTowerCollection> >::iterator i; 00122 00123 for (i=prods.begin(); i!=prods.end(); i++) { 00124 const CaloTowerCollection& c=*(*i); 00125 00126 for (CaloTowerCollection::const_iterator j=c.begin(); j!=c.end(); j++) { 00127 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << *j; 00128 } 00129 } 00130 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << "End!"; 00131 */ 00132 00133 00134 edm::Handle<CaloTowerCollection> input; 00135 00136 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << "Start!"; 00137 e.getByLabel(m_L1Config.TowerInput,input); 00138 00139 for (CaloTowerCollection::const_iterator j=input->begin(); j!=input->end(); j++) { 00140 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << *j; 00141 } 00142 00143 edm::LogInfo("FastL1GlobalAlgo::CaloTowersDump") << "End!"; 00144 }
void FastL1GlobalAlgo::checkMapping | ( | ) | [private] |
Definition at line 1427 of file FastL1GlobalAlgo.cc.
References FastL1RegionMap::convertFromECal_to_HCal_iphi(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), FastL1RegionMap::getRegionCenterEtaPhi(), FastL1RegionMap::getRegionEtaPhiIndex(), FastL1RegionMap::getRegionIndex(), FastL1RegionMap::getRegionTowerIndex(), i, j, and m_RMap.
01427 { 01428 01429 // loop over towers ieta,iphi 01430 for (int j=1;j<=72;j++) { 01431 for (int i=-28; i<=28; i++) { 01432 if (i==0) continue; 01433 int iRgn = m_RMap->getRegionIndex(i,j); 01434 std::pair<double, double> RgnEtaPhi = m_RMap->getRegionCenterEtaPhi(iRgn); 01435 //int iTwr = m_RMap->getRegionTowerIndex(i,j); 01436 std::pair<int, int> iRgnEtaPhi = m_RMap->getRegionEtaPhiIndex(iRgn); 01437 std::pair<int, int> iRgnEtaPhi2 = m_RMap->getRegionEtaPhiIndex(std::pair<int, int>(i,j)); 01438 01439 std::cout<<"---------------------------------------------------------------------------"<<std::endl; 01440 std::cout<<"Region: "<<iRgn<<" | "<<RgnEtaPhi.first<<", "<<RgnEtaPhi.second*180./3.141<<std::endl; 01441 std::cout<<" - "<<iRgnEtaPhi.first<<", "<<iRgnEtaPhi.second<<std::endl; 01442 std::cout<<" - "<<iRgnEtaPhi2.first<<", "<<iRgnEtaPhi2.second<<std::endl; 01443 std::cout<<" Tower: "<<i<<", "<<m_RMap->convertFromECal_to_HCal_iphi(j)<<std::endl; 01444 std::cout<<" TowerId: "<<m_RMap->getRegionTowerIndex(i,j)<<std::endl; 01445 01446 } 01447 } 01448 01449 }
void FastL1GlobalAlgo::FillBitInfos | ( | ) |
Definition at line 880 of file FastL1GlobalAlgo.cc.
References i, m_BitInfos, m_DoBitInfo, and m_Regions.
Referenced by FastL1CaloSim::produce().
00880 { 00881 if (m_DoBitInfo){ 00882 m_BitInfos.clear(); 00883 for (int i=0; i<396; i++) { 00884 m_BitInfos.push_back(m_Regions[i].getBitInfo()); 00885 } 00886 } 00887 }
void FastL1GlobalAlgo::FillEgammas | ( | edm::Event const & | e | ) |
Definition at line 324 of file FastL1GlobalAlgo.cc.
References edm::Event::getByLabel(), myspace::greaterEt(), iggi_31X_cfg::input, isEMCand(), m_Egammas, m_isoEgammas, m_L1Config, rp4, python::multivaluedict::sort(), and FastL1Config::TowerInput.
Referenced by FastL1CaloSim::produce().
00324 { 00325 m_Egammas.clear(); 00326 m_isoEgammas.clear(); 00327 00328 //std::vector< edm::Handle<CaloTowerCollection> > input; 00329 //e.getManyByType(input); 00330 edm::Handle<CaloTowerCollection> input; 00331 e.getByLabel(m_L1Config.TowerInput,input); 00332 00333 //std::vector< edm::Handle<CaloTowerCollection> >::iterator j; 00334 //for (j=input.begin(); j!=input.end(); j++) { 00335 // const CaloTowerCollection& c=*(*j); 00336 00337 l1extra::L1EmParticle* ph = new l1extra::L1EmParticle(); 00338 //l1extra::L1EmParticle ph; 00339 //for (CaloTowerCollection::const_iterator cnd=c.begin(); cnd!=c.end(); cnd++) { 00340 for (CaloTowerCollection::const_iterator cnd=input->begin(); cnd!=input->end(); cnd++) { 00341 reco::Particle::LorentzVector rp4(0.,0.,0.,0.); 00342 //l1extra::L1EmParticle* ph = new l1extra::L1EmParticle(rp4); 00343 *ph = l1extra::L1EmParticle(rp4); 00344 00345 CaloTowerDetId cid = cnd->id(); 00346 00347 int emTag = isEMCand(cid,ph,e); 00348 00349 // 1 = non-iso EM, 2 = iso EM 00350 if (emTag==1) { 00351 m_Egammas.push_back(*ph); 00352 } else if (emTag==2) { 00353 m_isoEgammas.push_back(*ph); 00354 } 00355 00356 } 00357 //} 00358 00359 std::sort(m_Egammas.begin(),m_Egammas.end(), myspace::greaterEt); 00360 std::sort(m_isoEgammas.begin(),m_isoEgammas.end(), myspace::greaterEt); 00361 00362 delete ph; 00363 }
void FastL1GlobalAlgo::FillEgammasTP | ( | edm::Event const & | e | ) |
Definition at line 283 of file FastL1GlobalAlgo.cc.
References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), myspace::greaterEt(), i, isEMCand(), m_Egammas, m_isoEgammas, m_Regions, rp4, and python::multivaluedict::sort().
Referenced by FastL1CaloSim::produce().
00283 { 00284 m_Egammas.clear(); 00285 m_isoEgammas.clear(); 00286 00287 l1extra::L1EmParticle* ph = new l1extra::L1EmParticle(); 00288 //l1extra::L1EmParticle ph; 00289 for (int i=0; i<396; i++) { 00290 CaloTowerCollection towers = m_Regions[i].GetCaloTowers(); 00291 00292 for (CaloTowerCollection::const_iterator cnd=towers.begin(); cnd!=towers.end(); cnd++) { 00293 if (cnd->emEt()<0.01 && cnd->hadEt()<0.01) continue; 00294 //if (cnd->emEt()<0.01) continue; 00295 00296 reco::Particle::LorentzVector rp4(0.,0.,0.,0.); 00297 // l1extra::L1EmParticle* ph = new l1extra::L1EmParticle(rp4); 00298 *ph = l1extra::L1EmParticle(rp4); 00299 00300 CaloTowerDetId cid = cnd->id(); 00301 //std::cout<<"+++ "<<cid<<std::endl; 00302 00303 int emTag = isEMCand(cid,ph,e); 00304 //std::cout<<"+++ "<<ph<<std::endl; 00305 //std::cout<<"+++ "<<emTag<<" | "<<ph->et()<<std::endl; 00306 00307 // 1 = non-iso EM, 2 = iso EM 00308 if (emTag==1) { 00309 m_Egammas.push_back(*ph); 00310 } else if (emTag==2) { 00311 m_isoEgammas.push_back(*ph); 00312 } 00313 00314 } 00315 std::sort(m_Egammas.begin(),m_Egammas.end(), myspace::greaterEt); 00316 std::sort(m_isoEgammas.begin(),m_isoEgammas.end(), myspace::greaterEt); 00317 } 00318 delete ph; 00319 }
void FastL1GlobalAlgo::FillJets | ( | const edm::EventSetup & | e | ) | [inline] |
Definition at line 93 of file FastL1GlobalAlgo.h.
References findJets().
Referenced by FastL1CaloSim::produce().
00093 { findJets(); };
void FastL1GlobalAlgo::FillL1Regions | ( | edm::Event const & | e, | |
const edm::EventSetup & | c | |||
) |
Definition at line 789 of file FastL1GlobalAlgo.cc.
References funct::abs(), FastL1Config::EmInputs, edm::EventSetup::get(), edm::Event::getByLabel(), FastL1RegionMap::getRegionEtaPhiIndex(), FastL1RegionMap::getRegionTowerIndex(), i, InitL1Regions(), iggi_31X_cfg::input, m_DoBitInfo, m_L1Config, m_Regions, m_RMap, edm::ESHandle< T >::product(), and FastL1Config::TowerInput.
Referenced by FastL1CaloSim::produce().
00790 { 00791 InitL1Regions(); 00792 00793 edm::Handle<CaloTowerCollection> input; 00794 e.getByLabel(m_L1Config.TowerInput,input); 00795 00796 edm::ESHandle<CaloTowerConstituentsMap> cttopo; 00797 c.get<IdealGeometryRecord>().get(cttopo); 00798 const CaloTowerConstituentsMap* theTowerConstituentsMap = cttopo.product(); 00799 00800 edm::ESHandle<CaloTopology> calotopo; 00801 c.get<CaloTopologyRecord>().get(calotopo); 00802 00803 edm::ESHandle<CaloGeometry> cGeom; 00804 c.get<CaloGeometryRecord>().get(cGeom); 00805 00806 edm::Handle<EcalRecHitCollection> ec1; 00807 e.getByLabel(m_L1Config.EmInputs.at(1),ec1); 00808 00809 edm::Handle<EcalRecHitCollection> ec0; 00810 e.getByLabel(m_L1Config.EmInputs.at(0),ec0); 00811 00812 // ascii visualisation of mapping 00813 //m_RMap->display(); 00814 00815 00816 // works for barrel/endcap region only right now! 00817 //std::vector< edm::Handle<CaloTowerCollection> > input; 00818 //e.getManyByType(input); 00819 //edm::Handle<CaloTowerCollection> input; 00820 //e.getByLabel(m_L1Config.TowerInput,input); 00821 00822 //std::vector< edm::Handle<CaloTowerCollection> >::iterator j; 00823 //for (j=input.begin(); j!=input.end(); j++) { 00824 // const CaloTowerCollection& c=*(*j); 00825 00826 // for (CaloTowerCollection::const_iterator cnd=c.begin(); cnd!=c.end(); cnd++) { 00827 for (CaloTowerCollection::const_iterator cnd=input->begin(); cnd!=input->end(); cnd++) { 00828 00829 CaloTowerDetId cid = cnd->id(); 00830 std::pair<int, int> pep = m_RMap->getRegionEtaPhiIndex(cid); 00831 00832 //if (abs(cid.ieta())>=0) { 00833 //std::cout << cid.ieta() << " " << cid.iphi() << std::endl; 00834 //std::cout << cnd->eta() << " " << cnd->phi() << std::endl; 00835 //std::cout << pep.first << " " << pep.second << std::endl; 00836 //std::cout << "**************************************************" << std::endl; 00837 //} 00838 00839 int rgnid = 999; 00840 int twrid = 999; 00841 00842 //std::cout << "FastL1GlobalAlgo::FillL1Regions calotowers dump: " << *cnd << std::endl; 00843 00844 if (std::abs(pep.first)<=22) { 00845 rgnid = pep.second*22 + pep.first; 00846 twrid = m_RMap->getRegionTowerIndex(cid); 00847 //std::cout << rgnid << " " << twrid << std::endl; 00848 } 00849 00850 if (rgnid<396 && twrid<16) { 00851 m_Regions[rgnid].FillTower_Scaled(*cnd,twrid); 00852 m_Regions[rgnid].SetRegionBits(e, m_DoBitInfo); 00853 } else { 00854 //std::cerr << "FastL1GlobalAlgo::FillL1Regions(): ERROR - invalid region or tower ID: " << rgnid << " | " << twrid << std::endl; 00855 } 00856 00857 } 00858 00859 //} 00860 00861 // Fill EM Crystals 00862 for (int i=0; i<396; i++) { 00863 00864 //m_Regions[i].FillEMCrystals(e,iConfig,m_RMap); 00865 m_Regions[i].FillEMCrystals(theTowerConstituentsMap, 00866 &(*calotopo), 00867 &(*cGeom), 00868 &(*ec0), &(*ec1), 00869 m_RMap); 00870 00871 } 00872 00873 //checkMapping(); 00874 00875 }
void FastL1GlobalAlgo::FillL1RegionsTP | ( | edm::Event const & | e, | |
const edm::EventSetup & | c | |||
) |
Definition at line 557 of file FastL1GlobalAlgo.cc.
References funct::abs(), corrEmEt(), FastL1Config::DoEMCorr, FastL1Config::EcalTPInput, FastL1Config::EMLSB, eta, funct::exp(), edm::Event::getByLabel(), FastL1RegionMap::getRegionCenterEtaPhi(), FastL1RegionMap::getRegionIndex(), FastL1RegionMap::getRegionTowerIndex(), hcaletValue(), FastL1Config::HcalTPInput, FastL1Config::hOeThreshold, i, InitL1Regions(), int, j, m_DoBitInfo, m_L1Config, m_Regions, m_RMap, FastL1Config::noFGThreshold, phi, funct::sin(), t, and theta.
Referenced by FastL1CaloSim::produce().
00558 { 00559 //edm::ESHandle<CaloTowerConstituentsMap> cttopo; 00560 //s.get<IdealGeometryRecord>().get(cttopo); 00561 //const CaloTowerConstituentsMap* theTowerConstituentsMap = cttopo.product(); 00562 00563 InitL1Regions(); 00564 00565 edm::Handle<EcalTrigPrimDigiCollection> ETPinput; 00566 e.getByLabel(m_L1Config.EcalTPInput,ETPinput); 00567 00568 edm::Handle<HcalTrigPrimDigiCollection> HTPinput; 00569 e.getByLabel(m_L1Config.HcalTPInput,HTPinput); 00570 00571 //CaloTowerCollection towers; 00572 int hEtV[396][16] = {0}; 00573 int hFGV[396][16] = {0}; 00574 int hiEtaV[396][16] = {0}; 00575 int hiPhiV[396][16] = {0}; 00576 for (HcalTrigPrimDigiCollection::const_iterator hTP=HTPinput->begin(); 00577 hTP!=HTPinput->end(); hTP++) { 00578 00579 //if (hTP!=HTPinput->end()) { 00580 //HcalTrigTowerDetId htwrid = hTP->id(); 00581 //DetId htwrid = (DetId)hTP->id(); 00582 //std::cout<<"******* AAAAAAAAAAA"<<std::endl; 00583 //CaloTowerDetId hTPtowerDetId = theTowerConstituentsMap->towerOf((DetId)htwrid); 00584 //std::cout<<"******* BBBBBBBBB"<<std::endl; 00585 00586 int rgnid = 999; 00587 int twrid = 999; 00588 00589 int hiphi = hTP->id().iphi(); 00590 int hieta = hTP->id().ieta(); 00591 00592 /* 00593 if(abs(hieta) > 20 && hiphi%2 == 0) hiphi--; 00594 std::pair<int, int> prim_tower_feed; // prim tower indeces iEta +/- 1~32, iPhi (+) 1~72 00595 prim_tower_feed.first = hieta; 00596 prim_tower_feed.second = hiphi; 00597 std::pair<int, int> rct_index = m_RMap-> getRegionEtaPhiIndex(prim_tower_feed); // convert prim tower indeces into RCT indeces ieta 0~21, iphi 0~17 00598 rgnid = rct_index.second*22 + rct_index.first; // converting fastL1 obsolete RCT numbering 00599 */ 00600 00601 rgnid = m_RMap->getRegionIndex(hieta,hiphi); 00602 twrid = m_RMap->getRegionTowerIndex(hieta,hiphi); 00603 00604 //std::cout<<hieta<<" "<<hiphi<<" "<<rgnid<<" "<<twrid<<" "<<std::endl; 00605 /* 00606 if (std::abs(htwrid.ieta())>28) { 00607 std::cout<<htwrid.ieta()<<" "<<htwrid.iphi()<<" "<<rgnid<<" "<<twrid<<" "<<std::endl; 00608 } 00609 */ 00610 00611 /* 00612 if (hTP->SOI_compressedEt()>0) { 00613 std::cout<<"hcalTP >>> "<<hTP->SOI_compressedEt()<<" "<<hTP->SOI_fineGrain()<<" " 00614 <<rgnid<<" "<<twrid<<std::endl; 00615 } 00616 */ 00617 if(rgnid < 396 && twrid < 16){ 00618 hEtV[rgnid][twrid] = (int)hTP->SOI_compressedEt(); 00619 hFGV[rgnid][twrid] = (int)hTP->SOI_fineGrain(); 00620 hiEtaV[rgnid][twrid] = hieta; 00621 hiPhiV[rgnid][twrid] = hiphi; 00622 } 00623 } 00624 00625 00626 int emEtV[396][16] = {0}; 00627 int emFGV[396][16] = {0}; 00628 int emiEtaV[396][16] = {0}; 00629 int emiPhiV[396][16] = {0}; 00630 //double emEtaV[396][16] = {0.}; 00631 for (EcalTrigPrimDigiCollection::const_iterator eTP=ETPinput->begin(); 00632 eTP!=ETPinput->end(); eTP++) { 00633 00634 int eieta = eTP->id().ieta(); 00635 00636 if(abs(eieta)> 28) continue; // no crystal in HF 00637 else{ 00638 int eiphi = eTP->id().iphi(); 00639 //int teiphi = eiphi; 00640 00641 int rgnid = 999; 00642 int twrid = 999; 00643 00644 //if(abs(eieta) > 20 && eiphi%2 == 0) teiphi=eiphi-1; 00645 00646 /* 00647 if(abs(eieta) > 20 && eiphi%2 == 0) eiphi--; 00648 std::pair<int, int> prim_tower_feed; // prim tower indeces iEta +/- 1~28, iPhi (+) 1~72 00649 prim_tower_feed.first = eieta; 00650 prim_tower_feed.second = eiphi; 00651 std::pair<int, int> rct_index = m_RMap-> getRegionEtaPhiIndex(prim_tower_feed); // convert prim tower indeces into RCT indeces ieta 0~21, iphi 0~17 00652 rgnid = rct_index.second*22 + rct_index.first; // converting fastL1 obsolete RCT numbering 00653 */ 00654 00655 /* 00656 rgnid = m_RMap->getRegionIndex(eieta,eiphi); 00657 twrid = m_RMap->getRegionTowerIndex(eieta,eiphi); 00658 00659 if (eTP->compressedEt()>0) { 00660 std::cout<<"ecalTP *** "<<eTP->compressedEt()<<" "<<eTP->fineGrain()<<" " 00661 <<rgnid<<" "<<twrid<<std::endl; 00662 } 00663 */ 00664 if(rgnid < 396 && twrid < 16){ 00665 emEtV[rgnid][twrid] = (int)eTP->compressedEt(); 00666 emFGV[rgnid][twrid] = (int)eTP->fineGrain(); 00667 emiEtaV[rgnid][twrid] = eieta; 00668 emiPhiV[rgnid][twrid] = eiphi; 00669 00670 //edm::ESHandle<CaloGeometry> cGeom; 00671 //s.get<IdealGeometryRecord>().get(cGeom); 00672 00673 //CaloTowerDetId towerDetId = CaloTowerDetId( eieta, teiphi); 00674 //CaloTowerDetId towerDetId2 = CaloTowerDetId( eieta, eiphi); 00675 //const GlobalPoint gP1 = cGeom->getPosition(towerDetId); 00676 //const GlobalPoint gP12 = cGeom->getPosition(towerDetId2); 00677 //double eta = gP1.eta(); 00678 00679 //if(abs(eieta) > 20) 00680 //std::cout<<eiphi<<" "<<gP1.phi()<<" "<<eieta<<" "<<gP1.eta()<<" "<<std::endl; 00681 00682 //double phi = gP1.phi(); 00683 //emEtaV[rgnid][twrid] = eta; 00684 } 00685 } // else 00686 } // ecalTP 00687 00688 00689 for (int i=0; i<396; i++) { 00690 for (int j=0; j<16; j++) { 00691 /* sm 00692 if (emEtV[i][j] == 0 && hEtV[i][j] == 0){ 00693 m_Regions[i].BitInfo.ecal.push_back(0); 00694 m_Regions[i].BitInfo.hcal.push_back(0); 00695 } 00696 *///ms 00697 if (emEtV[i][j]>0 || hEtV[i][j]>0) { 00698 00699 00700 std::pair<double, double> etaphi 00701 = m_RMap->getRegionCenterEtaPhi(i); 00702 double eta = etaphi.first; 00703 double phi = etaphi.second; 00704 00705 00706 double emEt = ((double) emEtV[i][j]) * m_L1Config.EMLSB; 00707 //double hadEt = ((double )hEtV[i][j]) * m_L1Config.JetLSB * cos(2.*atan(exp(-hiEtaV[i][j]))); 00708 int iAbsTwrEta = std::abs(hiEtaV[i][j]); 00709 //double hadEt = ((double )hcaletValue(iAbsTwrEta, hEtV[i][j])) * m_L1Config.JetLSB; 00710 double hadEt = ((double )hcaletValue(iAbsTwrEta, hEtV[i][j])); 00711 //double hadEt = hEtV[i][j] * m_L1Config.JetLSB; 00712 00713 if (m_L1Config.DoEMCorr) { 00714 //emEt = corrEmEt(emEt,emEtaV[i][j]); 00715 emEt = corrEmEt(emEt,std::abs(emiEtaV[i][j])); 00716 } 00717 00718 double et = emEt + hadEt; 00719 /*/ sm 00720 m_Regions[i].BitInfo.ecal[j] = emEt; 00721 m_Regions[i].BitInfo.hcal[j] = hadEt; 00722 //ms */ 00723 //math::RhoEtaPhiVector lvec(et,eta,phi); 00724 math::PtEtaPhiMLorentzVector lvec(et,eta,phi,0.); 00725 00726 CaloTowerDetId towerDetId; 00727 if (emEtV[i][j]>0) 00728 towerDetId = CaloTowerDetId(emiEtaV[i][j],emiPhiV[i][j]); 00729 else 00730 towerDetId = CaloTowerDetId(hiEtaV[i][j],hiPhiV[i][j]); 00731 00732 /* 00733 CaloTower t = CaloTower(towerDetId, lvec, 00734 emEt, hadEt, 00735 0., 0, 0); 00736 */ 00737 // New Dataformat in 2_1_X 00738 GlobalPoint emPosition,hadPosition; 00739 double theta = 2.*atan(exp(-eta)); 00740 CaloTower t = CaloTower(towerDetId,emEt/sin(theta),hadEt/sin(theta), 00741 0.,0,0,lvec,emPosition,hadPosition); 00742 00743 //m_Regions[i].FillTower_Scaled(t,j,false); 00744 m_Regions[i].FillTower_Scaled(t,j,true); 00745 00746 /* 00747 if (et>0) { 00748 std::cout<<"+++ "<<emEt<<" "<<hadEt<<" " 00749 <<i<<" "<<j<<" " 00750 <<std::endl<<"-- " 00751 <<t.emEt()<<" "<<t.hadEt()<<" " 00752 <<t.eta()<<" "<<t.phi()<<" " 00753 <<std::endl; 00754 } 00755 */ 00756 00757 00758 // Explicitely take care of integer boolean conversion 00759 if (emEt > 3.0 && emEt < m_L1Config.noFGThreshold && (int)emFGV[i][j]!=0) 00760 m_Regions[i].SetFGBit(j,true); 00761 else 00762 m_Regions[i].SetFGBit(j,false); 00763 00764 if (emEt > 3.0){ 00765 if (emEt < 60. && hadEt/emEt > m_L1Config.hOeThreshold) 00766 m_Regions[i].SetHOEBit(j,true); 00767 else 00768 m_Regions[i].SetHOEBit(j,false); 00769 } 00770 else 00771 m_Regions[i].SetHOEBit(j,false); 00772 00773 m_Regions[i].SetRegionBits(e, m_DoBitInfo); 00774 } 00775 00776 00777 } 00778 } 00779 00780 00781 00782 00783 00784 00785 }
void FastL1GlobalAlgo::FillMET | ( | edm::Event const & | e | ) |
Definition at line 367 of file FastL1GlobalAlgo.cc.
References funct::abs(), funct::cos(), eta, funct::exp(), edm::Event::getByLabel(), iggi_31X_cfg::input, m_L1Config, m_MET, phi, RCTEnergyTrunc(), rp4, funct::sin(), funct::sqrt(), theta, FastL1Config::TowerEBScale, FastL1Config::TowerEBThreshold, FastL1Config::TowerEEScale, FastL1Config::TowerEEThreshold, FastL1Config::TowerHBScale, FastL1Config::TowerHBThreshold, FastL1Config::TowerHEScale, and FastL1Config::TowerInput.
00367 { 00368 //m_METs.clear(); 00369 00370 //std::vector< edm::Handle<CaloTowerCollection> > input; 00371 //e.getManyByType(input); 00372 edm::Handle<CaloTowerCollection> input; 00373 e.getByLabel(m_L1Config.TowerInput,input); 00374 00375 double sum_hade = 0.0; 00376 double sum_hadet = 0.0; 00377 double sum_hadex = 0.0; 00378 double sum_hadey = 0.0; 00379 double sum_hadez = 0.0; 00380 double sum_e = 0.0; 00381 double sum_et = 0.0; 00382 double sum_ex = 0.0; 00383 double sum_ey = 0.0; 00384 double sum_ez = 0.0; 00385 00386 //std::vector< edm::Handle<CaloTowerCollection> >::iterator i; 00387 00388 //for (i=input.begin(); i!=input.end(); i++) { 00389 // const CaloTowerCollection& c=*(*i); 00390 00391 // for (CaloTowerCollection::const_iterator candidate=c.begin(); candidate!=c.end(); candidate++) { 00392 for (CaloTowerCollection::const_iterator candidate=input->begin(); candidate!=input->end(); candidate++) { 00393 //double eme = candidate->emEnergy(); 00394 //double hade = candidate->hadEnergy(); 00395 double eme = candidate->emEt(); 00396 double hade = candidate->hadEt(); 00397 00398 double EThres = 0.; 00399 double HThres = 0.; 00400 double EBthres = m_L1Config.TowerEBThreshold; 00401 double HBthres = m_L1Config.TowerHBThreshold; 00402 double EEthres = m_L1Config.TowerEBThreshold; 00403 double HEthres = m_L1Config.TowerEEThreshold; 00404 00405 //if(std::abs(candidate->eta())<1.479) { 00406 if(std::abs(candidate->eta())<2.322) { 00407 EThres = EBthres; 00408 } else { 00409 EThres = EEthres; 00410 } 00411 //if(std::abs(candidate->eta())<1.305) { 00412 if(std::abs(candidate->eta())<2.322) { 00413 HThres = HBthres; 00414 } else { 00415 HThres = HEthres; 00416 } 00417 00418 // rescale energies 00419 double emScale = 1.0; 00420 double hadScale = 1.0; 00421 if (std::abs(candidate->eta()>1.3050) && std::abs(candidate->eta())<3.0) { 00422 hadScale = m_L1Config.TowerHEScale; 00423 emScale = m_L1Config.TowerEEScale; 00424 } 00425 if (std::abs(candidate->eta()<1.3050)) { 00426 hadScale = m_L1Config.TowerHBScale; 00427 emScale = m_L1Config.TowerEBScale; 00428 } 00429 eme *= emScale; 00430 hade *= hadScale; 00431 00432 if (eme>=EThres || hade>=HThres) { 00433 double phi = candidate->phi(); 00434 double eta = candidate->eta(); 00435 //double et = candidate->et(); 00436 //double e = candidate->energy(); 00437 double theta = 2.*atan(exp(-eta)); 00438 double et = 0.; 00439 double e = 0.; 00440 double had_et = 0.; 00441 double had_e = 0.; 00442 00443 if (eme>=EThres) { 00444 et += candidate->emEt(); 00445 e += candidate->emEnergy(); 00446 } 00447 if (hade>=HThres) { 00448 et += candidate->hadEt(); 00449 e += candidate->hadEnergy(); 00450 had_et += candidate->hadEt(); 00451 had_e += candidate->hadEnergy(); 00452 } 00453 00454 //sum_et += et; 00455 sum_et += RCTEnergyTrunc(et,1.0,1024); 00456 sum_ex += et*cos(phi); 00457 sum_ey += et*sin(phi); 00458 //sum_ex += e*sin(theta)*cos(phi); 00459 //sum_ey += e*sin(theta)*sin(phi); 00460 //sum_e += e; 00461 sum_e += et/sin(theta); 00462 sum_ez += et*cos(theta)/sin(theta); 00463 00464 sum_hadet += had_et; 00465 sum_hadex += had_et*cos(phi); 00466 sum_hadey += had_et*sin(phi); 00467 //sum_hadex += had_e*sin(theta)*cos(phi); 00468 //sum_hadey += had_e*sin(theta)*sin(phi); 00469 //sum_hade += had_e; 00470 sum_hade += had_et/sin(theta); 00471 sum_hadez += had_et*cos(theta)/sin(theta); 00472 } 00473 } 00474 //} 00475 00476 reco::Particle::LorentzVector rp4(-sum_ex,-sum_ey,0.,std::sqrt(sum_ex*sum_ex + sum_ey*sum_ey)); 00477 m_MET = l1extra::L1EtMissParticle(rp4,sum_et,0.); 00478 //m_METs.push_back(l1extra::L1EtMissParticle(rp4,sum_et,0.)); 00479 }
void FastL1GlobalAlgo::FillMET | ( | ) |
Definition at line 483 of file FastL1GlobalAlgo.cc.
References funct::cos(), FastL1RegionMap::getRegionCenterEtaPhi(), i, m_MET, m_Regions, m_RMap, phi, rp4, funct::sin(), and funct::sqrt().
Referenced by FastL1CaloSim::produce().
00483 { 00484 //m_METs.clear(); 00485 00486 //double sum_e = 0.0; 00487 double sum_et = 0.0; 00488 double sum_ex = 0.0; 00489 double sum_ey = 0.0; 00490 //double sum_ez = 0.0; 00491 00492 for (int i=0; i<396; i++) { 00493 std::pair<double, double> etaphi = m_RMap->getRegionCenterEtaPhi(i); 00494 double phi = etaphi.second; 00495 //double eta = etaphi.first; 00496 //double theta = 2.*atan(exp(-eta)); 00497 00498 double et = m_Regions[i].SumEt(); 00499 //double e = m_Regions[i].SumE(); 00500 00501 //sum_et += et; 00502 //sum_et += RCTEnergyTrunc(et,0.5,2048); 00503 //sum_et += et; 00504 //sum_ex += RCTEnergyTrunc(et*cos(phi),0.5,2048); 00505 //sum_ey += RCTEnergyTrunc(et*sin(phi),0.5,2048); 00506 sum_ex += et*cos(phi); 00507 sum_ey += et*sin(phi); 00508 //sum_ex += e*sin(theta)*cos(phi); 00509 //sum_ey += e*sin(theta)*sin(phi); 00510 //sum_e += e; 00511 //sum_e += RCTEnergyTrunc(et/sin(theta),0.5,2048); 00512 //sum_ez += RCTEnergyTrunc(et*cos(theta)/sin(theta),0.5,2048); 00513 //sum_e += et/sin(theta); 00514 //sum_ez += et*cos(theta)/sin(theta); 00515 //sum_ez += e*cos(theta); 00516 //sum_et += e*sin(theta); 00517 } 00518 00519 //sum_et = RCTEnergyTrunc(std::sqrt(sum_ex*sum_ex + sum_ey*sum_ey),0.5,2048); 00520 sum_et = std::sqrt(sum_ex*sum_ex + sum_ey*sum_ey); 00521 00522 //reco::Particle::LorentzVector rp4(-sum_ex,-sum_ey,-sum_ez,sum_e); 00523 reco::Particle::LorentzVector rp4(-sum_ex,-sum_ey,0.,std::sqrt(sum_ex*sum_ex + sum_ey*sum_ey)); 00524 //edm::LogInfo("********** FastL1GlobalAlgo::FillMET()")<<rp4.mass()<<std::endl; 00525 m_MET = l1extra::L1EtMissParticle(rp4,sum_et,0.); 00526 //m_METs.push_back(l1extra::L1EtMissParticle(rp4,sum_et,0.)); 00527 00528 }
void FastL1GlobalAlgo::findJets | ( | ) | [private] |
Definition at line 158 of file FastL1GlobalAlgo.cc.
References addJet(), eta, FastL1RegionMap::getRegionCenterEtaPhi(), i, isMaxEtRgn_Window33(), isTauJet(), FastL1Config::JetSeedEtThreshold, m_CenJets, m_DoBitInfo, m_ForJets, m_GctIso, m_L1Config, m_Regions, m_RMap, m_TauJets, p, phi, and TauIsolation().
Referenced by FillJets().
00158 { 00159 00160 m_TauJets.clear(); 00161 m_CenJets.clear(); 00162 m_ForJets.clear(); 00163 00164 for (int i=0; i<396; i++) { 00165 // barrel/endcap part only: 00166 //if ((i%22)>3 && (i%22)<18) { 00167 std::pair<double, double> p = m_RMap->getRegionCenterEtaPhi(i); 00168 00169 double eta = p.first; 00170 double phi = p.second; 00171 if (m_DoBitInfo){ 00172 m_Regions[i].BitInfo.setEta ( eta); 00173 m_Regions[i].BitInfo.setPhi ( phi); 00174 } 00175 00176 if (m_Regions.at(i).SumEt()>m_L1Config.JetSeedEtThreshold) { 00177 if (isMaxEtRgn_Window33(i)) { 00178 00179 if (m_GctIso == true) { 00180 if (TauIsolation(i) && (i%22)>3 && (i%22)<18 ) { 00181 addJet(i,true); 00182 } else { 00183 addJet(i,false); 00184 } 00185 } else { 00186 00187 if (isTauJet(i) && (i%22)>3 && (i%22)<18 ) { 00188 addJet(i,true); 00189 } else { 00190 //if (m_DoBitInfo) m_Regions[i].BitInfo.setIsolationVeto (true); 00191 addJet(i,false); 00192 } 00193 } 00194 00195 00196 } 00197 else { if (m_DoBitInfo) m_Regions[i].BitInfo.setMaxEt (true);} 00198 } else { 00199 if (m_DoBitInfo) m_Regions[i].BitInfo.setSumEtBelowThres (true); 00200 } 00201 //} 00202 } 00203 00204 }
FastL1BitInfoCollection FastL1GlobalAlgo::getBitInfos | ( | ) | [inline] |
Definition at line 84 of file FastL1GlobalAlgo.h.
References m_BitInfos.
Referenced by FastL1CaloSim::produce().
00084 { return m_BitInfos; }
l1extra::L1JetParticleCollection FastL1GlobalAlgo::getCenJets | ( | ) | const [inline] |
Definition at line 80 of file FastL1GlobalAlgo.h.
References m_CenJets.
Referenced by FastL1CaloSim::produce().
00080 { return m_CenJets; }
l1extra::L1EmParticleCollection FastL1GlobalAlgo::getEgammas | ( | ) | const [inline] |
Definition at line 82 of file FastL1GlobalAlgo.h.
References m_Egammas.
Referenced by FastL1CaloSim::produce().
00082 { return m_Egammas; }
l1extra::L1JetParticleCollection FastL1GlobalAlgo::getForJets | ( | ) | const [inline] |
Definition at line 81 of file FastL1GlobalAlgo.h.
References m_ForJets.
Referenced by FastL1CaloSim::produce().
00081 { return m_ForJets; }
l1extra::L1EmParticleCollection FastL1GlobalAlgo::getisoEgammas | ( | ) | const [inline] |
Definition at line 83 of file FastL1GlobalAlgo.h.
References m_isoEgammas.
Referenced by FastL1CaloSim::produce().
00083 { return m_isoEgammas; }
l1extra::L1EtMissParticle FastL1GlobalAlgo::getMET | ( | ) | const [inline] |
Definition at line 77 of file FastL1GlobalAlgo.h.
References m_MET.
Referenced by FastL1CaloSim::produce().
00077 { return m_MET; }
l1extra::L1JetParticleCollection FastL1GlobalAlgo::getTauJets | ( | ) | const [inline] |
Definition at line 79 of file FastL1GlobalAlgo.h.
References m_TauJets.
Referenced by FastL1CaloSim::produce().
00079 { return m_TauJets; }
bool FastL1GlobalAlgo::greaterEt | ( | const reco::Candidate & | a, | |
const reco::Candidate & | b | |||
) | [private] |
Definition at line 1452 of file FastL1GlobalAlgo.cc.
References m_hcaluncomp.
Referenced by FillL1RegionsTP().
01452 { 01453 double etvalue = m_hcaluncomp[ieta][compET];//*cos(eta_ave); 01454 return etvalue; 01455 }
void FastL1GlobalAlgo::InitL1Regions | ( | ) |
Definition at line 531 of file FastL1GlobalAlgo.cc.
References c, FastL1RegionMap::getRegionEtaPhiIndex(), i, m_L1Config, m_Regions, m_RMap, and p.
Referenced by FillL1Regions(), and FillL1RegionsTP().
00532 { 00533 m_Regions.clear(); 00534 m_Regions = std::vector<FastL1Region>(396); // ieta: 1-22, iphi: 1-18 00535 00536 // init regions 00537 for (int i=0; i<396; i++) { 00538 m_Regions[i].SetParameters(m_L1Config); 00539 /*/ sm 00540 for (unsigned int j = 0; j < 16; ++j){ 00541 m_Regions[i].BitInfo.ecal[j]; 00542 m_Regions[i].BitInfo.hcal[j]; 00543 } 00544 //ms */ 00545 std::pair<int, int> p = m_RMap->getRegionEtaPhiIndex(i); 00546 m_Regions[i].SetEtaPhiIndex(p.first,p.second,i); 00547 CaloTower c; 00548 //std::cout<<"+++ "<<c.emEt()<<" "<<c.hadEt()<<std::endl; 00549 for (int twrid=0; twrid<16; twrid++) { 00550 m_Regions[i].FillTowerZero(c,twrid); 00551 } 00552 } 00553 }
int FastL1GlobalAlgo::isEMCand | ( | CaloTowerDetId | cid, | |
l1extra::L1EmParticle * | p, | |||
const edm::Event & | e | |||
) | [private] |
Definition at line 1019 of file FastL1GlobalAlgo.cc.
References c, funct::cos(), FastL1Config::EMLSB, FastL1Config::EMSeedEnThreshold, funct::exp(), GCTEnergyTrunc(), FastL1RegionMap::getRegionCenterEtaPhi(), FastL1RegionMap::getRegionIndex(), FastL1RegionMap::getRegionTowerIndex(), FastL1RegionMap::GetTowerEastEtaPhi(), FastL1RegionMap::GetTowerNEEtaPhi(), FastL1RegionMap::GetTowerNorthEtaPhi(), FastL1RegionMap::GetTowerNWEtaPhi(), FastL1RegionMap::GetTowerSEEtaPhi(), FastL1RegionMap::GetTowerSouthEtaPhi(), FastL1RegionMap::GetTowerSWEtaPhi(), FastL1RegionMap::GetTowerWestEtaPhi(), CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), m_L1Config, m_Regions, m_RMap, max, FastL1Config::QuietRegionThreshold, rp4, funct::sin(), and FastL1Config::TowerEBThreshold.
Referenced by FillEgammas(), and FillEgammasTP().
01019 { 01020 01021 // center tower 01022 int crgn = m_RMap->getRegionIndex(cid); 01023 int ctwr = m_RMap->getRegionTowerIndex(cid); 01024 01025 // crystals only in barrel/endcap part 01026 if ((crgn%22)<4 || (crgn%22)>17) return 0; 01027 if (crgn>395 || crgn < 0 || ctwr > 15 || ctwr < 0) return 0; 01028 01029 CaloTowerCollection c = m_Regions.at(crgn).GetCaloTowers(); 01030 double cenEt = c[ctwr].et(); 01031 //double cenEt = RCTEnergyTrunc(c[ctwr].et(),0.5,64); 01032 //double cenE = c[ctwr].emEnergy(); 01033 01034 // Using region position rather than tower position 01035 std::pair<double, double> crpos = m_RMap->getRegionCenterEtaPhi(crgn); 01036 //double cenEta = c[ctwr].eta(); 01037 //double cenPhi = c[ctwr].phi(); 01038 double cenEta = crpos.first; 01039 double cenPhi = crpos.second; 01040 01041 double cenFGbit = m_Regions.at(crgn).GetFGBit(ctwr); 01042 double cenHOEbit = m_Regions.at(crgn).GetHOEBit(ctwr); 01043 01044 if (cenEt<m_L1Config.TowerEBThreshold) return 0; 01045 01046 // check fine grain bit 01047 if (cenFGbit) return 0; 01048 01049 // check H/E bit 01050 if (cenHOEbit) return 0; 01051 01052 // check neighbours 01053 std::pair<int, int> no = m_RMap->GetTowerNorthEtaPhi(cid.ieta(),cid.iphi()); 01054 std::pair<int, int> so = m_RMap->GetTowerSouthEtaPhi(cid.ieta(),cid.iphi()); 01055 std::pair<int, int> we = m_RMap->GetTowerWestEtaPhi(cid.ieta(),cid.iphi()); 01056 std::pair<int, int> ea = m_RMap->GetTowerEastEtaPhi(cid.ieta(),cid.iphi()); 01057 std::pair<int, int> nw = m_RMap->GetTowerNWEtaPhi(cid.ieta(),cid.iphi()); 01058 std::pair<int, int> ne = m_RMap->GetTowerNEEtaPhi(cid.ieta(),cid.iphi()); 01059 std::pair<int, int> sw = m_RMap->GetTowerSWEtaPhi(cid.ieta(),cid.iphi()); 01060 std::pair<int, int> se = m_RMap->GetTowerSEEtaPhi(cid.ieta(),cid.iphi()); 01061 if (no.first>29 || no.first<-29 || no.second>72 || no.second<0) return 0; 01062 if (so.first>29 || so.first<-29 || so.second>72 || so.second<0) return 0; 01063 if (we.first>29 || we.first<-29 || we.second>72 || we.second<0) return 0; 01064 if (ea.first>29 || ea.first<-29 || ea.second>72 || ea.second<0) return 0; 01065 if (nw.first>29 || nw.first<-29 || nw.second>72 || nw.second<0) return 0; 01066 if (ne.first>29 || ne.first<-29 || ne.second>72 || ne.second<0) return 0; 01067 if (sw.first>29 || sw.first<-29 || sw.second>72 || sw.second<0) return 0; 01068 if (se.first>29 || se.first<-29 || se.second>72 || se.second<0) return 0; 01069 01070 int notwr = m_RMap->getRegionTowerIndex(no); 01071 int norgn = m_RMap->getRegionIndex(no.first,no.second); 01072 int sotwr = m_RMap->getRegionTowerIndex(so); 01073 int sorgn = m_RMap->getRegionIndex(so.first,so.second); 01074 int wetwr = m_RMap->getRegionTowerIndex(we); 01075 int wergn = m_RMap->getRegionIndex(we.first,we.second); 01076 int eatwr = m_RMap->getRegionTowerIndex(ea); 01077 int eargn = m_RMap->getRegionIndex(ea.first,ea.second); 01078 int setwr = m_RMap->getRegionTowerIndex(se); 01079 int sergn = m_RMap->getRegionIndex(se.first,sw.second); 01080 int swtwr = m_RMap->getRegionTowerIndex(sw); 01081 int swrgn = m_RMap->getRegionIndex(sw.first,sw.second); 01082 int netwr = m_RMap->getRegionTowerIndex(ne); 01083 int nergn = m_RMap->getRegionIndex(ne.first,ne.second); 01084 int nwtwr = m_RMap->getRegionTowerIndex(nw); 01085 int nwrgn = m_RMap->getRegionIndex(nw.first,nw.second); 01086 01087 // 01088 if (norgn>395 || norgn < 0 || notwr > 15 || notwr < 0) return 0; 01089 c = m_Regions[norgn].GetCaloTowers(); 01090 double noEt = c[notwr].et(); 01091 //double noEt = RCTEnergyTrunc(c[notwr].et(),0.5,64); 01092 //double noE = c[notwr].emEnergy(); 01093 // check fine grain bit 01094 bool noFGbit = m_Regions[norgn].GetFGBit(notwr); 01095 // check H/E bit 01096 bool noHOEbit = m_Regions[norgn].GetHOEBit(notwr); 01097 01098 // 01099 if (sorgn>395 || sorgn < 0 || sotwr > 15 || sotwr < 0) return 0; 01100 c = m_Regions[sorgn].GetCaloTowers(); 01101 double soEt = c[sotwr].et(); 01102 //double soEt = RCTEnergyTrunc(c[sotwr].et(),0.5,64); 01103 //double soE = c[sotwr].emEnergy(); 01104 // check fine grain bit 01105 bool soFGbit = m_Regions[sorgn].GetFGBit(sotwr); 01106 // check H/E bit 01107 bool soHOEbit = m_Regions[sorgn].GetHOEBit(sotwr); 01108 01109 // 01110 if (wergn>395 || wergn < 0 || wetwr > 15 || wetwr < 0) return 0; 01111 c = m_Regions[wergn].GetCaloTowers(); 01112 double weEt = c[wetwr].et(); 01113 //double weEt = RCTEnergyTrunc(c[wetwr].et(),0.5,64); 01114 //double weE = c[wetwr].emEnergy(); 01115 // check fine grain bit 01116 bool weFGbit = m_Regions[wergn].GetFGBit(wetwr); 01117 // check H/E bit 01118 bool weHOEbit = m_Regions[wergn].GetHOEBit(wetwr); 01119 01120 // 01121 if (eargn>395 || eargn < 0 || eatwr > 15 || eatwr < 0) return 0; 01122 c = m_Regions[eargn].GetCaloTowers(); 01123 double eaEt = c[eatwr].et(); 01124 //double eaEt = RCTEnergyTrunc(c[eatwr].et(),0.5,64); 01125 //double eaE = c[eatwr].emEnergy(); 01126 // check fine grain bit 01127 bool eaFGbit = m_Regions[eargn].GetFGBit(eatwr); 01128 // check H/E bit 01129 bool eaHOEbit = m_Regions[eargn].GetHOEBit(eatwr); 01130 01131 // 01132 if (nwrgn>395 || nwrgn < 0 || nwtwr > 15 || nwtwr < 0) return 0; 01133 c = m_Regions[nwrgn].GetCaloTowers(); 01134 double nwEt = c[nwtwr].et(); 01135 //double nwEt = RCTEnergyTrunc(c[nwtwr].et(),0.5,64); 01136 //double nwE = c[nwtwr].emEnergy(); 01137 // check fine grain bit 01138 bool nwFGbit = m_Regions[nwrgn].GetFGBit(nwtwr); 01139 // check H/E bit 01140 bool nwHOEbit = m_Regions[nwrgn].GetHOEBit(nwtwr); 01141 01142 // 01143 if (nergn>395 || nergn < 0 || netwr > 15 || netwr < 0) return 0; 01144 c = m_Regions[nergn].GetCaloTowers(); 01145 double neEt = c[netwr].et(); 01146 //double neEt = RCTEnergyTrunc(c[netwr].et(),0.5,64); 01147 //double neE = c[netwr].emEnergy(); 01148 // check fine grain bit 01149 bool neFGbit = m_Regions[nergn].GetFGBit(netwr); 01150 // check H/E bit 01151 bool neHOEbit = m_Regions[nergn].GetHOEBit(netwr); 01152 01153 // 01154 if (swrgn>395 || swrgn < 0 || swtwr > 15 || swtwr < 0) return 0; 01155 c = m_Regions[swrgn].GetCaloTowers(); 01156 double swEt = c[swtwr].et(); 01157 //double swEt = RCTEnergyTrunc(c[swtwr].et(),0.5,64); 01158 //double swE = c[swtwr].emEnergy(); 01159 // check fine grain bit 01160 bool swFGbit = m_Regions[swrgn].GetFGBit(swtwr); 01161 // check H/E bit 01162 bool swHOEbit = m_Regions[swrgn].GetHOEBit(swtwr); 01163 01164 // 01165 if (sergn>395 || sergn < 0 || setwr > 15 || setwr < 0) return 0; 01166 c = m_Regions[sergn].GetCaloTowers(); 01167 double seEt = c[setwr].et(); 01168 //double seEt = RCTEnergyTrunc(c[setwr].et(),0.5,64); 01169 //double seE = c[setwr].emEnergy(); 01170 // check fine grain bit 01171 bool seFGbit = m_Regions[sergn].GetFGBit(setwr); 01172 // check H/E bit 01173 bool seHOEbit = m_Regions[sergn].GetHOEBit(setwr); 01174 01175 01176 // check if highest et tower 01177 bool isHit = false; 01178 if ( cenEt > noEt && cenEt >= soEt && cenEt > weEt && 01179 cenEt >= eaEt && cenEt > nwEt && cenEt > neEt && 01180 cenEt >= swEt && cenEt >= seEt ) isHit = true; 01181 else 01182 return 0; 01183 01184 // find highest neighbour 01185 double hitEt = cenEt; 01186 //double hitE = cenE; 01187 double maxEt = std::max(noEt,std::max(soEt,std::max(weEt,eaEt))); 01188 //double maxE = std::max(noE,std::max(soE,std::max(weE,eaE))); 01189 01190 // check 2 tower Et 01191 float emEtThres = m_L1Config.EMSeedEnThreshold; 01192 01193 // at this point candidate is at least non-iso Egamma 01194 //double eme = (hitE+maxE); 01195 //double eme = (hitE+maxE); 01196 double emet = (hitEt+maxEt); 01197 01198 /* 01199 if (m_L1Config.DoEMCorr) { 01200 emet = GCTEnergyTrunc(corrEmEt(emet,cenEta),m_L1Config.EMLSB, true); 01201 //emet = GCTEnergyTrunc(emet,m_L1Config.EMLSB, true); 01202 } else { 01203 emet = GCTEnergyTrunc(emet,m_L1Config.EMLSB, true); 01204 } 01205 */ 01206 emet = GCTEnergyTrunc(emet,m_L1Config.EMLSB, true); 01207 01208 if ((emet)<emEtThres) return 0; 01209 01210 double emtheta = 2.*atan(exp(-cenEta)); 01211 //double emet = eme*sin(emtheta); 01212 double emex = emet*cos(cenPhi); 01213 double emey = emet*sin(cenPhi); 01214 //double emex = eme*sin(emtheta)*cos(cenPhi); 01215 //double emey = eme*sin(emtheta)*sin(cenPhi); 01216 double eme = emex/sin(emtheta)/cos(cenPhi); 01217 double emez = eme*cos(emtheta); 01218 01219 01220 reco::Particle::LorentzVector rp4(emex,emey,emez,eme); 01221 //reco::Particle::Point rp3(0.,0.,0.); 01222 //reco::Particle::Charge q(0); 01223 //*ph = reco::Photon(q,rp4,rp3); 01224 *ph = l1extra::L1EmParticle(rp4); 01225 //ph = l1extra::L1EmParticle(rp4); 01226 01227 //std::cout<<"EM eme : "<<eme<<std::endl; 01228 //std::cout<<"EM rp4.et(): "<<rp4.Et()<<std::endl; 01229 //std::cout<<"EM ph->et() : "<<ph->et()<<std::endl; 01230 01231 //if (emet>0.) { 01232 // std::cout << "em region et, eta, phi: "<< emet<<" "<< cenEta<<" "<< cenPhi<<" " << std::endl; 01233 // std::cout << "em lv et, eta, phi: "<< ph->et()<<" "<< ph->eta()<<" "<< ph->phi()<<" " << std::endl; 01234 //} 01235 01236 // check isolation FG bits 01237 if (noFGbit || soFGbit || weFGbit || eaFGbit || 01238 nwFGbit || neFGbit || swFGbit || seFGbit || 01239 noHOEbit || soHOEbit || weHOEbit || eaHOEbit || 01240 nwHOEbit || neHOEbit || swHOEbit || seHOEbit) 01241 return 1; 01242 01243 // check isolation corners 01244 //double corThres = 0.4; 01245 //double quietThres = m_L1Config.EMNoiseLevel; 01246 double quietThres = m_L1Config.QuietRegionThreshold; 01247 bool isoVeto1 = false,isoVeto2 = false,isoVeto3 = false,isoVeto4 = false; 01248 if (swEt>quietThres || weEt>quietThres || nwEt>quietThres || noEt>quietThres || neEt>quietThres ) { 01249 //if ((swEt + weEt + nwEt + noEt + neEt)/cenEt > corThres) 01250 isoVeto1 = true; 01251 } 01252 if (neEt>quietThres || eaEt>quietThres || seEt>quietThres || soEt>quietThres || swEt>quietThres ) { 01253 //if ((neEt + eaEt + seEt + soEt + swEt)/cenEt > corThres) 01254 isoVeto2 = true; 01255 } 01256 if (nwEt>quietThres || noEt>quietThres || neEt>quietThres || eaEt>quietThres || seEt>quietThres ) { 01257 //if ((nwEt + noEt + neEt + eaEt + seEt)/cenEt > corThres) 01258 isoVeto3 = true; 01259 } 01260 if (seEt>quietThres || soEt>quietThres || swEt>quietThres || weEt>quietThres || nwEt>quietThres ) { 01261 //if ((seEt + soEt + swEt + weEt + nwEt)/cenEt > corThres) 01262 isoVeto4 = true; 01263 } 01264 if (isoVeto1 && isoVeto2 && isoVeto3 && isoVeto4) 01265 return 1; 01266 01267 return 2; 01268 }
Definition at line 1273 of file FastL1GlobalAlgo.cc.
References m_Regions.
Referenced by findJets().
01273 { 01274 01275 int nwid = m_Regions.at(crgn).GetNWId(); 01276 int nid = m_Regions.at(crgn).GetNorthId(); 01277 int neid = m_Regions.at(crgn).GetNEId(); 01278 int wid = m_Regions.at(crgn).GetWestId(); 01279 int eid = m_Regions.at(crgn).GetEastId(); 01280 int swid = m_Regions.at(crgn).GetSWId(); 01281 int sid = m_Regions.at(crgn).GetSouthId(); 01282 int seid = m_Regions.at(crgn).GetSEId(); 01283 01284 01285 //Use 3x2 window at eta borders! 01286 // east border: 01287 if ((crgn%22)==21) { 01288 01289 if (nwid==999 || nid==999 || swid==999 || sid==999 || wid==999 ) { 01290 return false; 01291 } 01292 01293 double cenet = m_Regions.at(crgn).SumEt(); 01294 double nwet = m_Regions[nwid].SumEt(); 01295 double noet = m_Regions[nid].SumEt(); 01296 double weet = m_Regions[wid].SumEt(); 01297 double swet = m_Regions[swid].SumEt(); 01298 double soet = m_Regions[sid].SumEt(); 01299 01300 if ( cenet > nwet && cenet > noet && 01301 cenet >= weet && cenet >= soet && 01302 cenet >= swet ) 01303 { 01304 01305 double cene = m_Regions.at(crgn).SumE(); 01306 double nwe = m_Regions[nwid].SumE(); 01307 double noe = m_Regions[nid].SumE(); 01308 double wee = m_Regions[wid].SumE(); 01309 double swe = m_Regions[swid].SumE(); 01310 double soe = m_Regions[sid].SumE(); 01311 01312 // if region is central: jet energy is sum of 3x3 region 01313 // surrounding the central region 01314 double jE = cene + nwe + noe + wee + swe + soe; 01315 double jEt = cenet + nwet + noet + weet + swet + soet; 01316 01317 01318 m_Regions.at(crgn).SetJetE(jE); 01319 m_Regions.at(crgn).SetJetEt(jEt); 01320 01321 m_Regions.at(crgn).SetJetE3x3(cene); 01322 m_Regions.at(crgn).SetJetEt3x3(cenet); 01323 01324 return true; 01325 } else { return false; } 01326 01327 } 01328 01329 01330 // west border: 01331 if ((crgn%22)==0) { 01332 01333 if (neid==999 || nid==999 || seid==999 || sid==999 || eid==999 ) { 01334 return false; 01335 } 01336 01337 double cenet = m_Regions.at(crgn).SumEt(); 01338 double neet = m_Regions[neid].SumEt(); 01339 double noet = m_Regions[nid].SumEt(); 01340 double eaet = m_Regions[eid].SumEt(); 01341 double seet = m_Regions[seid].SumEt(); 01342 double soet = m_Regions[sid].SumEt(); 01343 01344 if ( cenet > neet && cenet > noet && 01345 cenet >= eaet && cenet >= soet && 01346 cenet >= seet ) 01347 { 01348 01349 double cene = m_Regions.at(crgn).SumE(); 01350 double nee = m_Regions[neid].SumE(); 01351 double noe = m_Regions[nid].SumE(); 01352 double eae = m_Regions[eid].SumE(); 01353 double see = m_Regions[seid].SumE(); 01354 double soe = m_Regions[sid].SumE(); 01355 01356 // if region is central: jet energy is sum of 3x3 region 01357 // surrounding the central region 01358 double jE = cene + nee + noe + eae + see + soe; 01359 double jEt = cenet + neet + noet + eaet + seet + soet; 01360 01361 m_Regions.at(crgn).SetJetE(jE); 01362 m_Regions.at(crgn).SetJetEt(jEt); 01363 01364 m_Regions.at(crgn).SetJetE3x3(cene); 01365 m_Regions.at(crgn).SetJetEt3x3(cenet); 01366 01367 return true; 01368 } else { return false; } 01369 01370 } 01371 01372 01373 if (nwid==999 || neid==999 || nid==999 || swid==999 || seid==999 || sid==999 || wid==999 || 01374 eid==999 ) { 01375 //std::cerr << "FastL1GlobalAlgo::isMaxEtRgn_Window33(): RegionId out of bounds: " << std::endl 01376 // << nwid << " " << nid << " " << neid << " " << std::endl 01377 // << wid << " " << crgn << " " << eid << " " << std::endl 01378 // << swid << " " << sid << " " << seid << " " << std::endl; 01379 return false; 01380 } 01381 01382 double cenet = m_Regions.at(crgn).SumEt(); 01383 double nwet = m_Regions[nwid].SumEt(); 01384 double noet = m_Regions[nid].SumEt(); 01385 double neet = m_Regions[neid].SumEt(); 01386 double weet = m_Regions[wid].SumEt(); 01387 double eaet = m_Regions[eid].SumEt(); 01388 double swet = m_Regions[swid].SumEt(); 01389 double soet = m_Regions[sid].SumEt(); 01390 double seet = m_Regions[seid].SumEt(); 01391 01392 if ( cenet > nwet && cenet > noet && 01393 cenet > neet && cenet >= eaet && 01394 cenet > weet && cenet >= soet && 01395 cenet >= swet && cenet >= seet ) 01396 { 01397 01398 double cene = m_Regions.at(crgn).SumE(); 01399 double nwe = m_Regions[nwid].SumE(); 01400 double noe = m_Regions[nid].SumE(); 01401 double nee = m_Regions[neid].SumE(); 01402 double wee = m_Regions[wid].SumE(); 01403 double eae = m_Regions[eid].SumE(); 01404 double swe = m_Regions[swid].SumE(); 01405 double soe = m_Regions[sid].SumE(); 01406 double see = m_Regions[seid].SumE(); 01407 01408 // if region is central: jet energy is sum of 3x3 region 01409 // surrounding the central region 01410 double jE = cene + nwe + noe + nee + wee + eae + swe + soe + see; 01411 double jEt = cenet + nwet + noet + neet + weet + eaet + swet + soet + seet; 01412 01413 01414 m_Regions.at(crgn).SetJetE(jE); 01415 m_Regions.at(crgn).SetJetEt(jEt); 01416 01417 m_Regions.at(crgn).SetJetE3x3(cene); 01418 m_Regions.at(crgn).SetJetEt3x3(cenet); 01419 01420 return true; 01421 } else { return false; } 01422 01423 }
Definition at line 891 of file FastL1GlobalAlgo.cc.
References m_DoBitInfo, and m_Regions.
Referenced by findJets().
00891 { 00892 00893 // Barrel and Endcap only 00894 if ((cRgn%22)<4 || (cRgn%22)>17) 00895 return false; 00896 00897 int shower_shape = 0; 00898 int et_isolation = 0; 00899 00900 if (m_Regions[cRgn].GetTauBit()) 00901 if (!m_DoBitInfo) 00902 return false; 00903 00904 int nwid = m_Regions[cRgn].GetNWId(); 00905 int nid = m_Regions[cRgn].GetNorthId(); 00906 int neid = m_Regions[cRgn].GetNEId(); 00907 int wid = m_Regions[cRgn].GetWestId(); 00908 int eid = m_Regions[cRgn].GetEastId(); 00909 int swid = m_Regions[cRgn].GetSWId(); 00910 int sid = m_Regions[cRgn].GetSouthId(); 00911 int seid = m_Regions[cRgn].GetSEId(); 00912 00913 if (!m_DoBitInfo) 00914 if (m_Regions[cRgn].GetTauBit()) shower_shape = 1; // check center 00915 00916 //Use 3x2 window at eta borders! 00917 00918 if((cRgn%22)==4 || (cRgn%22)==17 ) { 00919 // west border: 00920 if ((cRgn%22)==4) { 00921 //std::cout << "West border check: " << std::endl 00922 // << nwid << " " << nid << " " << neid << " " << std::endl 00923 // << wid << " " << cRgn << " " << eid << " " << std::endl 00924 // << swid << " " << sid << " " << seid << " " << std::endl; 00925 //std::cout << "West border check: " << std::endl 00926 // << m_Regions[nwid].GetTauBit() << " " << m_Regions[nid].GetTauBit() << " " << m_Regions[neid].GetTauBit() << " " << std::endl 00927 // << m_Regions[wid].GetTauBit() << " " << m_Regions[cRgn].GetTauBit() << " " << m_Regions[eid].GetTauBit() << " " << std::endl 00928 // << m_Regions[swid].GetTauBit() << " " << m_Regions[sid].GetTauBit() << " " << m_Regions[seid].GetTauBit() << " " << std::endl; 00929 00930 if ( 00931 m_Regions[nid].GetTauBit() || 00932 m_Regions[neid].GetTauBit() || 00933 m_Regions[eid].GetTauBit() || 00934 m_Regions[seid].GetTauBit() || 00935 m_Regions[sid].GetTauBit() || 00936 m_Regions[cRgn].GetTauBit() 00937 ) 00938 { 00939 if (!m_DoBitInfo) return false; 00940 } 00941 else { 00942 if (!m_DoBitInfo) return true; 00943 } 00944 00945 if (m_DoBitInfo) m_Regions[cRgn].BitInfo.setIsolationVeto ( true); 00946 et_isolation = 1; 00947 } else { et_isolation = 2;} 00948 00949 // east border: 00950 if ((cRgn%22)==17) { 00951 //std::cout << "East border check2: " << std::endl 00952 // << nwid << " " << nid << " " << neid << " " << std::endl 00953 // << wid << " " << cRgn << " " << eid << " " << std::endl 00954 // << swid << " " << sid << " " << seid << " " << std::endl; 00955 //std::cout << "East border check: " << std::endl 00956 // << m_Regions[nwid].GetTauBit() << " " << m_Regions[nid].GetTauBit() << " " << m_Regions[neid].GetTauBit() << " " << std::endl 00957 // << m_Regions[wid].GetTauBit() << " " << m_Regions[cRgn].GetTauBit() << " " << m_Regions[eid].GetTauBit() << " " << std::endl 00958 // << m_Regions[swid].GetTauBit() << " " << m_Regions[sid].GetTauBit() << " " << m_Regions[seid].GetTauBit() << " " << std::endl; 00959 00960 if ( 00961 m_Regions[nid].GetTauBit() || 00962 m_Regions[nwid].GetTauBit() || 00963 m_Regions[wid].GetTauBit() || 00964 m_Regions[swid].GetTauBit() || 00965 m_Regions[sid].GetTauBit() || 00966 m_Regions[cRgn].GetTauBit() 00967 ) 00968 { 00969 if (!m_DoBitInfo) return false; 00970 } 00971 else { 00972 if (!m_DoBitInfo) return true; 00973 } 00974 00975 } else { et_isolation = 2; } 00976 00977 00978 // Closing 2x3 method 00979 if (et_isolation == 1 || shower_shape == 1 ) return false; // done at boarder 00980 if (et_isolation == 2 && shower_shape == 0) return true; // done at boarder 00981 } 00982 00983 if ( (cRgn%22)>4 && (cRgn%22)<17){ // non-boarder 00984 if (nwid==999 || neid==999 || nid==999 || swid==999 || seid==999 || sid==999 || wid==999 || 00985 eid==999 ) { 00986 return false; 00987 } 00988 00989 if ( 00990 m_Regions[nwid].GetTauBit() || 00991 m_Regions[nid].GetTauBit() || 00992 m_Regions[neid].GetTauBit() || 00993 m_Regions[wid].GetTauBit() || 00994 m_Regions[eid].GetTauBit() || 00995 m_Regions[swid].GetTauBit() || 00996 m_Regions[seid].GetTauBit() || 00997 m_Regions[sid].GetTauBit() || 00998 m_Regions[cRgn].GetTauBit() 00999 ) 01000 { 01001 if (m_DoBitInfo) m_Regions[cRgn].BitInfo.setIsolationVeto(true); 01002 et_isolation = 1; 01003 if (!m_DoBitInfo) return false; 01004 } else { 01005 et_isolation = 2; 01006 if (!m_DoBitInfo) return true; 01007 } 01008 01009 if (et_isolation == 1 || shower_shape == 1) return false; 01010 if (et_isolation == 2 && shower_shape == 0) return true; 01011 } // non-boarder 01012 01013 return true; // shouldn't reach here 01014 }
Definition at line 1459 of file FastL1GlobalAlgo.cc.
References m_DoBitInfo, m_IsolationEt, and m_Regions.
Referenced by findJets().
01459 { 01460 01461 if ((cRgn%22)<4 || (cRgn%22)>17) return false; 01462 01463 double iso_threshold = m_IsolationEt; // arbitrarily set 01464 int shower_shape = 0; 01465 int et_isolation = 0; 01466 unsigned int iso_count = 0; 01467 01468 int nwid = m_Regions[cRgn].GetNWId(); 01469 int nid = m_Regions[cRgn].GetNorthId(); 01470 int neid = m_Regions[cRgn].GetNEId(); 01471 int wid = m_Regions[cRgn].GetWestId(); 01472 int eid = m_Regions[cRgn].GetEastId(); 01473 int swid = m_Regions[cRgn].GetSWId(); 01474 int sid = m_Regions[cRgn].GetSouthId(); 01475 int seid = m_Regions[cRgn].GetSEId(); 01476 01477 if (m_Regions[cRgn].GetTauBit()) shower_shape = 1; // check center 01478 if((cRgn%22)==4 || (cRgn%22)==17 ) { 01479 // west border 01480 if ((cRgn%22)==4) { 01481 if( m_Regions[neid].SumEt() > iso_threshold){ 01482 iso_count ++; 01483 if (m_Regions[neid].GetTauBit()) iso_count++; 01484 } 01485 if( m_Regions[nid].SumEt() > iso_threshold){ 01486 iso_count ++; 01487 if (m_Regions[nid].GetTauBit()) iso_count++; 01488 } 01489 if( m_Regions[eid].SumEt() > iso_threshold){ 01490 iso_count ++; 01491 if (m_Regions[eid].GetTauBit()) iso_count++; 01492 } 01493 if( m_Regions[seid].SumEt() > iso_threshold){ 01494 iso_count ++; 01495 if (m_Regions[seid].GetTauBit()) iso_count++; 01496 } 01497 if( m_Regions[sid].SumEt() > iso_threshold){ 01498 iso_count ++; 01499 if (m_Regions[sid].GetTauBit()) iso_count++; 01500 } 01501 01502 if (iso_count >= 2 ){ 01503 if (m_DoBitInfo){ 01504 m_Regions[cRgn].BitInfo.setIsolationVeto ( true); 01505 // m_Regions[cRgn].BitInfo.setIsolationCount ( iso_count); 01506 } 01507 et_isolation = 1; 01508 } 01509 else{ et_isolation = 2;} 01510 } // west bd 01511 01512 // east border: 01513 if ((cRgn%22)==17) { 01514 if( m_Regions[nwid].SumEt() > iso_threshold){ 01515 iso_count ++; 01516 if (m_Regions[nwid].GetTauBit()) iso_count++; 01517 } 01518 if( m_Regions[nid].SumEt() > iso_threshold){ 01519 iso_count ++; 01520 if (m_Regions[nid].GetTauBit()) iso_count++; 01521 } 01522 if( m_Regions[wid].SumEt() > iso_threshold){ 01523 iso_count ++; 01524 if (m_Regions[wid].GetTauBit()) iso_count++; 01525 } 01526 if( m_Regions[swid].SumEt() > iso_threshold){ 01527 iso_count ++; 01528 if (m_Regions[swid].GetTauBit()) iso_count++; 01529 } 01530 if( m_Regions[sid].SumEt() > iso_threshold){ 01531 iso_count ++; 01532 if (m_Regions[sid].GetTauBit()) iso_count++; 01533 } 01534 01535 if (iso_count >= 2 ){ 01536 if (m_DoBitInfo){ 01537 m_Regions[cRgn].BitInfo.setIsolationVeto ( true); 01538 // m_Regions[cRgn].BitInfo.setIsolationCount ( iso_count); 01539 } 01540 et_isolation = 1; 01541 } 01542 else{ et_isolation = 2;} 01543 } // east bd 01544 01545 // Closing 2x3 method 01546 if (et_isolation == 1 || shower_shape == 1 ) return false; // done at boarder 01547 if (et_isolation == 2 && shower_shape == 0) return true; // done at boarder 01548 } 01549 01550 if ( (cRgn%22)>4 && (cRgn%22)<17){ // non-boarder 01551 if (nwid==999 || neid==999 || nid==999 || swid==999 || seid==999 || sid==999 || wid==999 || 01552 eid==999 ) { 01553 return false; 01554 } 01555 01556 if( m_Regions[neid].SumEt() > iso_threshold){ 01557 iso_count ++; 01558 if (m_Regions[neid].GetTauBit()) iso_count++; 01559 } 01560 if( m_Regions[nid].SumEt() > iso_threshold){ 01561 iso_count ++; 01562 if (m_Regions[nid].GetTauBit()) iso_count++; 01563 } 01564 if( m_Regions[eid].SumEt() > iso_threshold){ 01565 iso_count ++; 01566 if (m_Regions[eid].GetTauBit()) iso_count++; 01567 } 01568 if( m_Regions[seid].SumEt() > iso_threshold){ 01569 iso_count ++; 01570 if (m_Regions[seid].GetTauBit()) iso_count++; 01571 } 01572 if( m_Regions[sid].SumEt() > iso_threshold){ 01573 iso_count ++; 01574 if (m_Regions[sid].GetTauBit()) iso_count++; 01575 } 01576 if( m_Regions[nwid].SumEt() > iso_threshold){ 01577 iso_count ++; 01578 if (m_Regions[nwid].GetTauBit()) iso_count++; 01579 } 01580 if( m_Regions[wid].SumEt() > iso_threshold){ 01581 iso_count ++; 01582 if (m_Regions[wid].GetTauBit()) iso_count++; 01583 } 01584 if( m_Regions[swid].SumEt() > iso_threshold){ 01585 iso_count ++; 01586 if (m_Regions[swid].GetTauBit()) iso_count++; 01587 } 01588 01589 if (iso_count >= 2 ){ 01590 if (m_DoBitInfo){ 01591 m_Regions[cRgn].BitInfo.setIsolationVeto ( true); 01592 // m_Regions[cRgn].BitInfo.setIsolationCount ( iso_count); 01593 } 01594 et_isolation = 1; 01595 } 01596 else {et_isolation = 2;} 01597 01598 if (et_isolation == 1 || shower_shape == 1) return false; 01599 if (et_isolation == 2 && shower_shape == 0) return true; 01600 }// non-boarder 01601 01602 return true; // shouldn't reach here 01603 }//
Definition at line 118 of file FastL1GlobalAlgo.h.
Referenced by addJet(), findJets(), and getCenJets().
bool FastL1GlobalAlgo::m_DoBitInfo [private] |
Definition at line 126 of file FastL1GlobalAlgo.h.
Referenced by addJet(), FastL1GlobalAlgo(), FillBitInfos(), FillL1Regions(), FillL1RegionsTP(), findJets(), isTauJet(), and TauIsolation().
Definition at line 120 of file FastL1GlobalAlgo.h.
Referenced by FillEgammas(), FillEgammasTP(), and getEgammas().
Definition at line 119 of file FastL1GlobalAlgo.h.
Referenced by addJet(), findJets(), and getForJets().
bool FastL1GlobalAlgo::m_GctIso [private] |
Definition at line 128 of file FastL1GlobalAlgo.h.
Referenced by FastL1GlobalAlgo(), and findJets().
double FastL1GlobalAlgo::m_hcaluncomp[33][256] [private] |
Definition at line 132 of file FastL1GlobalAlgo.h.
Referenced by FastL1GlobalAlgo(), and hcaletValue().
Definition at line 121 of file FastL1GlobalAlgo.h.
Referenced by FillEgammas(), FillEgammasTP(), and getisoEgammas().
double FastL1GlobalAlgo::m_IsolationEt [private] |
Definition at line 129 of file FastL1GlobalAlgo.h.
Referenced by FastL1GlobalAlgo(), and TauIsolation().
FastL1Config FastL1GlobalAlgo::m_L1Config [private] |
Definition at line 131 of file FastL1GlobalAlgo.h.
Referenced by addJet(), CaloTowersDump(), FastL1GlobalAlgo(), FillEgammas(), FillL1Regions(), FillL1RegionsTP(), FillMET(), findJets(), InitL1Regions(), and isEMCand().
std::vector<FastL1Region> FastL1GlobalAlgo::m_Regions [private] |
Definition at line 124 of file FastL1GlobalAlgo.h.
Referenced by addJet(), FillBitInfos(), FillEgammasTP(), FillL1Regions(), FillL1RegionsTP(), FillMET(), findJets(), InitL1Regions(), isEMCand(), isMaxEtRgn_Window33(), isTauJet(), and TauIsolation().
FastL1RegionMap* FastL1GlobalAlgo::m_RMap [private] |
Definition at line 125 of file FastL1GlobalAlgo.h.
Referenced by addJet(), checkMapping(), FastL1GlobalAlgo(), FillL1Regions(), FillL1RegionsTP(), FillMET(), findJets(), InitL1Regions(), and isEMCand().
Definition at line 117 of file FastL1GlobalAlgo.h.
Referenced by addJet(), findJets(), and getTauJets().