Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcRawHitContainerv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcRawHitContainerv1.cc
1 #include "TpcRawHitContainerv1.h"
2 #include "TpcRawHitv1.h"
3 
4 #include <TClonesArray.h>
5 
6 static const int NTPCHITS = 100;
7 
9 {
10  TpcRawHitsTCArray = new TClonesArray("TpcRawHitv1",NTPCHITS);
11 }
12 
14 {
15  TpcRawHitsTCArray->Clear("C");
16  delete TpcRawHitsTCArray;
17 }
18 
19 
21 {
22  TpcRawHitsTCArray->Clear("C");
23  TpcRawHitsTCArray->Expand(NTPCHITS);
24 }
25 
26 void TpcRawHitContainerv1::identify(std::ostream &os) const
27 {
28  os << "TpcRawHitContainerv1" << std::endl;
29  os << "containing " << TpcRawHitsTCArray->GetEntriesFast() << " Tpc hits" << std::endl;
30  TpcRawHit *tpchit = static_cast< TpcRawHit *> (TpcRawHitsTCArray->At(0));
31  if (tpchit)
32  {
33  os << "for beam clock: " << std::hex << tpchit->get_bco() << std::dec << std::endl;
34  }
35 }
36 
38 {
39  return TpcRawHitsTCArray->GetSize();
40 }
41 
43 {
44  return TpcRawHitsTCArray->GetEntriesFast();
45 }
46 
48 {
49  TpcRawHit *newhit = new ((*TpcRawHitsTCArray)[TpcRawHitsTCArray->GetLast()+1]) TpcRawHitv1();
50  return newhit;
51 }
52 
54 {
55  TpcRawHit *newhit = new ((*TpcRawHitsTCArray)[TpcRawHitsTCArray->GetLast()+1]) TpcRawHitv1(tpchit);
56  return newhit;
57 }
58 
60 {
61  return (TpcRawHit *) TpcRawHitsTCArray->At(index);
62 }