CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Types | Private Attributes
TtSemiLRJetCombObservables Class Reference

Steering class for the overall top-lepton likelihood. More...

#include "TopQuarkAnalysis/TopLeptonSelection/interface/TtSemiLRJetCombObservables.h"

Public Types

typedef std::pair< unsigned
int, bool > 
IntBoolPair
 

Public Member Functions

void jetSource (const edm::InputTag &jetSource)
 
std::vector< IntBoolPairoperator() (TtSemiEvtSolution &, const edm::Event &iEvent, bool matchOnly=false)
 
 TtSemiLRJetCombObservables ()
 
 ~TtSemiLRJetCombObservables ()
 

Private Types

typedef std::pair< unsigned
int, double > 
IntDblPair
 

Private Attributes

std::vector< IntBoolPairevtselectVarMatch
 
std::vector< IntDblPairevtselectVarVal
 
edm::InputTag jetSource_
 

Detailed Description

Steering class for the overall top-lepton likelihood.

In this TtSemiLRJetCombObservables class a list of observables is calculated that might be used in the evaluation of the combined Likelihood ratio to distinguish between correct and wrong jet combinations obs1 : obs2 : obs3 : ...

Author
Jan Heyninck
Version
Id:
TtSemiLRJetCombObservables.h,v 1.6 2008/04/15 10:13:43 rwolf Exp

Definition at line 40 of file TtSemiLRJetCombObservables.h.

Member Typedef Documentation

typedef std::pair<unsigned int,bool> TtSemiLRJetCombObservables::IntBoolPair

Definition at line 44 of file TtSemiLRJetCombObservables.h.

typedef std::pair<unsigned int,double> TtSemiLRJetCombObservables::IntDblPair
private

Definition at line 55 of file TtSemiLRJetCombObservables.h.

Constructor & Destructor Documentation

TtSemiLRJetCombObservables::TtSemiLRJetCombObservables ( )

Definition at line 15 of file TtSemiLRJetCombObservables.cc.

15 {}
TtSemiLRJetCombObservables::~TtSemiLRJetCombObservables ( )

Definition at line 19 of file TtSemiLRJetCombObservables.cc.

19 {}

Member Function Documentation

void TtSemiLRJetCombObservables::jetSource ( const edm::InputTag jetSource)
inline

Definition at line 51 of file TtSemiLRJetCombObservables.h.

References jetSource(), and jetSource_.

Referenced by jetSource().

void jetSource(const edm::InputTag &jetSource)
std::vector< TtSemiLRJetCombObservables::IntBoolPair > TtSemiLRJetCombObservables::operator() ( TtSemiEvtSolution solution,
const edm::Event iEvent,
bool  matchOnly = false 
)

Definition at line 22 of file TtSemiLRJetCombObservables.cc.

References pat::Jet::bDiscriminator(), gather_cfg::cout, debug, evtselectVarMatch, evtselectVarVal, MCTruth::genEvent, edm::Event::getByLabel(), TtSemiEvtSolution::getCalHadb(), TtSemiEvtSolution::getCalHadp(), TtSemiEvtSolution::getCalHadq(), TtSemiEvtSolution::getCalHadt(), TtSemiEvtSolution::getCalHadW(), TtSemiEvtSolution::getCalLepb(), TtSemiEvtSolution::getCalLept(), TtSemiEvtSolution::getDecay(), TtSemiEvtSolution::getFitHadt(), TtSemiEvtSolution::getFitLepn(), TtSemiEvtSolution::getFitLept(), TtSemiEvtSolution::getGenHadb(), TtSemiEvtSolution::getGenHadp(), TtSemiEvtSolution::getGenHadq(), TtSemiEvtSolution::getGenHadt(), TtSemiEvtSolution::getGenHadW(), TtSemiEvtSolution::getGenLepb(), TtSemiEvtSolution::getGenLepl(), TtSemiEvtSolution::getGenLepn(), TtSemiEvtSolution::getGenLept(), TtSemiEvtSolution::getGenLepW(), TtSemiEvtSolution::getHadb(), TtSemiEvtSolution::getHadp(), TtSemiEvtSolution::getHadq(), TtSemiEvtSolution::getLepb(), TtSemiEvtSolution::getProbChi2(), TtSemiEvtSolution::getRecHadb(), TtSemiEvtSolution::getRecHadp(), TtSemiEvtSolution::getRecHadq(), TtSemiEvtSolution::getRecHadt(), TtSemiEvtSolution::getRecHadW(), TtSemiEvtSolution::getRecLepb(), TtSemiEvtSolution::getRecLepe(), TtSemiEvtSolution::getRecLepm(), TtSemiEvtSolution::getRecLepn(), TtSemiEvtSolution::getRecLept(), TtSemiEvtSolution::getRecLepW(), i, analyzePatCleaning_cfg::jets, jetSource_, reco::Particle::p4(), reco::LeafCandidate::p4(), reco::GsfElectron::p4(), reco::LeafCandidate::pt(), and TtSemiEvtSolution::setLRJetCombObservables().

