CMS 3D CMS Logo

MuonAnalyzer Class Reference

DQM muon analysis monitoring. More...

#include <DQMOffline/Muon/src/MuonAnalyzer.h>

Inheritance diagram for MuonAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Get the analysis.
void beginJob (edm::EventSetup const &iSetup)
 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
DQMStoretheDbe
SegmentTrackAnalyzertheGlbMuonSegmentsAnalyzer
edm::InputTag theGlbMuTrackCollectionLabel
MuonEnergyDepositAnalyzertheMuEnergyAnalyzer
bool theMuEnergyAnalyzerFlag
edm::InputTag theMuonCollectionLabel
MuonRecoAnalyzertheMuonRecoAnalyzer
bool theMuonRecoAnalyzerFlag
bool theMuonSegmentsAnalyzerFlag
MuonSeedsAnalyzertheSeedsAnalyzer
bool theSeedsAnalyzerFlag
edm::InputTag theSeedsCollectionLabel
MuonServiceProxytheService
SegmentTrackAnalyzertheStaMuonSegmentsAnalyzer
edm::InputTag theStaMuTrackCollectionLabel


Detailed Description

DQM muon analysis monitoring.

Date
2008/07/16 09:56:36
Revision
1.12
Author:
G. Mila - INFN Torino

Definition at line 25 of file MuonAnalyzer.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 41 of file MuonAnalyzer.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), MuonServiceProxy_cff::MuonServiceProxy, parameters, theGlbMuonSegmentsAnalyzer, theGlbMuTrackCollectionLabel, theMuEnergyAnalyzer, theMuEnergyAnalyzerFlag, theMuonCollectionLabel, theMuonRecoAnalyzer, theMuonRecoAnalyzerFlag, theMuonSegmentsAnalyzerFlag, theSeedsAnalyzer, theSeedsAnalyzerFlag, theSeedsCollectionLabel, theService, theStaMuonSegmentsAnalyzer, and theStaMuTrackCollectionLabel.

00041                                                       {
00042 
00043   parameters = pSet;
00044 
00045   // the services
00046   theService = new MuonServiceProxy(parameters.getParameter<ParameterSet>("ServiceParameters"));
00047   
00048   // Muon Collection Label
00049   theMuonCollectionLabel = parameters.getParameter<edm::InputTag>("MuonCollection");
00050   // Glb Muon Collection Label
00051   theGlbMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("GlobalMuTrackCollection");
00052   // STA Muon Collection Label
00053   theStaMuTrackCollectionLabel = parameters.getParameter<edm::InputTag>("STAMuTrackCollection");
00054   // Seeds Collection Label
00055   theSeedsCollectionLabel = parameters.getParameter<edm::InputTag>("SeedCollection");
00056   
00057   theMuEnergyAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonEnergyAnalysis",true);
00058   theSeedsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonSeedAnalysis",true);
00059   theMuonRecoAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoMuonRecoAnalysis",true);
00060   theMuonSegmentsAnalyzerFlag = parameters.getUntrackedParameter<bool>("DoTrackSegmentsAnalysis",true);
00061 
00062   // do the analysis on muon energy
00063   if(theMuEnergyAnalyzerFlag)
00064     theMuEnergyAnalyzer = new MuonEnergyDepositAnalyzer(parameters.getParameter<ParameterSet>("muonEnergyAnalysis"), theService);
00065   // do the analysis on seeds
00066   if(theSeedsAnalyzerFlag)
00067     theSeedsAnalyzer = new MuonSeedsAnalyzer(parameters.getParameter<ParameterSet>("seedsAnalysis"), theService);
00068   // do the analysis on muon energy
00069   if(theMuonRecoAnalyzerFlag)
00070     theMuonRecoAnalyzer = new MuonRecoAnalyzer(parameters.getParameter<ParameterSet>("muonRecoAnalysis"), theService);
00071   // do the analysis on muon track segments
00072   if(theMuonSegmentsAnalyzerFlag){
00073     // analysis on glb muon tracks
00074     ParameterSet  trackGlbMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis");
00075     trackGlbMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",
00076                                                     theGlbMuTrackCollectionLabel);
00077     theGlbMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackGlbMuAnalysisParameters, theService);
00078     // analysis on sta muon tracks
00079     ParameterSet  trackStaMuAnalysisParameters = parameters.getParameter<ParameterSet>("trackSegmentsAnalysis");
00080     trackStaMuAnalysisParameters.addParameter<edm::InputTag>("MuTrackCollection",
00081                                                     theStaMuTrackCollectionLabel);
00082     theStaMuonSegmentsAnalyzer = new SegmentTrackAnalyzer(trackStaMuAnalysisParameters, theService);
00083   }
00084 }

MuonAnalyzer::~MuonAnalyzer (  )  [virtual]

Destructor.

Definition at line 86 of file MuonAnalyzer.cc.

