ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/SFrameTools/src/EventCalc.cxx
(Generate patch)

Comparing UserCode/UHHAnalysis/SFrameTools/src/EventCalc.cxx (file contents):
Revision 1.5 by peiffer, Thu Jun 28 15:57:26 2012 UTC vs.
Revision 1.7 by mmeyer, Mon Jul 2 15:04:15 2012 UTC

# Line 26 | Line 26 | EventCalc::EventCalc() : m_logger( "Even
26    m_bcc = NULL;
27    m_lumi = NULL;
28    m_primlep = NULL;
29 +  m_ttgen = NULL;
30   }
31  
32   EventCalc::~EventCalc()
# Line 48 | Line 49 | void EventCalc::Reset()
49    // reset booleans
50    b_HT = false;
51    b_HTlep = false;
52 +  b_Reconstruction = false;
53  
54 +  m_TotalWeight = 1.;
55 +  
56    m_primlep = NULL;
57 +  m_ttgen = NULL;
58  
59   }
60  
# Line 152 | Line 157 | Particle* EventCalc::GetPrimaryLepton(){
157    return m_primlep;
158   }
159  
160 + TTbarGen* EventCalc::GetTTbarGen(){
161 +
162 +  if(!m_ttgen){
163 +    m_ttgen = new TTbarGen();
164 +  }
165 +
166 +  return m_ttgen;
167 + }
168 +
169  
170   std::vector<LorentzVector> EventCalc::NeutrinoReconstruction(const LorentzVector lepton, const LorentzVector met){
171  
# Line 215 | Line 229 | std::vector<LorentzVector> EventCalc::Ne
229  
230   void EventCalc::FillHighMassTTbarHypotheses(){
231  
232 +  if(b_Reconstruction) return;
233 +  b_Reconstruction=true;
234 +
235    //clear hypothesis list
236    m_bcc->recoHyps->clear();
237  
# Line 268 | Line 285 | void EventCalc::FillHighMassTTbarHypothe
285          num /= 3;
286        }
287        
288 +      //search jet with highest pt assigned to leptonic top
289 +      float maxpt=-999;
290 +      int maxind=-1;
291 +      for(unsigned int i=0; i<hyp.toplep_jets_indices().size(); ++i){
292 +        float pt = m_bcc->jets->at(hyp.toplep_jets_indices().at(i)).pt();
293 +        if(pt>maxpt){
294 +          maxpt=pt;
295 +          maxind=hyp.toplep_jets_indices().at(i);
296 +        }
297 +      }
298 +      hyp.set_blep_index(maxind);
299 +
300        
301 <      //fill only hypotheses with at least on ejet assigned to each top quark
301 >      //fill only hypotheses with at least one jet assigned to each top quark
302        if(hadjets>0 && lepjets>0){
303          hyp.set_tophad_v4(tophad_v4);
304          hyp.set_toplep_v4(toplep_v4);
# Line 323 | Line 352 | void EventCalc::PrintEventContent(){
352      }
353    }
354   }
355 +
356 +
357 + void EventCalc::ProduceWeight(double weight)
358 + {
359 +  m_TotalWeight = m_TotalWeight * weight;
360 + }
361 +
362 + double EventCalc::GetWeight()
363 + {
364 +
365 + return m_TotalWeight;
366 + }
367 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines