Main Page
Namespaces
Classes
Package Documentation
MuonAnalysis
MomentumScaleCalibration
plugins
TestResolution.h
Go to the documentation of this file.
1
#ifndef TESTRESOLUTION_HH
2
#define TESTRESOLUTION_HH
3
4
// -*- C++ -*-
5
//
6
// Package: TestResolution
7
// Class: TestResolution
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 "
DataFormats/Candidate/interface/LeafCandidate.h
"
42
43
// For the momentum scale resolution
44
#include "
MuonAnalysis/MomentumScaleCalibration/interface/ResolutionFunction.h
"
45
46
#include "TFile.h"
47
#include "TProfile.h"
48
49
//
50
// class decleration
51
//
52
53
class
TestResolution
:
public
edm::EDAnalyzer
{
54
public
:
55
explicit
TestResolution
(
const
edm::ParameterSet
&);
56
~TestResolution
()
override
;
57
58
private
:
59
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
60
void
endJob
()
override
{};
61
template
<
typename
T>
62
std::vector<reco::LeafCandidate>
fillMuonCollection
(
const
std::vector<T>&
tracks
) {
63
std::vector<reco::LeafCandidate>
muons
;
64
typename
std::vector<T>::const_iterator
track
;
65
for
(track = tracks.begin(); track != tracks.end(); ++
track
) {
66
// Where 0.011163612 is the squared muon mass.
67
reco::Particle::LorentzVector
mu
(
68
track->px(), track->py(), track->pz(),
sqrt
(track->p() * track->p() + 0.011163612));
69
reco::LeafCandidate
muon
(track->charge(),
mu
);
70
// Store muon
71
// ----------
72
muons.push_back(
muon
);
73
}
74
return
muons
;
75
}
76
77
// ----------member data ---------------------------
78
79
// Collections labels
80
// ------------------
81
edm::InputTag
theMuonLabel_
;
82
edm::EDGetTokenT<reco::MuonCollection>
glbMuonsToken_
;
83
edm::EDGetTokenT<reco::TrackCollection>
saMuonsToken_
;
84
edm::EDGetTokenT<reco::TrackCollection>
tracksToken_
;
85
86
int
theMuonType_
;
87
std::string
theRootFileName_
;
88
TFile*
outputFile_
;
89
90
TProfile*
sigmaPt_
;
91
92
int
eventCounter_
;
93
94
std::unique_ptr<ResolutionFunction>
resolutionFunction_
;
95
};
96
97
#endif // TESTRESOLUTION_HH
reco::LeafCandidate
Definition:
LeafCandidate.h:16
TestResolution
Definition:
TestResolution.h:53
TestResolution::TestResolution
TestResolution(const edm::ParameterSet &)
Definition:
TestResolution.cc:20
LeafCandidate.h
TestResolution::eventCounter_
int eventCounter_
Definition:
TestResolution.h:92
MuonServiceProxy.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Event.h
TestResolution::saMuonsToken_
edm::EDGetTokenT< reco::TrackCollection > saMuonsToken_
Definition:
TestResolution.h:83
MakerMacros.h
amptDefaultParameters_cff.mu
mu
Definition:
amptDefaultParameters_cff.py:16
muon
Definition:
MuonCocktails.h:17
TestResolution::theRootFileName_
std::string theRootFileName_
Definition:
TestResolution.h:87
ResolutionFunction.h
edm::EDGetTokenT< reco::MuonCollection >
Frameworkfwd.h
MuonFwd.h
TestResolution::tracksToken_
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition:
TestResolution.h:84
TestResolution::outputFile_
TFile * outputFile_
Definition:
TestResolution.h:88
ParameterSet.h
TestResolution::theMuonType_
int theMuonType_
Definition:
TestResolution.h:86
PDWG_EXOHSCP_cff.tracks
tracks
Definition:
PDWG_EXOHSCP_cff.py:28
Candidate.h
MuonPatternRecoDumper.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
edm::EventSetup
Definition:
EventSetup.h:57
Muon.h
TestResolution::~TestResolution
~TestResolution() override
Definition:
TestResolution.cc:38
edm::EDAnalyzer
Definition:
EDAnalyzer.h:29
EDAnalyzer.h
TestResolution::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition:
TestResolution.h:62
HLT_2018_cff.muon
muon
Definition:
HLT_2018_cff.py:10336
TestResolution::sigmaPt_
TProfile * sigmaPt_
Definition:
TestResolution.h:90
edm::InputTag
Definition:
InputTag.h:15
TestResolution::glbMuonsToken_
edm::EDGetTokenT< reco::MuonCollection > glbMuonsToken_
Definition:
TestResolution.h:82
TestResolution::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
TestResolution.cc:63
TestResolution::endJob
void endJob() override
Definition:
TestResolution.h:60
edm::ParameterSet
Definition:
ParameterSet.h:36
PDWG_BPHSkim_cff.muons
muons
Definition:
PDWG_BPHSkim_cff.py:47
TestResolution::resolutionFunction_
std::unique_ptr< ResolutionFunction > resolutionFunction_
Definition:
TestResolution.h:94
TestResolution::theMuonLabel_
edm::InputTag theMuonLabel_
Definition:
TestResolution.h:81
edm::Event
Definition:
Event.h:72
Track.h
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:21
HLT_2018_cff.track
track
Definition:
HLT_2018_cff.py:10339
Generated for CMSSW Reference Manual by
1.8.11