Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
MuonAnalysis
MomentumScaleCalibration
plugins
ResolutionAnalyzer.h
Go to the documentation of this file.
1
#ifndef RESOLUTIONANALYZER_HH
2
#define RESOLUTIONANALYZER_HH
3
4
// -*- C++ -*-
5
//
6
// Package: ResolutionAnalyzer
7
// Class: ResolutionAnalyzer
8
//
16
//
17
// Original Author: Marco De Mattia
18
// Created: Thu Sep 11 12:16:00 CEST 2008
19
// $Id: ResolutionAnalyzer.h,v 1.16 2012/12/20 16:09:29 emiglior Exp $
20
//
21
//
22
23
// system include files
24
#include <memory>
25
#include <string>
26
#include <vector>
27
28
// user include files
29
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
30
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
31
#include "
FWCore/Framework/interface/Event.h
"
32
#include "
FWCore/Framework/interface/MakerMacros.h
"
33
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
34
35
#include "
DataFormats/TrackReco/interface/Track.h
"
36
#include "
DataFormats/MuonReco/interface/Muon.h
"
37
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
38
#include "
DataFormats/Candidate/interface/Candidate.h
"
39
#include "
RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h
"
40
#include "
RecoMuon/TrackingTools/interface/MuonServiceProxy.h
"
41
42
#include "HepPDT/defs.h"
43
#include "HepPDT/TableBuilder.hh"
44
#include "HepPDT/ParticleDataTable.hh"
45
46
#include "
DataFormats/HepMCCandidate/interface/GenParticleFwd.h
"
47
#include "HepMC/GenParticle.h"
48
#include "HepMC/GenEvent.h"
49
// #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
50
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
51
52
#include "
SimGeneral/HepPDTRecord/interface/ParticleDataTable.h
"
53
#include "
SimDataFormats/Track/interface/SimTrackContainer.h
"
54
#include "
SimDataFormats/Vertex/interface/SimVertexContainer.h
"
55
56
#include <CLHEP/Vector/LorentzVector.h>
57
58
#include "
DataFormats/Candidate/interface/LeafCandidate.h
"
59
60
#include "
Histograms.h
"
61
#include "
MuScleFitUtils.h
"
62
//
63
// class decleration
64
//
65
66
class
ResolutionAnalyzer
:
public
edm::EDAnalyzer
{
67
public
:
68
explicit
ResolutionAnalyzer
(
const
edm::ParameterSet
&);
69
~ResolutionAnalyzer
();
70
71
private
:
72
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&);
73
virtual
void
endJob
() {};
74
75
template
<
typename
T>
76
std::vector<reco::LeafCandidate>
fillMuonCollection
(
const
std::vector<T>&
tracks
) {
77
std::vector<reco::LeafCandidate>
muons
;
78
typename
std::vector<T>::const_iterator track;
79
for
(track = tracks.begin(); track != tracks.end(); ++track){
80
reco::Particle::LorentzVector
mu
(track->px(),track->py(),track->pz(),
81
sqrt
(track->p()*track->p() +
MuScleFitUtils::mMu2
));
82
MuScleFitUtils::goodmuon
++;
83
if
(
debug_
>0)
std::cout
<<std::setprecision(9)<<
"Muon #"
<<
MuScleFitUtils::goodmuon
84
<<
": initial value Pt = "
<< mu.Pt() << std::endl;
85
reco::LeafCandidate
muon
(track->charge(),
mu
);
86
// Store muon
87
// ----------
88
muons.push_back(
muon
);
89
}
90
return
muons
;
91
}
92
94
void
fillHistoMap
();
96
void
writeHistoMap
();
98
bool
checkDeltaR
(
const
reco::Particle::LorentzVector
& genMu,
const
reco::Particle::LorentzVector
& recMu);
99
100
// ----------member data ---------------------------
101
102
// Collections labels
103
// ------------------
104
edm::InputTag
theMuonLabel_
;
105
106
int
theMuonType_
;
107
std::string
theRootFileName_
;
108
std::string
theCovariancesRootFileName_
;
109
bool
debug_
;
110
std::map<std::string, Histograms*>
mapHisto_
;
111
TFile *
outputFile_
;
112
113
int
eventCounter_
;
114
bool
resonance_
;
115
bool
readCovariances_
;
116
117
TString
treeFileName_
;
118
int32_t
maxEvents_
;
119
120
double
ptMax_
;
121
122
HCovarianceVSxy
*
massResolutionVsPtEta_
;
123
TH2D *
recoPtVsgenPt_
;
124
TH2D *
recoPtVsgenPtEta12_
;
125
TH1D *
deltaPtOverPt_
;
126
TH1D *
deltaPtOverPtForEta12_
;
127
};
128
129
#endif // RESOLUTIONANALYZER_HH
ResolutionAnalyzer::eventCounter_
int eventCounter_
Definition:
ResolutionAnalyzer.h:113
reco::LeafCandidate
Definition:
LeafCandidate.h:18
ResolutionAnalyzer::maxEvents_
int32_t maxEvents_
Definition:
ResolutionAnalyzer.h:118
Histograms.h
ResolutionAnalyzer::mapHisto_
std::map< std::string, Histograms * > mapHisto_
Definition:
ResolutionAnalyzer.h:110
ResolutionAnalyzer::theRootFileName_
std::string theRootFileName_
Definition:
ResolutionAnalyzer.h:107
ResolutionAnalyzer::recoPtVsgenPtEta12_
TH2D * recoPtVsgenPtEta12_
Definition:
ResolutionAnalyzer.h:124
LeafCandidate.h
ResolutionAnalyzer::outputFile_
TFile * outputFile_
Definition:
ResolutionAnalyzer.h:111
MuonServiceProxy.h
Event.h
MakerMacros.h
ResolutionAnalyzer::~ResolutionAnalyzer
~ResolutionAnalyzer()
Definition:
ResolutionAnalyzer.cc:54
Frameworkfwd.h
MuonFwd.h
ParameterSet.h
Candidate.h
ParticleDataTable.h
ResolutionAnalyzer::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition:
ResolutionAnalyzer.h:76
ResolutionAnalyzer::massResolutionVsPtEta_
HCovarianceVSxy * massResolutionVsPtEta_
Definition:
ResolutionAnalyzer.h:122
ResolutionAnalyzer::fillHistoMap
void fillHistoMap()
Used to fill the map with the histograms needed.
Definition:
ResolutionAnalyzer.cc:420
MuonPatternRecoDumper.h
HCovarianceVSxy
Definition:
Histograms.h:1820
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:46
ResolutionAnalyzer::endJob
virtual void endJob()
Definition:
ResolutionAnalyzer.h:73
ResolutionAnalyzer::writeHistoMap
void writeHistoMap()
Writes the histograms in the map.
Definition:
ResolutionAnalyzer.cc:539
ResolutionAnalyzer::readCovariances_
bool readCovariances_
Definition:
ResolutionAnalyzer.h:115
ResolutionAnalyzer::treeFileName_
TString treeFileName_
Definition:
ResolutionAnalyzer.h:117
GenParticleFwd.h
ResolutionAnalyzer::theCovariancesRootFileName_
std::string theCovariancesRootFileName_
Definition:
ResolutionAnalyzer.h:108
edm::EventSetup
Definition:
EventSetup.h:44
RPCpg::mu
const int mu
Definition:
Constants.h:23
Muon.h
ResolutionAnalyzer::resonance_
bool resonance_
Definition:
ResolutionAnalyzer.h:114
ResolutionAnalyzer
Definition:
ResolutionAnalyzer.h:66
HepMCProduct.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:14
EDAnalyzer.h
ResolutionAnalyzer::checkDeltaR
bool checkDeltaR(const reco::Particle::LorentzVector &genMu, const reco::Particle::LorentzVector &recMu)
Returns true if the two particles have DeltaR < cut.
Definition:
ResolutionAnalyzer.cc:552
ResolutionAnalyzer::ptMax_
double ptMax_
Definition:
ResolutionAnalyzer.h:120
metsig::muon
Definition:
SignAlgoResolutions.h:41
testEve_cfg.tracks
tuple tracks
Definition:
testEve_cfg.py:39
ResolutionAnalyzer::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
ResolutionAnalyzer.cc:68
MuScleFitUtils::goodmuon
static int goodmuon
Definition:
MuScleFitUtils.h:199
MuScleFitUtils::mMu2
static const double mMu2
Definition:
MuScleFitUtils.h:124
SimTrackContainer.h
edm::InputTag
Definition:
InputTag.h:12
patZpeak.muons
tuple muons
Definition:
patZpeak.py:38
ResolutionAnalyzer::deltaPtOverPtForEta12_
TH1D * deltaPtOverPtForEta12_
Definition:
ResolutionAnalyzer.h:126
edm::ParameterSet
Definition:
ParameterSet.h:35
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
ResolutionAnalyzer::deltaPtOverPt_
TH1D * deltaPtOverPt_
Definition:
ResolutionAnalyzer.h:125
edm::Event
Definition:
Event.h:50
Track.h
ResolutionAnalyzer::recoPtVsgenPt_
TH2D * recoPtVsgenPt_
Definition:
ResolutionAnalyzer.h:123
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:25
ResolutionAnalyzer::debug_
bool debug_
Definition:
ResolutionAnalyzer.h:109
MuScleFitUtils.h
ResolutionAnalyzer::theMuonType_
int theMuonType_
Definition:
ResolutionAnalyzer.h:106
ResolutionAnalyzer::ResolutionAnalyzer
ResolutionAnalyzer(const edm::ParameterSet &)
Definition:
ResolutionAnalyzer.cc:19
SimVertexContainer.h
ResolutionAnalyzer::theMuonLabel_
edm::InputTag theMuonLabel_
Definition:
ResolutionAnalyzer.h:104
Generated for CMSSW Reference Manual by
1.8.5