#include <DQM/HLTEvF/interface/HLTMuonRecoDQMSource.h>
Description: <one line="" class="" summary>=""> Implementation: <Notes on="" implementation>="">.
Definition at line 25 of file HLTMuonRecoDQMSource.h.
HLTMuonRecoDQMSource::HLTMuonRecoDQMSource | ( | const edm::ParameterSet & | parameters_ | ) |
Definition at line 50 of file HLTMuonRecoDQMSource.cc.
References beamSpotTag_, candCollectionTag_, GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), edm::ParameterSet::getUntrackedParameter(), l2seedscollectionTag_, level_, monitorName_, NULL, outputFile_, prescaleEvt_, and verbose_.
00050 :counterEvt_(0) 00051 00052 { 00053 verbose_ = parameters_.getUntrackedParameter < bool > ("verbose", false); 00054 monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","HLT/HLTMuon"); 00055 level_ = parameters_.getUntrackedParameter<int>("Level",2); 00056 prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1); 00057 candCollectionTag_ = parameters_.getUntrackedParameter<InputTag>("CandMuonTag",edm::InputTag("hltL2MuonCandidates")); 00058 beamSpotTag_ = parameters_.getUntrackedParameter<InputTag>("BeamSpotTag",edm::InputTag("offlineBeamSpot")); 00059 l2seedscollectionTag_ = parameters_.getUntrackedParameter<InputTag>("l2MuonSeedTag",edm::InputTag("hltL2MuonSeeds")); 00060 00061 dbe_ = 0 ; 00062 if (parameters_.getUntrackedParameter < bool > ("DQMStore", false)) { 00063 dbe_ = Service < DQMStore > ().operator->(); 00064 dbe_->setVerbose(0); 00065 } 00066 00067 outputFile_ = 00068 parameters_.getUntrackedParameter < std::string > ("outputFile", ""); 00069 if (outputFile_.size() != 0) { 00070 if (verbose_) std::cout << "Muon HLT Monitoring histograms will be saved to " 00071 << outputFile_ << std::endl; 00072 } 00073 else { 00074 outputFile_ = "HLTMuonDQM.root"; 00075 } 00076 00077 bool disable = 00078 parameters_.getUntrackedParameter < bool > ("disableROOToutput", true); 00079 if (disable) { 00080 outputFile_ = ""; 00081 } 00082 00083 if (dbe_ != NULL) { 00084 dbe_->setCurrentFolder("HLT/HLTMuon"); 00085 } 00086 00087 00088 }
HLTMuonRecoDQMSource::~HLTMuonRecoDQMSource | ( | ) |
Definition at line 91 of file HLTMuonRecoDQMSource.cc.
00092 { 00093 00094 // do anything here that needs to be done at desctruction time 00095 // (e.g. close files, deallocate resources etc.) 00096 00097 }
void HLTMuonRecoDQMSource::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Fake Analyze.
Implements edm::EDAnalyzer.
Definition at line 239 of file HLTMuonRecoDQMSource.cc.
References beamSpotTag_, candCollectionTag_, counterEvt_, GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), edm::Handle< T >::failedToGet(), MonitorElement::Fill(), edm::Event::getByLabel(), hcharge, hd0, hd0phi, hdimumass, hdr, hdrphi, hdz, hdzeta, herr0, heta, hetaphi, hetares, hetareseta, hnhit, hNMu, hphi, hphires, hphiresphi, hpt, hpteta, hptphi, hptres, edm::Ref< C, T, F >::id(), edm::RefToBase< T >::id(), edm::Ref< C, T, F >::key(), edm::RefToBase< T >::key(), l2seedscollectionTag_, level_, reco::BeamSpot::position(), prescaleEvt_, TwoPi, and verbose_.
00241 { 00242 if ( !dbe_) return; 00243 counterEvt_++; 00244 if (prescaleEvt_ > 0 && counterEvt_%prescaleEvt_!=0) return; 00245 if (verbose_)cout << " processing conterEvt_: " << counterEvt_ <<endl; 00246 00247 Handle<RecoChargedCandidateCollection> mucands; 00248 iEvent.getByLabel (candCollectionTag_,mucands); 00249 00250 reco::BeamSpot beamSpot; 00251 Handle<reco::BeamSpot> recoBeamSpotHandle; 00252 iEvent.getByLabel(beamSpotTag_,recoBeamSpotHandle); 00253 if (!recoBeamSpotHandle.failedToGet()) beamSpot = *recoBeamSpotHandle; 00254 RecoChargedCandidateCollection::const_iterator cand,cand2; 00255 if (!mucands.failedToGet()) { 00256 if (verbose_)cout << " filling Reco stuff " << endl; 00257 hNMu->Fill(mucands->size()); 00258 for (cand=mucands->begin(); cand!=mucands->end(); ++cand) { 00259 TrackRef tk = cand->get<TrackRef>(); 00260 // eta cut 00261 hpt->Fill(tk->pt()); 00262 hcharge->Fill(tk->charge()); 00263 if ( tk->charge() != 0 ) { 00264 heta->Fill(tk->eta()); 00265 hphi->Fill(tk->phi()); 00266 hetaphi->Fill(tk->phi(),tk->eta()); 00267 hptphi->Fill(tk->pt(),tk->phi()); 00268 hpteta->Fill(tk->pt(),tk->eta()); 00269 hnhit->Fill(tk->numberOfValidHits()); 00270 hd0->Fill(tk->d0()); 00271 if (!recoBeamSpotHandle.failedToGet()){ 00272 hdr->Fill(tk->dxy(beamSpot.position())); 00273 hdrphi->Fill(tk->phi(),tk->dxy(beamSpot.position())); 00274 } 00275 hd0phi->Fill(tk->phi(),tk->d0()); 00276 hdz->Fill(tk->dz()); 00277 hdzeta->Fill(tk->eta(),tk->dz()); 00278 herr0->Fill(tk->error(0)); 00279 cand2=cand; 00280 ++cand2; 00281 for (; cand2!=mucands->end(); cand2++) { 00282 TrackRef tk2=cand2->get<TrackRef>(); 00283 if ( tk->charge()*tk2->charge() == -1 ){ 00284 double mass=(cand->p4()+cand2->p4()).M(); 00285 hdimumass->Fill(mass); 00286 } 00287 } 00288 if ( level_ == 3 ) { 00289 TrackRef l2tk=tk->seedRef().castTo<Ref<L3MuonTrajectorySeedCollection> >()->l2Track(); 00290 if(tk->pt()*l2tk->pt() != 0 )hptres->Fill(1/tk->pt() - 1/l2tk->pt()); 00291 hetares->Fill(tk->eta()-l2tk->eta()); 00292 hetareseta->Fill(tk->eta(),tk->eta()-l2tk->eta()); 00293 hphires->Fill(tk->phi()-l2tk->phi()); 00294 double dphi=tk->phi()-l2tk->phi(); 00295 if (dphi>TMath::TwoPi())dphi-=2*TMath::TwoPi(); 00296 else if (dphi<-TMath::TwoPi()) dphi+=TMath::TwoPi(); 00297 hphiresphi->Fill(tk->phi(),dphi); 00298 } else { 00299 Handle<L2MuonTrajectorySeedCollection> museeds; 00300 iEvent.getByLabel (l2seedscollectionTag_,museeds); 00301 if (!museeds.failedToGet()){ 00302 RefToBase<TrajectorySeed> seed=tk->seedRef(); 00303 L1MuonParticleRef l1ref; 00304 for(uint iMuSeed=0 ; iMuSeed!=museeds->size(); ++iMuSeed){ 00305 Ref<L2MuonTrajectorySeedCollection> l2seed(museeds,iMuSeed); 00306 if (l2seed.id()==seed.id() && l2seed.key()==seed.key()){ 00307 l1ref = l2seed->l1Particle(); 00308 break; 00309 } 00310 } 00311 if( tk->pt()*l1ref->pt() != 0 )hptres->Fill(1/tk->pt() - 1/l1ref->pt()); 00312 hetares->Fill(tk->eta()-l1ref->eta()); 00313 hetareseta->Fill(tk->eta(),tk->eta()-l1ref->eta()); 00314 hphires->Fill(tk->phi()-l1ref->phi()); 00315 double dphi=tk->phi()-l1ref->phi(); 00316 if (dphi>TMath::TwoPi())dphi-=2*TMath::TwoPi(); 00317 else if (dphi<-TMath::TwoPi()) dphi+=TMath::TwoPi(); 00318 hphiresphi->Fill(tk->phi(),dphi); 00319 } 00320 } 00321 } else LogWarning("HLTMonMuon")<<"stop filling candidate with update@Vtx failure"; 00322 } 00323 } 00324 }
void HLTMuonRecoDQMSource::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
BeginJob.
book some histograms here
Reimplemented from edm::EDAnalyzer.
Definition at line 101 of file HLTMuonRecoDQMSource.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), hcharge, hd0, hd0phi, hdimumass, hdr, hdrphi, hdz, hdzeta, herr0, heta, hetaphi, hetares, hetareseta, hnhit, hNMu, hphi, hphires, hphiresphi, hpt, hpteta, hptphi, hptres, level_, monitorName_, name, NBINS, prescaleEvt_, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), DQMStore::showDirStructure(), DQMStore::tagContents(), indexGen::title, verbose_, XMAX, and XMIN.
00101 { 00102 00103 if (dbe_) { 00104 dbe_->setCurrentFolder("monitorName_"); 00105 if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ; 00106 if (verbose_)cout << "===>DQM event prescale = " << prescaleEvt_ << " events "<< endl; 00107 00108 00110 const int NBINS = 100; XMIN = 0; XMAX = 50; 00111 00112 // create and cd into new folder 00113 char name[512], title[512]; 00114 sprintf(name,"Level%i",level_); 00115 dbe_->setCurrentFolder(monitorName_+name); 00116 sprintf(name,"HLTMuonL%i_NMu",level_); 00117 sprintf(title,"L%i number of muons",level_); 00118 hNMu= dbe_->book1D(name,title, 5, 0., 5.); 00119 hNMu->setAxisTitle("Number of muons", 1); 00120 sprintf(name,"HLTMuonL%i_pt",level_); 00121 sprintf(title,"L%i Pt",level_); 00122 hpt = dbe_->book1D(name,title, NBINS, 0., 100); 00123 hpt->setAxisTitle("Pt", 1); 00124 sprintf(name,"HLTMuonL%i_eta",level_); 00125 sprintf(title,"L%i Muon #eta",level_); 00126 heta = dbe_->book1D(name,title, NBINS, -2.5, 2.5); 00127 heta->setAxisTitle("#eta", 1); 00128 sprintf(name,"HLTMuonL%i_phi",level_); 00129 sprintf(title,"L%i Muon #phi",level_); 00130 hphi = dbe_->book1D(name,title, NBINS, -3.15, 3.15); 00131 hphi->setAxisTitle("#phi", 1); 00132 sprintf(name,"HLTMuonL%i_etaphi",level_); 00133 sprintf(title,"L%i Muon #eta vs #phi",level_); 00134 hetaphi = dbe_->book2D(name,title, NBINS, -3.15, 3.15,NBINS,-2.5, 2.5); 00135 hetaphi->setAxisTitle("#phi", 1); 00136 hetaphi->setAxisTitle("#eta", 2); 00137 sprintf(name,"HLTMuonL%i_ptphi",level_); 00138 sprintf(title,"L%i Muon pt vs #phi",level_); 00139 hptphi = dbe_->book2D(name,title, NBINS, 0., 100.,NBINS,-3.15, 3.15); 00140 hptphi->setAxisTitle("pt", 1); 00141 hptphi->setAxisTitle("#phi", 2); 00142 sprintf(name,"HLTMuonL%i_pteta",level_); 00143 sprintf(title,"L%i Muon pt vs #eta",level_); 00144 hpteta = dbe_->book2D(name,title, NBINS, 0., 100.,NBINS,-2.5, 2.5); 00145 hpteta->setAxisTitle("pt", 1); 00146 hpteta->setAxisTitle("#eta", 2); 00147 sprintf(name,"HLTMuonL%i_nhit",level_); 00148 sprintf(title,"L%i Number of Valid Hits",level_); 00149 hnhit = dbe_->book1D(name,title, NBINS, 0., 100.); 00150 hnhit->setAxisTitle("Number of Valid Hits", 1); 00151 sprintf(name,"HLTMuonL%i_charge",level_); 00152 sprintf(title,"L%i Muon Charge",level_); 00153 hcharge = dbe_->book1D(name,title, 3, -1.5, 1.5); 00154 hcharge->setAxisTitle("Charge", 1); 00155 sprintf(name,"HLTMuonL%i_dr",level_); 00156 sprintf(title,"L%i Muon radial impact vs BeamSpot",level_); 00157 hdr = dbe_->book1D(name,title, NBINS, -0.3, 0.3); 00158 hdr->setAxisTitle("R Impact (cm) vs BeamSpot", 1); 00159 sprintf(name,"HLTMuonL%i_d0",level_); 00160 sprintf(title,"L%i Muon radial impact vs (0,0)",level_); 00161 hd0 = dbe_->book1D(name,title, NBINS, -0.3, 0.3); 00162 hd0->setAxisTitle("R Impact (cm) vs 0,0", 1); 00163 sprintf(name,"HLTMuonL%i_dz",level_); 00164 sprintf(title,"L%i Muon Z impact",level_); 00165 hdz = dbe_->book1D(name,title, NBINS, -25., 25.); 00166 hdz->setAxisTitle("Z impact (cm)", 1); 00167 sprintf(name,"HLTMuonL%i_err0",level_); 00168 sprintf(title,"L%i Muon Error on Pt",level_); 00169 herr0 = dbe_->book1D(name,title,NBINS, 0., 0.03); 00170 herr0->setAxisTitle("Error on Pt", 1); 00171 sprintf(name,"HLTMuonL%i_DiMuMass",level_); 00172 sprintf(title,"L%i Opposite charge DiMuon invariant Mass",level_); 00173 hdimumass= dbe_->book1D(name,title, NBINS, 0., 150.); 00174 hdimumass->setAxisTitle("Di Muon Invariant Mass (GeV)"); 00175 sprintf(name,"HLTMuonL%i_drphi",level_); 00176 sprintf(title,"L%i #Deltar vs #phi",level_); 00177 hdrphi = dbe_->bookProfile(name,title, NBINS, -3.15, 3.15,1,-999.,999.,"s"); 00178 hdrphi->setAxisTitle("#phi", 1); 00179 hdrphi->setAxisTitle("#Deltar", 2); 00180 sprintf(name,"HLTMuonL%i_d0phi",level_); 00181 sprintf(title,"L%i #Delta0 vs #phi",level_); 00182 hd0phi = dbe_->bookProfile(name,title, NBINS, -3.15, 3.15,1,-999.,999.,"s"); 00183 hd0phi->setAxisTitle("#phi", 1); 00184 hd0phi->setAxisTitle("#Delta0", 2); 00185 sprintf(name,"HLTMuonL%i_dzeta",level_); 00186 sprintf(title,"L%i #Deltaz vs #eta",level_); 00187 hdzeta = dbe_->bookProfile(name,title, NBINS,-2.5, 2.5,1,-999.,999.,"s"); 00188 hdzeta->setAxisTitle("#eta", 1); 00189 hdzeta->setAxisTitle("#Deltaz", 2); 00190 sprintf(name,"Level%i",level_-1); 00191 dbe_->setCurrentFolder(monitorName_+name); 00192 sprintf(name,"HLTMuonL%i_ptres",level_-1); 00193 sprintf(title,"L%iMuon1/Pt - L%iMuon1/Pt",level_-1,level_); 00194 hptres = dbe_->book1D(name,title, NBINS, -0.1, 0.1); 00195 sprintf(title,"1/PtL%i - 1/PtL%i",level_-1,level_); 00196 hptres->setAxisTitle(title, 1); 00197 sprintf(name,"HLTMuonL%i_etares",level_-1); 00198 sprintf(title,"L%i Muon #Delta#eta (wrt L%i)",level_-1,level_); 00199 hetares =dbe_->book1D(name,title, NBINS, -0.1, 0.1); 00200 hetares->setAxisTitle("#Delta#eta", 1); 00201 sprintf(name,"HLTMuonL%i_phires",level_-1); 00202 sprintf(title,"L%i Muon #Delta#phi (wrt L%i)",level_-1,level_); 00203 hphires =dbe_->book1D(name,title, NBINS, -0.1, 0.1); 00204 hphires->setAxisTitle("#Delta#phi", 1); 00205 sprintf(name,"HLTMuonL%i_phiresphi",level_-1); 00206 sprintf(title,"L%i Muon #Delta#phi vs #phi ",level_-1); 00207 hphiresphi =dbe_->bookProfile(name,title, NBINS, -3.15, 3.15,1,-999.,999.,"s"); 00208 hphiresphi->setAxisTitle("<#Delta#phi>", 2); 00209 hphiresphi->setAxisTitle("#phi", 1); 00210 sprintf(name,"HLTMuonL%i_etareseta",level_-1); 00211 sprintf(title,"L%i Muon #Delta#eta vs #eta ",level_-1); 00212 hetareseta =dbe_->bookProfile(name,title, NBINS,-2.5, 2.5,1,-999.,999.,"s"); 00213 hetareseta->setAxisTitle("<#Delta#eta>", 2); 00214 hetareseta->setAxisTitle("#eta", 1); 00215 if(verbose_)dbe_->showDirStructure(); 00216 // Muon det id is 2 pushed in bits 28:31 00217 const unsigned int detector_id = 2<<28; 00218 dbe_->tagContents(monitorName_, detector_id); 00219 } 00220 }
void HLTMuonRecoDQMSource::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | context | |||
) | [protected, virtual] |
void HLTMuonRecoDQMSource::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
BeginRun.
Reimplemented from edm::EDAnalyzer.
Definition at line 223 of file HLTMuonRecoDQMSource.cc.
References dbe_, DQMStore::getAllContents(), me, and monitorName_.
00223 { 00224 // reset all me's 00225 vector<MonitorElement*> AllME=dbe_->getAllContents(monitorName_); 00226 vector<MonitorElement*>::iterator me=AllME.begin(); 00227 for ( ; me != AllME.end() ; ++me ){ 00228 (*me)->Reset(); 00229 } 00230 }
Endjob.
Reimplemented from edm::EDAnalyzer.
Definition at line 337 of file HLTMuonRecoDQMSource.cc.
References counterEvt_, dbe_, outputFile_, and DQMStore::save().
00337 { 00338 LogInfo("HLTMonMuon") << "analyzed " << counterEvt_ << " events"; 00339 00340 if (outputFile_.size() != 0 && dbe_) 00341 dbe_->save(outputFile_); 00342 00343 return; 00344 }
void HLTMuonRecoDQMSource::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
DQM Client Diagnostic.
Reimplemented from edm::EDAnalyzer.
Definition at line 330 of file HLTMuonRecoDQMSource.cc.
void HLTMuonRecoDQMSource::endRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Definition at line 66 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), and HLTMuonRecoDQMSource().
Definition at line 65 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), and HLTMuonRecoDQMSource().
double HLTMuonRecoDQMSource::coneSize_ [private] |
int HLTMuonRecoDQMSource::counterEvt_ [private] |
DQMStore* HLTMuonRecoDQMSource::dbe_ [private] |
Definition at line 58 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), beginJob(), beginRun(), endJob(), and HLTMuonRecoDQMSource().
MonitorElement* HLTMuonRecoDQMSource::hcharge [private] |
MonitorElement* HLTMuonRecoDQMSource::hd0 [private] |
MonitorElement* HLTMuonRecoDQMSource::hd0phi [private] |
MonitorElement* HLTMuonRecoDQMSource::hdimumass [private] |
MonitorElement* HLTMuonRecoDQMSource::hdr [private] |
MonitorElement* HLTMuonRecoDQMSource::hdrphi [private] |
MonitorElement* HLTMuonRecoDQMSource::hdz [private] |
MonitorElement* HLTMuonRecoDQMSource::hdzeta [private] |
MonitorElement* HLTMuonRecoDQMSource::herr0 [private] |
MonitorElement* HLTMuonRecoDQMSource::heta [private] |
MonitorElement* HLTMuonRecoDQMSource::hetaphi [private] |
MonitorElement* HLTMuonRecoDQMSource::hetares [private] |
MonitorElement* HLTMuonRecoDQMSource::hetareseta [private] |
MonitorElement* HLTMuonRecoDQMSource::hnhit [private] |
MonitorElement* HLTMuonRecoDQMSource::hNMu [private] |
MonitorElement* HLTMuonRecoDQMSource::hphi [private] |
MonitorElement* HLTMuonRecoDQMSource::hphires [private] |
MonitorElement* HLTMuonRecoDQMSource::hphiresphi [private] |
MonitorElement* HLTMuonRecoDQMSource::hpt [private] |
MonitorElement* HLTMuonRecoDQMSource::hpteta [private] |
MonitorElement* HLTMuonRecoDQMSource::hptphi [private] |
MonitorElement* HLTMuonRecoDQMSource::hptres [private] |
Definition at line 67 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), and HLTMuonRecoDQMSource().
int HLTMuonRecoDQMSource::level_ [private] |
Definition at line 61 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), beginJob(), and HLTMuonRecoDQMSource().
std::string HLTMuonRecoDQMSource::monitorName_ [private] |
Definition at line 59 of file HLTMuonRecoDQMSource.h.
Referenced by beginJob(), beginRun(), and HLTMuonRecoDQMSource().
std::string HLTMuonRecoDQMSource::outputFile_ [private] |
Definition at line 60 of file HLTMuonRecoDQMSource.h.
Referenced by endJob(), and HLTMuonRecoDQMSource().
Definition at line 56 of file HLTMuonRecoDQMSource.h.
int HLTMuonRecoDQMSource::prescaleEvt_ [private] |
counter
Definition at line 63 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), beginJob(), and HLTMuonRecoDQMSource().
bool HLTMuonRecoDQMSource::verbose_ [private] |
Definition at line 69 of file HLTMuonRecoDQMSource.h.
Referenced by analyze(), beginJob(), and HLTMuonRecoDQMSource().
float HLTMuonRecoDQMSource::XMAX [private] |
float HLTMuonRecoDQMSource::XMIN [private] |