CMS 3D CMS Logo

Public Member Functions | Private Attributes

MuonKinVsEtaAnalyzer Class Reference

#include <MuonKinVsEtaAnalyzer.h>

Inheritance diagram for MuonKinVsEtaAnalyzer:
MuonAnalyzerBase

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const reco::Muon &recoMu)
 Get the analysis.
void beginJob (DQMStore *dbe)
 Inizialize parameters for histo binning.
 MuonKinVsEtaAnalyzer (const edm::ParameterSet &, MuonServiceProxy *theService)
 Constructor.
virtual ~MuonKinVsEtaAnalyzer ()
 Destructor.

Private Attributes

int etaBin
double etaBMax
double etaBMin
double EtaCutMax
double EtaCutMin
double etaECMax
double etaECMin
std::vector< MonitorElement * > etaGlbTrack
double etaMax
double etaMin
double etaOvlpMax
double etaOvlpMin
std::vector< MonitorElement * > etaStaTrack
std::vector< MonitorElement * > etaTightTrack
std::vector< MonitorElement * > etaTrack
std::string metname
edm::ParameterSet parameters
int pBin
std::vector< MonitorElement * > pGlbTrack
int phiBin
std::vector< MonitorElement * > phiGlbTrack
double phiMax
double phiMin
std::vector< MonitorElement * > phiStaTrack
std::vector< MonitorElement * > phiTightTrack
std::vector< MonitorElement * > phiTrack
double pMax
double pMin
std::vector< MonitorElement * > pStaTrack
int ptBin
std::vector< MonitorElement * > ptGlbTrack
std::vector< MonitorElement * > pTightTrack
double ptMax
double ptMin
std::vector< MonitorElement * > pTrack
std::vector< MonitorElement * > ptStaTrack
std::vector< MonitorElement * > ptTightTrack
std::vector< MonitorElement * > ptTrack
edm::InputTag theSTACollectionLabel

Detailed Description

Definition at line 28 of file MuonKinVsEtaAnalyzer.h.


Constructor & Destructor Documentation

MuonKinVsEtaAnalyzer::MuonKinVsEtaAnalyzer ( const edm::ParameterSet pSet,
MuonServiceProxy *  theService 
)

Constructor.

Definition at line 28 of file MuonKinVsEtaAnalyzer.cc.

References parameters.

MuonKinVsEtaAnalyzer::~MuonKinVsEtaAnalyzer ( ) [virtual]

Destructor.

Definition at line 32 of file MuonKinVsEtaAnalyzer.cc.

{ }

Member Function Documentation

void MuonKinVsEtaAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::Muon recoMu 
)

Get the analysis.

