test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 //
6 // Jet Tester class for heavy ion jets. for DQM jet analysis monitoring
7 // For CMSSW_7_5_X, especially reading background subtracted jets
8 // author: Raghav Kunnawalkam Elayavalli,
9 // April 6th 2015
10 // Rutgers University, email: raghav.k.e at CERN dot CH
11 //
12 // The logic for the matching is taken from Pawan Kumar Netrakanti's macro analysis level macro available here
13 // https://github.com/pawannetrakanti/UserCode/blob/master/JetRAA/jetmatch.C
14 //
15 
16 
17 #include <memory>
18 #include <fstream>
27 
35 
44 
50 
51 // include the basic jet for the PuPF jets.
54 // include the pf candidates
56 // include the voronoi subtraction
59 // include the centrality variables
61 
68 
73 #include <map>
74 #include <string>
75 #include <vector>
76 #include <algorithm>
77 #include <set>
78 #include <utility>
79 
80 
81 class MonitorElement;
82 
84  public:
85 
88 
89  void analyze(const edm::Event&, const edm::EventSetup&) override;
90  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
91 
92  // calojet1token = vscalo
93  // calojet2token = pucalo
94 
95  private:
96 
99 
104  double mRecoDelRMatch;
105  double mRecoJetEtaCut;
106 
107  //Tokens
113 
119 
127 
133 
141 
147 
148 
149  struct MyJet{
150  int id;
151  float pt;
152  float eta;
153  float phi;
154  };
155 
156 
157  typedef std::pair< MyJet, MyJet > ABJetPair;
158 
161  bool operator()(const ABJetPair &A1, const ABJetPair &A2){
162  MyJet jet1_pair1 = A1.first;
163  MyJet jet2_pair1 = A1.second;
164  MyJet jet1_pair2 = A2.first;
165  MyJet jet2_pair2 = A2.second;
166  float delr1 = deltaRR(jet1_pair1.eta, jet1_pair1.phi, jet2_pair1.eta, jet2_pair1.phi);
167  float delr2 = deltaRR(jet1_pair2.eta, jet1_pair2.phi, jet2_pair2.eta, jet2_pair2.phi);
168 
169  return ((delr1 < delr2) && (jet1_pair1.pt > jet1_pair2.pt));
170 
171  }
172  };
173 
174 
175  typedef std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets;
176  typedef std::multiset< ABJetPair >::iterator ABItr;
177 
178  static float deltaRR(float eta1, float phi1, float eta2, float phi2)
179  {
180  float deta = eta1 - eta2;
181  float dphi = fabs(phi1 - phi2);
182  if(dphi > M_PI )dphi -= 2*M_PI;
183  float dr = sqrt(deta*deta + dphi*dphi);
184  return dr;
185  }
186 
187 
188 
189 };
190 
191 
192 
193 #endif
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
std::multiset< ABJetPair, CompareMatchedJets > ABMatchedJets
void analyze(const edm::Event &, const edm::EventSetup &) override
T sqrt(T t)
Definition: SSEVec.h:18
bool operator()(const ABJetPair &A1, const ABJetPair &A2)
A-B jet match.
#define M_PI
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< reco::CaloJetCollection > caloJet1Token_
static float deltaRR(float eta1, float phi1, float eta2, float phi2)
JetAnalyzer_HeavyIons_matching(const edm::ParameterSet &)
std::multiset< ABJetPair >::iterator ABItr
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
edm::EDGetTokenT< reco::CaloJetCollection > caloJet2Token_
Definition: Run.h:43
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_