57 theMuEnergyAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoMuonEnergyAnalysis" ,
true);
58 theSeedsAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoMuonSeedAnalysis" ,
true);
59 theMuonRecoAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoMuonRecoAnalysis" ,
true);
60 theMuonSegmentsAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoTrackSegmentsAnalysis",
true);
61 theMuonKinVsEtaAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoMuonKinVsEtaAnalysis" ,
true);
62 theDiMuonHistogramsFlag =
parameters.getUntrackedParameter<
bool>(
"DoDiMuonHistograms" ,
true);
63 theMuonRecoOneHLTAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoMuonRecoOneHLT" ,
true);
64 theEfficiencyAnalyzerFlag =
parameters.getUntrackedParameter<
bool>(
"DoEfficiencyAnalysis" ,
true);
67 if(theMuEnergyAnalyzerFlag)
69 if(theSeedsAnalyzerFlag)
71 if(theMuonRecoAnalyzerFlag)
73 if(theMuonRecoAnalyzerFlag)
75 if(theDiMuonHistogramsFlag)
77 if(theMuonSegmentsAnalyzerFlag){
87 if (theMuonRecoOneHLTAnalyzerFlag)
89 if(theEfficiencyAnalyzerFlag)
96 if(theMuEnergyAnalyzerFlag)
delete theMuEnergyAnalyzer;
97 if(theSeedsAnalyzerFlag)
delete theSeedsAnalyzer;
98 if(theMuonRecoAnalyzerFlag)
delete theMuonRecoAnalyzer;
99 if(theMuonSegmentsAnalyzerFlag) {
100 delete theGlbMuonSegmentsAnalyzer;
101 delete theStaMuonSegmentsAnalyzer;
103 if(theMuonKinVsEtaAnalyzerFlag)
delete theMuonKinVsEtaAnalyzer;
104 if(theDiMuonHistogramsFlag)
delete theDiMuonHistograms;
105 if(theMuonRecoOneHLTAnalyzerFlag)
delete theMuonRecoOneHLTAnalyzer;
106 if(theEfficiencyAnalyzerFlag)
delete theEfficiencyAnalyzer;
109 if (theMuonRecoOneHLTAnalyzerFlag) theMuonRecoOneHLTAnalyzer->beginRun(iRun,iSetup);
117 if(theMuEnergyAnalyzerFlag) theMuEnergyAnalyzer->beginJob(theDbe);
118 if(theSeedsAnalyzerFlag) theSeedsAnalyzer->beginJob(theDbe);
119 if(theMuonRecoAnalyzerFlag) theMuonRecoAnalyzer->beginJob(theDbe);
120 if(theMuonSegmentsAnalyzerFlag) theGlbMuonSegmentsAnalyzer->beginJob(theDbe);
121 if(theMuonSegmentsAnalyzerFlag) theStaMuonSegmentsAnalyzer->beginJob(theDbe);
122 if(theMuonKinVsEtaAnalyzerFlag) theMuonKinVsEtaAnalyzer->beginJob(theDbe);
123 if(theDiMuonHistogramsFlag) theDiMuonHistograms->beginJob(theDbe);
124 if(theMuonRecoOneHLTAnalyzerFlag) theMuonRecoOneHLTAnalyzer->beginJob(theDbe);
125 if(theDiMuonHistogramsFlag) theDiMuonHistograms->beginJob(theDbe);
126 if(theEfficiencyAnalyzerFlag) theEfficiencyAnalyzer->beginJob(theDbe);
130 theService->update(iSetup);
134 iEvent.
getByLabel(theMuonCollectionLabel,muons);
137 iEvent.
getByLabel(theTriggerResultsLabel, triggerResults);
140 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
141 if(theMuEnergyAnalyzerFlag){
143 theMuEnergyAnalyzer->analyze(iEvent, iSetup, *recoMu);
145 if(theMuonRecoAnalyzerFlag){
147 theMuonRecoAnalyzer->analyze(iEvent, iSetup, *recoMu);
149 if(theMuonKinVsEtaAnalyzerFlag){
150 LogTrace(
metname)<<
"[MuonAnalyzer] Call to the muon KinVsEta analyzer";
151 theMuonKinVsEtaAnalyzer->analyze(iEvent, iSetup, *recoMu);
159 if(theMuonRecoOneHLTAnalyzerFlag) {
160 LogTrace(
metname)<<
"[MuonAnalyzer] Call to the muon reco One HLT analyzer";
161 theMuonRecoOneHLTAnalyzer->analyze(iEvent, iSetup, *triggerResults);
163 if (theEfficiencyAnalyzerFlag){
165 theEfficiencyAnalyzer->analyze(iEvent,iSetup);
167 if (theDiMuonHistogramsFlag){
169 theDiMuonHistograms->analyze(iEvent,iSetup);
175 iEvent.
getByLabel(theGlbMuTrackCollectionLabel,glbTracks);
177 iEvent.
getByLabel(theStaMuTrackCollectionLabel,staTracks);
180 for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){
181 if(theMuonSegmentsAnalyzerFlag){
182 LogTrace(
metname)<<
"[SegmentsAnalyzer] Call to the track segments analyzer for glb muons";
183 theGlbMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
188 for (reco::TrackCollection::const_iterator recoTrack = staTracks->begin(); recoTrack!=staTracks->end(); ++recoTrack){
189 if(theMuonSegmentsAnalyzerFlag){
190 LogTrace(
metname)<<
"[SegmentsAnalyzer] Call to the track segments analyzer for sta muons";
191 theStaMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
201 iEvent.
getByLabel(theSeedsCollectionLabel, seeds);
203 for(TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed){
204 if(theSeedsAnalyzerFlag){
206 theSeedsAnalyzer->analyze(iEvent, iSetup, *seed);
216 bool outputMEsInRootFile =
parameters.getParameter<
bool>(
"OutputMEsInRootFile");
218 if(outputMEsInRootFile){
219 theDbe->showDirStructure();
220 theDbe->save(outputFileName);
const std::string metname
void beginJob(void)
Inizialize parameters for histo binning.
void endJob(void)
Save the histos.
void addParameter(std::string const &name, T const &value)
virtual ~MuonAnalyzer()
Destructor.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void beginRun(const edm::Run &, const edm::EventSetup &)
MuonAnalyzer(const edm::ParameterSet &)
Constructor.
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.