CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MuonAnalyzer Class Reference

#include <MuonAnalyzer.h>

Inheritance diagram for MuonAnalyzer:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Get the analysis. More...
 
void beginJob (void)
 Inizialize parameters for histo binning. More...
 
void endJob (void)
 Save the histos. More...
 
 MuonAnalyzer (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~MuonAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

std::string metname
 
edm::ParameterSet parameters
 
DQMStoretheDbe
 
DiMuonHistogramstheDiMuonHistograms
 
bool theDiMuonHistogramsFlag
 
SegmentTrackAnalyzertheGlbMuonSegmentsAnalyzer
 
edm::InputTag theGlbMuTrackCollectionLabel
 
MuonEnergyDepositAnalyzertheMuEnergyAnalyzer
 
bool theMuEnergyAnalyzerFlag
 
edm::InputTag theMuonCollectionLabel
 
MuonKinVsEtaAnalyzertheMuonKinVsEtaAnalyzer
 
bool theMuonKinVsEtaAnalyzerFlag
 
MuonRecoAnalyzertheMuonRecoAnalyzer
 
bool theMuonRecoAnalyzerFlag
 
bool theMuonSegmentsAnalyzerFlag
 
MuonSeedsAnalyzertheSeedsAnalyzer
 
bool theSeedsAnalyzerFlag
 
edm::InputTag theSeedsCollectionLabel
 
MuonServiceProxytheService
 
SegmentTrackAnalyzertheStaMuonSegmentsAnalyzer
 
edm::InputTag theStaMuTrackCollectionLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

DQM muon analysis monitoring

Date:
2010/07/19 22:17:37
Revision:
1.16
Author
G. Mila - INFN Torino

Definition at line 30 of file MuonAnalyzer.h.

Constructor & Destructor Documentation

MuonAnalyzer::MuonAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 44 of file MuonAnalyzer.cc.

References edm::ParameterSet::addParameter(), MuonServiceProxy_cff::MuonServiceProxy, and Parameters::parameters.

44  {
45 
46  parameters = pSet;
47 
48  // the services
49  theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters"));
50 
51  // Muon Collection Label
53  // Glb Muon Collection Label
55  // STA Muon Collection Label
57  // Seeds Collection Label
59 
60  theMuEnergyAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonEnergyAnalysis",true);
61  theSeedsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonSeedAnalysis",true);
62  theMuonRecoAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonRecoAnalysis",true);
63  theMuonSegmentsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoTrackSegmentsAnalysis",true);
64  theMuonKinVsEtaAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonKinVsEtaAnalysis",false);
65  theDiMuonHistogramsFlag = parameters.getUntrackedParameter<bool>("DoDiMuonHistograms",true);
66 
67  // do the analysis on muon energy
68  if(theMuEnergyAnalyzerFlag)
70  // do the analysis on seeds
71  if(theSeedsAnalyzerFlag)
73  // do the analysis on muon energy
74  if(theMuonRecoAnalyzerFlag)
76  // do the analysis of kin quantities in eta regions
77  if(theMuonRecoAnalyzerFlag)
79  if(theDiMuonHistogramsFlag)
81  // do the analysis on muon track segments
82  if(theMuonSegmentsAnalyzerFlag){
83  // analysis on glb muon tracks
84  ParameterSet trackGlbMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis");
85  trackGlbMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",
87  theGlbMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackGlbMuAnalysisParameters, theService);
88  // analysis on sta muon tracks
89  ParameterSet trackStaMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis");
90  trackStaMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",
92  theStaMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackStaMuAnalysisParameters, theService);
93  }
94 }
T getParameter(std::string const &) const
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:75
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:67
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag theStaMuTrackCollectionLabel
Definition: MuonAnalyzer.h:62
edm::InputTag theGlbMuTrackCollectionLabel
Definition: MuonAnalyzer.h:60
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:83
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:79
MuonServiceProxy * theService
Definition: MuonAnalyzer.h:53
bool theDiMuonHistogramsFlag
Definition: MuonAnalyzer.h:71
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:81
edm::InputTag theSeedsCollectionLabel
Definition: MuonAnalyzer.h:64
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:69
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:139
edm::ParameterSet parameters
Definition: MuonAnalyzer.h:52
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:68
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:73
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:70
edm::InputTag theMuonCollectionLabel
Definition: MuonAnalyzer.h:58
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:77
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:66
DiMuonHistograms * theDiMuonHistograms
Definition: MuonAnalyzer.h:85
MuonAnalyzer::~MuonAnalyzer ( )
virtual

Destructor.

Definition at line 96 of file MuonAnalyzer.cc.

96  {
97 
98  delete theService;
105  }
108  }
110  delete theDiMuonHistograms;
111  }
112 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:75
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:67
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:83
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:79
MuonServiceProxy * theService
Definition: MuonAnalyzer.h:53
bool theDiMuonHistogramsFlag
Definition: MuonAnalyzer.h:71
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:81
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:69
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:68
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:73
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:70
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:77
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:66
DiMuonHistograms * theDiMuonHistograms
Definition: MuonAnalyzer.h:85

Member Function Documentation

void MuonAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Get the analysis.

Implements edm::EDAnalyzer.

Definition at line 140 of file MuonAnalyzer.cc.

References edm::Event::getByLabel(), edm::HandleBase::isValid(), LogTrace, metname, patZpeak::muons, and muonTagProbeFilters_cff::staTracks.

140  {
141 
142  LogTrace(metname)<<"[MuonAnalyzer] Analysis of event # ";
143 
144  theService->update(iSetup);
145 
146  // Take the STA muon container
148  iEvent.getByLabel(theMuonCollectionLabel,muons);
149 
150  if(muons.isValid()){
151  for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
153  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon energy analyzer";
154  theMuEnergyAnalyzer->analyze(iEvent, iSetup, *recoMu);
155  }
157  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco analyzer";
158  theMuonRecoAnalyzer->analyze(iEvent, iSetup, *recoMu);
159  }
161  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon KinVsEta analyzer";
162  theMuonKinVsEtaAnalyzer->analyze(iEvent, iSetup, *recoMu);
163  }
164  }
165 
167  LogTrace(metname)<<"[MuonAnalyzer] Call to the dimuon analyzer";
168  theDiMuonHistograms->analyze(iEvent,iSetup);
169  }
170  }
171 
172  // Take the track containers
174  iEvent.getByLabel(theGlbMuTrackCollectionLabel,glbTracks);
176  iEvent.getByLabel(theStaMuTrackCollectionLabel,staTracks);
177 
178  if(glbTracks.isValid()){
179  for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){
181  LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for glb muons";
182  theGlbMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
183  }
184  }
185  }
186  if(staTracks.isValid()){
187  for (reco::TrackCollection::const_iterator recoTrack = staTracks->begin(); recoTrack!=staTracks->end(); ++recoTrack){
189  LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for sta muons";
190  theStaMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
191  }
192  }
193  }
194 
195 
196 
197 
198  // Take the seeds container
200  iEvent.getByLabel(theSeedsCollectionLabel, seeds);
201  if(seeds.isValid()){
202  for(TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed){
204  LogTrace(metname)<<"[MuonAnalyzer] Call to the seeds analyzer";
205  theSeedsAnalyzer->analyze(iEvent, iSetup, *seed);
206  }
207  }
208  }
209 
210 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:75
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:67
edm::InputTag theStaMuTrackCollectionLabel
Definition: MuonAnalyzer.h:62
edm::InputTag theGlbMuTrackCollectionLabel
Definition: MuonAnalyzer.h:60
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Track &recoTrack)
Get the analysis.
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
Get the analysis.
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:83
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:79
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
Get the analysis.
void analyze(const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
Get the analysis.
MuonServiceProxy * theService
Definition: MuonAnalyzer.h:53
bool theDiMuonHistogramsFlag
Definition: MuonAnalyzer.h:71
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:81
edm::InputTag theSeedsCollectionLabel
Definition: MuonAnalyzer.h:64
std::string metname
Definition: MuonAnalyzer.h:55
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:69
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
#define LogTrace(id)
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:68
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:73
tuple muons
Definition: patZpeak.py:38
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:70
void analyze(const edm::Event &, const edm::EventSetup &, const TrajectorySeed &seed)
Get the analysis.
edm::InputTag theMuonCollectionLabel
Definition: MuonAnalyzer.h:58
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:77
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:66
DiMuonHistograms * theDiMuonHistograms
Definition: MuonAnalyzer.h:85
void MuonAnalyzer::beginJob ( void  )
virtual

Inizialize parameters for histo binning.

Reimplemented from edm::EDAnalyzer.

Definition at line 115 of file MuonAnalyzer.cc.

References LogTrace, metname, and cmsCodeRules.cppFunctionSkipper::operator.

115  {
116 
117  metname = "muonAnalyzer";
118 
119  LogTrace(metname)<<"[MuonAnalyzer] Parameters initialization";
121 
128  }
131  }
132 
135  }
136 
137 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:75
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:67
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:83
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:79
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
bool theDiMuonHistogramsFlag
Definition: MuonAnalyzer.h:71
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:81
std::string metname
Definition: MuonAnalyzer.h:55
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:69
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
#define LogTrace(id)
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:68
DQMStore * theDbe
Definition: MuonAnalyzer.h:51
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:73
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:70
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:77
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:66
DiMuonHistograms * theDiMuonHistograms
Definition: MuonAnalyzer.h:85
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
void MuonAnalyzer::endJob ( void  )
virtual

