Skip to Content.
Sympa Menu

sphenix-tracking-l - [Sphenix-tracking-l] Code snippets for adding TrkrHits to node tree

sphenix-tracking-l AT lists.bnl.gov

Subject: sPHENIX tracking discussion

List archive

Chronological Thread  
  • From: Anthony Frawley <afrawley AT fsu.edu>
  • To: "Martin L. Purschke" <purschke AT bnl.gov>, "sphenix-tracking-l AT lists.bnl.gov" <sphenix-tracking-l AT lists.bnl.gov>
  • Subject: [Sphenix-tracking-l] Code snippets for adding TrkrHits to node tree
  • Date: Tue, 21 Feb 2023 22:30:43 +0000

For Martin,

Code snippets for adding a TrkrHit to the node tree.
See examples in the HitReco modules in: offline/simulation/g4simulation/
             g4Intt, g4mvtx, g4tpc, g4micromegas

Ping me if you have questions.

Cheers
Tony

-----------------------------

Assumes the TrkrHitsetContainer is on the node tree, and that hitsetcontainer is a pointer to it.

For INTT:
     //Need ladder index in phi, sensor index in z

    TrkrDefs::hitsetkey hitsetkey = InttDefs::genHitSetKey(sphxlayer, ladder_z_index, ladder_phi_index, crossing);

      // Use existing hitset or add new one if needed
      TrkrHitSetContainer::Iterator hitsetit = hitsetcontainer->findOrAddHitSet(hitsetkey);

      // generate the key for this hit
      TrkrDefs::hitkey hitkey = InttDefs::genHitKey(zbin, phibin);
      // See if this hit already exists
      TrkrHit *hit = hitsetit->second->getHit(hitkey);
      if (!hit)
      {
        // Otherwise, create a new one
      hit = new TrkrHitv2();
        hitsetit->second->addHitSpecificKey(hitkey, hit);
      }

      // Either way, add the energy to it
      hit->addEnergy(energy);

Changes for MVTX:
      // Need stave index, chip number in stave, strobe
      TrkrDefs::hitsetkey hitsetkey = MvtxDefs::genHitSetKey(sphxlayer, stave, chip, strobe);
      TrkrDefs::hitkey = MvtxDefs::genHitKey(column, row);

Changes for TPC:
    // Need layer, sector, side
      TrkrDefs::hitsetkey hitsetkey = TpcDefs::genHitSetKey(sphxlayer, sector, side);
      TrkrDefs::hitkey = TpcDefs::genHitKey(tbin, phibin);

Changes for Micromegas:
     // layer, segmentation type (phi or z orientation), strip
     TrkrDefs::hitsetkey hitsetkey = MicromegasDefs::genHitSetKey(sphxlayer, segmentation type, tile);
      TrkrDefs::hitkey = MvtxDefs::genHitKey(strip);



  • [Sphenix-tracking-l] Code snippets for adding TrkrHits to node tree, Anthony Frawley, 02/21/2023

Archive powered by MHonArc 2.6.24.

Top of Page