Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:44

0001 /// ===========================================================================
0002 /*! \file   TrksInJetQAInclusiveFiller.cc
0003  *  \author Derek Anderson
0004  *  \date   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 
0011 #define TRKSINJETQAINCLUSIVEFILLER_CC
0012 
0013 // submodule definition
0014 #include "TrksInJetQAInclusiveFiller.h"
0015 
0016 // inherited public methods ===================================================
0017 
0018 // ----------------------------------------------------------------------------
0019 //! Run fill routines for relevant histograms
0020 // ----------------------------------------------------------------------------
0021 void TrksInJetQAInclusiveFiller::Fill(PHCompositeNode* topNode)
0022 {
0023   GetNodes(topNode);
0024 
0025   if (m_config.doHitQA)
0026   {
0027     FillHitQAHists();
0028   }
0029   if (m_config.doClustQA)
0030   {
0031     FillClustQAHists();
0032   }
0033   if (m_config.doTrackQA)
0034   {
0035     FillTrackQAHists();
0036   }
0037   if (m_config.doJetQA)
0038   {
0039     FillJetQAHists();
0040   }
0041 }  // end 'Fill(PHCompositeNode* topNode)'
0042 
0043 // private methods ============================================================
0044 
0045 // ----------------------------------------------------------------------------
0046 //! Fill histograms for inclusive tracker hits
0047 // ----------------------------------------------------------------------------
0048 void TrksInJetQAInclusiveFiller::FillHitQAHists()
0049 {
0050   // loop over hit sets
0051   TrkrHitSetContainer::ConstRange hitSets = m_hitMap->getHitSets();
0052   for (
0053       TrkrHitSetContainer::ConstIterator itSet = hitSets.first;
0054       itSet != hitSets.second;
0055       ++itSet)
0056   {
0057     // grab hit set
0058     TrkrDefs::hitsetkey setKey = itSet->first;
0059     TrkrHitSet* set = itSet->second;
0060 
0061     // loop over all hits in hit set
0062     TrkrHitSet::ConstRange hits = set->getHits();
0063     for (
0064         TrkrHitSet::ConstIterator itHit = hits.first;
0065         itHit != hits.second;
0066         ++itHit)
0067     {
0068       // grab hit
0069       TrkrDefs::hitkey hitKey = itHit->first;
0070       TrkrHit* hit = itHit->second;
0071 
0072       // grab info and fill histograms
0073       m_hitManager->GetInfo(hit, setKey, hitKey);
0074 
0075     }  // end hit loop
0076   }  // end hit set loop
0077 }  // end 'FillHitQAHists()'
0078 
0079 // ----------------------------------------------------------------------------
0080 //! Fill histograms for inclusive track clusters
0081 // ----------------------------------------------------------------------------
0082 void TrksInJetQAInclusiveFiller::FillClustQAHists()
0083 {
0084   // loop over hit sets
0085   for (const auto& det : {TrkrDefs::TrkrId::mvtxId, TrkrDefs::TrkrId::inttId,
0086                   TrkrDefs::TrkrId::tpcId, TrkrDefs::TrkrId::micromegasId})
0087   {
0088     for (const auto& hitsetkey : m_clustMap->getHitSetKeys(det))
0089     {
0090       // loop over clusters associated w/ hit set
0091       TrkrClusterContainer::ConstRange clusters = m_clustMap->getClusters(hitsetkey);
0092       for (
0093           TrkrClusterContainer::ConstIterator itClust = clusters.first;
0094           itClust != clusters.second;
0095           ++itClust)
0096       {
0097         // grab cluster
0098         TrkrDefs::cluskey clustKey = itClust->first;
0099         TrkrCluster* cluster = m_clustMap->findCluster(clustKey);
0100 
0101         // grab cluster info
0102         m_clustManager->GetInfo(cluster, clustKey, m_actsGeom);
0103       }  // end cluster loop
0104     } // end hit set loop
0105   }
0106 }  // end 'FillClustQAHists()'
0107 
0108 // ----------------------------------------------------------------------------
0109 //! Fill histograms for inclusive tracks
0110 // ----------------------------------------------------------------------------
0111 void TrksInJetQAInclusiveFiller::FillTrackQAHists()
0112 {
0113   // loop over tracks
0114   for (auto& itTrk : *m_trkMap)
0115   {
0116     // grab track
0117     SvtxTrack* track = itTrk.second;
0118 
0119     // grab info and fill histograms
0120     m_trackManager->GetInfo(track);
0121 
0122   }  // end track loop
0123 }  // end 'FillTrackQAHists()'
0124 
0125 // ----------------------------------------------------------------------------
0126 //! Fill histograms for inclusive jets
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     // grab jet
0137     Jet* jet = m_jetMap->get_jet(iJet);
0138 
0139     // grab info and fill histograms
0140     m_jetManager->GetInfo(jet);
0141 
0142   }  // end jet loop
0143 }  // end 'FillJetQAHists()'
0144 
0145 // end ========================================================================