Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicromegasRawHitContainerv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MicromegasRawHitContainerv1.cc
2 #include "MicromegasRawHitv1.h"
3 
4 #include <TClonesArray.h>
5 
6 static constexpr int NHITS = 100;
7 
9 {
10  MicromegasRawHitsTCArray = new TClonesArray("MicromegasRawHitv1",NHITS);
11 }
12 
14 {
16 }
17 
18 
20 {
21  MicromegasRawHitsTCArray->Clear();
23 }
24 
25 void MicromegasRawHitContainerv1::identify(std::ostream &os) const
26 {
27  os << "MicromegasRawHitContainerv1" << std::endl;
28  os << "containing " << MicromegasRawHitsTCArray->GetEntriesFast() << " Micromegas hits" << std::endl;
29  auto hit = static_cast< MicromegasRawHit *> (MicromegasRawHitsTCArray->At(0));
30  if (hit)
31  {
32  os << "for beam clock: " << std::hex << hit->get_bco() << std::dec << std::endl;
33  }
34 }
35 
37 {
38  return MicromegasRawHitsTCArray->GetSize();
39 }
40 
42 {
43  return MicromegasRawHitsTCArray->GetEntriesFast();
44 }
45 
47 {
48  MicromegasRawHit *newhit = new ((*MicromegasRawHitsTCArray)[MicromegasRawHitsTCArray->GetLast()+1]) MicromegasRawHitv1();
49  return newhit;
50 }
51 
53 {
54  auto newhit = new ((*MicromegasRawHitsTCArray)[MicromegasRawHitsTCArray->GetLast()+1]) MicromegasRawHitv1(source);
55  return newhit;
56 }
57 
59 {
60  return static_cast<MicromegasRawHit*>( MicromegasRawHitsTCArray->At(index) );
61 }