Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackInfoContainer_v1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackInfoContainer_v1.cc
1 
2 #include "SvtxTrackInfo.h"
4 #include <phool/PHObject.h>
5 
6 #include <climits>
7 #include <map>
8 
9 
11 
12 
13  _clones = new TClonesArray("SvtxTrackInfo");
14 
15  _clones->SetOwner();
16  _clones->SetName("TrackInfoContainer_v1");
17 
18  }
19 
21 
22  _clones->Clear("C");
23  }
24 
25  void TrackInfoContainer_v1::identify(std::ostream& os) const{
26  os << "TrackInfoContainer_v1 of size " << size() << std::endl;
27  }
28 
30  {
31  // clear content of towers in the container for the next event
32 
33  for (Int_t i = 0; i < _clones->GetEntriesFast(); ++i)
34  {
35  TObject* obj = _clones->UncheckedAt(i);
36 
37  if (obj == nullptr)
38  {
39  std::cout << __PRETTY_FUNCTION__ << " Fatal access error:"
40  << " _clones->GetSize() = " << _clones->GetSize()
41  << " _clones->GetEntriesFast() = " << _clones->GetEntriesFast()
42  << " i = " << i << std::endl;
43  _clones->Print();
44  }
45 
46  assert(obj);
47  // same as TClonesArray::Clear() but only clear but not to erase all towers
48  obj->Clear();
49  obj->ResetBit(kHasUUID);
50  obj->ResetBit(kIsReferenced);
51  obj->SetUniqueID(0);
52  }
53  _clones->Clear("C");
54 
55  }
56 
57 
58 
59 
60 
61