CMS 3D CMS Logo

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
33 
40 
42 
43 // For the momentum scale resolution
45 
46 #include "TFile.h"
47 #include "TProfile.h"
48 
49 //
50 // class decleration
51 //
52 
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.
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  // ------------------
85 
88  TFile* outputFile_;
89 
90  TProfile* sigmaPt_;
91 
93 
94  std::unique_ptr<ResolutionFunction> resolutionFunction_;
95 };
96 
97 #endif // TESTRESOLUTION_HH
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
Muon.h
MuonPatternRecoDumper.h
muon
Definition: MuonCocktails.h:17
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm::EDGetTokenT< reco::MuonCollection >
TestResolution::TestResolution
TestResolution(const edm::ParameterSet &)
Definition: TestResolution.cc:22
TestResolution::resolutionFunction_
std::unique_ptr< ResolutionFunction > resolutionFunction_
Definition: TestResolution.h:94
EDAnalyzer.h
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
TestResolution::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition: TestResolution.h:62
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
TestResolution::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: TestResolution.cc:65
Track.h
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11710
MuonFwd.h
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ResolutionFunction.h
TestResolution
Definition: TestResolution.h:53
LeafCandidate.h
TestResolution::sigmaPt_
TProfile * sigmaPt_
Definition: TestResolution.h:90
TestResolution::eventCounter_
int eventCounter_
Definition: TestResolution.h:92
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TestResolution::glbMuonsToken_
edm::EDGetTokenT< reco::MuonCollection > glbMuonsToken_
Definition: TestResolution.h:82
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
TestResolution::theMuonLabel_
edm::InputTag theMuonLabel_
Definition: TestResolution.h:81
edm::EventSetup
Definition: EventSetup.h:58
TestResolution::saMuonsToken_
edm::EDGetTokenT< reco::TrackCollection > saMuonsToken_
Definition: TestResolution.h:83
Frameworkfwd.h
MuonServiceProxy.h
TestResolution::theRootFileName_
std::string theRootFileName_
Definition: TestResolution.h:87
reco::LeafCandidate
Definition: LeafCandidate.h:16
Candidate.h
ParameterSet.h
TestResolution::outputFile_
TFile * outputFile_
Definition: TestResolution.h:88
edm::Event
Definition: Event.h:73
TestResolution::~TestResolution
~TestResolution() override
Definition: TestResolution.cc:40
edm::InputTag
Definition: InputTag.h:15
TestResolution::endJob
void endJob() override
Definition: TestResolution.h:60
TestResolution::tracksToken_
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition: TestResolution.h:84
TestResolution::theMuonType_
int theMuonType_
Definition: TestResolution.h:86