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
 
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 19:54:13
Revision:
1.15
Author
G. Mila - INFN Torino

Definition at line 29 of file MuonAnalyzer.h.

Constructor & Destructor Documentation

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.

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

Destructor.

Definition at line 91 of file MuonAnalyzer.cc.

91  {
92 
93  delete theService;
100  }
103  }
104 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:74
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:66
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:82
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:78
MuonServiceProxy * theService
Definition: MuonAnalyzer.h:52
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:80
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:68
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:67
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:72
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:69
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:76
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:65

Member Function Documentation

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.

128  {
129 
130  LogTrace(metname)<<"[MuonAnalyzer] Analysis of event # ";
131 
132  theService->update(iSetup);
133 
134  // Take the STA muon container
136  iEvent.getByLabel(theMuonCollectionLabel,muons);
137 
138  if(muons.isValid()){
139  for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
141  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon energy analyzer";
142  theMuEnergyAnalyzer->analyze(iEvent, iSetup, *recoMu);
143  }
145  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco analyzer";
146  theMuonRecoAnalyzer->analyze(iEvent, iSetup, *recoMu);
147  }
149  LogTrace(metname)<<"[MuonAnalyzer] Call to the muon KinVsEta analyzer";
150  theMuonKinVsEtaAnalyzer->analyze(iEvent, iSetup, *recoMu);
151  }
152  }
153  }
154 
155 
156  // Take the track containers
158  iEvent.getByLabel(theGlbMuTrackCollectionLabel,glbTracks);
160  iEvent.getByLabel(theStaMuTrackCollectionLabel,staTracks);
161 
162  if(glbTracks.isValid()){
163  for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){
165  LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for glb muons";
166  theGlbMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
167  }
168  }
169  }
170  if(staTracks.isValid()){
171  for (reco::TrackCollection::const_iterator recoTrack = staTracks->begin(); recoTrack!=staTracks->end(); ++recoTrack){
173  LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for sta muons";
174  theStaMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
175  }
176  }
177  }
178 
179 
180 
181 
182  // Take the seeds container
184  iEvent.getByLabel(theSeedsCollectionLabel, seeds);
185  if(seeds.isValid()){
186  for(TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed){
188  LogTrace(metname)<<"[MuonAnalyzer] Call to the seeds analyzer";
189  theSeedsAnalyzer->analyze(iEvent, iSetup, *seed);
190  }
191  }
192  }
193 
194 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:74
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:66
edm::InputTag theStaMuTrackCollectionLabel
Definition: MuonAnalyzer.h:61
edm::InputTag theGlbMuTrackCollectionLabel
Definition: MuonAnalyzer.h:59
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:82
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:78
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:52
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:80
edm::InputTag theSeedsCollectionLabel
Definition: MuonAnalyzer.h:63
std::string metname
Definition: MuonAnalyzer.h:54
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:68
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
#define LogTrace(id)
bool theMuonRecoAnalyzerFlag
Definition: MuonAnalyzer.h:67
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:72
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:69
void analyze(const edm::Event &, const edm::EventSetup &, const TrajectorySeed &seed)
Get the analysis.
edm::InputTag theMuonCollectionLabel
Definition: MuonAnalyzer.h:57
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:76
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:65
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.

107  {
108 
109  metname = "muonAnalyzer";
110 
111  LogTrace(metname)<<"[MuonAnalyzer] Parameters initialization";
113 
120  }
123  }
124 
125 }
MuonSeedsAnalyzer * theSeedsAnalyzer
Definition: MuonAnalyzer.h:74
bool theSeedsAnalyzerFlag
Definition: MuonAnalyzer.h:66
SegmentTrackAnalyzer * theStaMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:82
MuonKinVsEtaAnalyzer * theMuonKinVsEtaAnalyzer
Definition: MuonAnalyzer.h:78
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
SegmentTrackAnalyzer * theGlbMuonSegmentsAnalyzer
Definition: MuonAnalyzer.h:80
std::string metname
Definition: MuonAnalyzer.h:54
bool theMuonKinVsEtaAnalyzerFlag
Definition: MuonAnalyzer.h:68
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:67
DQMStore * theDbe
Definition: MuonAnalyzer.h:50
MuonEnergyDepositAnalyzer * theMuEnergyAnalyzer
Definition: MuonAnalyzer.h:72
bool theMuonSegmentsAnalyzerFlag
Definition: MuonAnalyzer.h:69
MuonRecoAnalyzer * theMuonRecoAnalyzer
Definition: MuonAnalyzer.h:76
bool theMuEnergyAnalyzerFlag
Definition: MuonAnalyzer.h:65
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
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.

197  {
198  LogTrace(metname)<<"[MuonAnalyzer] Saving the histos";
199  bool outputMEsInRootFile = parameters.getParameter<bool>("OutputMEsInRootFile");
200  std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");
201  if(outputMEsInRootFile){
203  theDbe->save(outputFileName);
204  }
205 }
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:1883
std::string metname
Definition: MuonAnalyzer.h:54
#define LogTrace(id)
edm::ParameterSet parameters
Definition: MuonAnalyzer.h:51
DQMStore * theDbe
Definition: MuonAnalyzer.h:50
void showDirStructure(void) const
Definition: DQMStore.cc:2539

Member Data Documentation

std::string MuonAnalyzer::metname
private

Definition at line 54 of file MuonAnalyzer.h.

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

Definition at line 50 of file MuonAnalyzer.h.

SegmentTrackAnalyzer* MuonAnalyzer::theGlbMuonSegmentsAnalyzer
private

Definition at line 80 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theGlbMuTrackCollectionLabel
private

Definition at line 59 of file MuonAnalyzer.h.

MuonEnergyDepositAnalyzer* MuonAnalyzer::theMuEnergyAnalyzer
private

Definition at line 72 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuEnergyAnalyzerFlag
private

Definition at line 65 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theMuonCollectionLabel
private

Definition at line 57 of file MuonAnalyzer.h.

MuonKinVsEtaAnalyzer* MuonAnalyzer::theMuonKinVsEtaAnalyzer
private

Definition at line 78 of file MuonAnalyzer.h.

bool MuonAnalyzer::theMuonKinVsEtaAnalyzerFlag
private

Definition at line 68 of file MuonAnalyzer.h.

MuonRecoAnalyzer* MuonAnalyzer::theMuonRecoAnalyzer
private

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.

edm::InputTag MuonAnalyzer::theSeedsCollectionLabel
private

Definition at line 63 of file MuonAnalyzer.h.

MuonServiceProxy* MuonAnalyzer::theService
private

Definition at line 52 of file MuonAnalyzer.h.

SegmentTrackAnalyzer* MuonAnalyzer::theStaMuonSegmentsAnalyzer
private

Definition at line 82 of file MuonAnalyzer.h.

edm::InputTag MuonAnalyzer::theStaMuTrackCollectionLabel
private

Definition at line 61 of file MuonAnalyzer.h.