CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CalculateHLT Class Reference

#include <TopHLTOfflineDQMHelper.h>

Public Member Functions

 CalculateHLT (int maxNJets, double wMass)
 default constructor More...
 
double masslb (reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
 calculate mlb estimate More...
 
double massTopQuark (const std::vector< reco::Jet > &jets)
 calculate top quark mass estimate More...
 
double massWBoson (const std::vector< reco::Jet > &jets)
 calculate W boson mass estimate More...
 
double tmassTopQuark (reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
 calculate top quark transverse mass estimate More...
 
double tmassWBoson (reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
 calculate W boson transverse mass estimate More...
 
 ~CalculateHLT ()=default
 default destructor More...
 

Private Member Functions

void operator() (const std::vector< reco::Jet > &jets)
 
void operator() (const reco::Jet &bJet, reco::RecoCandidate *lepton, const reco::MET &met)
 

Private Attributes

bool failed_
 indicate failed associations More...
 
double massTopQuark_
 cache of top quark mass estimate More...
 
double massWBoson_
 cache of w boson mass estimate More...
 
int maxNJets_
 max. number of jets to be considered More...
 
double mlb_
 cache of mlb estimate More...
 
double tmassTopQuark_
 cache of top quark transverse mass estimate More...
 
double tmassWBoson_
 cache of W boson transverse mass estimate More...
 
double wMass_
 paramater of the w boson mass More...
 

Detailed Description

Definition at line 72 of file TopHLTOfflineDQMHelper.h.

Constructor & Destructor Documentation

CalculateHLT::CalculateHLT ( int  maxNJets,
double  wMass 
)

default constructor

Definition at line 81 of file TopHLTOfflineDQMHelper.cc.

81  :
83 {
84 }
bool failed_
indicate failed associations
double wMass_
paramater of the w boson mass
double massWBoson_
cache of w boson mass estimate
double mlb_
cache of mlb estimate
double massTopQuark_
cache of top quark mass estimate
maxNJets
maximum number of jets taken into account per event for each hypothesis (this parameter is used in th...
double tmassWBoson_
cache of W boson transverse mass estimate
int maxNJets_
max. number of jets to be considered
double tmassTopQuark_
cache of top quark transverse mass estimate
CalculateHLT::~CalculateHLT ( )
default

default destructor

Member Function Documentation

double CalculateHLT::masslb ( reco::RecoCandidate mu,
const reco::MET met,
const reco::Jet b 
)

calculate mlb estimate

Definition at line 143 of file TopHLTOfflineDQMHelper.cc.

References failed_, mlb_, and operator()().

Referenced by HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill().

144 {
145  if(!failed_&& mlb_<0) operator()(b,mu,met);
146  return mlb_;
147 }
bool failed_
indicate failed associations
void operator()(const std::vector< reco::Jet > &jets)
double mlb_
cache of mlb estimate
double CalculateHLT::massTopQuark ( const std::vector< reco::Jet > &  jets)

calculate top quark mass estimate

Definition at line 96 of file TopHLTOfflineDQMHelper.cc.

References failed_, massTopQuark_, and operator()().

Referenced by HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill().

97 {
99  return massTopQuark_;
100 }
bool failed_
indicate failed associations
void operator()(const std::vector< reco::Jet > &jets)
vector< PseudoJet > jets
double massTopQuark_
cache of top quark mass estimate
double CalculateHLT::massWBoson ( const std::vector< reco::Jet > &  jets)

calculate W boson mass estimate

Definition at line 88 of file TopHLTOfflineDQMHelper.cc.

References failed_, massWBoson_, and operator()().

Referenced by HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill().

89 {
91  return massWBoson_;
92 }
bool failed_
indicate failed associations
void operator()(const std::vector< reco::Jet > &jets)
double massWBoson_
cache of w boson mass estimate
vector< PseudoJet > jets
void CalculateHLT::operator() ( const std::vector< reco::Jet > &  jets)
private

do the calculation; this is called only once per event by the first function call to return a mass estimate. The once calculated values are cached afterwards

Definition at line 173 of file TopHLTOfflineDQMHelper.cc.

References failed_, training_settings::idx, createfilelist::int, ResonanceBuilder::mass, massTopQuark_, massWBoson_, maxNJets_, MuonErrorMatrixAnalyzer_cfi::maxPt, and wMass_.

Referenced by masslb(), massTopQuark(), massWBoson(), tmassTopQuark(), and tmassWBoson().

174 {
175 
176  if(maxNJets_<0) maxNJets_=jets.size();
177  failed_= jets.size()<(unsigned int) maxNJets_;
178  if( failed_){ return; }
179 
180  // associate those jets with maximum pt of the vectorial
181  // sum to the hadronic decay chain
182  double maxPt=-1.;
183  std::vector<int> maxPtIndices;
184  maxPtIndices.push_back(-1);
185  maxPtIndices.push_back(-1);
186  maxPtIndices.push_back(-1);
187  for(int idx=0; idx<maxNJets_; ++idx){
188  for(int jdx=0; jdx<maxNJets_; ++jdx){ if(jdx<=idx) continue;
189  for(int kdx=0; kdx<maxNJets_; ++kdx){ if(kdx==idx || kdx==jdx) continue;
190  reco::Particle::LorentzVector sum = jets[idx].p4()+jets[jdx].p4()+jets[kdx].p4();
191  if( maxPt<0. || maxPt<sum.pt() ){
192  maxPt=sum.pt();
193  maxPtIndices.clear();
194  maxPtIndices.push_back(idx);
195  maxPtIndices.push_back(jdx);
196  maxPtIndices.push_back(kdx);
197  }
198  }
199  }
200  }
201  massTopQuark_= (jets[maxPtIndices[0]].p4()+
202  jets[maxPtIndices[1]].p4()+
203  jets[maxPtIndices[2]].p4()).mass();
204 
205  // associate those jets that get closest to the W mass
206  // with their invariant mass to the W boson
207  double wDist =-1.;
208  std::vector<int> wMassIndices;
209  wMassIndices.push_back(-1);
210  wMassIndices.push_back(-1);
211  for(unsigned idx=0; idx<maxPtIndices.size(); ++idx){
212  for(unsigned jdx=0; jdx<maxPtIndices.size(); ++jdx){
213  if( jdx==idx || maxPtIndices[idx]>maxPtIndices[jdx] ) continue;
214  reco::Particle::LorentzVector sum = jets[maxPtIndices[idx]].p4()+jets[maxPtIndices[jdx]].p4();
215  if( wDist<0. || wDist>fabs(sum.mass()-wMass_) ){
216  wDist=fabs(sum.mass()-wMass_);
217  wMassIndices.clear();
218  wMassIndices.push_back(maxPtIndices[idx]);
219  wMassIndices.push_back(maxPtIndices[jdx]);
220  }
221  }
222  }
223  massWBoson_= (jets[wMassIndices[0]].p4()+
224  jets[wMassIndices[1]].p4()).mass();
225 }
bool failed_
indicate failed associations
double wMass_
paramater of the w boson mass
double massWBoson_
cache of w boson mass estimate
vector< PseudoJet > jets
double massTopQuark_
cache of top quark mass estimate
int maxNJets_
max. number of jets to be considered
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
void CalculateHLT::operator() ( const reco::Jet bJet,
reco::RecoCandidate lepton,
const reco::MET met 
)
private

Definition at line 158 of file TopHLTOfflineDQMHelper.cc.

References mlb_, reco::LeafCandidate::p4(), funct::pow(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), mathSSE::sqrt(), tmassTopQuark_, and tmassWBoson_.

158  {
159  double metT = sqrt(pow(met.px(),2) + pow(met.py(),2));
160  double lepT = sqrt(pow(lepton->px(),2) + pow(lepton->py(),2));
161  double bT = sqrt(pow(bJet.px(),2) + pow(bJet.py(),2));
162  reco::Particle::LorentzVector WT = lepton->p4() + met.p4();
163  // cout<<"in calculate:\n\t"<<bJet.pt()<<"\t"<<lepton->pt()<<"\t"<<met.pt()<<endl;
164  tmassWBoson_ = sqrt(pow(metT+lepT,2) - (WT.px()*WT.px()) - (WT.py()*WT.py()));
165  reco::Particle::LorentzVector topT = WT + bJet.p4();
166  tmassTopQuark_ = sqrt(pow((metT+lepT+bT),2) - (topT.px()*topT.px()) - (topT.py()*topT.py()));
167  reco::Particle::LorentzVector lb = bJet.p4() + lepton->p4();
168  mlb_ = lb.mass();
169 }
double px() const final
x coordinate of momentum vector
double mlb_
cache of mlb estimate
T sqrt(T t)
Definition: SSEVec.h:18
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
double tmassWBoson_
cache of W boson transverse mass estimate
double py() const final
y coordinate of momentum vector
double tmassTopQuark_
cache of top quark transverse mass estimate
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double CalculateHLT::tmassTopQuark ( reco::RecoCandidate mu,
const reco::MET met,
const reco::Jet b 
)

calculate top quark transverse mass estimate

Definition at line 151 of file TopHLTOfflineDQMHelper.cc.

References failed_, operator()(), and tmassTopQuark_.

Referenced by HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill().

152 {
153  if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met);
154  return tmassTopQuark_;
155 }
bool failed_
indicate failed associations
void operator()(const std::vector< reco::Jet > &jets)
double tmassTopQuark_
cache of top quark transverse mass estimate
double CalculateHLT::tmassWBoson ( reco::RecoCandidate mu,
const reco::MET met,
const reco::Jet b 
)

calculate W boson transverse mass estimate

calculate W boson transverse mass estimate

Definition at line 135 of file TopHLTOfflineDQMHelper.cc.

References failed_, operator()(), and tmassWBoson_.

Referenced by HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill().

136 {
137  if(!failed_&& tmassWBoson_<0) operator()(b,mu,met);
138  return tmassWBoson_;
139 }
bool failed_
indicate failed associations
void operator()(const std::vector< reco::Jet > &jets)
double tmassWBoson_
cache of W boson transverse mass estimate

Member Data Documentation

bool CalculateHLT::failed_
private

indicate failed associations

Definition at line 105 of file TopHLTOfflineDQMHelper.h.

Referenced by masslb(), massTopQuark(), massWBoson(), operator()(), tmassTopQuark(), and tmassWBoson().

double CalculateHLT::massTopQuark_
private

cache of top quark mass estimate

Definition at line 113 of file TopHLTOfflineDQMHelper.h.

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

double CalculateHLT::massWBoson_
private

cache of w boson mass estimate

Definition at line 111 of file TopHLTOfflineDQMHelper.h.

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

int CalculateHLT::maxNJets_
private

max. number of jets to be considered

Definition at line 107 of file TopHLTOfflineDQMHelper.h.

Referenced by operator()().

double CalculateHLT::mlb_
private

cache of mlb estimate

Definition at line 119 of file TopHLTOfflineDQMHelper.h.

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

double CalculateHLT::tmassTopQuark_
private

cache of top quark transverse mass estimate

Definition at line 117 of file TopHLTOfflineDQMHelper.h.

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

double CalculateHLT::tmassWBoson_
private

cache of W boson transverse mass estimate

Definition at line 115 of file TopHLTOfflineDQMHelper.h.

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

double CalculateHLT::wMass_
private

paramater of the w boson mass

Definition at line 109 of file TopHLTOfflineDQMHelper.h.

Referenced by operator()().