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.9 by peiffer, Wed Oct 31 09:48:57 2012 UTC vs.
Revision 1.12 by rkogler, Fri Jun 14 14:59:26 2013 UTC

# Line 42 | Line 42 | void EventCalc::Reset()
42    // when they are accessed
43    
44    // (re-)set the pointers using the ObjectHandler
45 <  ObjectHandler* objs = ObjectHandler::Instance();
46 <  m_bcc = objs->GetBaseCycleContainer();
47 <  m_lumi = objs->GetLumiHandler();
45 >
46 >  //m_bcc = ?
47 >  //m_lumi = ?
48  
49    // reset booleans
50    b_HT = false;
# Line 54 | Line 54 | void EventCalc::Reset()
54    m_TotalWeight = 1.;
55    
56    m_primlep = NULL;
57 +  delete m_ttgen;
58    m_ttgen = NULL;
59  
60   }
61  
62 + void EventCalc::SetBaseCycleContainer(BaseCycleContainer* bcc)
63 + {
64 +  // set the internal pointer to the container with all objects
65 +  m_bcc = bcc;
66 +  m_logger << DEBUG << "Pointer to BaseCycleContainer set." << SLogger::endmsg;
67 + }
68 +
69 + void EventCalc::SetLumiHandler(LuminosityHandler* lh)
70 + {
71 +  // set the internal pointer to the container with all objects
72 +  m_lumi = lh;
73 +  m_logger << DEBUG << "Pointer to LumiHandler set." << SLogger::endmsg;
74 + }
75 +
76   BaseCycleContainer* EventCalc::GetBaseCycleContainer()
77   {
78    // return the pointer to the container with all objects
# Line 160 | Line 175 | Particle* EventCalc::GetPrimaryLepton(){
175   TTbarGen* EventCalc::GetTTbarGen(){
176  
177    if(!m_ttgen){
178 <    m_ttgen = new TTbarGen();
178 >    m_ttgen = new TTbarGen(m_bcc);
179    }
180  
181    return m_ttgen;
# Line 366 | Line 381 | double EventCalc::GetWeight()
381   return m_TotalWeight;
382   }
383  
384 + void EventCalc::PrintGenParticles(string name)
385 + {
386 +  
387 +  m_logger << INFO << "Printing generator particles for event " << GetEventNum() << " (name = " << name << ")" << SLogger::endmsg;
388 +  if (GetGenParticles()->size()>0){
389 +
390 +    std::cout << setw(10) << "index" << '|';
391 +    std::cout << setw(10) << "pdgId" << '|';
392 +    std::cout << setw(10) << "status" << '|';
393 +    std::cout << setw(20) << "mother1" << '|';
394 +    std::cout << setw(20) << "mother2" << '|';
395 +    std::cout << setw(20) << "daughter1" << '|';
396 +    std::cout << setw(20) << "daughter2" << '|';
397 +    std::cout << setw(10) << "Px" << '|';
398 +    std::cout << setw(10) << "Py" << '|';
399 +    std::cout << setw(10) << "Pz"<< '|';
400 +    std::cout << setw(10) << "energy" << '|';
401 +    std::cout << setw(10) << "Pt" << '|';
402 +    std::cout << setw(10) << "M" << std::endl;
403 +
404 +    std::cout.fill('-');
405 +    std::cout << setw(11) << "+";
406 +    std::cout << setw(11) << "+";
407 +    std::cout << setw(11) << "+";
408 +    std::cout << setw(21) << "+";
409 +    std::cout << setw(21) << "+";
410 +    std::cout << setw(21) << "+";
411 +    std::cout << setw(21) << "+";
412 +    std::cout << setw(11) << "+";
413 +    std::cout << setw(11) << "+";
414 +    std::cout << setw(11) << "+";
415 +    std::cout << setw(11) << "+";
416 +    std::cout << setw(11) << "+";
417 +    std::cout << setw(11) << "" << std::endl;
418 +    std::cout.fill(' ');
419 +
420 +    for (unsigned int i=0; i<GetGenParticles()->size(); ++i){
421 +      GenParticle gp = GetGenParticles()->at(i);
422 +      gp.Print(GetGenParticles());
423 +    }
424 +    std::cout << std::endl;
425 +  } else {
426 +    m_logger << INFO << "No generator particles found." << SLogger::endmsg;
427 +  }
428 +
429 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines