An experience with HepMC and Monte Carlo Truth in ATLAS


This page is not a formal introduction to handling truths, rather a collection of useful truth things that we experience frequently which you may not find it anywhere or deeply buried until you dig hard enough. But experiences can become obsolete over time when there are improvements. Bear that in mind !
Hence, every comments below are dated.

2009-09-25 Chang Wei Loh

  • For listing of all decay codes, do :
    In Pythia :
     call pylist(12) 

    In Athena :
     Pythia.PythiaCommand += ["pyinit pylist 12"] 

2009-09-19 Chang Wei Loh

  • Consider the decay relationship : mother -> (daughter 1, daughter 2, daughter 3). This is healthy.
    Some HepMC vertices or daughters have multiple mothers !! Consequence of QCD stringy model.
    For example, (gluon 1, gluon 2, gluon 3, gluon 4) -> (daughter 1, daughter 2)

  • pdg_id() == 0 can mean geantino or nuclear fragments having no associated pdg_id

  • Input to a HepMC vertex can have status() 1 . Particularly true when you deal with Geant4 interactions. Does that mean it is stable ?
    Use something like this as complementary search: (*particle)->end_vertex() == NULL
    status() 2 means intermediate. Usually, you will write your analysis code to ignore status > 2.

  • Particle can decay into itself. I do not think it correspond to Feynman loop diagram ! Reject them, but do not accidentally reject real interactions like bremsstrahlung : electron -> electron + gamma that has its particle repeating itself .
        Vertex:      -12 ID:    0 (X,cT)=+1.48e+00,+2.49e+00,+1.00e+01,+4.42e-14
         I: 1        22  1000022 -2.72e+05,+1.95e+05,-2.60e+05,+6.51e+05   2       -12  
         O: 1        23  1000022 -2.72e+05,+1.95e+05,-2.60e+05,+6.51e+05   2       -16 

  • Beware that a vertex can repeat itself. Again, I do not think this is a loop diagram. They seem to occur at the same spacetime but 4-momenta changes :
 Vertex:      -13 ID:    0 (X,cT)=+1.48e+00,+2.49e+00,+1.00e+01,+1.01e-13
 I: 1        20  1000022 +1.67e+05,-1.72e+05,-5.57e+05,+7.83e+05   2       -13
 O: 1        24  1000022 +1.68e+05,-1.71e+05,-5.57e+05,+7.82e+05   2       -14
Vertex:      -14 ID:    0 (X,cT)=+1.48e+00,+2.49e+00,+1.00e+01,+1.01e-13
 I: 1        24  1000022 +1.68e+05,-1.71e+05,-5.57e+05,+7.82e+05   2       -14
 O: 1        25  1000022 +1.70e+05,-1.71e+05,-5.56e+05,+7.82e+05   2       -15

  • Avoid using IteratorRange like (HepMC::children) if you are going to deal with jets, say X going to a jet and a lepton. Utilise vertices to get a good mother-children relationship. Consider writing the following (you may not realise there are errors until you cout or mLog << MSG::INFO << ):
   HepMC::GenVertex::particle_iterator out = (*pitr)->end_vertex()->particles_begin(HepMC::children);
   HepMC::GenVertex::particle_iterator outE = (*pitr)->end_vertex()->particles_end(HepMC::children);
   HepMC::GenVertex::particle_iterator thisout = out;

......

   for( ; thisout != outE ; ++thisout ){
     checke += (*out)->momentum().e();
     mLog << MSG::INFO << "Energy = " << (*out)->momentum().e() << endreq;
   }
   mLog << MSG::INFO << "Sum of energy =  " << checke << endreq;

For the following vertex (details from event record):
Vertex:       -8 ID:    0 (X,cT)=+1.48e+00,+2.49e+00,+1.00e+01,+0.00e+00
 I: 1         9  1000022 -2.72e+05,+1.95e+05,-2.60e+05,+6.51e+05   3        -8
 O: 3        13       13 -1.70e+05,+1.03e+05,-2.94e+05,+3.55e+05   3
             14        2 -1.00e+05,+1.45e+05,+1.07e+05,+2.06e+05   3
             15       -1 -1.75e+03,-5.29e+04,-7.28e+04,+9.00e+04   3
Output ?
...   INFO Energy = 354702
...   INFO Energy = 354702
...   INFO Energy = 354702
...   INFO Sum of energy =  1.06411e+06
Notice that only the energy of the muon (pdgid 13) with energy +3.55e+05 is picked out and is repeated 3 times ! The other two with pdgid 2 and -1 are nowhere to be found.



-- ChangWeiLoh - 2009-09-19

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2009-09-25 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback