CMS 3D CMS Logo

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
33 
40 
41 #include "HepPDT/defs.h"
42 #include "HepPDT/TableBuilder.hh"
43 #include "HepPDT/ParticleDataTable.hh"
44 
46 #include "HepMC/GenParticle.h"
47 #include "HepMC/GenEvent.h"
48 // #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
50 
54 
55 #include <CLHEP/Vector/LorentzVector.h>
56 
58 
59 #include "Histograms.h"
60 #include "MuScleFitUtils.h"
61 //
62 // class decleration
63 //
64 
66 public:
67  explicit ResolutionAnalyzer(const edm::ParameterSet&);
68  ~ResolutionAnalyzer() override;
69 
70 private:
71  void analyze(const edm::Event&, const edm::EventSetup&) override;
72  void endJob() override{};
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) {
80  track->px(), track->py(), track->pz(), sqrt(track->p() * track->p() + MuScleFitUtils::mMu2));
82  if (debug_ > 0)
83  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();
99 
100  // ----------member data ---------------------------
101 
102  // Collections labels
103  // ------------------
105 
109  bool debug_;
110  std::map<std::string, Histograms*> mapHisto_;
111  TFile* outputFile_;
112 
116 
117  TString treeFileName_;
118  int32_t maxEvents_;
119 
120  double ptMax_;
121 
127 };
128 
129 #endif // RESOLUTIONANALYZER_HH
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
MuScleFitUtils.h
ResolutionAnalyzer::theRootFileName_
std::string theRootFileName_
Definition: ResolutionAnalyzer.h:107
ResolutionAnalyzer::ptMax_
double ptMax_
Definition: ResolutionAnalyzer.h:120
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
Muon.h
MuonPatternRecoDumper.h
ResolutionAnalyzer::deltaPtOverPtForEta12_
TH1D * deltaPtOverPtForEta12_
Definition: ResolutionAnalyzer.h:126
muon
Definition: MuonCocktails.h:17
ResolutionAnalyzer::fillHistoMap
void fillHistoMap()
Used to fill the map with the histograms needed.
Definition: ResolutionAnalyzer.cc:433
ResolutionAnalyzer::~ResolutionAnalyzer
~ResolutionAnalyzer() override
Definition: ResolutionAnalyzer.cc:52
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
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:578
ResolutionAnalyzer::mapHisto_
std::map< std::string, Histograms * > mapHisto_
Definition: ResolutionAnalyzer.h:110
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MuScleFitUtils::mMu2
static const double mMu2
Definition: MuScleFitUtils.h:139
ResolutionAnalyzer::massResolutionVsPtEta_
HCovarianceVSxy * massResolutionVsPtEta_
Definition: ResolutionAnalyzer.h:122
ResolutionAnalyzer::resonance_
bool resonance_
Definition: ResolutionAnalyzer.h:114
ResolutionAnalyzer::maxEvents_
int32_t maxEvents_
Definition: ResolutionAnalyzer.h:118
EDAnalyzer.h
ResolutionAnalyzer::endJob
void endJob() override
Definition: ResolutionAnalyzer.h:72
ResolutionAnalyzer::debug_
bool debug_
Definition: ResolutionAnalyzer.h:109
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
HCovarianceVSxy
Definition: Histograms.h:1906
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
ResolutionAnalyzer::outputFile_
TFile * outputFile_
Definition: ResolutionAnalyzer.h:111
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
GenParticleFwd.h
LeafCandidate.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ParticleDataTable.h
Histograms.h
ResolutionAnalyzer::readCovariances_
bool readCovariances_
Definition: ResolutionAnalyzer.h:115
ResolutionAnalyzer::ResolutionAnalyzer
ResolutionAnalyzer(const edm::ParameterSet &)
Definition: ResolutionAnalyzer.cc:19
ResolutionAnalyzer::theCovariancesRootFileName_
std::string theCovariancesRootFileName_
Definition: ResolutionAnalyzer.h:108
ResolutionAnalyzer
Definition: ResolutionAnalyzer.h:65
ResolutionAnalyzer::recoPtVsgenPt_
TH2D * recoPtVsgenPt_
Definition: ResolutionAnalyzer.h:123
edm::EventSetup
Definition: EventSetup.h:57
ResolutionAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ResolutionAnalyzer.cc:64
ResolutionAnalyzer::deltaPtOverPt_
TH1D * deltaPtOverPt_
Definition: ResolutionAnalyzer.h:125
ResolutionAnalyzer::theMuonType_
int theMuonType_
Definition: ResolutionAnalyzer.h:106
ResolutionAnalyzer::recoPtVsgenPtEta12_
TH2D * recoPtVsgenPtEta12_
Definition: ResolutionAnalyzer.h:124
ResolutionAnalyzer::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition: ResolutionAnalyzer.h:75
Frameworkfwd.h
MuonServiceProxy.h
ResolutionAnalyzer::eventCounter_
int eventCounter_
Definition: ResolutionAnalyzer.h:113
ResolutionAnalyzer::treeFileName_
TString treeFileName_
Definition: ResolutionAnalyzer.h:117
ResolutionAnalyzer::theMuonLabel_
edm::InputTag theMuonLabel_
Definition: ResolutionAnalyzer.h:104
reco::LeafCandidate
Definition: LeafCandidate.h:16
Candidate.h
ParameterSet.h
HepMCProduct.h
edm::Event
Definition: Event.h:73
SimTrackContainer.h
edm::InputTag
Definition: InputTag.h:15
SimVertexContainer.h
MuScleFitUtils::goodmuon
static int goodmuon
Definition: MuScleFitUtils.h:214
ResolutionAnalyzer::writeHistoMap
void writeHistoMap()
Writes the histograms in the map.
Definition: ResolutionAnalyzer.cc:565