References theGlbMuonSegmentsAnalyzer, theMuEnergyAnalyzer, theMuEnergyAnalyzerFlag, theMuonRecoAnalyzer, theMuonRecoAnalyzerFlag, theMuonSegmentsAnalyzerFlag, theSeedsAnalyzer, theSeedsAnalyzerFlag, and theStaMuonSegmentsAnalyzer.

00086                             { 
00087   
00088   if(theMuEnergyAnalyzerFlag) delete theMuEnergyAnalyzer;
00089   if(theSeedsAnalyzerFlag) delete theSeedsAnalyzer;
00090   if(theMuonRecoAnalyzerFlag) delete theMuonRecoAnalyzer;
00091   if(theMuonSegmentsAnalyzerFlag) {
00092     delete theGlbMuonSegmentsAnalyzer;
00093     delete theStaMuonSegmentsAnalyzer;
00094   }
00095 }


Member Function Documentation

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

Get the analysis.

Implements edm::EDAnalyzer.

Definition at line 116 of file MuonAnalyzer.cc.

References MuonRecoAnalyzer::analyze(), MuonSeedsAnalyzer::analyze(), SegmentTrackAnalyzer::analyze(), MuonEnergyDepositAnalyzer::analyze(), edm::Event::getByLabel(), edm::Handle< T >::isValid(), LogTrace, metname, muons_cfi::muons, theGlbMuonSegmentsAnalyzer, theGlbMuTrackCollectionLabel, theMuEnergyAnalyzer, theMuEnergyAnalyzerFlag, theMuonCollectionLabel, theMuonRecoAnalyzer, theMuonRecoAnalyzerFlag, theMuonSegmentsAnalyzerFlag, theSeedsAnalyzer, theSeedsAnalyzerFlag, theSeedsCollectionLabel, theService, theStaMuonSegmentsAnalyzer, and theStaMuTrackCollectionLabel.

00116                                                                               {
00117 
00118   LogTrace(metname)<<"[MuonAnalyzer] Analysis of event # ";
00119   
00120   theService->update(iSetup);
00121 
00122    // Take the STA muon container
00123    edm::Handle<reco::MuonCollection> muons;
00124    iEvent.getByLabel(theMuonCollectionLabel,muons);
00125 
00126    if(muons.isValid()){
00127      for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
00128        if(theMuEnergyAnalyzerFlag){
00129          LogTrace(metname)<<"[MuonAnalyzer] Call to the muon energy analyzer";
00130          theMuEnergyAnalyzer->analyze(iEvent, iSetup, *recoMu);
00131        }
00132        if(theMuonRecoAnalyzerFlag){
00133          LogTrace(metname)<<"[MuonAnalyzer] Call to the muon reco analyzer";
00134          theMuonRecoAnalyzer->analyze(iEvent, iSetup, *recoMu);
00135        }
00136      }
00137    }
00138 
00139 
00140    // Take the track containers
00141    Handle<reco::TrackCollection> glbTracks;
00142    iEvent.getByLabel(theGlbMuTrackCollectionLabel,glbTracks);
00143    Handle<reco::TrackCollection> staTracks;
00144    iEvent.getByLabel(theStaMuTrackCollectionLabel,staTracks);
00145 
00146    if(glbTracks.isValid()){
00147      for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){
00148        if(theMuonSegmentsAnalyzerFlag){
00149          LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for glb muons";
00150          theGlbMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
00151        }
00152      }
00153    }
00154    if(staTracks.isValid()){
00155      for (reco::TrackCollection::const_iterator recoTrack = staTracks->begin(); recoTrack!=staTracks->end(); ++recoTrack){
00156        if(theMuonSegmentsAnalyzerFlag){
00157          LogTrace(metname)<<"[SegmentsAnalyzer] Call to the track segments analyzer for sta muons";
00158          theStaMuonSegmentsAnalyzer->analyze(iEvent, iSetup, *recoTrack);
00159        }
00160      }
00161    }
00162    
00163    
00164      
00165 
00166    // Take the seeds container
00167    edm::Handle<TrajectorySeedCollection> seeds;
00168    iEvent.getByLabel(theSeedsCollectionLabel, seeds);
00169    if(seeds.isValid()){
00170      for(TrajectorySeedCollection::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed){
00171        if(theSeedsAnalyzerFlag){
00172          LogTrace(metname)<<"[MuonAnalyzer] Call to the seeds analyzer";
00173          theSeedsAnalyzer->analyze(iEvent, iSetup, *seed);
00174        }
00175      }
00176    }
00177 
00178 }

void MuonAnalyzer::beginJob ( edm::EventSetup const &  iSetup  )  [virtual]

Inizialize parameters for histo binning.

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file MuonAnalyzer.cc.

