Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawHitSetv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawHitSetv1.cc
1 
7 #include "RawHitSetv1.h"
8 #include "RawHit.h"
9 
10 #include <cstdlib> // for exit
11 #include <iostream>
12 #include <type_traits> // for __decay_and_strip<>::__type
13 
15 {
16  m_hitSetKey = TrkrDefs::HITSETKEYMAX;
17  for( const auto& hit:m_hits )
18  { delete hit; }
19 
20  m_hits.clear();
21  return;
22 }
23 
24 void RawHitSetv1::identify(std::ostream& os) const
25 {
26  const unsigned int layer = TrkrDefs::getLayer(m_hitSetKey);
27  const unsigned int trkrid = TrkrDefs::getTrkrId(m_hitSetKey);
28  os
29  << "RawHitSetv1: "
30  << " hitsetkey " << getHitSetKey()
31  << " TrkrId " << trkrid
32  << " layer " << layer
33  << " nhits: " << m_hits.size()
34  << std::endl;
35 
36 }
37 
39 {
40  m_hits.push_back(hit);
41  return;
42 }
43 //void RawHitSetv1::addTpcHit(unsigned short phibin,RawHit* hit)
45 // m_tpchits[phibin].push_back(hit);
46 // return;
47 //}
48 void RawHitSetv1::setTpcPhiBins(unsigned short phibins)
49 {
50  m_tpchits.resize(phibins);
51  return;
52 }
53 /*RawHit*
54 RawHitSetv1::getHit(const TrkrDefs::hitkey key) const
55 {
56  RawHitSetv1::ConstIterator it = m_hits.find(key);
57 
58  if (it != m_hits.end()) return it->second;
59  else return nullptr;
60 }
61 */
63 {
64  return std::make_pair(m_hits.cbegin(), m_hits.cend());
65 }
66 
67 //RawHitSetv1::ConstRange RawHitSetv1::getTpcHits(unsigned short phibin) const
68 //{
69 // return std::make_pair(m_tpchits[phibin].cbegin(), m_tpchits[phibin].cend());
70 //}