Fork me on GitHub

Changes between Initial Version and Version 2 of Ticket #1042


Ignore:
Timestamp:
Oct 21, 2016, 5:21:42 PM (8 years ago)
Author:
Pavel Demin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1042

    • Property Type BugHow to
  • Ticket #1042 – Description

    initial v2  
    44
    55I tried using the GenParticle class with access to the mother of each particle as in what follows :
    6 
     6{{{
    77// after detecting jet1 as a jet
    88GenParticle *jet = (GenParticle*) (jet1);
     
    1010GenParticle *mother = (GenParticle*) (branchParticle->At(jet->M1));
    1111// branchParticle = treeReader->UseBranch("Particle")
    12 
     12}}}
    1313But I get indices that are far beyond any imaginable size of my branches (something like 841663897 while branchParticle has only 691 entries) and I can't access to any element of the decay channel. Is "Particle" the right branch to use ?
    1414
    1515I also tried testing this and it gives some results :
    16 
     16{{{
    1717for(int i=0; i<50; i++)
    18    {
    19    particle = (GenParticle *)(branchParticle->At(i));
    20    cout << "Mother index   " << particle->M1 << endl ;
    21    if((particle->M1 >-1) && (particle->M1 < branchParticle->GetSize())){
    22    mother = (GenParticle *)(branchParticle->At(particle->M1));
    23    histMother->Fill(mother->E);    // a histogram just to test if there's an output
    24    cout << " done " <<  endl;
    25    }
    26    }
    27 
     18{
     19  particle = (GenParticle *)(branchParticle->At(i));
     20  cout << "Mother index   " << particle->M1 << endl ;
     21  if((particle->M1 >-1) && (particle->M1 < branchParticle->GetSize()))
     22  {
     23    mother = (GenParticle *)(branchParticle->At(particle->M1));
     24    histMother->Fill(mother->E); // a histogram just to test if there's an output
     25    cout << " done " <<  endl;
     26  }
     27}
     28}}}
    2829But I couldn't access the jets through this branch. I don't know if it's possible to do that actually.
    2930