Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /**
0002  * @file trackbase/RawHitSetv1.cc
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Implementation of RawHitSetv1
0006  */
0007 #include "RawHitSetv1.h"
0008 #include "RawHit.h"
0009 
0010 #include <cstdlib>  // for exit
0011 #include <iostream>
0012 #include <type_traits>  // for __decay_and_strip<>::__type
0013 
0014 void RawHitSetv1::Reset()
0015 {
0016   m_hitSetKey = TrkrDefs::HITSETKEYMAX;
0017   for (const auto& hit : m_hits)
0018   {
0019     delete hit;
0020   }
0021 
0022   m_hits.clear();
0023   return;
0024 }
0025 
0026 void RawHitSetv1::identify(std::ostream& os) const
0027 {
0028   const unsigned int layer = TrkrDefs::getLayer(m_hitSetKey);
0029   const unsigned int trkrid = TrkrDefs::getTrkrId(m_hitSetKey);
0030   os
0031       << "RawHitSetv1: "
0032       << "       hitsetkey " << getHitSetKey()
0033       << " TrkrId " << trkrid
0034       << " layer " << layer
0035       << " nhits: " << m_hits.size()
0036       << std::endl;
0037 }
0038 
0039 void RawHitSetv1::addHit(RawHit* hit)
0040 {
0041   m_hits.push_back(hit);
0042   return;
0043 }
0044 // void RawHitSetv1::addTpcHit(unsigned short phibin,RawHit* hit)
0045 ///{
0046 //  m_tpchits[phibin].push_back(hit);
0047 // return;
0048 //}
0049 void RawHitSetv1::setTpcPhiBins(unsigned short phibins)
0050 {
0051   m_tpchits.resize(phibins);
0052   return;
0053 }
0054 /*RawHit*
0055 RawHitSetv1::getHit(const TrkrDefs::hitkey key) const
0056 {
0057   RawHitSetv1::ConstIterator it = m_hits.find(key);
0058 
0059   if (it != m_hits.end()) return it->second;
0060   else return nullptr;
0061 }
0062 */
0063 RawHitSetv1::ConstRange RawHitSetv1::getHits() const
0064 {
0065   return std::make_pair(m_hits.cbegin(), m_hits.cend());
0066 }
0067 
0068 // RawHitSetv1::ConstRange RawHitSetv1::getTpcHits(unsigned short phibin) const
0069 //{
0070 //   return std::make_pair(m_tpchits[phibin].cbegin(), m_tpchits[phibin].cend());
0071 // }