Changes between Initial Version and Version 2 of Ticket #1042
- Timestamp:
- Oct 21, 2016, 5:21:42 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1042
- Property Type Bug → How to
-
Ticket #1042 – Description
initial v2 4 4 5 5 I tried using the GenParticle class with access to the mother of each particle as in what follows : 6 6 {{{ 7 7 // after detecting jet1 as a jet 8 8 GenParticle *jet = (GenParticle*) (jet1); … … 10 10 GenParticle *mother = (GenParticle*) (branchParticle->At(jet->M1)); 11 11 // branchParticle = treeReader->UseBranch("Particle") 12 12 }}} 13 13 But 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 ? 14 14 15 15 I also tried testing this and it gives some results : 16 16 {{{ 17 17 for(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 }}} 28 29 But I couldn't access the jets through this branch. I don't know if it's possible to do that actually. 29 30