ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TtresdRmin Class Reference

#include <TtresdRmin.h>

Collaboration diagram for TtresdRmin:

Public Member Functions

 TtresdRmin (TString units="GeV", bool verbose=false)
 Class constructor. More...
 
virtual ~TtresdRmin ()
 Class destructor. More...
 
void Init (double highJetMass=60.0, double minJetPt=25.0, double dRCutOffset=2.5, double dRCutMassFactor=0.015)
 Initialize the tool, giving specific parameters needed for dRmin cut Paramters are given in GeV scale, will be scaled internally to MeV if set. More...
 
bool SetupEvent (vector< TLorentzVector * > &jets, TLorentzVector &lepton, TLorentzVector &neutrino)
 Set the objects needed to calculate the invariant ttbar mass. More...
 
vector< int > GetJetIndices ()
 Get jet indicices identified by dRmin method, used for mtt reconstruction. More...
 
int GetHighMassJetIndex ()
 Get index of jet with highest mass. More...
 
double GetHighestJetMass ()
 Get highest jet mass found in jet vector. More...
 
void SetHighMThreshold (double highJetMass)
 Set threshold for highMass case. More...
 
double GetMttdRmin ()
 Get calculated invariant ttbar mass for dRmin method. More...
 
TLorentzVector GetTlvdRmin ()
 Get the TLorentzVector for the ttbar system. More...
 

Private Member Functions

bool FindJetIndices_HM ()
 Find the jet indices used for mtt reconstruction for events containing a high mass jet. More...
 
bool FindJetIndices_LM ()
 Find the jet indices used for mtt reconstruction for events NOT containing a high mass jet. More...
 

Private Attributes

bool m_init
 Flag of initialization status of tool. More...
 
bool m_verbose
 Flag for verbosity level. More...
 
double m_highM
 Jet mass threshold to identify it as a "high mass jet". More...
 
double m_Units
 Unit factor used, GeV = 1, MeV = 1000. More...
 
double m_minJetPt
 Minimum jet pT used for highM jet search. More...
 
double m_dRCutOffset
 Offset of dRmin specific cut on jet_dR. More...
 
double m_dRCutMassFactor
 Jet mass factor of dRmin specific cut on jet_dR. More...
 
int m_highMassJetIndex
 Index of highest mass jet for current event. More...
 
double m_highestJetMass
 Highest jet mass found for current event. More...
 
vector< TLorentzVector * > m_jets
 Input vector of jet objects. More...
 
TLorentzVector m_lepton
 Input lepton object. More...
 
TLorentzVector m_neutrino
 Input neutrino object. More...
 
TLorentzVector m_Wleptonic
 leptonic W object reconstructed from lepton and neutrino More...
 
vector< int > m_jet_indices
 Indices of jets used for reconstruction of invariant ttbar mass. More...
 

Detailed Description

Definition at line 16 of file TtresdRmin.h.

Constructor & Destructor Documentation

◆ TtresdRmin()

TtresdRmin::TtresdRmin ( TString  units = "GeV",
bool  verbose = false 
)

Class constructor.

Set unit used in four momentum vector calculations

Parameters
units: Unit used for reconstruction, MeV or GeV

Definition at line 35 of file TtresdRmin.cxx.

35  {
36  m_init = false;
38 
39  if (units == "MeV") {
40  m_Units = 1000.0;
41  } else if (units == "GeV") {
42  m_Units = 1.0;
43  } else {
44  cout << " ERROR in in TtresdRmin :: Unit setting '" << units << "' doest not match pattern of GeV or MeV" << endl;
45  }
46 }

◆ ~TtresdRmin()

virtual TtresdRmin::~TtresdRmin ( )
inlinevirtual

Class destructor.

Definition at line 31 of file TtresdRmin.h.

31 {};

Member Function Documentation

◆ FindJetIndices_HM()

bool TtresdRmin::FindJetIndices_HM ( )
private

Find the jet indices used for mtt reconstruction for events containing a high mass jet.

