#include <MuonAnalyzer.h>
Public Member Functions | |
void | analyze (const edm::Event &, const edm::EventSetup &) |
Get the analysis. | |
void | beginJob (void) |
Inizialize parameters for histo binning. | |
void | endJob (void) |
Save the histos. | |
MuonAnalyzer (const edm::ParameterSet &) | |
Constructor. | |
virtual | ~MuonAnalyzer () |
Destructor. | |
Private Attributes | |
std::string | metname |
edm::ParameterSet | parameters |
DQMStore * | theDbe |
SegmentTrackAnalyzer * | theGlbMuonSegmentsAnalyzer |
edm::InputTag | theGlbMuTrackCollectionLabel |
MuonEnergyDepositAnalyzer * | theMuEnergyAnalyzer |
bool | theMuEnergyAnalyzerFlag |
edm::InputTag | theMuonCollectionLabel |
MuonKinVsEtaAnalyzer * | theMuonKinVsEtaAnalyzer |
bool | theMuonKinVsEtaAnalyzerFlag |
MuonRecoAnalyzer * | theMuonRecoAnalyzer |
bool | theMuonRecoAnalyzerFlag |
bool | theMuonSegmentsAnalyzerFlag |
MuonSeedsAnalyzer * | theSeedsAnalyzer |
bool | theSeedsAnalyzerFlag |
edm::InputTag | theSeedsCollectionLabel |
MuonServiceProxy * | theService |
SegmentTrackAnalyzer * | theStaMuonSegmentsAnalyzer |
edm::InputTag | theStaMuTrackCollectionLabel |
DQM muon analysis monitoring
Definition at line 29 of file MuonAnalyzer.h.
MuonAnalyzer::MuonAnalyzer | ( | const edm::ParameterSet & | pSet | ) |
Constructor.
Definition at line 42 of file MuonAnalyzer.cc.
References edm::ParameterSet::addParameter(), MuonServiceProxy_cff::MuonServiceProxy, and ExpressReco_HICollisions_FallBack::parameters.
{ parameters = pSet; // the services theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters")); // Muon Collection Label theMuonCollectionLabel = parameters.getParameter<edm::InputTag>("MuonCollection"); // Glb Muon Collection Label theGlbMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("GlobalMuTrackCollection"); // STA Muon Collection Label theStaMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("STAMuTrackCollection"); // Seeds Collection Label theSeedsCollectionLabel = parameters.getParameter<edm::InputTag>("SeedCollection"); 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",false); // do the analysis on muon energy if(theMuEnergyAnalyzerFlag) theMuEnergyAnalyzer = new MuonEnergyDepositAnalyzer(parameters.getParameter<ParameterSet>("muonEnergyAnalysis"), theService); // do the analysis on seeds if(theSeedsAnalyzerFlag) theSeedsAnalyzer = new MuonSeedsAnalyzer(parameters.getParameter<ParameterSet>("seedsAnalysis"), theService); // do the analysis on muon energy if(theMuonRecoAnalyzerFlag) theMuonRecoAnalyzer = new MuonRecoAnalyzer(parameters.getParameter<ParameterSet>("muonRecoAnalysis"), theService); // do the analysis of kin quantities in eta regions if(theMuonRecoAnalyzerFlag) theMuonKinVsEtaAnalyzer = new MuonKinVsEtaAnalyzer(parameters.getParameter<ParameterSet>("muonKinVsEtaAnalysis"), theService); // do the analysis on muon track segments 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); } }
MuonAnalyzer::~MuonAnalyzer | ( | ) | [virtual] |
Destructor.
Definition at line 91 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; } }
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, ExpressReco_HICollisions_FallBack::muons, and muonTagProbeFilters_cff::staTracks.
{ LogTrace(metname)<<"[MuonAnalyzer] Analysis of event # "; theService->update(iSetup); // Take the STA muon container edm::Handle<reco::MuonCollection> muons; iEvent.getByLabel(theMuonCollectionLabel,muons); 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); } } } // 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 107 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); theStaMuonSegmentsAnalyzer->beginJob(theDbe); } if(theMuonKinVsEtaAnalyzerFlag) { theMuonKinVsEtaAnalyzer->beginJob(theDbe); } }
void MuonAnalyzer::endJob | ( | void | ) | [virtual] |
Save the histos.
Reimplemented from edm::EDAnalyzer.
Definition at line 197 of file MuonAnalyzer.cc.
References LogTrace, metname, ExpressReco_HICollisions_FallBack::outputFileName, and ExpressReco_HICollisions_FallBack::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 54 of file MuonAnalyzer.h.
edm::ParameterSet MuonAnalyzer::parameters [private] |
Definition at line 51 of file MuonAnalyzer.h.
DQMStore* MuonAnalyzer::theDbe [private] |
Definition at line 50 of file MuonAnalyzer.h.
Definition at line 80 of file MuonAnalyzer.h.
Definition at line 59 of file MuonAnalyzer.h.
Definition at line 72 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuEnergyAnalyzerFlag [private] |
Definition at line 65 of file MuonAnalyzer.h.
Definition at line 57 of file MuonAnalyzer.h.
Definition at line 78 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonKinVsEtaAnalyzerFlag [private] |
Definition at line 68 of file MuonAnalyzer.h.
Definition at line 76 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonRecoAnalyzerFlag [private] |
Definition at line 67 of file MuonAnalyzer.h.
bool MuonAnalyzer::theMuonSegmentsAnalyzerFlag [private] |
Definition at line 69 of file MuonAnalyzer.h.
MuonSeedsAnalyzer* MuonAnalyzer::theSeedsAnalyzer [private] |
Definition at line 74 of file MuonAnalyzer.h.
bool MuonAnalyzer::theSeedsAnalyzerFlag [private] |
Definition at line 66 of file MuonAnalyzer.h.
Definition at line 63 of file MuonAnalyzer.h.
MuonServiceProxy* MuonAnalyzer::theService [private] |
Definition at line 52 of file MuonAnalyzer.h.
Definition at line 82 of file MuonAnalyzer.h.
Definition at line 61 of file MuonAnalyzer.h.