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
//
20
//
21
22
// system include files
23
#include <memory>
24
#include <string>
25
#include <vector>
26
27
// user include files
28
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
29
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
30
#include "
FWCore/Framework/interface/Event.h
"
31
#include "
FWCore/Framework/interface/MakerMacros.h
"
32
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
33
34
#include "
DataFormats/TrackReco/interface/Track.h
"
35
#include "
DataFormats/MuonReco/interface/Muon.h
"
36
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
37
#include "
DataFormats/Candidate/interface/Candidate.h
"
38
#include "
RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h
"
39
#include "
RecoMuon/TrackingTools/interface/MuonServiceProxy.h
"
40
41
#include "HepPDT/defs.h"
42
#include "HepPDT/TableBuilder.hh"
43
#include "HepPDT/ParticleDataTable.hh"
44
45
#include "
DataFormats/HepMCCandidate/interface/GenParticleFwd.h
"
46
#include "HepMC/GenParticle.h"
47
#include "HepMC/GenEvent.h"
48
// #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
49
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
50
51
#include "
SimGeneral/HepPDTRecord/interface/ParticleDataTable.h
"
52
#include "
SimDataFormats/Track/interface/SimTrackContainer.h
"
53
#include "
SimDataFormats/Vertex/interface/SimVertexContainer.h
"
54
55
#include <CLHEP/Vector/LorentzVector.h>
56
57
#include "
DataFormats/Candidate/interface/LeafCandidate.h
"
58
59
#include "
Histograms.h
"
60
#include "
MuScleFitUtils.h
"
61
//
62
// class decleration
63
//
64
65
class
ResolutionAnalyzer
:
public
edm::EDAnalyzer
{
66
public
:
67
explicit
ResolutionAnalyzer
(
const
edm::ParameterSet
&);
68
~ResolutionAnalyzer
();
69
70
private
:
71
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&);
72
virtual
void
endJob
() {};
73
74
template
<
typename
T>
75
std::vector<reco::LeafCandidate>
fillMuonCollection
(
const
std::vector<T>&
tracks
) {
76
std::vector<reco::LeafCandidate>
muons
;
77
typename
std::vector<T>::const_iterator track;
78
for
(track = tracks.begin(); track != tracks.end(); ++track){
79
reco::Particle::LorentzVector
mu
(track->px(),track->py(),track->pz(),
80
sqrt
(track->p()*track->p() +
MuScleFitUtils::mMu2
));
81
MuScleFitUtils::goodmuon
++;
82
if
(
debug_
>0)
std::cout
<<std::setprecision(9)<<
"Muon #"
<<
MuScleFitUtils::goodmuon
83
<<
": initial value Pt = "
<< mu.Pt() << std::endl;
84
reco::LeafCandidate
muon
(track->charge(),
mu
);
85
// Store muon
86
// ----------
87
muons.push_back(
muon
);
88
}
89
return
muons
;
90
}
91
93
void
fillHistoMap
();
95
void
writeHistoMap
();
97
bool
checkDeltaR
(
const
reco::Particle::LorentzVector
& genMu,
const
reco::Particle::LorentzVector
& recMu);
98
99
// ----------member data ---------------------------
100
101
// Collections labels
102
// ------------------
103
edm::InputTag
theMuonLabel_
;
104
105
int
theMuonType_
;
106
std::string
theRootFileName_
;
107
std::string
theCovariancesRootFileName_
;
108
bool
debug_
;
109
std::map<std::string, Histograms*>
mapHisto_
;
110
TFile *
outputFile_
;
111
112
int
eventCounter_
;
113
bool
resonance_
;
114
bool
readCovariances_
;
115
116
TString
treeFileName_
;
117
int32_t
maxEvents_
;
118
119
double
ptMax_
;
120
121
HCovarianceVSxy
*
massResolutionVsPtEta_
;
122
TH2D *
recoPtVsgenPt_
;
123
TH2D *
recoPtVsgenPtEta12_
;
124
TH1D *
deltaPtOverPt_
;
125
TH1D *
deltaPtOverPtForEta12_
;
126
};
127
128
#endif // RESOLUTIONANALYZER_HH
ResolutionAnalyzer::eventCounter_
int eventCounter_
Definition:
ResolutionAnalyzer.h:112
reco::LeafCandidate
Definition:
LeafCandidate.h:16
ResolutionAnalyzer::maxEvents_
int32_t maxEvents_
Definition:
ResolutionAnalyzer.h:117
Histograms.h
ResolutionAnalyzer::mapHisto_
std::map< std::string, Histograms * > mapHisto_
Definition:
ResolutionAnalyzer.h:109
ResolutionAnalyzer::theRootFileName_
std::string theRootFileName_
Definition:
ResolutionAnalyzer.h:106
ResolutionAnalyzer::recoPtVsgenPtEta12_
TH2D * recoPtVsgenPtEta12_
Definition:
ResolutionAnalyzer.h:123
LeafCandidate.h
ResolutionAnalyzer::outputFile_
TFile * outputFile_
Definition:
ResolutionAnalyzer.h:110
MuonServiceProxy.h
Event.h
MakerMacros.h
ResolutionAnalyzer::~ResolutionAnalyzer
~ResolutionAnalyzer()
Definition:
ResolutionAnalyzer.cc:54
Frameworkfwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
MuonFwd.h
ParameterSet.h
Candidate.h
ParticleDataTable.h
ResolutionAnalyzer::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition:
ResolutionAnalyzer.h:75
ResolutionAnalyzer::massResolutionVsPtEta_
HCovarianceVSxy * massResolutionVsPtEta_
Definition:
ResolutionAnalyzer.h:121
ResolutionAnalyzer::fillHistoMap
void fillHistoMap()
Used to fill the map with the histograms needed.
Definition:
ResolutionAnalyzer.cc:420
MuonPatternRecoDumper.h
HCovarianceVSxy
Definition:
Histograms.h:1818
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:48
ResolutionAnalyzer::endJob
virtual void endJob()
Definition:
ResolutionAnalyzer.h:72
ResolutionAnalyzer::writeHistoMap
void writeHistoMap()
Writes the histograms in the map.
Definition:
ResolutionAnalyzer.cc:539
ResolutionAnalyzer::readCovariances_
bool readCovariances_
Definition:
ResolutionAnalyzer.h:114
ResolutionAnalyzer::treeFileName_
TString treeFileName_
Definition:
ResolutionAnalyzer.h:116
GenParticleFwd.h
ResolutionAnalyzer::theCovariancesRootFileName_
std::string theCovariancesRootFileName_
Definition:
ResolutionAnalyzer.h:107
edm::EventSetup
Definition:
EventSetup.h:45
RPCpg::mu
const int mu
Definition:
Constants.h:22
Muon.h
ResolutionAnalyzer::resonance_
bool resonance_
Definition:
ResolutionAnalyzer.h:113
ResolutionAnalyzer
Definition:
ResolutionAnalyzer.h:65
HepMCProduct.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:27
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:119
metsig::muon
Definition:
SignAlgoResolutions.h:40
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:197
MuScleFitUtils::mMu2
static const double mMu2
Definition:
MuScleFitUtils.h:122
SimTrackContainer.h
edm::InputTag
Definition:
InputTag.h:18
patZpeak.muons
tuple muons
Definition:
patZpeak.py:38
ResolutionAnalyzer::deltaPtOverPtForEta12_
TH1D * deltaPtOverPtForEta12_
Definition:
ResolutionAnalyzer.h:125
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
ResolutionAnalyzer::deltaPtOverPt_
TH1D * deltaPtOverPt_
Definition:
ResolutionAnalyzer.h:124
edm::Event
Definition:
Event.h:64
Track.h
ResolutionAnalyzer::recoPtVsgenPt_
TH2D * recoPtVsgenPt_
Definition:
ResolutionAnalyzer.h:122
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:21
ResolutionAnalyzer::debug_
bool debug_
Definition:
ResolutionAnalyzer.h:108
MuScleFitUtils.h
ResolutionAnalyzer::theMuonType_
int theMuonType_
Definition:
ResolutionAnalyzer.h:105
ResolutionAnalyzer::ResolutionAnalyzer
ResolutionAnalyzer(const edm::ParameterSet &)
Definition:
ResolutionAnalyzer.cc:19
SimVertexContainer.h
ResolutionAnalyzer::theMuonLabel_
edm::InputTag theMuonLabel_
Definition:
ResolutionAnalyzer.h:103
Generated for CMSSW Reference Manual by
1.8.5