Returns
bool : success of function

Definition at line 153 of file TtresdRmin.cxx.

153  {
154  //===== Find closest jet to high mass jet =====
155  double dR_had = 999.9;
156  int closest_jetIdx_had = -1;
157 
158  //Loop m_jets
159  for (int ijet = 0; ijet < (int) m_jets.size(); ijet++) {
160  if (ijet == m_highMassJetIndex) continue; //next jet
161  double dR = m_jets.at(m_highMassJetIndex)->DeltaR(*(m_jets.at(ijet)));
162  if (dR < dR_had) {
163  closest_jetIdx_had = ijet;
164  dR_had = dR;
165  }
166  }//end of jet loop
167 
168 
169  //===== Find closest jet to leptonic W-boson =====
170  double dR_lep = 999.9;
171  int closest_jetIdx_lep = -1;
172 
173  //Loop jets
174  for (int ijet = 0; ijet < (int) m_jets.size(); ijet++) {
175  if (ijet == m_highMassJetIndex) continue; //next jet
176  if (ijet == closest_jetIdx_had) continue; //next jet
177  double dR = m_Wleptonic.DeltaR(*(m_jets.at(ijet)));
178  if (dR < dR_lep) {
179  closest_jetIdx_lep = ijet;
180  dR_lep = dR;
181  }
182  }//end of jet loop
183 
184  //===== Save jet indices used for reconstruction =====
186 
187  if (closest_jetIdx_had >= 0) {
188  m_jet_indices.push_back(closest_jetIdx_had);
189  } else {
190  if (m_verbose) cout << " WARNING in TtresdRmin :: Can not find jet close to high mass jet" << endl;
191  }
192 
193  if (closest_jetIdx_lep >= 0) {
194  m_jet_indices.push_back(closest_jetIdx_lep);
195  } else {
196  if (m_verbose) cout << " WARNING in TtresdRmin :: Can not find jet close to leptonic W-boson" << endl;
197  }
198 
199  return true;
200 }

◆ FindJetIndices_LM()

bool TtresdRmin::FindJetIndices_LM ( )
private

Find the jet indices used for mtt reconstruction for events NOT containing a high mass jet.

Returns
bool : success of function

Definition at line 205 of file TtresdRmin.cxx.

205  {
206  //jetflag vector to flag jets rejected by dRmin method
207  vector<bool> jetflags(m_jets.size(), true);
208 
209  //do dRmin procedure if at least 4 jets are available
210  bool repeat_dRmin = ((int) m_jets.size() > 3);
211 
212  //Loop dRmin method
213  while (repeat_dRmin) {
214  repeat_dRmin = false;
215 
216  double dR_max = 0.0; //Maximum dR passing dRmin cut requirement
217  int index_max = -1; //Index of jet with dR_max
218 
219  //Number of goodflagged processed jets (outer loop)
220  int nijet = 0;
221 
222  //Outer jet loop
223  for (int ijet = 0; ijet < (int) m_jets.size(); ijet++) {
224  if (!jetflags.at(ijet)) continue; //next outer jet
225 
226  //Use maximum of 4 goodflagged jets
227  if (nijet > 3) break;
228  nijet++;
229 
230  double dR_min = 999.9;
231 
232  double dR_lep = m_jets.at(ijet)->DeltaR(m_lepton);
233  dR_min = dR_lep;
234 
235  //Number of goodflagged processed jets (inner loop)
236  int njjet = 0;
237 
238  //Inner jet loop
239  for (int jjet = 0; jjet < (int) m_jets.size(); jjet++) {
240  if (!jetflags.at(jjet)) continue; //next inner jet
241 
242  //Use maximum of 4 goodflagged jets
243  if (njjet > 3) break;
244  njjet++;
245 
246  if (jjet == ijet) continue; //next inner jet
247 
248  double dR_jet = m_jets.at(ijet)->DeltaR(*(m_jets.at(jjet)));
249  if (dR_jet < dR_min) {
250  dR_min = dR_jet;
251  }
252  } //end of inner jet loop
253 
254  if (dR_min > dR_max) {
255  //dRmin specific cut (defined for GeV, needs m_Units correction on mass)
256  double dR_cut = m_dRCutOffset - m_dRCutMassFactor * m_jets.at(ijet)->M() / m_Units;
257  if (dR_min > dR_cut) {
258  dR_max = dR_min;
259  index_max = ijet;
260  }
261  }
262  }//end of outer jet loop
263 
264  if (index_max >= 0) {
265  jetflags.at(index_max) = false;
266  if (count(jetflags.begin(), jetflags.end(), true) > 3) repeat_dRmin = true;
267  }
268  }//end of while(repeat)
269 
270  int nijet = 0;
271  //Save selected jet indices
272  for (int ijet = 0; ijet < (int) m_jets.size(); ijet++) {
273  if (!jetflags.at(ijet)) continue; //next jet
274 
275  //Use maximum of 4 goodflagged jets
276  if (nijet > 3) break;
277  nijet++;
278 
279  m_jet_indices.push_back(ijet);
280  }
281 
282  return true;
283 }

◆ GetHighestJetMass()

double TtresdRmin::GetHighestJetMass ( )
inline

Get highest jet mass found in jet vector.

Returns
double : jet mass

Definition at line 77 of file TtresdRmin.h.

77 {return m_highestJetMass;};

◆ GetHighMassJetIndex()

int TtresdRmin::GetHighMassJetIndex ( )
inline

Get index of jet with highest mass.

Returns
int : jet index

Definition at line 70 of file TtresdRmin.h.

70 {return m_highMassJetIndex;};

◆ GetJetIndices()

vector<int> TtresdRmin::GetJetIndices ( )
inline

Get jet indicices identified by dRmin method, used for mtt reconstruction.

Returns
vector<int> : Indices of identified jets in passed jet vector

Definition at line 63 of file TtresdRmin.h.

63 {return m_jet_indices;};

◆ GetMttdRmin()

double TtresdRmin::GetMttdRmin ( )

Get calculated invariant ttbar mass for dRmin method.

Returns
double : invariant ttbar mass

Definition at line 119 of file TtresdRmin.cxx.

119  {
120  double mtt_dRmin = 0.0;
121 
122  if (m_jet_indices.size() > 0) {
123  TLorentzVector dRsumJet(0, 0, 0, 0);
124  for (unsigned int ijet = 0; ijet < m_jet_indices.size(); ijet++) {
125  dRsumJet += *(m_jets.at(m_jet_indices.at(ijet)));
126  }
127  mtt_dRmin = (dRsumJet + m_Wleptonic).M();
128  }
129 
130  return mtt_dRmin;
131 }

◆ GetTlvdRmin()

TLorentzVector TtresdRmin::GetTlvdRmin ( )

Get the TLorentzVector for the ttbar system.

Definition at line 136 of file TtresdRmin.cxx.

136  {
137  TLorentzVector tt_dRmin(0, 0, 0, 0);
138 
139  if (m_jet_indices.size() > 0) {
140  TLorentzVector dRsumJet(0, 0, 0, 0);
141  for (unsigned int ijet = 0; ijet < (unsigned int) m_jet_indices.size(); ijet++) {
142  dRsumJet += *(m_jets.at(m_jet_indices.at(ijet)));
143  }
144  tt_dRmin = dRsumJet + m_Wleptonic;
145  }
146 
147  return tt_dRmin;
148 }

◆ Init()

void TtresdRmin::Init ( double  highJetMass = 60.0,
double  minJetPt = 25.0,
double  dRCutOffset = 2.5,
double  dRCutMassFactor = 0.015 
)

Initialize the tool, giving specific parameters needed for dRmin cut Paramters are given in GeV scale, will be scaled internally to MeV if set.

Parameters
highJetMass: jet mass for highMass jet criteria
minJetPt: minimum pT of jets used for dRmin method
dRCutOffset: Offset for dRmin specific cut
dRCutMassFactor: Factor applied to jet mass in dRmin specific cut
Returns
void

Definition at line 51 of file TtresdRmin.cxx.

51  {
52  //Set parameters
53  m_highM = highJetMass;
54  m_minJetPt = minJetPt;
55  m_dRCutOffset = dRCutOffset;
56  m_dRCutMassFactor = dRCutMassFactor;
57 
58  //Reset
59  m_jet_indices.clear();
60  m_highMassJetIndex = -1;
61  m_highestJetMass = 0.0;
62 
63  //Initialization status
64  m_init = true;
65 }

◆ SetHighMThreshold()

void TtresdRmin::SetHighMThreshold ( double  highJetMass)
inline

Set threshold for highMass case.

Parameters
highJetMassthreshold for the high jet mass case

Definition at line 84 of file TtresdRmin.h.

84 {m_highM = highJetMass;};

◆ SetupEvent()

bool TtresdRmin::SetupEvent ( vector< TLorentzVector * > &  jets,
TLorentzVector &  lepton,
TLorentzVector &  neutrino 
)

Set the objects needed to calculate the invariant ttbar mass.

Parameters
jets: Jet container
lepton: Selected lepton
neutrino: Reconstructed neutrino
Returns
bool : Success of setup

Definition at line 70 of file TtresdRmin.cxx.

70  {
71  if (!m_init) {
72  cout << " ERROR in TtresdRmin :: Tool not initialized! Initialize tool before usage!!!" << endl;
73  return false;
74  }
75 
76  //Set objects
77  m_jets = jets;
78  m_lepton = lepton;
79  m_neutrino = neutrino;
80  m_Wleptonic = lepton + neutrino;
81 
82  //Reset
83  m_jet_indices.clear();
84  m_highMassJetIndex = -1;
85  m_highestJetMass = 0.0;
86 
87 
88  //===== Search for high mass jet =====
89  int highMJetIdx = -1; //Index of jet with highest mass above threshold
90  double highM = m_highM * m_Units; //Threshold for high mass jet
91  double minJetPt = m_minJetPt * m_Units; //Threshold for jet pT
92 
93  //Loop jets
94  for (int ijet = 0; ijet < (int) jets.size(); ijet++) {
95  //pT requirmenet
96  if (jets.at(ijet)->Pt() <= minJetPt) continue; //next jet
97 
98  //high mass requirement
99  if (jets.at(ijet)->M() <= highM) continue; //next jet
100 
101  highMJetIdx = ijet;
102  highM = jets.at(ijet)->M();
103  }//end of jet loop
104 
105  if (highMJetIdx >= 0) {
106  m_highMassJetIndex = highMJetIdx;
107  m_highestJetMass = highM;
109  } else {
111  }
112 
113  return true;
114 }

Member Data Documentation

◆ m_dRCutMassFactor

double TtresdRmin::m_dRCutMassFactor
private

Jet mass factor of dRmin specific cut on jet_dR.

Definition at line 122 of file TtresdRmin.h.

◆ m_dRCutOffset

double TtresdRmin::m_dRCutOffset
private

Offset of dRmin specific cut on jet_dR.

Definition at line 121 of file TtresdRmin.h.

◆ m_highestJetMass

double TtresdRmin::m_highestJetMass
private

Highest jet mass found for current event.

Definition at line 125 of file TtresdRmin.h.

◆ m_highM

double TtresdRmin::m_highM
private

Jet mass threshold to identify it as a "high mass jet".

Definition at line 118 of file TtresdRmin.h.

◆ m_highMassJetIndex

int TtresdRmin::m_highMassJetIndex
private

Index of highest mass jet for current event.

Definition at line 124 of file TtresdRmin.h.

◆ m_init

bool TtresdRmin::m_init
private

Flag of initialization status of tool.

Definition at line 116 of file TtresdRmin.h.

◆ m_jet_indices

vector<int> TtresdRmin::m_jet_indices
private

Indices of jets used for reconstruction of invariant ttbar mass.

Definition at line 132 of file TtresdRmin.h.

◆ m_jets

vector<TLorentzVector*> TtresdRmin::m_jets
private

Input vector of jet objects.

Definition at line 127 of file TtresdRmin.h.

◆ m_lepton

TLorentzVector TtresdRmin::m_lepton
private

Input lepton object.

Definition at line 128 of file TtresdRmin.h.

◆ m_minJetPt

double TtresdRmin::m_minJetPt
private

Minimum jet pT used for highM jet search.

Definition at line 120 of file TtresdRmin.h.

◆ m_neutrino

TLorentzVector TtresdRmin::m_neutrino
private

Input neutrino object.

Definition at line 129 of file TtresdRmin.h.

◆ m_Units

double TtresdRmin::m_Units
private

Unit factor used, GeV = 1, MeV = 1000.

Definition at line 119 of file TtresdRmin.h.

◆ m_verbose

bool TtresdRmin::m_verbose
private

Flag for verbosity level.

Definition at line 117 of file TtresdRmin.h.

◆ m_Wleptonic

TLorentzVector TtresdRmin::m_Wleptonic
private

leptonic W object reconstructed from lepton and neutrino

Definition at line 130 of file TtresdRmin.h.


The documentation for this class was generated from the following files:
TtresdRmin::m_lepton
TLorentzVector m_lepton
Input lepton object.
Definition: TtresdRmin.h:128
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TtresdRmin::m_jets
vector< TLorentzVector * > m_jets
Input vector of jet objects.
Definition: TtresdRmin.h:127
TtresdRmin::m_init
bool m_init
Flag of initialization status of tool.
Definition: TtresdRmin.h:116
TtresdRmin::m_highMassJetIndex
int m_highMassJetIndex
Index of highest mass jet for current event.
Definition: TtresdRmin.h:124
TtresdRmin::FindJetIndices_HM
bool FindJetIndices_HM()
Find the jet indices used for mtt reconstruction for events containing a high mass jet.
Definition: TtresdRmin.cxx:153
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TtresdRmin::m_verbose
bool m_verbose
Flag for verbosity level.
Definition: TtresdRmin.h:117
TtresdRmin::m_dRCutOffset
double m_dRCutOffset
Offset of dRmin specific cut on jet_dR.
Definition: TtresdRmin.h:121
TtresdRmin::m_neutrino
TLorentzVector m_neutrino
Input neutrino object.
Definition: TtresdRmin.h:129
TtresdRmin::m_Units
double m_Units
Unit factor used, GeV = 1, MeV = 1000.
Definition: TtresdRmin.h:119
TtresdRmin::m_highestJetMass
double m_highestJetMass
Highest jet mass found for current event.
Definition: TtresdRmin.h:125
perfmonmt-refit.units
string units
Definition: perfmonmt-refit.py:77
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
TtresdRmin::m_minJetPt
double m_minJetPt
Minimum jet pT used for highM jet search.
Definition: TtresdRmin.h:120
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
TtresdRmin::m_highM
double m_highM
Jet mass threshold to identify it as a "high mass jet".
Definition: TtresdRmin.h:118
TtresdRmin::FindJetIndices_LM
bool FindJetIndices_LM()
Find the jet indices used for mtt reconstruction for events NOT containing a high mass jet.
Definition: TtresdRmin.cxx:205
TtresdRmin::m_Wleptonic
TLorentzVector m_Wleptonic
leptonic W object reconstructed from lepton and neutrino
Definition: TtresdRmin.h:130
TtresdRmin::m_jet_indices
vector< int > m_jet_indices
Indices of jets used for reconstruction of invariant ttbar mass.
Definition: TtresdRmin.h:132
TtresdRmin::m_dRCutMassFactor
double m_dRCutMassFactor
Jet mass factor of dRmin specific cut on jet_dR.
Definition: TtresdRmin.h:122