CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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
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 ( )
inline

default destructor

Definition at line 77 of file TopHLTOfflineDQMHelper.h.

77 {};

Member Function Documentation

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

calculate mlb estimate

Definition at line 140 of file TopHLTOfflineDQMHelper.cc.

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

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

141 {
142  if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_;
143 }
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 95 of file TopHLTOfflineDQMHelper.cc.

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

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

96 {
98 }
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 {
90  if(!failed_&& massWBoson_<0) operator()(jets); return massWBoson_;
91 }
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 168 of file TopHLTOfflineDQMHelper.cc.

References failed_, customizeTrackingMonitorSeedNumber::idx, ResonanceBuilder::mass, massTopQuark_, massWBoson_, maxNJets_, and wMass_.

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

169 {
170 
171  if(maxNJets_<0) maxNJets_=jets.size();
172  failed_= jets.size()<(unsigned int) maxNJets_;
173  if( failed_){ return; }
174 
175  // associate those jets with maximum pt of the vectorial
176  // sum to the hadronic decay chain
177  double maxPt=-1.;
178  std::vector<int> maxPtIndices;
179  maxPtIndices.push_back(-1);
180  maxPtIndices.push_back(-1);
181  maxPtIndices.push_back(-1);
182  for(int idx=0; idx<maxNJets_; ++idx){
183  for(int jdx=0; jdx<maxNJets_; ++jdx){ if(jdx<=idx) continue;
184  for(int kdx=0; kdx<maxNJets_; ++kdx){ if(kdx==idx || kdx==jdx) continue;
185  reco::Particle::LorentzVector sum = jets[idx].p4()+jets[jdx].p4()+jets[kdx].p4();
186  if( maxPt<0. || maxPt<sum.pt() ){
187  maxPt=sum.pt();
188  maxPtIndices.clear();
189  maxPtIndices.push_back(idx);
190  maxPtIndices.push_back(jdx);
191  maxPtIndices.push_back(kdx);
192  }
193  }
194  }
195  }
196  massTopQuark_= (jets[maxPtIndices[0]].p4()+
197  jets[maxPtIndices[1]].p4()+
198  jets[maxPtIndices[2]].p4()).mass();
199 
200  // associate those jets that get closest to the W mass
201  // with their invariant mass to the W boson
202  double wDist =-1.;
203  std::vector<int> wMassIndices;
204  wMassIndices.push_back(-1);
205  wMassIndices.push_back(-1);
206  for(unsigned idx=0; idx<maxPtIndices.size(); ++idx){
207  for(unsigned jdx=0; jdx<maxPtIndices.size(); ++jdx){
208  if( jdx==idx || maxPtIndices[idx]>maxPtIndices[jdx] ) continue;
209  reco::Particle::LorentzVector sum = jets[maxPtIndices[idx]].p4()+jets[maxPtIndices[jdx]].p4();
210  if( wDist<0. || wDist>fabs(sum.mass()-wMass_) ){
211  wDist=fabs(sum.mass()-wMass_);
212  wMassIndices.clear();
213  wMassIndices.push_back(maxPtIndices[idx]);
214  wMassIndices.push_back(maxPtIndices[jdx]);
215  }
216  }
217  }
218  massWBoson_= (jets[wMassIndices[0]].p4()+
219  jets[wMassIndices[1]].p4()).mass();
220 }
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
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 153 of file TopHLTOfflineDQMHelper.cc.

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

153  {
154  double metT = sqrt(pow(met.px(),2) + pow(met.py(),2));
155  double lepT = sqrt(pow(lepton->px(),2) + pow(lepton->py(),2));
156  double bT = sqrt(pow(bJet.px(),2) + pow(bJet.py(),2));
157  reco::Particle::LorentzVector WT = lepton->p4() + met.p4();
158  // cout<<"in calculate:\n\t"<<bJet.pt()<<"\t"<<lepton->pt()<<"\t"<<met.pt()<<endl;
159  tmassWBoson_ = sqrt(pow(metT+lepT,2) - (WT.px()*WT.px()) - (WT.py()*WT.py()));
160  reco::Particle::LorentzVector topT = WT + bJet.p4();
161  tmassTopQuark_ = sqrt(pow((metT+lepT+bT),2) - (topT.px()*topT.px()) - (topT.py()*topT.py()));
162  reco::Particle::LorentzVector lb = bJet.p4() + lepton->p4();
163  mlb_ = lb.mass();
164 }
double mlb_
cache of mlb estimate
T sqrt(T t)
Definition: SSEVec.h:18
virtual double py() const final
y coordinate of momentum vector
double tmassWBoson_
cache of W boson transverse mass estimate
virtual double px() const final
x coordinate of momentum vector
double tmassTopQuark_
cache of top quark transverse mass estimate
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
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 147 of file TopHLTOfflineDQMHelper.cc.

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

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

148 {
149  if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_;
150 }
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 133 of file TopHLTOfflineDQMHelper.cc.

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

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

134 {
135  if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_;
136 }
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()().