Save the histos.

Reimplemented from edm::EDAnalyzer.

Definition at line 213 of file MuonAnalyzer.cc.

References LogTrace, metname, dumpDBToFile_GT_ttrig_cfg::outputFileName, and Parameters::parameters.

213  {
214  LogTrace(metname)<<"[MuonAnalyzer] Saving the histos";
215  bool outputMEsInRootFile = parameters.getParameter<bool>("OutputMEsInRootFile");
216  std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");
217  if(outputMEsInRootFile){
219  theDbe->save(outputFileName);
220  }
221 }
T getParameter(std::string const &) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
std::string metname
Definition: MuonAnalyzer.h:55
#define LogTrace(id)
edm::ParameterSet parameters
Definition: MuonAnalyzer.h:52
DQMStore * theDbe
Definition: MuonAnalyzer.h:51
void showDirStructure(void) const
Definition: DQMStore.cc:2554

Member Data Documentation

std::string MuonAnalyzer::metname
private

Definition at line 55 of file MuonAnalyzer.h.

edm::ParameterSet MuonAnalyzer::parameters
private
DQMStore* MuonAnalyzer::theDbe
private

Definition at line 51 of file MuonAnalyzer.h.

DiMuonHistograms* MuonAnalyzer::theDiMuonHistograms
private

Definition at line 85 of file MuonAnalyzer.h.

bool MuonAnalyzer::theDiMuonHistogramsFlag
private

Definition at line 71 of file MuonAnalyzer.h.

SegmentTrackAnalyzer* MuonAnalyzer::theGlbMuonSegmentsAnalyzer
private

Definition at line 81 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theGlbMuTrackCollectionLabel
private

Definition at line 60 of file MuonAnalyzer.h.

MuonEnergyDepositAnalyzer* MuonAnalyzer::theMuEnergyAnalyzer
private

Definition at line 73 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuEnergyAnalyzerFlag
private

Definition at line 66 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theMuonCollectionLabel
private

Definition at line 58 of file MuonAnalyzer.h.

MuonKinVsEtaAnalyzer* MuonAnalyzer::theMuonKinVsEtaAnalyzer
private

Definition at line 79 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuonKinVsEtaAnalyzerFlag
private

Definition at line 69 of file MuonAnalyzer.h.

MuonRecoAnalyzer* MuonAnalyzer::theMuonRecoAnalyzer
private

Definition at line 77 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuonRecoAnalyzerFlag
private

Definition at line 68 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuonSegmentsAnalyzerFlag
private

Definition at line 70 of file MuonAnalyzer.h.

MuonSeedsAnalyzer* MuonAnalyzer::theSeedsAnalyzer
private

Definition at line 75 of file MuonAnalyzer.h.

bool MuonAnalyzer::theSeedsAnalyzerFlag
private

Definition at line 67 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theSeedsCollectionLabel
private

Definition at line 64 of file MuonAnalyzer.h.

MuonServiceProxy* MuonAnalyzer::theService
private

Definition at line 53 of file MuonAnalyzer.h.

SegmentTrackAnalyzer* MuonAnalyzer::theStaMuonSegmentsAnalyzer
private

Definition at line 83 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theStaMuTrackCollectionLabel
private

Definition at line 62 of file MuonAnalyzer.h.