CMS 3D CMS Logo

TtSemiLepSignalSel.cc
Go to the documentation of this file.
2 #include "TVector3.h"
3 
5 
6 TtSemiLepSignalSel::TtSemiLepSignalSel(const std::vector<pat::Jet>& topJets, const math::XYZTLorentzVector& lepton,
8 { //function
9 
10  unsigned int nJetsMax = topJets.size();
11 
12  var_MET = MET.begin()->et();
13  var_sumEt = 0.;
14 
15  math::XYZTLorentzVector Jetsum(0.,0.,0.,0.);
16 
17  for(unsigned int i=0; i<nJetsMax; i++) {
18  math::XYZTLorentzVector aJet = topJets[i].p4();
19  Jetsum += aJet;
20  var_sumEt += topJets[i].et();
21  }
22  massalljets = Jetsum.M();
23 
24  var_lepeta = lepton.Eta();
25 
26  math::XYZTLorentzVector Met = MET.begin()->p4();
28  double Etjet[4];
29  double Jetjet[6];
30  double dijetmass;
31  var_mindijetmass = 99999.;
32  var_maxdijetmass = -1.;
33  int counter = 0;
34  for(int i=0; i<4; i++) {
35  math::XYZTLorentzVector aJet = topJets[i].p4();
36  Etjet[i] = aJet.Et();
37  for(int j=i+1; j<4; j++) {
38  math::XYZTLorentzVector asecJet = topJets[j].p4();
39  dijetmass = (aJet+asecJet).M();
40  if(dijetmass<var_mindijetmass) var_mindijetmass = dijetmass;
41  if(dijetmass>var_maxdijetmass) var_maxdijetmass = dijetmass;
42  counter++;
43  }
44  }
45 
46  var_Et1 = Etjet[0];
47 
48  var_dphiMETlepton = DeltaPhi(Met,Lep);
49 
50 
51 
52  counter=0;
53  for(int i=0; i<4; i++) {
54  math::XYZTLorentzVector aJet = topJets[i].p4();
55  for(int j=i+1; j<4; j++) {
56  math::XYZTLorentzVector asecJet = topJets[j].p4();
57  Jetjet[counter] = fabs(aJet.Eta()-asecJet.Eta());
58  counter++;
59  }
60  }
61 
62  var_detajet2jet3 = Jetjet[3];
63  var_detajet3jet4 = Jetjet[5];
64 
65 
66  double Lepjet[4];
67  var_mindRjetlepton = 99999.;
68  for(int i=0; i<4; i++) {
69  math::XYZTLorentzVector aJet = topJets[i].p4();
70  Lepjet[i] = DeltaR(Lep,aJet);
71  if(Lepjet[i]<var_mindRjetlepton) var_mindRjetlepton = Lepjet[i];
72  }
73 
74 }
75 
77 {
78  double dPhi = fabs(v1.Phi() - v2.Phi());
79  if (dPhi > TMath::Pi()) dPhi = 2*TMath::Pi() - dPhi;
80  return dPhi;
81 }
82 
84 {
85  double dPhi = DeltaPhi(v1,v2);
86  double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
87  return dR;
88 }
89 
91 {
92 }
const double Pi
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const_iterator begin() const
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
double DeltaR(const math::XYZTLorentzVector &, const math::XYZTLorentzVector &)
static std::atomic< unsigned int > counter
double DeltaPhi(const math::XYZTLorentzVector &, const math::XYZTLorentzVector &)
static const std::string Lep