Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:23

0001 // ----------------------------------------------------------------------------
0002 // 'TrksInJetQAInclusiveFiller.cc'
0003 // Derek Anderson
0004 // 04.03.2024
0005 //
0006 // A submodule for the TrksInJetQA F4A module to produce
0007 // QA histograms for tracks and more in jets
0008 // ----------------------------------------------------------------------------
0009 
0010 #define TRKSINJETQAINCLUSIVEFILLER_CC
0011 
0012 // submodule definition
0013 #include "TrksInJetQAInclusiveFiller.h"
0014 
0015 
0016 
0017 // inherited public methods ---------------------------------------------------
0018 
0019 void TrksInJetQAInclusiveFiller::Fill(PHCompositeNode* topNode) {
0020 
0021   GetNodes(topNode);
0022   
0023   if (m_config.doHitQA)   FillHitQAHists();
0024   if (m_config.doClustQA) FillClustQAHists();
0025   if (m_config.doTrackQA) FillTrackQAHists();
0026   if (m_config.doJetQA)   FillJetQAHists();
0027   return;
0028 
0029 }  // end 'Fill(PHCompositeNode* topNode)'
0030 
0031 
0032 
0033 // private methods ------------------------------------------------------------
0034 
0035 void TrksInJetQAInclusiveFiller::FillHitQAHists() {
0036 
0037   // loop over hit sets
0038   TrkrHitSetContainer::ConstRange hitSets = m_hitMap -> getHitSets();
0039   for (
0040     TrkrHitSetContainer::ConstIterator itSet = hitSets.first;
0041     itSet != hitSets.second;
0042     ++itSet
0043   ) {
0044 
0045     // grab hit set
0046     TrkrDefs::hitsetkey setKey = itSet -> first;
0047     TrkrHitSet*         set    = itSet -> second;
0048 
0049     // loop over all hits in hit set
0050     TrkrHitSet::ConstRange hits = set -> getHits();
0051     for (
0052       TrkrHitSet::ConstIterator itHit = hits.first;
0053       itHit != hits.second;
0054       ++itHit
0055     ) {
0056 
0057       // grab hit
0058       TrkrDefs::hitkey hitKey = itHit -> first;
0059       TrkrHit*         hit    = itHit -> second;
0060 
0061       // grab info and fill histograms
0062       m_hitManager -> GetInfo(hit, setKey, hitKey);
0063 
0064     }  // end hit loop
0065   }  // end hit set loop
0066   return;
0067 
0068 }  // end 'FillHitQAHists()'
0069 
0070 
0071 
0072 void TrksInJetQAInclusiveFiller::FillClustQAHists() {
0073 
0074   // loop over hit sets
0075   TrkrHitSetContainer::ConstRange hitSets = m_hitMap -> getHitSets();
0076   for (
0077     TrkrHitSetContainer::ConstIterator itSet = hitSets.first;
0078     itSet != hitSets.second;
0079     ++itSet
0080   ) {
0081 
0082     // loop over clusters associated w/ hit set
0083     TrkrDefs::hitsetkey              setKey   = itSet      -> first;
0084     TrkrClusterContainer::ConstRange clusters = m_clustMap -> getClusters(setKey);
0085     for (
0086       TrkrClusterContainer::ConstIterator itClust = clusters.first;
0087       itClust != clusters.second;
0088       ++itClust
0089     ) {
0090 
0091       // grab cluster
0092       TrkrDefs::cluskey clustKey = itClust    -> first;
0093       TrkrCluster*      cluster  = m_clustMap -> findCluster(clustKey);
0094 
0095       // grab cluster info
0096       m_clustManager -> GetInfo(cluster, clustKey, m_actsGeom);
0097 
0098     }  // end cluster loop
0099   }  // end hit set loop
0100   return;
0101 
0102 }  // end 'Process()'
0103 
0104 
0105 
0106 void TrksInJetQAInclusiveFiller::FillTrackQAHists() {
0107 
0108   // loop over tracks
0109   for (
0110     SvtxTrackMap::Iter itTrk = m_trkMap -> begin();
0111     itTrk != m_trkMap -> end();
0112     ++itTrk
0113   ) {
0114 
0115     // grab track
0116     SvtxTrack* track = itTrk -> second;
0117 
0118     // grab info and fill histograms
0119     m_trackManager -> GetInfo(track);
0120 
0121   }  // end track loop
0122   return;
0123 
0124 }  // end 'Process()'
0125 
0126 
0127 
0128 void TrksInJetQAInclusiveFiller::FillJetQAHists() {
0129 
0130   // loop over jets
0131   for (
0132     uint64_t iJet = 0;
0133     iJet < m_jetMap -> size();
0134     ++iJet
0135   ) {
0136 
0137     // grab jet
0138     Jet* jet = m_jetMap -> get_jet(iJet);
0139 
0140     // grab info and fill histograms
0141     m_jetManager -> GetInfo(jet);
0142 
0143   }  // end jet loop
0144   return;
0145 
0146 }  // end 'FillJetQAHists()'
0147 
0148 // end ------------------------------------------------------------------------
0149