23 {
24  bool debug=false;
25 
26  evtselectVarVal.clear();
27  evtselectVarMatch.clear();
28 
29  // Check whether the objects are matched:
30  bool matchHadt = false;
31  bool matchLept = false;
32  bool matchHadW = false;
33  bool matchLepW = false;
34  bool matchHadb = false;
35  bool matchLepb = false;
36  bool matchHadp = false;
37  bool matchHadq = false;
38  bool matchHadpq = false;
39  bool matchHadqp = false;
40  bool matchLepl = false;
41  bool matchLepn = false;
42 
43  if(debug) std::cout << "== start matching the objects " << std::endl;
44 
45  try {
46 
47  if(debug) std::cout << "== start trying " << std::endl;
48  double drLepl=0, drLepn=0, drHadb=0, drLepb=0, drHadp=0, drHadq=0, drHadpq=0, drHadqp=0, drHadt=0, drLept=0, drLepW=0, drHadW=0;
49 
51  iEvent.getByLabel ("genEvt",genEvent);
52  if(debug) std::cout << "== found genEvent " << std::endl;
53 
54  if (genEvent->isSemiLeptonic() && genEvent->numberOfBQuarks() == 2) {
55 
56  //if(debug) std::cout << "== genEvent->quarkFromAntiTop() " << genEvent->quarkFromAntiTop()->pt() << std::endl;
57  if(debug) std::cout << "== genEvent->isSemiLeptonic() && genEvent->numberOfBQuarks() == 2 " << std::endl;
58  if(debug) std::cout << "== solution.getDecay() == " <<solution.getDecay()<< std::endl;
59  if(debug) std::cout << "== solution.getRecLepm().pt() = " <<solution.getRecLepm().pt() << std::endl;
60  //if(debug) if(solution.getGenLepl() == 0) std::cout << "solution.getGenLepl() == NULL" << std::endl;
61  if(debug) std::cout << "== *(solution.getGenLept())" << solution.getGenLept()->pt() << std::endl;
62  if(debug) std::cout << "== *(solution.getGenLepl())" << solution.getGenLepl()->pt() << std::endl;
63  // std::cout << "Semilepton:\n";
64  // Match the lepton by deltaR
65  if (solution.getDecay() == "muon") drLepl = DeltaR<pat::Particle, reco::GenParticle>()(solution.getRecLepm(), *(solution.getGenLepl()));
66  if(debug) std::cout << "== matching lepton " << std::endl;
67  if (solution.getDecay() == "electron") drLepl = DeltaR<pat::Particle, reco::GenParticle>()(solution.getRecLepe(), *(solution.getGenLepl()));
68  matchLepl = (drLepl < 0.3);
69 
70  if(debug) std::cout << "== lepton is matched " << std::endl;
71  // Match the neutrino by deltaR
72  drLepn = DeltaR<pat::Particle, reco::GenParticle>()(solution.getRecLepn(), *(solution.getGenLepn()));
73  matchLepn = (drLepn < 0.3);
74 
75  // Match the hadronic b by deltaR
76  drHadb = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecHadb(), *(solution.getGenHadb()));
77  matchHadb = (drHadb < 0.3);
78 
79  // Match the hadronicleptonic b by deltaR
80  drLepb = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecLepb(), *(solution.getGenLepb()));
81  matchLepb = (drLepb < 0.3);
82 
83  // Match the hadronic p by deltaR
84  drHadp = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecHadp(), *(solution.getGenHadp()));
85  matchHadp = (drHadp < 0.3);
86 
87  // Match the hadronic pq by deltaR
88  drHadpq = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecHadp(), *(solution.getGenHadq()));
89  matchHadpq = (drHadpq < 0.3);
90 
91  // Match the hadronic q by deltaR
92  drHadq = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecHadq(), *(solution.getGenHadq()));
93  matchHadq = (drHadq < 0.3);
94 
95  // Match the hadronic qp by deltaR
96  drHadqp = DeltaR<pat::Jet, reco::GenParticle>()(solution.getRecHadq(), *(solution.getGenHadp()));
97  matchHadqp = (drHadqp < 0.3);
98 
99  // Match the hadronic W by deltaR
100  drHadW = DeltaR<reco::Particle, reco::GenParticle>()(solution.getRecHadW(), *(solution.getGenHadW()));
101  matchHadW = (drHadW < 0.3);
102 
103  // Match the leptonic W by deltaR
104  drLepW = DeltaR<reco::Particle, reco::GenParticle>()(solution.getRecLepW(), *(solution.getGenLepW()));
105  matchLepW = (drLepW < 0.3);
106 
107  // Match the hadronic t by deltaR
108  drHadt = DeltaR<reco::Particle, reco::GenParticle>()(solution.getRecHadt(), *(solution.getGenHadt()));
109  matchHadt = (drHadt < 0.3);
110 
111  // Match the leptonic t by deltaR
112  drLept = DeltaR<reco::Particle, reco::GenParticle>()(solution.getRecLept(), *(solution.getGenLept()));
113  matchLept = (drLept < 0.3);
114  }
115  } catch (...){std::cout << "Exception\n";}
116 
117  if(debug) std::cout << "== objects matched" <<std::endl;
118 
120  iEvent.getByLabel(jetSource_, jets);
121 
122  if(debug) std::cout << "== start calculating observables" << std::endl;
123 
124 
125  //obs1 : pt(had top)
126  double AverageTop =((solution.getHadb().p4()+solution.getHadq().p4()+solution.getHadp().p4()).pt()+(solution.getLepb().p4()+solution.getHadq().p4()+solution.getHadp().p4()).pt()+(solution.getHadb().p4()+solution.getLepb().p4()+solution.getHadp().p4()).pt()+(solution.getHadb().p4()+solution.getHadq().p4()+solution.getLepb().p4()).pt())/4.;
127  double Obs1 = ((solution.getHadb().p4()+solution.getHadq().p4()+solution.getHadp().p4()).pt())/AverageTop;
128  evtselectVarVal.push_back(IntDblPair(1,Obs1));
129  evtselectVarMatch.push_back(IntBoolPair(1, ((matchHadq&&matchHadp)||(matchHadpq&&matchHadqp))&&matchHadb));
130 
131  if(debug) std::cout << "== observable 1 " << Obs1 << std::endl;
132 
133  //obs2 : (pt_b1 + pt_b2)/(sum jetpt)
134  double Obs2 = (solution.getHadb().pt()+solution.getLepb().pt())/(solution.getHadp().pt()+solution.getHadq().pt());
135  evtselectVarVal.push_back(IntDblPair(2,Obs2));
136  evtselectVarMatch.push_back(IntBoolPair(2,((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
137 
138  if(debug) std::cout << "== observable 2 " << Obs2 << std::endl;
139 
140  //obs3: delta R between lep b and lepton
141  double Obs3 = -999;
142  if (solution.getDecay() == "muon") Obs3 = ROOT::Math::VectorUtil::DeltaR( solution.getLepb().p4(),solution.getRecLepm().p4() );
143  if (solution.getDecay() == "electron") Obs3 = ROOT::Math::VectorUtil::DeltaR( solution.getLepb().p4(),solution.getRecLepe().p4() );
144  evtselectVarVal.push_back(IntDblPair(3,Obs3));
145  evtselectVarMatch.push_back(IntBoolPair(3,matchLepb&&matchLepl));
146 
147  if(debug) std::cout << "== observable 3 " << Obs3 << std::endl;
148 
149  //obs4 : del R ( had b, had W)
150  double Obs4 = ROOT::Math::VectorUtil::DeltaR( solution.getHadb().p4(), solution.getHadq().p4()+solution.getHadp().p4() );
151  evtselectVarVal.push_back(IntDblPair(4,Obs4));
152  evtselectVarMatch.push_back(IntBoolPair(4,matchHadb&&((matchHadp&&matchHadp)||(matchHadpq&&matchHadqp))));
153 
154  if(debug) std::cout << "== observable 4 " << Obs4 << std::endl;
155 
156  //obs5 : del R between light quarkssolution.getHadp().phi(
157  double Obs5 = ROOT::Math::VectorUtil::DeltaR( solution.getHadq().p4(),solution.getHadp().p4() );
158  evtselectVarVal.push_back(IntDblPair(5,Obs5));
159  evtselectVarMatch.push_back(IntBoolPair(5,(matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
160 
161  if(debug) std::cout << "== observable 5 " << Obs5 << std::endl;
162 
163  //obs6 : b-tagging information
164  double Obs6 = 0;
165  if ( fabs(solution.getHadb().bDiscriminator("trackCountingJetTags") +10) < 0.0001 || fabs(solution.getLepb().bDiscriminator("trackCountingJetTags") +10)< 0.0001 ){
166  Obs6 = -10.;
167  } else {
168  Obs6 = (solution.getHadb().bDiscriminator("trackCountingJetTags")+solution.getLepb().bDiscriminator("trackCountingJetTags"));
169  }
170  evtselectVarVal.push_back(IntDblPair(6,Obs6));
171  evtselectVarMatch.push_back(IntBoolPair(6,1));
172 
173  if(debug) std::cout << "== observable 6 " << Obs6 << std::endl;
174 
175  //obs7 : chi2 value of kinematical fit with W-mass constraint
176  double Obs7 =0;
177  if(solution.getProbChi2() <0){Obs7 = -0;} else { Obs7 = log10(solution.getProbChi2()+.00001);}
178  evtselectVarVal.push_back(IntDblPair(7,Obs7));
179  evtselectVarMatch.push_back(IntBoolPair(7,((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
180 
181  if(debug) std::cout << "== observable 7 " << Obs7 << std::endl;
182 
183  //obs8(=7+1)
184  double Obs8 = solution.getCalHadt().p4().pt();
185  evtselectVarVal.push_back(IntDblPair(8,Obs8));
186  evtselectVarMatch.push_back(IntBoolPair(8, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
187 
188  if(debug) std::cout << "== observable 8 " << Obs8 << std::endl;
189 
190  //obs9
191  double Obs9 = fabs(solution.getCalHadt().p4().eta());
192  evtselectVarVal.push_back(IntDblPair(9,Obs9));
193  evtselectVarMatch.push_back(IntBoolPair(9, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
194 
195  if(debug) std::cout << "== observable 9 " << Obs9 << std::endl;
196 
197  //obs10
198  double Obs10 = solution.getCalHadt().p4().theta();
199  evtselectVarVal.push_back(IntDblPair(10,Obs10));
200  evtselectVarMatch.push_back(IntBoolPair(10, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
201 
202  if(debug) std::cout << "== observable 10 " << Obs10 << std::endl;
203 
204  //obs11
205  double Obs11 = solution.getCalHadW().p4().pt();
206  evtselectVarVal.push_back(IntDblPair(11,Obs11));
207  evtselectVarMatch.push_back(IntBoolPair(11, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
208 
209  if(debug) std::cout << "== observable 11 " << Obs11 << std::endl;
210 
211  //obs12
212  double Obs12 = fabs(solution.getCalHadW().p4().eta());
213  evtselectVarVal.push_back(IntDblPair(12,Obs12));
214  evtselectVarMatch.push_back(IntBoolPair(12, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
215 
216  if(debug) std::cout << "== observable 12 " << Obs12 << std::endl;
217 
218  //obs13
219  double Obs13 = solution.getCalHadW().p4().theta();
220  evtselectVarVal.push_back(IntDblPair(13,Obs13));
221  evtselectVarMatch.push_back(IntBoolPair(13, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
222 
223  if(debug) std::cout << "== observable 13 " << Obs13 << std::endl;
224 
225  //obs14
226  double Obs14 = solution.getCalHadb().p4().pt();
227  evtselectVarVal.push_back(IntDblPair(14,Obs14));
228  evtselectVarMatch.push_back(IntBoolPair(14, matchHadb));
229 
230  if(debug) std::cout << "== observable 14 " << Obs14 << std::endl;
231 
232  //obs15
233  double Obs15 = fabs(solution.getCalHadb().p4().eta());
234  evtselectVarVal.push_back(IntDblPair(15,Obs15));
235  evtselectVarMatch.push_back(IntBoolPair(15, matchHadb));
236 
237  if(debug) std::cout << "== observable 15 " << Obs15 << std::endl;
238 
239  //obs16
240  double Obs16 = solution.getCalHadb().p4().theta();
241  evtselectVarVal.push_back(IntDblPair(16,Obs16));
242  evtselectVarMatch.push_back(IntBoolPair(16, matchHadb));
243 
244  if(debug) std::cout << "== observable 16 " << Obs16 << std::endl;
245 
246  //obs17
247  double Obs17 = solution.getCalHadp().p4().pt();
248  evtselectVarVal.push_back(IntDblPair(17,Obs17));
249  evtselectVarMatch.push_back(IntBoolPair(17, matchHadp));
250 
251  if(debug) std::cout << "== observable 17 " << Obs17 << std::endl;
252 
253  //obs18
254  double Obs18 = fabs(solution.getCalHadp().p4().eta());
255  evtselectVarVal.push_back(IntDblPair(18,Obs18));
256  evtselectVarMatch.push_back(IntBoolPair(18, matchHadp));
257 
258  if(debug) std::cout << "== observable 18 " << Obs18 << std::endl;
259 
260  //obs19
261  double Obs19 = solution.getCalHadp().p4().theta();
262  evtselectVarVal.push_back(IntDblPair(19,Obs19));
263  evtselectVarMatch.push_back(IntBoolPair(19, matchHadp));
264 
265  if(debug) std::cout << "== observable 19 " << Obs19 << std::endl;
266 
267  //obs20
268  double Obs20 = solution.getCalHadq().p4().pt();
269  evtselectVarVal.push_back(IntDblPair(20,Obs20));
270  evtselectVarMatch.push_back(IntBoolPair(20, matchHadq));
271 
272  if(debug) std::cout << "== observable 20 " << Obs20 << std::endl;
273 
274  //obs21
275  double Obs21 = fabs(solution.getCalHadq().p4().eta());
276  evtselectVarVal.push_back(IntDblPair(21,Obs21));
277  evtselectVarMatch.push_back(IntBoolPair(21, matchHadq));
278 
279  if(debug) std::cout << "== observable 21 " << Obs21 << std::endl;
280 
281  //obs22
282  double Obs22 = solution.getCalHadq().p4().theta();
283  evtselectVarVal.push_back(IntDblPair(22,Obs22));
284  evtselectVarMatch.push_back(IntBoolPair(22, matchHadq));
285 
286  if(debug) std::cout << "== observable 22 " << Obs22 << std::endl;
287 
288  //obs23
289  double Obs23 = solution.getCalLept().p4().pt();
290  evtselectVarVal.push_back(IntDblPair(23,Obs23));
291  evtselectVarMatch.push_back(IntBoolPair(23, matchLepl&&matchLepn&&matchLepb));
292 
293  if(debug) std::cout << "== observable 23 " << Obs23 << std::endl;
294 
295  //obs24
296  double Obs24 = fabs(solution.getCalLept().p4().eta());
297  evtselectVarVal.push_back(IntDblPair(24,Obs24));
298  evtselectVarMatch.push_back(IntBoolPair(24, matchLepl&&matchLepn&&matchLepb));
299 
300  if(debug) std::cout << "== observable 24 " << Obs24 << std::endl;
301 
302  //obs25
303  double Obs25 = solution.getCalLept().p4().theta();
304  evtselectVarVal.push_back(IntDblPair(25,Obs25));
305  evtselectVarMatch.push_back(IntBoolPair(25, matchLepl&&matchLepn&&matchLepb));
306 
307  if(debug) std::cout << "== observable 25 " << Obs25 << std::endl;
308 
309  //obs26
310  double Obs26 = solution.getRecLepW().p4().pt();
311  evtselectVarVal.push_back(IntDblPair(26,Obs26));
312  evtselectVarMatch.push_back(IntBoolPair(26, matchLepl&&matchLepn));
313 
314  if(debug) std::cout << "== observable 26 " << Obs26 << std::endl;
315 
316  //obs27
317  double Obs27 = fabs(solution.getRecLepW().p4().eta());
318  evtselectVarVal.push_back(IntDblPair(27,Obs27));
319  evtselectVarMatch.push_back(IntBoolPair(27, matchLepl&&matchLepn));
320 
321  if(debug) std::cout << "== observable 27 " << Obs27 << std::endl;
322 
323  //obs28
324  double Obs28 = solution.getRecLepW().p4().theta();
325  evtselectVarVal.push_back(IntDblPair(28,Obs28));
326  evtselectVarMatch.push_back(IntBoolPair(28, matchLepl&&matchLepn));
327 
328  if(debug) std::cout << "== observable 28 " << Obs28 << std::endl;
329 
330  //obs29
331  double Obs29 = solution.getCalLepb().p4().pt();
332  evtselectVarVal.push_back(IntDblPair(29,Obs29));
333  evtselectVarMatch.push_back(IntBoolPair(29, matchLepb));
334 
335  if(debug) std::cout << "== observable 29 " << Obs29 << std::endl;
336 
337  //obs30
338  double Obs30 = fabs(solution.getCalLepb().p4().eta());
339  evtselectVarVal.push_back(IntDblPair(30,Obs30));
340  evtselectVarMatch.push_back(IntBoolPair(30, matchLepb));
341 
342  if(debug) std::cout << "== observable 30 " << Obs30 << std::endl;
343 
344  //obs31
345  double Obs31 = solution.getCalLepb().p4().theta();
346  evtselectVarVal.push_back(IntDblPair(31,Obs31));
347  evtselectVarMatch.push_back(IntBoolPair(31, matchLepb));
348 
349  if(debug) std::cout << "== observable 31 " << Obs31 << std::endl;
350 
351  //obs32
352  double Obs32 = -999.;
353  if (solution.getDecay() == "muon") Obs32 = solution.getRecLepm().p4().pt();
354  if (solution.getDecay() == "electron") Obs32 = solution.getRecLepe().p4().pt();
355  evtselectVarVal.push_back(IntDblPair(32,Obs32));
356  evtselectVarMatch.push_back(IntBoolPair(32, matchLepl));
357 
358  if(debug) std::cout << "== observable 32 " << Obs32 << std::endl;
359 
360  //obs33
361  double Obs33 = -999.;
362  if (solution.getDecay() == "muon") Obs33 = fabs(solution.getRecLepm().p4().eta());
363  if (solution.getDecay() == "electron") Obs33 = fabs(solution.getRecLepe().p4().eta());
364  evtselectVarVal.push_back(IntDblPair(33,Obs33));
365  evtselectVarMatch.push_back(IntBoolPair(33, matchLepl));
366 
367  if(debug) std::cout << "== observable 33 " << Obs33 << std::endl;
368 
369  //obs34
370  double Obs34 = -999.;
371  if (solution.getDecay() == "muon") Obs34 = fabs(solution.getRecLepm().p4().theta());
372  if (solution.getDecay() == "electron") Obs34 = fabs(solution.getRecLepe().p4().theta());
373  evtselectVarVal.push_back(IntDblPair(34,Obs34));
374  evtselectVarMatch.push_back(IntBoolPair(34, matchLepl));
375 
376  if(debug) std::cout << "== observable 34 " << Obs34 << std::endl;
377 
378  //obs35
379  double Obs35 = solution.getFitLepn().p4().pt();
380  evtselectVarVal.push_back(IntDblPair(35,Obs35));
381  evtselectVarMatch.push_back(IntBoolPair(35, matchLepn));
382 
383  if(debug) std::cout << "== observable 35 " << Obs35 << std::endl;
384 
385  //obs36
386  double Obs36 = fabs(solution.getFitLepn().p4().eta());
387  evtselectVarVal.push_back(IntDblPair(36,Obs36));
388  evtselectVarMatch.push_back(IntBoolPair(36, matchLepn));
389 
390  if(debug) std::cout << "== observable 36 " << Obs36 << std::endl;
391 
392  //obs37
393  double Obs37 = solution.getFitLepn().p4().theta();
394  evtselectVarVal.push_back(IntDblPair(37,Obs37));
395  evtselectVarMatch.push_back(IntBoolPair(37, matchLepn));
396 
397  if(debug) std::cout << "== observable 37 " << Obs37 << std::endl;
398 
399  // 2 particle kinematics
400  //obs38
401  double Obs38 = fabs(solution.getCalHadW().p4().phi()- solution.getRecLepW().p4().phi());
402  if (Obs38 > 3.1415927) Obs38 = 2*3.1415927 - Obs31;
403  if (Obs38 < -3.1415927) Obs38 = -2*3.1415927 - Obs31;
404  evtselectVarVal.push_back(IntDblPair(38,Obs38));
405  evtselectVarMatch.push_back(IntBoolPair(38, matchLepl&&matchLepn&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
406 
407  if(debug) std::cout << "== observable 38 " << Obs38 << std::endl;
408 
409  //obs39
410  double Obs39 = fabs(solution.getCalHadW().p4().eta()- solution.getRecLepW().p4().eta());
411  evtselectVarVal.push_back(IntDblPair(39,Obs39));
412  evtselectVarMatch.push_back(IntBoolPair(39, matchLepl&&matchLepn&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
413 
414  if(debug) std::cout << "== observable 39 " << Obs39 << std::endl;
415 
416  //obs40
417  double Obs40 = fabs(solution.getCalHadW().p4().theta()- solution.getRecLepW().p4().theta());
418  evtselectVarVal.push_back(IntDblPair(40,Obs40));
419  evtselectVarMatch.push_back(IntBoolPair(40, matchLepl&&matchLepn&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
420 
421  if(debug) std::cout << "== observable 40 " << Obs40 << std::endl;
422 
423  //obs41
424  double Obs41 = ROOT::Math::VectorUtil::DeltaR(solution.getCalHadW().p4(), solution.getRecLepW().p4());
425  evtselectVarVal.push_back(IntDblPair(41,Obs41));
426  evtselectVarMatch.push_back(IntBoolPair(41, matchLepl&&matchLepn&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
427 
428  if(debug) std::cout << "== observable 41 " << Obs41 << std::endl;
429 
430  //obs42
431  double Obs42 = fabs(solution.getCalHadb().p4().phi()- solution.getCalLepb().p4().phi());
432  if (Obs42 > 3.1415927) Obs42 = 2*3.1415927 - Obs42;
433  if (Obs42 < -3.1415927) Obs42 = -2*3.1415927 - Obs42;
434  evtselectVarVal.push_back(IntDblPair(42,Obs42));
435  evtselectVarMatch.push_back(IntBoolPair(42, matchHadb&&matchLepb));
436 
437  if(debug) std::cout << "== observable 42 " << Obs42 << std::endl;
438 
439  //obs43
440  double Obs43 = fabs(solution.getCalHadb().p4().eta()- solution.getCalLepb().p4().eta());
441  evtselectVarVal.push_back(IntDblPair(43,Obs43));
442  evtselectVarMatch.push_back(IntBoolPair(43, matchHadb&&matchLepb));
443 
444  if(debug) std::cout << "== observable 43 " << Obs43 << std::endl;
445 
446  //obs44
447  double Obs44 = fabs(solution.getCalHadb().p4().theta()- solution.getCalLepb().p4().theta());
448  evtselectVarVal.push_back(IntDblPair(44,Obs44));
449  evtselectVarMatch.push_back(IntBoolPair(44, matchHadb&&matchLepb));
450 
451  if(debug) std::cout << "== observable 44 " << Obs44 << std::endl;
452 
453  //obs45
454  double Obs45 = ROOT::Math::VectorUtil::DeltaR(solution.getCalHadb().p4(), solution.getCalLepb().p4());
455  evtselectVarVal.push_back(IntDblPair(45,Obs45));
456  evtselectVarMatch.push_back(IntBoolPair(45, matchHadb&&matchLepb));
457 
458  if(debug) std::cout << "== observable 45 " << Obs45 << std::endl;
459 
460  //obs46
461  double Obs46 = fabs(solution.getCalHadb().p4().phi()- solution.getCalHadW().p4().phi());
462  if (Obs46 > 3.1415927) Obs46 = 2*3.1415927 - Obs46;
463  if (Obs46 < -3.1415927) Obs46 = -2*3.1415927 - Obs46;
464  evtselectVarVal.push_back(IntDblPair(46,Obs46));
465  evtselectVarMatch.push_back(IntBoolPair(46, matchHadb&&((matchHadq&&matchHadp)||(matchHadpq&&matchHadqp))));
466 
467  if(debug) std::cout << "== observable 46 " << Obs46 << std::endl;
468 
469  //obs47
470  double Obs47 = fabs(solution.getCalHadb().p4().eta()- solution.getCalHadW().p4().eta());
471  evtselectVarVal.push_back(IntDblPair(47,Obs47));
472  evtselectVarMatch.push_back(IntBoolPair(47, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
473 
474  if(debug) std::cout << "== observable 47 " << Obs47 << std::endl;
475 
476  //obs48
477  double Obs48 = fabs(solution.getCalHadb().p4().theta()- solution.getCalHadW().p4().theta());
478  evtselectVarVal.push_back(IntDblPair(48,Obs48));
479  evtselectVarMatch.push_back(IntBoolPair(48, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
480 
481  if(debug) std::cout << "== observable 48 " << Obs48 << std::endl;
482 
483  //obs49
484  double Obs49 = ROOT::Math::VectorUtil::DeltaR(solution.getCalHadb().p4(), solution.getCalHadW().p4());
485  evtselectVarVal.push_back(IntDblPair(49,Obs49));
486  evtselectVarMatch.push_back(IntBoolPair(49, matchHadb&&((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))));
487 
488  if(debug) std::cout << "== observable 49 " << Obs49 << std::endl;
489 
490  //obs50
491  double Obs50 = fabs(solution.getCalLepb().p4().phi()- solution.getRecLepW().p4().phi());
492  if (Obs50 > 3.1415927) Obs50 = 2*3.1415927 - Obs50;
493  if (Obs50 < -3.1415927) Obs50 = -2*3.1415927 - Obs50;
494  evtselectVarVal.push_back(IntDblPair(50,Obs50));
495  evtselectVarMatch.push_back(IntBoolPair(50, matchLepb&&matchLepn&&matchLepl));
496 
497  if(debug) std::cout << "== observable 50 " << Obs50 << std::endl;
498 
499  //obs51
500  double Obs51 = fabs(solution.getCalLepb().p4().eta()- solution.getRecLepW().p4().eta());
501  evtselectVarVal.push_back(IntDblPair(51,Obs51));
502  evtselectVarMatch.push_back(IntBoolPair(51, matchLepb&&matchLepn&&matchLepl));
503 
504  if(debug) std::cout << "== observable 51 " << Obs51 << std::endl;
505 
506  //obs52
507  double Obs52 = fabs(solution.getCalLepb().p4().theta()- solution.getRecLepW().p4().theta());
508  evtselectVarVal.push_back(IntDblPair(52,Obs52));
509  evtselectVarMatch.push_back(IntBoolPair(52, matchLepb&&matchLepn&&matchLepl));
510 
511  if(debug) std::cout << "== observable 52 " << Obs52 << std::endl;
512 
513  //obs53
514  double Obs53 = ROOT::Math::VectorUtil::DeltaR(solution.getCalLepb().p4(), solution.getRecLepW().p4());
515  evtselectVarVal.push_back(IntDblPair(53,Obs53));
516  evtselectVarMatch.push_back(IntBoolPair(53, matchLepb&&matchLepn&&matchLepl));
517 
518  if(debug) std::cout << "== observable 53 " << Obs53 << std::endl;
519 
520  //obs54
521  double Obs54 = fabs(solution.getCalHadp().p4().phi()- solution.getCalHadq().p4().phi());
522  if (Obs54 > 3.1415927) Obs54 = 2*3.1415927 - Obs54;
523  if (Obs54 < -3.1415927) Obs54 = -2*3.1415927 - Obs54;
524  evtselectVarVal.push_back(IntDblPair(54,Obs54));
525  evtselectVarMatch.push_back(IntBoolPair(54, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
526 
527  if(debug) std::cout << "== observable 54 " << Obs54 << std::endl;
528 
529  //obs55
530  double Obs55 = fabs(solution.getCalHadp().p4().eta()- solution.getCalHadq().p4().eta());
531  evtselectVarVal.push_back(IntDblPair(55,Obs55));
532  evtselectVarMatch.push_back(IntBoolPair(55, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
533 
534  if(debug) std::cout << "== observable 55 " << Obs55 << std::endl;
535 
536  //obs56
537  double Obs56 = fabs(solution.getCalHadp().p4().theta()- solution.getCalHadq().p4().theta());
538  evtselectVarVal.push_back(IntDblPair(56,Obs56));
539  evtselectVarMatch.push_back(IntBoolPair(56, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
540 
541  if(debug) std::cout << "== observable 56 " << Obs56 << std::endl;
542 
543  //obs57
544  double Obs57 = ROOT::Math::VectorUtil::DeltaR(solution.getCalHadp().p4(), solution.getCalHadq().p4());
545  evtselectVarVal.push_back(IntDblPair(57,Obs57));
546  evtselectVarMatch.push_back(IntBoolPair(57, (matchHadp&&matchHadq)||(matchHadpq&&matchHadqp)));
547 
548  if(debug) std::cout << "== observable 57 " << Obs57 << std::endl;
549 
550  //obs58
551  double Obs58 = -999.;
552  if (solution.getDecay() == "muon") Obs58 = fabs(solution.getRecLepm().p4().phi()- solution.getRecLepn().p4().phi());
553  if (solution.getDecay() == "electron") Obs58 = fabs(solution.getRecLepe().p4().phi()- solution.getRecLepn().p4().phi());
554  if (Obs58 > 3.1415927) Obs58 = 2*3.1415927 - Obs58;
555  if (Obs58 < -3.1415927) Obs58 = -2*3.1415927 - Obs58;
556  evtselectVarVal.push_back(IntDblPair(58,Obs58));
557  evtselectVarMatch.push_back(IntBoolPair(58, matchLepl&&matchLepn));
558 
559  if(debug) std::cout << "== observable 58 " << Obs58 << std::endl;
560 
561  //obs59
562  double Obs59 = -999.;
563  if (solution.getDecay() == "muon") Obs59 = fabs(solution.getRecLepm().p4().eta()- solution.getRecLepn().p4().eta());
564  if (solution.getDecay() == "electron") Obs59 = fabs(solution.getRecLepe().p4().eta()- solution.getRecLepn().p4().eta());
565  evtselectVarVal.push_back(IntDblPair(59,Obs59));
566  evtselectVarMatch.push_back(IntBoolPair(59, matchLepl&&matchLepn));
567 
568  if(debug) std::cout << "== observable 59 " << Obs59 << std::endl;
569 
570  //obs60
571  double Obs60 = -999.;
572  if (solution.getDecay() == "muon") Obs60 = fabs(solution.getRecLepm().p4().theta()- solution.getRecLepn().p4().theta());
573  if (solution.getDecay() == "electron") Obs60 = fabs(solution.getRecLepe().p4().theta()- solution.getRecLepn().p4().theta());
574  evtselectVarVal.push_back(IntDblPair(60,Obs60));
575  evtselectVarMatch.push_back(IntBoolPair(60, matchLepl&&matchLepn));
576 
577  if(debug) std::cout << "== observable 60 " << Obs60 << std::endl;
578 
579  //obs61
580  double Obs61 = -999.;
581  if (solution.getDecay() == "muon") Obs61 = ROOT::Math::VectorUtil::DeltaR(solution.getRecLepm().p4(), solution.getRecLepn().p4());
582  if (solution.getDecay() == "electron") Obs61 = ROOT::Math::VectorUtil::DeltaR(solution.getRecLepe().p4(), solution.getRecLepn().p4());
583  evtselectVarVal.push_back(IntDblPair(61,Obs61));
584  evtselectVarMatch.push_back(IntBoolPair(61, matchLepl&&matchLepn));
585 
586  if(debug) std::cout << "== observable 61 " << Obs61 << std::endl;
587 
588  // miscellaneous event variables
589 
590 
591  //obs62
592  double Obs62 = ((jets->size() > 4 && (*jets)[3].p4().Et() > 0.00001) ? (*jets)[4].p4().Et() / (*jets)[3].p4().Et() : 1.0);
593  //double Obs62 = 1;
594  evtselectVarVal.push_back(IntDblPair(62,Obs62));
595  evtselectVarMatch.push_back(IntBoolPair(62, ((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
596 
597  if(debug) std::cout << "== observable 62 " << Obs62 << std::endl;
598 
599  float calJetsSumEt = 0;
600  for (unsigned int i = 4; i < jets->size(); i++) {
601  calJetsSumEt += (*jets)[i].p4().Et();
602  }
603 
604  //obs63
605  double Obs63_den = (jets->size() > 4) ? ((*jets)[0].p4().Et()+(*jets)[1].p4().Et()+(*jets)[2].p4().Et()+(*jets)[3].p4().Et()+(*jets)[4].p4().Et()) : 0.0;
606  double Obs63 = (Obs63_den > 0.00001) ? calJetsSumEt / Obs63_den : 1.0;
607  //double Obs63 =1;
608  evtselectVarVal.push_back(IntDblPair(63,Obs63));
609  evtselectVarMatch.push_back(IntBoolPair(63, ((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
610 
611  if(debug) std::cout << "== observable 63 " << Obs63 << std::endl;
612 
613  //obs64
614  double Obs64 = solution.getProbChi2();
615  evtselectVarVal.push_back(IntDblPair(64,Obs64));
616  evtselectVarMatch.push_back(IntBoolPair(64, ((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
617 
618  if(debug) std::cout << "== observable 64 " << Obs64 << std::endl;
619 
620  //obs65
621  double Obs65 = solution.getFitHadt().p4().mass() - solution.getCalHadt().p4().mass();
622  evtselectVarVal.push_back(IntDblPair(65,Obs65));
623  evtselectVarMatch.push_back(IntBoolPair(65, ((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
624 
625  if(debug) std::cout << "== observable 65 " << Obs65 << std::endl;
626 
627  //obs66
628  double Obs66 = solution.getFitLept().p4().mass() - solution.getCalLept().p4().mass();
629  evtselectVarVal.push_back(IntDblPair(66,Obs66));
630  evtselectVarMatch.push_back(IntBoolPair(66, ((matchHadp&&matchHadq)||(matchHadpq&&matchHadqp))&&matchHadb&&matchLepb));
631 
632  if(debug) std::cout << "observables calculated" << std::endl;
633 
634  if (!matchOnly) solution.setLRJetCombObservables(evtselectVarVal);
635  return evtselectVarMatch;
636 }
int i
Definition: DBlmapReader.cc:9
reco::Particle getCalHadW() const
pat::Jet getLepb() const
pat::Jet getRecLepb() const
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:196
std::pair< unsigned int, double > IntDblPair
reco::Particle getRecLept() const
pat::Jet getHadq() const
Definition: deltaR.h:51
pat::Jet getCalHadq() const
std::pair< unsigned int, bool > IntBoolPair
const reco::GenParticle * getGenLept() const
pat::Particle getFitLepn() const
std::vector< IntDblPair > evtselectVarVal
const reco::GenParticle * getGenLepW() const
reco::Particle getFitHadt() const
std::string getDecay() const
const reco::GenParticle * getGenHadq() const
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.h:65
reco::Particle getRecHadW() const
const reco::GenParticle * getGenLepb() const
pat::Jet getHadb() const
reco::Particle getRecHadt() const
pat::Electron getRecLepe() const
const reco::GenParticle * getGenHadp() const
pat::Jet getRecHadp() const
const reco::GenParticle * getGenHadb() const
pat::Jet getHadp() const
const reco::GenParticle * getGenLepl() const
reco::Particle getCalLept() const
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
Definition: Jet.cc:308
tuple genEvent
Definition: MCTruth.py:33
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
void setLRJetCombObservables(std::vector< std::pair< unsigned int, double > > varval)
pat::Jet getRecHadb() const
pat::Jet getCalHadb() const
const reco::GenParticle * getGenHadW() const
const reco::GenParticle * getGenHadt() const
virtual double pt() const
transverse momentum
pat::Jet getRecHadq() const
const reco::GenParticle * getGenLepn() const
pat::Muon getRecLepm() const
pat::Jet getCalLepb() const
tuple cout
Definition: gather_cfg.py:41
pat::MET getRecLepn() const
std::vector< IntBoolPair > evtselectVarMatch
#define debug
Definition: MEtoEDMFormat.h:34
reco::Particle getCalHadt() const
reco::Particle getRecLepW() const
double getProbChi2() const
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
reco::Particle getFitLept() const
pat::Jet getCalHadp() const

Member Data Documentation

std::vector< IntBoolPair > TtSemiLRJetCombObservables::evtselectVarMatch
private

Definition at line 61 of file TtSemiLRJetCombObservables.h.

Referenced by operator()().

std::vector< IntDblPair > TtSemiLRJetCombObservables::evtselectVarVal
private

Definition at line 60 of file TtSemiLRJetCombObservables.h.

Referenced by operator()().

edm::InputTag TtSemiLRJetCombObservables::jetSource_
private

Definition at line 58 of file TtSemiLRJetCombObservables.h.

Referenced by jetSource(), and operator()().