CMS 3D CMS Logo

JetAnalyzer_HeavyIons_matching.h
Go to the documentation of this file.
1 #ifndef JetAnalyzer_HeavyIons_matching_H
2 #define JetAnalyzer_HeavyIons_matching_H
3 
4 //
5 // Jet Tester class for heavy ion jets. for DQM jet analysis monitoring
6 // For CMSSW_7_5_X, especially reading background subtracted jets
7 // author: Raghav Kunnawalkam Elayavalli,
8 // April 6th 2015
9 // Rutgers University, email: raghav.k.e at CERN dot CH
10 //
11 // The logic for the matching is taken from Pawan Kumar Netrakanti's macro analysis level macro available here
12 // https://github.com/pawannetrakanti/UserCode/blob/master/JetRAA/jetmatch.C
13 //
14 
15 #include <memory>
16 #include <fstream>
24 
32 
41 
47 
48 // include the basic jet for the PuPF jets.
51 // include the pf candidates
53 // include the voronoi subtraction
56 // include the centrality variables
58 
65 
70 #include <map>
71 #include <string>
72 #include <vector>
73 #include <algorithm>
74 #include <set>
75 #include <utility>
76 
78 public:
81 
82  void analyze(const edm::Event &, const edm::EventSetup &) override;
83  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
84 
85  // calojet1token = vscalo
86  // calojet2token = pucalo
87 
88 private:
91 
98 
99  //Tokens
105 
111 
119 
125 
133 
139 
140  struct MyJet {
141  int id;
142  float pt;
143  float eta;
144  float phi;
145  };
146 
147  typedef std::pair<MyJet, MyJet> ABJetPair;
148 
151  bool operator()(const ABJetPair &A1, const ABJetPair &A2) const {
152  MyJet jet1_pair1 = A1.first;
153  MyJet jet2_pair1 = A1.second;
154  MyJet jet1_pair2 = A2.first;
155  MyJet jet2_pair2 = A2.second;
156  float delr1 = deltaRR(jet1_pair1.eta, jet1_pair1.phi, jet2_pair1.eta, jet2_pair1.phi);
157  float delr2 = deltaRR(jet1_pair2.eta, jet1_pair2.phi, jet2_pair2.eta, jet2_pair2.phi);
158 
159  return ((delr1 < delr2) && (jet1_pair1.pt > jet1_pair2.pt));
160  }
161  };
162 
163  typedef std::multiset<ABJetPair, CompareMatchedJets> ABMatchedJets;
164  typedef std::multiset<ABJetPair>::iterator ABItr;
165 
166  static float deltaRR(float eta1, float phi1, float eta2, float phi2) {
167  float deta = eta1 - eta2;
168  float dphi = fabs(phi1 - phi2);
169  if (dphi > M_PI)
170  dphi -= 2 * M_PI;
171  float dr = sqrt(deta * deta + dphi * dphi);
172  return dr;
173  }
174 };
175 
176 #endif
JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet1_unmatched
MonitorElement * mChargedMuEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:118
JetAnalyzer_HeavyIons_matching::caloJet1Token_
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
Definition: JetAnalyzer_HeavyIons_matching.h:100
dqm::impl::MonitorElement
Definition: MonitorElement.h:99
CaloJetCollection.h
GenJetCollection.h
CaloJet.h
JetAnalyzer_HeavyIons_matching::mpT_Jet2_unmatched
MonitorElement * mpT_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:110
CaloTower.h
JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet2_unmatched
MonitorElement * mChargedHadEnergyFraction_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:134
DcsStatus.h
TriggerResults.h
PFJetIDSelectionFunctor.h
PFCandidate.h
JetAnalyzer_HeavyIons_matching::CompareMatchedJets::operator()
bool operator()(const ABJetPair &A1, const ABJetPair &A2) const
A-B jet match.
Definition: JetAnalyzer_HeavyIons_matching.h:151
edm::Run
Definition: Run.h:45
JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet1_unmatched
MonitorElement * mEmEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:113
TriggerEvent.h
JetAnalyzer_HeavyIons_matching::mRecoJetPtThreshold
double mRecoJetPtThreshold
Definition: JetAnalyzer_HeavyIons_matching.h:95
edm::EDGetTokenT< reco::CaloJetCollection >
JetCorrector.h
JetAnalyzer_HeavyIons_matching::mChargedMuEnergy_Jet2_unmatched
MonitorElement * mChargedMuEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:132
PFJet.h
JetAnalyzer_HeavyIons_matching::jptJetsToken_
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
Definition: JetAnalyzer_HeavyIons_matching.h:104
JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet2_unmatched
MonitorElement * mChargedHadronEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:128
JetAnalyzer_HeavyIons_matching::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: JetAnalyzer_HeavyIons_matching.cc:93
JetMETDQMDCSFilter.h
JetAnalyzer_HeavyIons_matching::CompareMatchedJets
Definition: JetAnalyzer_HeavyIons_matching.h:149
TriggerTypeDefs.h
BasicJetCollection.h
DQMStore.h
Jet.h
JetAnalyzer_HeavyIons_matching::pfJetsToken_
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
Definition: JetAnalyzer_HeavyIons_matching.h:102
EDAnalyzer.h
VoronoiBackground.h
JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet1_unmatched
MonitorElement * mElectronEnergyFraction_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:123
JetIDHelper.h
JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet2_unmatched
MonitorElement * mChargedEmEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:130
JetAnalyzer_HeavyIons_matching::caloJet2Token_
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
Definition: JetAnalyzer_HeavyIons_matching.h:101
JetAnalyzer_HeavyIons_matching::mInputJet1Collection
edm::InputTag mInputJet1Collection
Definition: JetAnalyzer_HeavyIons_matching.h:89
JetAnalyzer_HeavyIons_matching::MyJet::eta
float eta
Definition: JetAnalyzer_HeavyIons_matching.h:143
JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet1_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:121
JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet1_unmatched
MonitorElement * mPhotonEnergyFraction_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:122
JetAnalyzer_HeavyIons_matching::mOutputFile
std::string mOutputFile
Definition: JetAnalyzer_HeavyIons_matching.h:92
JetAnalyzer_HeavyIons_matching::JetType2
std::string JetType2
Definition: JetAnalyzer_HeavyIons_matching.h:94
CandidateFwd.h
JetAnalyzer_HeavyIons_matching::mInputJet2Collection
edm::InputTag mInputJet2Collection
Definition: JetAnalyzer_HeavyIons_matching.h:90
JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet1_unmatched
MonitorElement * mNeutralEmEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:117
CandidateWithRef.h
JetAnalyzer_HeavyIons_matching::~JetAnalyzer_HeavyIons_matching
~JetAnalyzer_HeavyIons_matching() override
Definition: JetAnalyzer_HeavyIons_matching.cc:189
JetAnalyzer_HeavyIons_matching::mpT_Jet1_matched
MonitorElement * mpT_Jet1_matched
Definition: JetAnalyzer_HeavyIons_matching.h:107
MakerMacros.h
JetAnalyzer_HeavyIons_matching::deltaRR
static float deltaRR(float eta1, float phi1, float eta2, float phi2)
Definition: JetAnalyzer_HeavyIons_matching.h:166
JetAnalyzer_HeavyIons_matching::mChargedHadronEnergy_Jet1_unmatched
MonitorElement * mChargedHadronEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:114
JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet1_unmatched
MonitorElement * mHadEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:112
Service.h
Centrality.h
GenericTriggerEventFlag.h
JetAnalyzer_HeavyIons_matching::mNeutralHadEnergyFraction_Jet2_unmatched
MonitorElement * mNeutralHadEnergyFraction_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:135
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLT_FULL_cff.eta2
eta2
Definition: HLT_FULL_cff.py:9551
EDGetToken.h
JetAnalyzer_HeavyIons_matching::mpT_Jet2_matched
MonitorElement * mpT_Jet2_matched
Definition: JetAnalyzer_HeavyIons_matching.h:108
JPTJetCollection.h
JetAnalyzer_HeavyIons_matching::mElectronEnergyFraction_Jet2_unmatched
MonitorElement * mElectronEnergyFraction_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:137
DQMEDAnalyzer.h
HLT_FULL_cff.eta1
eta1
Definition: HLT_FULL_cff.py:9550
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet2_unmatched
MonitorElement * mMuonEnergyFraction_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:138
JetAnalyzer_HeavyIons_matching::mNeutralEmEnergy_Jet2_unmatched
MonitorElement * mNeutralEmEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:131
edm::ParameterSet
Definition: ParameterSet.h:47
JetAnalyzer_HeavyIons_matching::ABJetPair
std::pair< MyJet, MyJet > ABJetPair
Definition: JetAnalyzer_HeavyIons_matching.h:147
Event.h
JetAnalyzer_HeavyIons_matching::mChargedHadEnergyFraction_Jet1_unmatched
MonitorElement * mChargedHadEnergyFraction_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:120
JetAnalyzer_HeavyIons_matching::mHadEnergy_Jet2_unmatched
MonitorElement * mHadEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:126
JetAnalyzer_HeavyIons_matching::basicJetsToken_
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_
Definition: JetAnalyzer_HeavyIons_matching.h:103
JetAnalyzer_HeavyIons_matching::JetType1
std::string JetType1
Definition: JetAnalyzer_HeavyIons_matching.h:93
JetAnalyzer_HeavyIons_matching::MyJet::pt
float pt
Definition: JetAnalyzer_HeavyIons_matching.h:142
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
JetAnalyzer_HeavyIons_matching::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: JetAnalyzer_HeavyIons_matching.cc:212
JetAnalyzer_HeavyIons_matching::JetAnalyzer_HeavyIons_matching
JetAnalyzer_HeavyIons_matching(const edm::ParameterSet &)
Definition: JetAnalyzer_HeavyIons_matching.cc:17
edm::EventSetup
Definition: EventSetup.h:58
HLTConfigProvider.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TriggerObject.h
JetAnalyzer_HeavyIons_matching::mRecoDelRMatch
double mRecoDelRMatch
Definition: JetAnalyzer_HeavyIons_matching.h:96
CaloTowerCollection.h
VertexFwd.h
JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet2_unmatched
MonitorElement * mNeutralHadronEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:129
JetAnalyzer_HeavyIons_matching::MyJet::id
int id
Definition: JetAnalyzer_HeavyIons_matching.h:141
JetAnalyzer_HeavyIons_matching::mNeutralHadronEnergy_Jet1_unmatched
MonitorElement * mNeutralHadronEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:115
JetAnalyzer_HeavyIons_matching::mpT_ratio_Jet1Jet2
MonitorElement * mpT_ratio_Jet1Jet2
Definition: JetAnalyzer_HeavyIons_matching.h:106
Vertex.h
JetAnalyzer_HeavyIons_matching::mRecoJetEtaCut
double mRecoJetEtaCut
Definition: JetAnalyzer_HeavyIons_matching.h:97
DetId.h
Frameworkfwd.h
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
JetAnalyzer_HeavyIons_matching::mpT_Jet1_unmatched
MonitorElement * mpT_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:109
BasicJet.h
UEParameters.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
JetAnalyzer_HeavyIons_matching::MyJet::phi
float phi
Definition: JetAnalyzer_HeavyIons_matching.h:144
GenJet.h
Candidate.h
ParameterSet.h
JetAnalyzer_HeavyIons_matching::mEmEnergy_Jet2_unmatched
MonitorElement * mEmEnergy_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:127
JetAnalyzer_HeavyIons_matching::MyJet
Definition: JetAnalyzer_HeavyIons_matching.h:140
edm::Event
Definition: Event.h:73
JetAnalyzer_HeavyIons_matching::ABItr
std::multiset< ABJetPair >::iterator ABItr
Definition: JetAnalyzer_HeavyIons_matching.h:164
JetAnalyzer_HeavyIons_matching::ABMatchedJets
std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets
Definition: JetAnalyzer_HeavyIons_matching.h:163
edm::InputTag
Definition: InputTag.h:15
JetAnalyzer_HeavyIons_matching::mPhotonEnergyFraction_Jet2_unmatched
MonitorElement * mPhotonEnergyFraction_Jet2_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:136
JetAnalyzer_HeavyIons_matching::mChargedEmEnergy_Jet1_unmatched
MonitorElement * mChargedEmEnergy_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:116
JPTJet.h
JetAnalyzer_HeavyIons_matching::mMuonEnergyFraction_Jet1_unmatched
MonitorElement * mMuonEnergyFraction_Jet1_unmatched
Definition: JetAnalyzer_HeavyIons_matching.h:124
JetAnalyzer_HeavyIons_matching
Definition: JetAnalyzer_HeavyIons_matching.h:77
JetIDSelectionFunctor.h