References MuonSeedsAnalyzer::beginJob(), MuonEnergyDepositAnalyzer::beginJob(), MuonRecoAnalyzer::beginJob(), SegmentTrackAnalyzer::beginJob(), LogTrace, metname, theDbe, theGlbMuonSegmentsAnalyzer, theMuEnergyAnalyzer, theMuEnergyAnalyzerFlag, theMuonRecoAnalyzer, theMuonRecoAnalyzerFlag, theMuonSegmentsAnalyzerFlag, theSeedsAnalyzer, theSeedsAnalyzerFlag, and theStaMuonSegmentsAnalyzer.

00098                                                        {
00099 
00100   metname = "muonAnalyzer";
00101 
00102   LogTrace(metname)<<"[MuonAnalyzer] Parameters initialization";
00103   theDbe = edm::Service<DQMStore>().operator->();
00104  
00105   if(theMuEnergyAnalyzerFlag) theMuEnergyAnalyzer->beginJob(iSetup, theDbe);
00106   if(theSeedsAnalyzerFlag) theSeedsAnalyzer->beginJob(iSetup, theDbe);
00107   if(theMuonRecoAnalyzerFlag) theMuonRecoAnalyzer->beginJob(iSetup, theDbe);
00108   if(theMuonSegmentsAnalyzerFlag) {
00109     theGlbMuonSegmentsAnalyzer->beginJob(iSetup, theDbe);
00110     theStaMuonSegmentsAnalyzer->beginJob(iSetup, theDbe);
00111   }
00112 
00113 }

void MuonAnalyzer::endJob ( void   )  [virtual]

Save the histos.

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file MuonAnalyzer.cc.

References edm::ParameterSet::getParameter(), LogTrace, metname, iggi_31X_cfg::outputFileName, parameters, DQMStore::save(), DQMStore::showDirStructure(), and theDbe.

00181                               {
00182   LogTrace(metname)<<"[MuonAnalyzer] Saving the histos";
00183   bool outputMEsInRootFile = parameters.getParameter<bool>("OutputMEsInRootFile");
00184   std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");
00185   if(outputMEsInRootFile){
00186     theDbe->showDirStructure();
00187     theDbe->save(outputFileName);
00188   }
00189 }


Member Data Documentation

std::string MuonAnalyzer::metname [private]

Definition at line 50 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

edm::ParameterSet MuonAnalyzer::parameters [private]

Definition at line 47 of file MuonAnalyzer.h.

Referenced by endJob(), and MuonAnalyzer().

DQMStore* MuonAnalyzer::theDbe [private]

Definition at line 46 of file MuonAnalyzer.h.

Referenced by beginJob(), and endJob().

SegmentTrackAnalyzer* MuonAnalyzer::theGlbMuonSegmentsAnalyzer [private]

Definition at line 73 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

edm::InputTag MuonAnalyzer::theGlbMuTrackCollectionLabel [private]

Definition at line 55 of file MuonAnalyzer.h.

Referenced by analyze(), and MuonAnalyzer().

MuonEnergyDepositAnalyzer* MuonAnalyzer::theMuEnergyAnalyzer [private]

Definition at line 67 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

bool MuonAnalyzer::theMuEnergyAnalyzerFlag [private]

Definition at line 61 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

edm::InputTag MuonAnalyzer::theMuonCollectionLabel [private]

Definition at line 53 of file MuonAnalyzer.h.

Referenced by analyze(), and MuonAnalyzer().

MuonRecoAnalyzer* MuonAnalyzer::theMuonRecoAnalyzer [private]

Definition at line 71 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

bool MuonAnalyzer::theMuonRecoAnalyzerFlag [private]

Definition at line 63 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

bool MuonAnalyzer::theMuonSegmentsAnalyzerFlag [private]

Definition at line 64 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

MuonSeedsAnalyzer* MuonAnalyzer::theSeedsAnalyzer [private]

Definition at line 69 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

bool MuonAnalyzer::theSeedsAnalyzerFlag [private]

Definition at line 62 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

edm::InputTag MuonAnalyzer::theSeedsCollectionLabel [private]

Definition at line 59 of file MuonAnalyzer.h.

Referenced by analyze(), and MuonAnalyzer().

MuonServiceProxy* MuonAnalyzer::theService [private]

Definition at line 48 of file MuonAnalyzer.h.

Referenced by analyze(), and MuonAnalyzer().

SegmentTrackAnalyzer* MuonAnalyzer::theStaMuonSegmentsAnalyzer [private]

Definition at line 75 of file MuonAnalyzer.h.

Referenced by analyze(), beginJob(), MuonAnalyzer(), and ~MuonAnalyzer().

edm::InputTag MuonAnalyzer::theStaMuTrackCollectionLabel [private]

Definition at line 57 of file MuonAnalyzer.h.

Referenced by analyze(), and MuonAnalyzer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:39 2009 for CMSSW by  doxygen 1.5.4