Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
();
57
58
private
:
59
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&);
60
virtual
void
endJob
() {};
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
(track->px(),track->py(),track->pz(),
68
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::auto_ptr<ResolutionFunction>
resolutionFunction_
;
95
};
96
97
#endif // TESTRESOLUTION_HH
reco::LeafCandidate
Definition:
LeafCandidate.h:21
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
Event.h
TestResolution::saMuonsToken_
edm::EDGetTokenT< reco::TrackCollection > saMuonsToken_
Definition:
TestResolution.h:83
MakerMacros.h
TestResolution::theRootFileName_
std::string theRootFileName_
Definition:
TestResolution.h:87
ResolutionFunction.h
edm::EDGetTokenT< reco::MuonCollection >
Frameworkfwd.h
TestResolution::~TestResolution
~TestResolution()
Definition:
TestResolution.cc:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
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
Candidate.h
TestResolution::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
TestResolution.cc:66
MuonPatternRecoDumper.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:48
TestResolution::resolutionFunction_
std::auto_ptr< ResolutionFunction > resolutionFunction_
Definition:
TestResolution.h:94
edm::EventSetup
Definition:
EventSetup.h:44
RPCpg::mu
const int mu
Definition:
Constants.h:22
Muon.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:25
EDAnalyzer.h
TestResolution::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition:
TestResolution.h:62
metsig::muon
Definition:
SignAlgoResolutions.h:40
testEve_cfg.tracks
tuple tracks
Definition:
testEve_cfg.py:39
TestResolution::sigmaPt_
TProfile * sigmaPt_
Definition:
TestResolution.h:90
edm::InputTag
Definition:
InputTag.h:17
patZpeak.muons
tuple muons
Definition:
patZpeak.py:38
TestResolution::glbMuonsToken_
edm::EDGetTokenT< reco::MuonCollection > glbMuonsToken_
Definition:
TestResolution.h:82
TestResolution::endJob
virtual void endJob()
Definition:
TestResolution.h:60
edm::ParameterSet
Definition:
ParameterSet.h:35
TestResolution::theMuonLabel_
edm::InputTag theMuonLabel_
Definition:
TestResolution.h:81
edm::Event
Definition:
Event.h:62
Track.h
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:27
Generated for CMSSW Reference Manual by
1.8.5