Definition at line 101 of file MuonKinVsEtaAnalyzer.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, reco::Muon::combinedMuon(), etaBMax, etaBMin, EtaCutMax, EtaCutMin, etaECMax, etaECMin, etaGlbTrack, etaOvlpMax, etaOvlpMin, etaStaTrack, etaTightTrack, etaTrack, edm::Event::getByLabel(), reco::Muon::isGlobalMuon(), reco::Muon::isStandAloneMuon(), reco::Muon::isTrackerMuon(), LogTrace, metname, reco::Muon::numberOfMatches(), pGlbTrack, phiGlbTrack, phiStaTrack, phiTightTrack, phiTrack, reco::BeamSpot::position(), pStaTrack, ptGlbTrack, pTightTrack, pTrack, ptStaTrack, ptTightTrack, ptTrack, reco::Muon::standAloneMuon(), and reco::Muon::track().

                                                                                                              {
  
  reco::BeamSpot beamSpot;
  Handle<reco::BeamSpot> beamSpotHandle;
  iEvent.getByLabel("offlineBeamSpot", beamSpotHandle);
  beamSpot = *beamSpotHandle;
  
  LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] Analyze the mu in different eta regions";

  for(unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
    if (iEtaRegion==0) {EtaCutMin= etaBMin; EtaCutMax=etaBMax;}
    if (iEtaRegion==1) {EtaCutMin= etaECMin; EtaCutMax=etaECMax;}
    if (iEtaRegion==2) {EtaCutMin= etaOvlpMin; EtaCutMax=etaOvlpMax;} 
    if (iEtaRegion==3) {EtaCutMin= etaBMin; EtaCutMax=etaECMax;}
    
    if(recoMu.isGlobalMuon()) {
      LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] The mu is global - filling the histos";
      reco::TrackRef recoCombinedGlbTrack = recoMu.combinedMuon();
      // get the track combinig the information from both the glb fit"
      if(fabs(recoCombinedGlbTrack->eta())>EtaCutMin && fabs(recoCombinedGlbTrack->eta())<EtaCutMax){
        etaGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->eta());
        phiGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->phi());
        pGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->p());
        ptGlbTrack[iEtaRegion]->Fill(recoCombinedGlbTrack->pt());
      }
    }

    if(recoMu.isTrackerMuon()) {
      LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] The mu is tracker - filling the histos";
      // get the track using only the tracker data
      reco::TrackRef recoTrack = recoMu.track();
      if(fabs(recoTrack->eta())>EtaCutMin && fabs(recoTrack->eta())<EtaCutMax){
        etaTrack[iEtaRegion]->Fill(recoTrack->eta());
        phiTrack[iEtaRegion]->Fill(recoTrack->phi());
        pTrack[iEtaRegion]->Fill(recoTrack->p());
        ptTrack[iEtaRegion]->Fill(recoTrack->pt());
      }
    }

    if(recoMu.isStandAloneMuon()) {
      LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] The mu is standalone - filling the histos";
      // get the track using only the mu spectrometer data
      reco::TrackRef recoStaTrack = recoMu.standAloneMuon();
      if(fabs(recoStaTrack->eta())>EtaCutMin && fabs(recoStaTrack->eta())<EtaCutMax){
        etaStaTrack[iEtaRegion]->Fill(recoStaTrack->eta());
        phiStaTrack[iEtaRegion]->Fill(recoStaTrack->phi());
        pStaTrack[iEtaRegion]->Fill(recoStaTrack->p());
        ptStaTrack[iEtaRegion]->Fill(recoStaTrack->pt());
      }
    }
    if (recoMu.isGlobalMuon() && recoMu.isTrackerMuon() && recoMu.combinedMuon()->normalizedChi2()<10. 
        && recoMu.combinedMuon()->hitPattern().numberOfValidMuonHits()>0 && fabs(recoMu.combinedMuon()->dxy(beamSpot.position()))<0.2 
        && recoMu.combinedMuon()->hitPattern().numberOfValidPixelHits()>0 && recoMu.numberOfMatches() > 1) {
      LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] The mu is Tight - filling the histos";
      reco::TrackRef recoTightTrack = recoMu.combinedMuon();
      if(fabs(recoTightTrack->eta())>EtaCutMin && fabs(recoTightTrack->eta())<EtaCutMax){
        etaTightTrack[iEtaRegion]->Fill(recoTightTrack->eta());
        phiTightTrack[iEtaRegion]->Fill(recoTightTrack->phi());
        pTightTrack[iEtaRegion]->Fill(recoTightTrack->p());
        ptTightTrack[iEtaRegion]->Fill(recoTightTrack->pt());
      }
    }
  }
}
void MuonKinVsEtaAnalyzer::beginJob ( DQMStore dbe) [virtual]

Inizialize parameters for histo binning.

Implements MuonAnalyzerBase.

Definition at line 35 of file MuonKinVsEtaAnalyzer.cc.

