#include <MuonAnalyzer.h>
DQM muon analysis monitoring
Definition at line 40 of file MuonAnalyzer.h.
MuonAnalyzer::MuonAnalyzer | ( | const edm::ParameterSet & | pSet | ) |
Constructor.
Definition at line 43 of file MuonAnalyzer.cc.
References edm::ParameterSet::addParameter(), MuonServiceProxy_cff::MuonServiceProxy, and Parameters::parameters.
{ parameters = pSet; // the services theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters")); // Muon Collection Label theMuonCollectionLabel = parameters.getParameter<edm::InputTag>("MuonCollection"); theGlbMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("GlobalMuTrackCollection"); theStaMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("STAMuTrackCollection"); theSeedsCollectionLabel = parameters.getParameter<edm::InputTag>("SeedCollection"); theTriggerResultsLabel = parameters.getParameter<edm::InputTag>("TriggerResultsLabel"); // Analyzer Flags - define wheter or not run a submodule theMuEnergyAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonEnergyAnalysis" ,true); theSeedsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonSeedAnalysis" ,true); theMuonRecoAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonRecoAnalysis" ,true); theMuonSegmentsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoTrackSegmentsAnalysis",true); theMuonKinVsEtaAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonKinVsEtaAnalysis" ,true); theDiMuonHistogramsFlag = parameters.getUntrackedParameter<bool>("DoDiMuonHistograms" ,true); theMuonRecoOneHLTAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonRecoOneHLT" ,true); theEfficiencyAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoEfficiencyAnalysis" ,true); // If the previous are defined... create the analyzer class if(theMuEnergyAnalyzerFlag) theMuEnergyAnalyzer = new MuonEnergyDepositAnalyzer(parameters.getParameter<ParameterSet>("muonEnergyAnalysis"), theService); if(theSeedsAnalyzerFlag) theSeedsAnalyzer = new MuonSeedsAnalyzer(parameters.getParameter<ParameterSet>("seedsAnalysis"), theService); if(theMuonRecoAnalyzerFlag) theMuonRecoAnalyzer = new MuonRecoAnalyzer(parameters.getParameter<ParameterSet>("muonRecoAnalysis"), theService); if(theMuonRecoAnalyzerFlag) theMuonKinVsEtaAnalyzer = new MuonKinVsEtaAnalyzer(parameters.getParameter<ParameterSet>("muonKinVsEtaAnalysis"), theService); if(theDiMuonHistogramsFlag) theDiMuonHistograms = new DiMuonHistograms(parameters.getParameter<ParameterSet>("dimuonHistograms"), theService); if(theMuonSegmentsAnalyzerFlag){ // analysis on glb muon tracks ParameterSet trackGlbMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis"); trackGlbMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",theGlbMuTrackCollectionLabel); theGlbMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackGlbMuAnalysisParameters, theService); // analysis on sta muon tracks ParameterSet trackStaMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis"); trackStaMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",theStaMuTrackCollectionLabel); theStaMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackStaMuAnalysisParameters, theService); } if (theMuonRecoOneHLTAnalyzerFlag) theMuonRecoOneHLTAnalyzer = new MuonRecoOneHLT(parameters.getParameter<ParameterSet>("muonRecoOneHLTAnalysis"),theService); if(theEfficiencyAnalyzerFlag) theEfficiencyAnalyzer = new EfficiencyAnalyzer(parameters.getParameter<ParameterSet>("efficiencyAnalysis"), theService); }
MuonAnalyzer::~MuonAnalyzer | ( | ) | [virtual] |
Destructor.
Definition at line 93 of file MuonAnalyzer.cc.
{ delete theService; if(theMuEnergyAnalyzerFlag) delete theMuEnergyAnalyzer; if(theSeedsAnalyzerFlag) delete theSeedsAnalyzer; if(theMuonRecoAnalyzerFlag) delete theMuonRecoAnalyzer; if(theMuonSegmentsAnalyzerFlag) { delete theGlbMuonSegmentsAnalyzer; delete theStaMuonSegmentsAnalyzer; } if(theMuonKinVsEtaAnalyzerFlag) delete theMuonKinVsEtaAnalyzer; if(theDiMuonHistogramsFlag) delete theDiMuonHistograms; if(theMuonRecoOneHLTAnalyzerFlag) delete theMuonRecoOneHLTAnalyzer; if(theEfficiencyAnalyzerFlag) delete theEfficiencyAnalyzer; }
void MuonAnalyzer::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Get the analysis.
Implements edm::EDAnalyzer.
Definition at line 128 of file MuonAnalyzer.cc.
References edm::Event::getByLabel(), edm::HandleBase::isValid(), LogTrace, metname, patZpeak::muons, muonTagProbeFilters_cff::staTracks, and patRefSel_triggerSelection_cff::triggerResults.
{ LogTrace(metname)<<"[MuonAnalyzer] Analysis of event # "; theService->update(iSetup); // Take the STA muon container edm::Handle<reco::MuonCollection> muons; iEvent.getByLabel(theMuonCollectionLabel,muons); edm::Handle<TriggerResults> triggerResults; iEvent.getByLabel(theTriggerResultsLabel, triggerResults); if(muons.isValid()){ for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){ if(theMuEnergyAnalyzerFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the muon energy analyzer"; theMuEnergyAnalyzer->analyze(iEvent, iSetup, *recoMu); } if(theMuonRecoAnalyzerFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco analyzer"; theMuonRecoAnalyzer->analyze(iEvent, iSetup, *recoMu); } if(theMuonKinVsEtaAnalyzerFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the muon KinVsEta analyzer"; theMuonKinVsEtaAnalyzer->analyze(iEvent, iSetup, *recoMu); } // if(theMuonRecoOneHLTAnalyzerFlag) { // LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco One HLT analyzer"; // theMuonRecoOneHLTAnalyzer->analyze(iEvent, iSetup, *recoMu, *triggerResults); // theMuonRecoOneHLTAnalyzer->analyze(iEvent, iSetup, *triggerResults); // } } if(theMuonRecoOneHLTAnalyzerFlag) { LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco One HLT analyzer"; theMuonRecoOneHLTAnalyzer->analyze(iEvent, iSetup, *triggerResults); } if (theEfficiencyAnalyzerFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the efficiency analyzer"; theEfficiencyAnalyzer->analyze(iEvent,iSetup); } if (theDiMuonHistogramsFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the dimuon analyzer"; theDiMuonHistograms->analyze(iEvent,iSetup); } } // Take the track containers Handle<reco::TrackCollection> glbTracks; iEvent.getByLabel(theGlbMuTrackCollectionLabel,glbTracks); Handle<reco::TrackCollection> staTracks; iEvent.getByLabel(theStaMuTrackCollectionLabel,staTracks); if(glbTracks.isValid()){ for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){ if(theMuonSegmentsAnalyzerFlag){ LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for glb muons"; theGlbMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack); } } } if(staTracks.isValid()){ for (reco::TrackCollection::const_iterator recoTrack = staTracks->begin(); recoTrack!=staTracks->end(); ++recoTrack){ if(theMuonSegmentsAnalyzerFlag){ LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for sta muons"; theStaMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack); } } } // Take the seeds container edm::Handle<TrajectorySeedCollection> seeds; iEvent.getByLabel(theSeedsCollectionLabel, seeds); if(seeds.isValid()){ for(TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed){ if(theSeedsAnalyzerFlag){ LogTrace(metname)<<"[MuonAnalyzer] Call to the seeds analyzer"; theSeedsAnalyzer->analyze(iEvent, iSetup, *seed); } } } }
void MuonAnalyzer::beginJob | ( | void | ) | [virtual] |
Inizialize parameters for histo binning.
Reimplemented from edm::EDAnalyzer.
Definition at line 111 of file MuonAnalyzer.cc.
References LogTrace, metname, and cmsCodeRules::cppFunctionSkipper::operator.
{ metname = "muonAnalyzer"; LogTrace(metname)<<"[MuonAnalyzer] Parameters initialization"; theDbe = edm::Service<DQMStore>().operator->(); if(theMuEnergyAnalyzerFlag) theMuEnergyAnalyzer->beginJob(theDbe); if(theSeedsAnalyzerFlag) theSeedsAnalyzer->beginJob(theDbe); if(theMuonRecoAnalyzerFlag) theMuonRecoAnalyzer->beginJob(theDbe); if(theMuonSegmentsAnalyzerFlag) theGlbMuonSegmentsAnalyzer->beginJob(theDbe); if(theMuonSegmentsAnalyzerFlag) theStaMuonSegmentsAnalyzer->beginJob(theDbe); if(theMuonKinVsEtaAnalyzerFlag) theMuonKinVsEtaAnalyzer->beginJob(theDbe); if(theDiMuonHistogramsFlag) theDiMuonHistograms->beginJob(theDbe); if(theMuonRecoOneHLTAnalyzerFlag) theMuonRecoOneHLTAnalyzer->beginJob(theDbe); if(theDiMuonHistogramsFlag) theDiMuonHistograms->beginJob(theDbe); if(theEfficiencyAnalyzerFlag) theEfficiencyAnalyzer->beginJob(theDbe); }
void MuonAnalyzer::beginRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 108 of file MuonAnalyzer.cc.
{ if (theMuonRecoOneHLTAnalyzerFlag) theMuonRecoOneHLTAnalyzer->beginRun(iRun,iSetup); }
void MuonAnalyzer::endJob | ( | void | ) | [virtual] |
Save the histos.
Reimplemented from edm::EDAnalyzer.
Definition at line 214 of file MuonAnalyzer.cc.
References LogTrace, metname, dumpDBToFile_GT_ttrig_cfg::outputFileName, and Parameters::parameters.
{ LogTrace(metname)<<"[MuonAnalyzer] Saving the histos"; bool outputMEsInRootFile = parameters.getParameter<bool>("OutputMEsInRootFile"); std::string outputFileName = parameters.getParameter<std::string>("OutputFileName"); if(outputMEsInRootFile){ theDbe->showDirStructure(); theDbe->save(outputFileName); } }
std::string MuonAnalyzer::metname [private] |
Definition at line 65 of file MuonAnalyzer.h.
edm::ParameterSet MuonAnalyzer::parameters [private] |
Definition at line 62 of file MuonAnalyzer.h.
DQMStore* MuonAnalyzer::theDbe [private] |
Definition at line 61 of file MuonAnalyzer.h.
Definition at line 93 of file MuonAnalyzer.h.
bool MuonAnalyzer::theDiMuonHistogramsFlag [private] |
Definition at line 82 of file MuonAnalyzer.h.
Definition at line 95 of file MuonAnalyzer.h.
bool MuonAnalyzer::theEfficiencyAnalyzerFlag [private] |
Definition at line 84 of file MuonAnalyzer.h.
Definition at line 91 of file MuonAnalyzer.h.
Definition at line 70 of file MuonAnalyzer.h.
Definition at line 87 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuEnergyAnalyzerFlag [private] |
Definition at line 77 of file MuonAnalyzer.h.
Definition at line 68 of file MuonAnalyzer.h.
Definition at line 90 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonKinVsEtaAnalyzerFlag [private] |
Definition at line 80 of file MuonAnalyzer.h.
Definition at line 89 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonRecoAnalyzerFlag [private] |
Definition at line 79 of file MuonAnalyzer.h.
Definition at line 94 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonRecoOneHLTAnalyzerFlag [private] |
Definition at line 83 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonSegmentsAnalyzerFlag [private] |
Definition at line 81 of file MuonAnalyzer.h.
MuonSeedsAnalyzer* MuonAnalyzer::theSeedsAnalyzer [private] |
Definition at line 88 of file MuonAnalyzer.h.
bool MuonAnalyzer::theSeedsAnalyzerFlag [private] |
Definition at line 78 of file MuonAnalyzer.h.
Definition at line 74 of file MuonAnalyzer.h.
MuonServiceProxy* MuonAnalyzer::theService [private] |
Definition at line 63 of file MuonAnalyzer.h.
Definition at line 92 of file MuonAnalyzer.h.
Definition at line 72 of file MuonAnalyzer.h.
Definition at line 75 of file MuonAnalyzer.h.