KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVReconNucTrajectory.cpp
1#include "KVReconNucTrajectory.h"
2#include "KVIDTelescope.h"
3
5
6
7
9
11 KVGeoDNTrajectory(), fIndependentIdentifications(0)
12{
13 // Copy constructor
14 o.Copy(*this);
15}
16
17
18
21
23 KVGeoDNTrajectory(), fIndependentIdentifications(0)
24{
25 // Build a reconstructed trajectory on tr starting from node n
26
28 KVUniqueNameList* idtlist = dynamic_cast<KVUniqueNameList*>(AccessIDTelescopeList());
29
30 tr->SaveIterationState();// in case an iteration was already underway
31 // add all nodes starting at n
32 tr->IterateFrom(n);
34 while ((_n = tr->GetNextNode())) {
35 AddLast(_n);
37 }
38 // add all ID telescopes from parent trajectory which contain ALL detectors on this trajectory
39 TIter next(tr->GetIDTelescopes());
40 KVIDTelescope* idt;
41 while ((idt = (KVIDTelescope*)next())) {
42 if (ContainsAll(idt->GetDetectors())) {
43 idtlist->Add(idt);
45 }
46 }
47
48 // unique name for fast look-up in hash table
49 SetName(Form("%s_%s", tr->GetTrajectoryName(), n->GetName()));
51}
52
53
54
56
58{
59 r.Copy(*this);
60 return (*this);
61}
62
63
64
72
74{
75 // This method copies the current state of 'this' object into 'obj'
76 // You should add here any member variables, for example:
77 // (supposing a member variable KVReconNucTrajectory::fToto)
78 // CastedObj.fToto = fToto;
79 // or
80 // CastedObj.SetToto( GetToto() );
81
85}
86
87
88
90
92{
94 std::cout << "Identifications [" << GetIDTelescopes()->GetEntries() << "/"
95 << fIndependentIdentifications << "] : " << std::endl;
96 TIter next(GetIDTelescopes());
97 KVIDTelescope* idt;
98 while ((idt = (KVIDTelescope*)next())) {
99 std::cout << "\t" << idt->GetName() << " (" << idt->IsIndependent() << ")" << std::endl;
100 }
101}
102
103
104
120
122{
123 // Returns detector with given *label* on this trajectory.
124 //
125 // **N.B.** *label*, not *type*: several detectors of same *type* may occur on
126 // trajectory. The geometry should be defined so that labels are unique on all trajectories.
127 //
128 // For example, given a reconstructed nucleus whose trajectory includes silicon detectors (same type)
129 // with labels "SI1" and "SI2", here is how to access the "SI2" detector through which it passed:
130 //
131 //~~~~~~~{.cpp}
132 //KVReconstructedNucleus* rnuc_p; /* pointer to reconstructed nucleus */
133 //KVDetector* si2_det = rnuc_p->GetReconstructionTrajectory()->GetDetector("SI2");
134 //~~~~~~~
135 //
136 // If no such detector exists, returns nullptr.
137
138#ifdef WITH_CPP11
139 auto it
140#else
141 std::map<std::string, KVDetector*>::const_iterator it
142#endif
143 = fDetLabels.find(label.Data());
144 return it != fDetLabels.end() ? it->second : nullptr;
145}
146
147
148
int Int_t
ROOT::R::TRInterface & r
constexpr Bool_t kFALSE
const char Option_t
char * Form(const char *fmt,...)
const Char_t * GetLabel() const
Definition KVBase.h:199
Base class for detector geometry description.
Definition KVDetector.h:160
Path taken by particles through multidetector geometry.
void SaveIterationState() const
Bool_t ContainsAll(const TCollection *l) const
Bool_t fAddToNodes
if kTRUE, add trajectory to node's list
const KVSeqCollection * GetIDTelescopes() const
const Char_t * GetTrajectoryName() const
void ls(Option_t *="") const
KVSeqCollection * AccessIDTelescopeList()
void AddLast(KVGeoDetectorNode *n)
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
void Copy(TObject &obj) const
void RestoreIterationState() const
KVGeoDetectorNode * GetNextNode() const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
Base class for all detectors or associations of detectors in array which can identify charged particl...
const KVList * GetDetectors() const
Bool_t IsIndependent() const
Path through detector array used to reconstruct detected particle.
KVReconNucTrajectory & operator=(const KVReconNucTrajectory &)
void Copy(TObject &obj) const
void ls(Option_t *="") const
KVDetector * GetDetector(const TString &label) const
Int_t fIndependentIdentifications
number of independent ID telescopes on trajectory
std::unordered_map< std::string, KVDetector * > fDetLabels
map detector labels to detectors
Optimised list in which named objects can only be placed once.
Bool_t ObjectAdded() const
virtual void Add(TObject *obj)
virtual Int_t GetEntries() const
const char * GetName() const override
virtual void SetName(const char *name)
virtual void Copy(TObject &object) const
const char * Data() const
const Int_t n
ClassImp(TPyArg)