Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:20

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