References DQMStore::book1D(), etaBin, etaBMax, etaBMin, etaECMax, etaECMin, etaGlbTrack, etaMax, etaMin, etaOvlpMax, etaOvlpMin, etaStaTrack, etaTightTrack, etaTrack, edm::ParameterSet::getParameter(), LogTrace, metname, parameters, pBin, pGlbTrack, phiBin, phiGlbTrack, phiMax, phiMin, phiStaTrack, phiTightTrack, phiTrack, pMax, pMin, pStaTrack, ptBin, ptGlbTrack, pTightTrack, ptMax, ptMin, pTrack, ptStaTrack, ptTightTrack, ptTrack, and DQMStore::setCurrentFolder().

                                                  {

  metname = "muonKinVsEta";

  LogTrace(metname)<<"[MuonKinVsEtaAnalyzer] Parameters initialization";
  dbe->setCurrentFolder("Muons/MuonKinVsEtaAnalyzer");

  etaBin = parameters.getParameter<int>("etaBin");
  etaMin = parameters.getParameter<double>("etaMin");
  etaMax = parameters.getParameter<double>("etaMax");

  phiBin = parameters.getParameter<int>("phiBin");
  phiMin = parameters.getParameter<double>("phiMin");
  phiMax = parameters.getParameter<double>("phiMax");

  pBin = parameters.getParameter<int>("pBin");
  pMin = parameters.getParameter<double>("pMin");
  pMax = parameters.getParameter<double>("pMax");

  ptBin = parameters.getParameter<int>("ptBin");
  ptMin = parameters.getParameter<double>("ptMin");
  ptMax = parameters.getParameter<double>("ptMax");

  etaBMin = parameters.getParameter<double>("etaBMin");
  etaBMax = parameters.getParameter<double>("etaBMax");
  etaECMin = parameters.getParameter<double>("etaECMin");
  etaECMax = parameters.getParameter<double>("etaECMax");
  etaOvlpMin = parameters.getParameter<double>("etaOvlpMin");
  etaOvlpMax = parameters.getParameter<double>("etaOvlpMax");

  std::string EtaName;
  for(unsigned int iEtaRegion=0;iEtaRegion<4;iEtaRegion++){
    if (iEtaRegion==0) EtaName = "Barrel_";   
    if (iEtaRegion==1) EtaName = "EndCap_";   
    if (iEtaRegion==2) EtaName = "Overlap_";
    if (iEtaRegion==3) EtaName = "_";

    // monitoring of eta parameter
    etaGlbTrack.push_back(dbe->book1D("GlbMuon_eta_"+EtaName, "#eta_{GLB} "+EtaName, etaBin, etaMin, etaMax));
    etaTrack.push_back(dbe->book1D("TkMuon_eta_"+EtaName, "#eta_{TK} "+EtaName, etaBin, etaMin, etaMax));
    etaStaTrack.push_back(dbe->book1D("StaMuon_eta_"+EtaName, "#eta_{STA} "+EtaName, etaBin, etaMin, etaMax));
    etaTightTrack.push_back(dbe->book1D("TightMuon_eta_"+EtaName, "#eta_{Tight} "+EtaName, etaBin, etaMin, etaMax));
    
    // monitoring of phi paramater
    phiGlbTrack.push_back(dbe->book1D("GlbMuon_phi_"+EtaName, "#phi_{GLB} "+EtaName+ "(rad)", phiBin, phiMin, phiMax));
    phiTrack.push_back(dbe->book1D("TkMuon_phi_"+EtaName, "#phi_{TK}" +EtaName +"(rad)", phiBin, phiMin, phiMax));
    phiStaTrack.push_back(dbe->book1D("StaMuon_phi_"+EtaName, "#phi_{STA}"+EtaName+" (rad)", phiBin, phiMin, phiMax));
    phiTightTrack.push_back(dbe->book1D("TightMuon_phi_"+EtaName, "#phi_{Tight}_"+EtaName, phiBin, phiMin, phiMax));

    // monitoring of the momentum
    pGlbTrack.push_back(dbe->book1D("GlbMuon_p_"+EtaName, "p_{GLB} "+EtaName, pBin, pMin, pMax));
    pTrack.push_back(dbe->book1D("TkMuon_p"+EtaName, "p_{TK} "+EtaName, pBin, pMin, pMax));
    pStaTrack.push_back(dbe->book1D("StaMuon_p"+EtaName, "p_{STA} "+EtaName, pBin, pMin, pMax));
    pTightTrack.push_back(dbe->book1D("TightMuon_p_"+EtaName, "p_{Tight} "+EtaName, pBin, pMin, pMax));

    // monitoring of the transverse momentum
    ptGlbTrack.push_back(dbe->book1D("GlbMuon_pt_" +EtaName, "pt_{GLB} "+EtaName, ptBin, ptMin, ptMax));
    ptTrack.push_back(dbe->book1D("TkMuon_pt_"+EtaName, "pt_{TK} "+EtaName, ptBin, ptMin, ptMax));
    ptStaTrack.push_back(dbe->book1D("StaMuon_pt_"+EtaName, "pt_{STA} "+EtaName, ptBin, ptMin, pMax));
    ptTightTrack.push_back(dbe->book1D("TightMuon_pt_"+EtaName, "pt_{Tight} "+EtaName, ptBin, ptMin, ptMax));
  }
}

Member Data Documentation

Definition at line 62 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 74 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 73 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 72 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze().

Definition at line 71 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze().

Definition at line 76 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 75 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 82 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

double MuonKinVsEtaAnalyzer::etaMax [private]

Definition at line 64 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

double MuonKinVsEtaAnalyzer::etaMin [private]

Definition at line 63 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 78 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 77 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 94 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 100 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 88 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

std::string MuonKinVsEtaAnalyzer::metname [private]

Definition at line 49 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 47 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob(), and MuonKinVsEtaAnalyzer().

Definition at line 54 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 84 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 66 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 83 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

double MuonKinVsEtaAnalyzer::phiMax [private]

Definition at line 68 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

double MuonKinVsEtaAnalyzer::phiMin [private]

Definition at line 67 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 95 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 101 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 89 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

double MuonKinVsEtaAnalyzer::pMax [private]

Definition at line 56 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

double MuonKinVsEtaAnalyzer::pMin [private]

Definition at line 55 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 96 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 58 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 85 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 102 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

double MuonKinVsEtaAnalyzer::ptMax [private]

Definition at line 60 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

double MuonKinVsEtaAnalyzer::ptMin [private]

Definition at line 59 of file MuonKinVsEtaAnalyzer.h.

Referenced by beginJob().

Definition at line 90 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 97 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 103 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 91 of file MuonKinVsEtaAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 51 of file MuonKinVsEtaAnalyzer.h.