#include <DQM/L1TMonitor/interface/L1TCompare.h>
Definition at line 61 of file L1TCompare.h.
typedef std::vector<L1TCompare::RctObject> L1TCompare::RctObjectCollection [private] |
Definition at line 124 of file L1TCompare.h.
L1TCompare::L1TCompare | ( | const edm::ParameterSet & | ps | ) |
Definition at line 115 of file L1TCompare.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), edm::ParameterSet::getUntrackedParameter(), NULL, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), verbose(), and verbose_.
00115 : 00116 rctSource_( ps.getParameter< InputTag >("rctSource") ) 00117 ,gctSource_( ps.getParameter< InputTag >("gctSource") ) 00118 ,ecalTpgSource_(ps.getParameter<edm::InputTag>("ecalTpgSource")) 00119 00120 { 00121 00122 // verbosity switch 00123 verbose_ = ps.getUntrackedParameter < bool > ("verbose", false); 00124 00125 if (verbose()) 00126 std::cout << "L1TCompare: constructor...." << std::endl; 00127 00128 00129 dbe = NULL; 00130 if (ps.getUntrackedParameter < bool > ("DQMStore", false)) { 00131 dbe = Service < DQMStore > ().operator->(); 00132 dbe->setVerbose(0); 00133 } 00134 00135 outputFile_ = 00136 ps.getUntrackedParameter < std::string > ("outputFile", ""); 00137 if (outputFile_.size() != 0) { 00138 std:: 00139 cout << "L1T Monitoring histograms will be saved to " << 00140 outputFile_.c_str() << std::endl; 00141 } 00142 00143 bool disable = 00144 ps.getUntrackedParameter < bool > ("disableROOToutput", false); 00145 if (disable) { 00146 outputFile_ = ""; 00147 } 00148 00149 00150 if (dbe != NULL) { 00151 dbe->setCurrentFolder("L1T/Compare"); 00152 } 00153 00154 00155 }
L1TCompare::~L1TCompare | ( | ) | [virtual] |
void L1TCompare::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 262 of file L1TCompare.cc.
References TestMuL1L2Filter_cff::cerr, GenMuonPlsPt100GeV_cfg::cout, e2, ecalTpgRctLeadingEmEta2_, ecalTpgRctLeadingEmEta_, ecalTpgRctLeadingEmPhi_, ecalTpgRctLeadingEmRank_, ecalTpgSource_, em, lat::endl(), MonitorElement::Fill(), gctSource_, edm::Event::getByLabel(), h, id, edm::Handle< T >::isValid(), edm::InputTag::label(), nev_, rctGctLeadingIsoEmEta_, rctGctLeadingIsoEmPhi_, rctGctLeadingIsoEmRank_, rctGctLeadingNonIsoEmEta_, rctGctLeadingNonIsoEmPhi_, rctGctLeadingNonIsoEmRank_, rctSource_, python::multivaluedict::sort(), UL, and verbose().
00263 { 00264 ++nev_; 00265 if (verbose()) { 00266 std::cout << "L1TCompare: analyze...." << std::endl; 00267 } 00268 00269 // L1E 00270 edm::Handle < L1EmParticleCollection > l1eIsoEm; 00271 edm::Handle < L1EmParticleCollection > l1eNonIsoEm; 00272 edm::Handle < L1JetParticleCollection > l1eCenJets; 00273 edm::Handle < L1JetParticleCollection > l1eForJets; 00274 edm::Handle < L1JetParticleCollection > l1eTauJets; 00275 // edm::Handle < L1EtMissParticle > l1eEtMiss; 00276 edm::Handle < L1EtMissParticleCollection > l1eEtMiss; 00277 // RCT 00278 edm::Handle < L1CaloEmCollection > em; // collection of L1CaloEmCands 00279 edm::Handle < L1CaloRegionCollection > rctEmRgn; 00280 00281 // GCT 00282 edm::Handle <L1GctJetCandCollection> gctCenJets; 00283 edm::Handle <L1GctEmCandCollection> gctIsoEmCands; 00284 edm::Handle <L1GctEmCandCollection> gctNonIsoEmCands; 00285 00286 00287 e.getByLabel(rctSource_,em); 00288 00289 if (!em.isValid()) { 00290 edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection with label " 00291 << rctSource_.label() ; 00292 return; 00293 } 00294 00295 00296 e.getByLabel(rctSource_,rctEmRgn); 00297 00298 if (!rctEmRgn.isValid()) { 00299 edm::LogInfo("DataNotFound") << "can't find " 00300 << "L1CaloRegionCollection with label " 00301 << rctSource_.label() ; 00302 return; 00303 } 00304 00305 00306 e.getByLabel(gctSource_.label(),"cenJets", gctCenJets); 00307 e.getByLabel(gctSource_.label(), "isoEm", gctIsoEmCands); 00308 e.getByLabel(gctSource_.label(), "nonIsoEm", gctNonIsoEmCands); 00309 00310 if (!gctCenJets.isValid()) { 00311 std::cerr << "L1TGCT: could not find one of the classes?" << std::endl; 00312 return; 00313 } 00314 if (!gctIsoEmCands.isValid()) { 00315 std::cerr << "L1TGCT: could not find one of the classes?" << std::endl; 00316 return; 00317 } 00318 if (!gctNonIsoEmCands.isValid()) { 00319 std::cerr << "L1TGCT: could not find one of the classes?" << std::endl; 00320 return; 00321 } 00322 00323 00324 // GCT 00325 if ( verbose() ) { 00326 for ( L1GctEmCandCollection::const_iterator iem = gctIsoEmCands->begin(); 00327 iem != gctIsoEmCands->end(); ++iem) { 00328 if ( !iem->empty() ) 00329 std::cout << "GCT EM: " << iem->rank() 00330 << ", " 00331 << iem->etaIndex() << "(" 00332 //<< int(iem->etaIndex()&0x3)*((iem->etaIndex()&0x4)?1:-1) 00333 << "), " 00334 << iem->phiIndex() 00335 << std::endl; 00336 } 00337 } 00338 // rct phi: 0-17 00339 // rct eta: 0-21 00340 00341 00342 // Fill the RCT histograms 00343 00344 // Regions 00345 RctObjectCollection rcj, rcj_iso, rcj_non_iso; 00346 for (L1CaloEmCollection::const_iterator iem = em->begin(); 00347 iem != em->end(); ++iem) { 00348 // L1CaloRegionDetId id(false, iem->rctCrate(), iem->rctCard(), 00349 // iem->rctRegion()); 00350 L1CaloRegionDetId id(iem->rctCrate(), iem->rctCard(), 00351 iem->rctRegion()); 00352 00353 // RctObject h(id.gctEta(), id.gctPhi(), iem->rank()); 00354 RctObject h(id.rctEta(), id.rctPhi(), iem->rank()); 00355 if ( !iem->isolated() ) 00356 rcj_non_iso.push_back(h); 00357 else 00358 rcj_iso.push_back(h); 00359 rcj.push_back(h); 00360 } 00361 // not so smart but ... 00362 std::sort(rcj.begin(), rcj.end(), RctObjectComp()); 00363 std::sort(rcj_non_iso.begin(), rcj_non_iso.end(), RctObjectComp()); 00364 std::sort(rcj_iso.begin(), rcj_iso.end(), RctObjectComp()); 00365 if ( verbose() ) { 00366 for (RctObjectCollection::reverse_iterator ij = rcj_iso.rbegin(); 00367 ij != rcj_iso.rend() && ij != rcj_iso.rbegin()+8; ++ij) { 00368 std::cout << "RCT cj: " 00369 << ij->rank_ << ", " << ij->eta_ << ", " << ij->phi_ 00370 << std::endl; 00371 } 00372 } 00373 L1GctEmCandCollection::const_iterator lead_em = gctIsoEmCands->begin(); 00374 if ( !lead_em->empty() ) { // equivalent to rank == 0 00375 rctGctLeadingIsoEmEta_->Fill(lead_em->etaIndex(), rcj_iso.rbegin()->eta_); 00376 rctGctLeadingIsoEmPhi_->Fill(lead_em->phiIndex(), rcj_iso.rbegin()->phi_); 00377 rctGctLeadingIsoEmRank_->Fill(lead_em->rank(), rcj_iso.rbegin()->rank_); 00378 } 00379 00380 // non-isolated 00381 if ( verbose() ) { 00382 for ( L1GctEmCandCollection::const_iterator iem 00383 = gctNonIsoEmCands->begin(); iem != gctNonIsoEmCands->end(); 00384 ++iem) { 00385 if ( ! iem->empty() ) 00386 std::cout << "GCT EM non: " << iem->rank() 00387 << ", " 00388 << iem->etaIndex() //<< "(" 00389 //<< int(iem->etaIndex()&0x3)*((iem->etaIndex()&0x4)?1:-1) 00390 //<< ")" 00391 << ", " 00392 << iem->phiIndex() 00393 << std::endl; 00394 } 00395 } 00396 if ( verbose() ) { 00397 for (RctObjectCollection::reverse_iterator ij = rcj_non_iso.rbegin(); 00398 ij != rcj_non_iso.rend() && ij != rcj_non_iso.rbegin()+8; ++ij) { 00399 std::cout << "RCT cj non: " 00400 << ij->rank_ << ", " << ij->eta_ << ", " << ij->phi_ 00401 << std::endl; 00402 } 00403 } 00404 lead_em = gctNonIsoEmCands->begin(); 00405 if ( !lead_em->empty() ) { // equivalent to rank != 0 00406 rctGctLeadingNonIsoEmEta_->Fill(lead_em->etaIndex(), 00407 rcj_non_iso.rbegin()->eta_); 00408 rctGctLeadingNonIsoEmPhi_->Fill(lead_em->phiIndex(), 00409 rcj_non_iso.rbegin()->phi_); 00410 rctGctLeadingNonIsoEmRank_->Fill(lead_em->rank(), 00411 rcj_non_iso.rbegin()->rank_); 00412 } 00413 00414 // ECAL TPG's to RCT EM 00415 edm::Handle < EcalTrigPrimDigiCollection > eTP; 00416 e.getByLabel(ecalTpgSource_,eTP); 00417 00418 if (!eTP.isValid()) { 00419 edm::LogInfo("DataNotFound") 00420 << "can't find EcalTrigPrimCollection with label " 00421 << ecalTpgSource_.label() ; 00422 return; 00423 } 00424 RctObjectCollection ecalobs; 00425 for (EcalTrigPrimDigiCollection::const_iterator ieTP = eTP->begin(); 00426 ieTP != eTP->end(); ieTP++) { 00427 ecalobs.push_back(RctObject(ieTP->id().ieta(), 00428 ieTP->id().iphi(), 00429 ieTP->compressedEt())); 00430 } 00431 std::sort(ecalobs.begin(), ecalobs.end(), RctObjectComp()); 00432 if ( verbose() ) { 00433 for (RctObjectCollection::reverse_iterator ij = ecalobs.rbegin(); 00434 ij != ecalobs.rend() && ij != ecalobs.rbegin()+8; ++ij) { 00435 std::cout << "ECAL cj : " 00436 << ij->rank_ << ", " << ij->eta_ << ", " << ij->phi_ 00437 << std::endl; 00438 } 00439 } 00440 // abritrary cut 00441 if ( rcj.rbegin()->rank_ > 4 ) { 00442 ecalTpgRctLeadingEmEta_->Fill(rcj.rbegin()->eta_, 00443 ecalobs.rbegin()->eta_); 00444 int e2 = (rcj.rbegin()->eta_&0x7UL)* ((rcj.rbegin()->eta_&0x8UL)?1:-1); 00445 ecalTpgRctLeadingEmEta2_->Fill(e2, ecalobs.rbegin()->eta_); 00446 ecalTpgRctLeadingEmPhi_->Fill(rcj.rbegin()->phi_, ecalobs.rbegin()->phi_); 00447 ecalTpgRctLeadingEmRank_->Fill(rcj.rbegin()->rank_, 00448 ecalobs.rbegin()->rank_); 00449 } 00450 if ( verbose() ) { 00451 int seta = rcj.rbegin()->eta_; 00452 seta = (seta&0x7UL)*(seta&0x8?-1:1); 00453 std::cout << "ZZ: " 00454 << rcj.rbegin()->eta_ << " " 00455 << rcj.rbegin()->phi_ << " " 00456 << rcj.rbegin()->rank_ << " " 00457 << (++rcj.rbegin())->rank_<< " " 00458 << ecalobs.rbegin()->eta_ << " " 00459 << ecalobs.rbegin()->phi_ << " " 00460 << ecalobs.rbegin()->rank_ << " " 00461 << (++ecalobs.rbegin())->rank_<< " " 00462 << seta << " " 00463 << std::endl; 00464 } 00465 00466 00467 00468 }
void L1TCompare::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 161 of file L1TCompare.cc.
References DQMStore::book2D(), dbe, ecalTpgRctLeadingEmEta2_, ecalTpgRctLeadingEmEta_, ecalTpgRctLeadingEmPhi_, ecalTpgRctLeadingEmRank_, ETABINS, ETAMAX, ETAMIN, nev_, PHIBINS, PHIMAX, PHIMIN, R6BINS, R6MAX, R6MIN, rctGctLeadingIsoEmEta_, rctGctLeadingIsoEmPhi_, rctGctLeadingIsoEmRank_, rctGctLeadingNonIsoEmEta_, rctGctLeadingNonIsoEmPhi_, rctGctLeadingNonIsoEmRank_, DQMStore::rmdir(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), TPETABINS, TPETAMAX, TPETAMIN, TPPHIBINS, TPPHIMAX, and TPPHIMIN.
00162 { 00163 00164 nev_ = 0; 00165 00166 // get hold of back-end interface 00167 DQMStore *dbe = 0; 00168 dbe = Service < DQMStore > ().operator->(); 00169 00170 if (dbe) { 00171 dbe->setCurrentFolder("L1T/Compare"); 00172 dbe->rmdir("L1T/Compare"); 00173 } 00174 00175 00176 if (dbe) { 00177 dbe->setCurrentFolder("L1T/Compare"); 00178 00179 // ------------------------------------------- 00180 // RCT-GCT 00181 // ------------------------------------------- 00182 // Isolated 00183 rctGctLeadingIsoEmRank_ = dbe->book2D("rctGctLeadingIsoEmRank", 00184 "RCT-GCT: rank", R6BINS, R6MIN, R6MAX, 00185 R6BINS, R6MIN, R6MAX); 00186 rctGctLeadingIsoEmRank_->setAxisTitle(std::string("gct"), 1); 00187 rctGctLeadingIsoEmRank_->setAxisTitle(std::string("rct"), 2); 00188 rctGctLeadingIsoEmEta_ = dbe->book2D("rctGctLeadingIsoEmEta", 00189 "RCT-GCT: #eta", ETABINS, ETAMIN, ETAMAX, 00190 ETABINS, ETAMIN, ETAMAX); 00191 rctGctLeadingIsoEmEta_->setAxisTitle(std::string("gct"), 1); 00192 rctGctLeadingIsoEmEta_->setAxisTitle(std::string("rct"), 2); 00193 00194 rctGctLeadingIsoEmPhi_ = dbe->book2D("rctGctLeadingIsoEmPhi", 00195 "RCT-GCT: #phi", PHIBINS, PHIMIN, PHIMAX, 00196 PHIBINS, PHIMIN, PHIMAX); 00197 rctGctLeadingIsoEmPhi_->setAxisTitle(std::string("gct"), 1); 00198 rctGctLeadingIsoEmPhi_->setAxisTitle(std::string("rct"), 2); 00199 // non-Isolated 00200 rctGctLeadingNonIsoEmRank_ = dbe->book2D("rctGctLeadingNonIsoEmRank", 00201 "RCT-GCT: rank", R6BINS, R6MIN, R6MAX, 00202 R6BINS, R6MIN, R6MAX); 00203 rctGctLeadingNonIsoEmRank_->setAxisTitle(std::string("gct"), 1); 00204 rctGctLeadingNonIsoEmRank_->setAxisTitle(std::string("rct"), 2); 00205 00206 rctGctLeadingNonIsoEmEta_ = dbe->book2D("rctGctLeadingNonIsoEmEta", 00207 "RCT-GCT: #eta", ETABINS, ETAMIN, ETAMAX, 00208 ETABINS, ETAMIN, ETAMAX); 00209 rctGctLeadingNonIsoEmEta_->setAxisTitle(std::string("gct"), 1); 00210 rctGctLeadingNonIsoEmEta_->setAxisTitle(std::string("rct"), 2); 00211 00212 rctGctLeadingNonIsoEmPhi_ = dbe->book2D("rctGctLeadingNonIsoEmPhi", 00213 "RCT-GCT: #phi", PHIBINS, PHIMIN, PHIMAX, 00214 PHIBINS, PHIMIN, PHIMAX); 00215 rctGctLeadingNonIsoEmPhi_->setAxisTitle(std::string("gct"), 1); 00216 rctGctLeadingNonIsoEmPhi_->setAxisTitle(std::string("rct"), 2); 00217 // ------------------------------------------- 00218 // ECAL TPG - RCT 00219 // ------------------------------------------- 00220 ecalTpgRctLeadingEmRank_ = dbe->book2D("ecalTpgRctLeadingEmRank", 00221 "ECAL TPG-RCT: rank", 00222 R6BINS, R6MIN, R6MAX, 00223 R6BINS, R6MIN, R6MAX); 00224 ecalTpgRctLeadingEmRank_->setAxisTitle(std::string("rct"), 1); 00225 ecalTpgRctLeadingEmRank_->setAxisTitle(std::string("ecal tp"), 2); 00226 00227 ecalTpgRctLeadingEmEta_ = dbe->book2D("ecalTpgRctLeadingEmEta", 00228 "ECAL TPG-RCT: #eta", 00229 15, -0.5, 14.5, 00230 TPETABINS, TPETAMIN, TPETAMAX); 00231 ecalTpgRctLeadingEmEta_->setAxisTitle(std::string("rct"), 1); 00232 ecalTpgRctLeadingEmEta_->setAxisTitle(std::string("ecal tp"), 2); 00233 ecalTpgRctLeadingEmEta2_ = dbe->book2D("ecalTpgRctLeadingEmEta2", 00234 "ECAL TPG-RCT: #eta (2)", 00235 13, -6.5, 6.5, 00236 TPETABINS, TPETAMIN, TPETAMAX); 00237 ecalTpgRctLeadingEmEta2_->setAxisTitle(std::string("rct"), 1); 00238 ecalTpgRctLeadingEmEta2_->setAxisTitle(std::string("ecal tp"), 2); 00239 ecalTpgRctLeadingEmPhi_ = dbe->book2D("ecalTpgRctLeadingEmPhi", 00240 "ECAL TPG-RCT: #phi", 00241 PHIBINS, PHIMIN, PHIMAX, 00242 TPPHIBINS, TPPHIMIN, TPPHIMAX); 00243 ecalTpgRctLeadingEmPhi_->setAxisTitle(std::string("rct"), 1); 00244 ecalTpgRctLeadingEmPhi_->setAxisTitle(std::string("ecal tp"), 2); 00245 } 00246 00247 }
Reimplemented from edm::EDAnalyzer.
Definition at line 250 of file L1TCompare.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), nev_, outputFile_, DQMStore::save(), and verbose().
00251 { 00252 if (verbose()) 00253 std::cout << "L1TCompare: end job...." << std::endl; 00254 LogInfo("EndJob") << "analyzed " << nev_ << " events"; 00255 00256 if (outputFile_.size() != 0 && dbe) 00257 dbe->save(outputFile_); 00258 00259 return; 00260 }
bool L1TCompare::verbose | ( | ) | const [inline, private] |
Definition at line 106 of file L1TCompare.h.
References verbose_.
Referenced by analyze(), endJob(), and L1TCompare().
00106 { return verbose_; };
DQMStore* L1TCompare::dbe [private] |
edm::InputTag L1TCompare::ecalTpgSource_ [private] |
edm::InputTag L1TCompare::gctSource_ [private] |
ofstream L1TCompare::logFile_ [private] |
Definition at line 108 of file L1TCompare.h.
bool L1TCompare::monitorDaemon_ [private] |
Definition at line 106 of file L1TCompare.h.
int L1TCompare::nev_ [private] |
std::string L1TCompare::outputFile_ [private] |
MonitorElement* L1TCompare::rctGctLeadingIsoEmEta_ [private] |
MonitorElement* L1TCompare::rctGctLeadingIsoEmPhi_ [private] |
edm::InputTag L1TCompare::rctSource_ [private] |
bool L1TCompare::verbose_ [private] |