CMS 3D CMS Logo

Public Member Functions | Private Attributes

MuonAnalyzer Class Reference

#include <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 (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
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

Detailed Description

DQM muon analysis monitoring

Date:
2010/07/19 22:17:37
Revision:
1.16
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.

                                                      {

  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]

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.

                                                                              {

  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]
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);
  }
}

Member Data Documentation

std::string MuonAnalyzer::metname [private]

Definition at line 54 of file MuonAnalyzer.h.

Definition at line 51 of file MuonAnalyzer.h.

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.

Definition at line 65 of file MuonAnalyzer.h.

Definition at line 57 of file MuonAnalyzer.h.

Definition at line 78 of file MuonAnalyzer.h.

Definition at line 68 of file MuonAnalyzer.h.

Definition at line 76 of file MuonAnalyzer.h.

Definition at line 67 of file MuonAnalyzer.h.

Definition at line 69 of file MuonAnalyzer.h.

Definition at line 74 of file MuonAnalyzer.h.

Definition at line 66 of file MuonAnalyzer.h.

Definition at line 63 of file MuonAnalyzer.h.

Definition at line 52 of file MuonAnalyzer.h.

Definition at line 82 of file MuonAnalyzer.h.

Definition at line 61 of file MuonAnalyzer.h.