KaliVeda
Toolkit for HIC analysis
KVGroup.h
1 #ifndef KVGROUP_H
2 #define KVGROUP_H
3 
4 #define KVGROUP_ADD_UNKNOWN_TELESCOPE "Attempt to add undefined telescope to group"
5 
6 #include "KVGeoStrucElement.h"
7 #include "KVList.h"
8 #include "KVGeoDNTrajectory.h"
9 #include "KVNameValueList.h"
10 class KVDetector;
11 class KVNucleus;
12 
20 class KVGroup : public KVGeoStrucElement {
21 
22 protected:
23  enum {
24  kIsRemoving = BIT(14) //flag set during call to RemoveTelescope
25  };
30 
31 public:
32  enum {
35  };
36  KVGroup();
37  void init();
38  virtual ~ KVGroup();
39  virtual void SetNumber(UInt_t num)
40  {
42  SetName(Form("Group_%u", num));
44  }
46  {
48  return (KVGeoStrucElement*)GetParents()->First();
49  }
50 
52 
53  void Reset(Option_t* opt = "");
54 
55  virtual TList* GetDetectorsInLayer(UInt_t lay);
57 
58  inline UInt_t GetHits()
59  {
61  return fReconstructedNuclei->GetSize();
62  else
63  return 0;
64  };
65  void ClearHitDetectors();
67  {
68  return fReconstructedNuclei;
69  }
70  void AddHit(KVNucleus* kvd);
71  void RemoveHit(KVNucleus* kvd);
72 
74  {
75  return TestBit(kIsRemoving);
76  }
77  virtual void Sort() {}
78  virtual void CountLayers() {}
80  {
81  return &fTrajectories;
82  }
84  {
85  fTrajectories.Add(t);
86  }
88  {
90  }
91 
94  {
96  return &fReconTraj;
97  }
99  {
102  }
103 
105  {
106  if (t && n) {
107  TString mapped_name = fReconTrajMap.GetStringValue(Form("%s_%s", t->GetTrajectoryName(), n->GetName()));
108  const KVGeoDNTrajectory* tr = (const KVGeoDNTrajectory*)fReconTraj.FindObject(mapped_name);
109  return tr;
110  }
111  return nullptr;
112  }
113  void PrintData() const;
114 
115  ClassDef(KVGroup, 1)//Group of detectors having similar angular positions.
116 };
117 #endif
int Int_t
unsigned int UInt_t
#define c(i)
bool Bool_t
unsigned char UChar_t
const char Option_t
#define ClassDef(name, id)
#define BIT(n)
char * Form(const char *fmt,...)
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:216
Base class for detector geometry description.
Definition: KVDetector.h:160
Path taken by particles through multidetector geometry.
const Char_t * GetTrajectoryName() const
Information on relative positions of detectors & particle trajectories.
Base class describing elements of array geometry.
const KVSeqCollection * GetParents() const
Group of detectors which can be treated independently of all others in array.
Definition: KVGroup.h:20
void AddTrajectory(KVGeoDNTrajectory *t)
Definition: KVGroup.h:83
KVHashList fTrajectories
Trajectories passing through group.
Definition: KVGroup.h:27
void Reset(Option_t *opt="")
Definition: KVGroup.cpp:114
const KVGeoDNTrajectory * FindReconTraj(const KVString &path)
Definition: KVGroup.h:98
UInt_t GetHits()
Definition: KVGroup.h:58
virtual TList * GetAlignedDetectors(KVDetector *, UChar_t dir=kBackwards)
Definition: KVGroup.cpp:177
KVGeoStrucElement * GetArray() const
Definition: KVGroup.h:45
@ kBackwards
Definition: KVGroup.h:34
@ kForwards
Definition: KVGroup.h:33
@ kIsRemoving
Definition: KVGroup.h:24
virtual ~ KVGroup()
KVHashList fReconTraj
list of all possible trajectories for reconstructed particles
Definition: KVGroup.h:28
void init()
Definition: KVGroup.cpp:30
KVNameValueList fReconTrajMap
map names of duplicate trajectories for reconstructed particles
Definition: KVGroup.h:29
virtual void SetNumber(UInt_t num)
Definition: KVGroup.h:39
KVList * GetParticles()
Definition: KVGroup.h:66
const TCollection * GetTrajectories() const
Definition: KVGroup.h:79
virtual void CountLayers()
Definition: KVGroup.h:78
virtual TList * GetDetectorsInLayer(UInt_t lay)
Definition: KVGroup.cpp:88
virtual UInt_t GetNumberOfDetectorLayers()
Definition: KVGroup.cpp:64
void ClearHitDetectors()
Definition: KVGroup.cpp:222
void AddHit(KVNucleus *kvd)
Definition: KVGroup.cpp:134
const KVGeoDNTrajectory * GetTrajectoryForReconstruction(const KVGeoDNTrajectory *t, const KVGeoDetectorNode *n) const
Definition: KVGroup.h:104
void AddTrajectories(const TCollection *c)
Definition: KVGroup.h:87
const TSeqCollection * GetReconTrajectories() const
Definition: KVGroup.h:93
virtual void Sort()
Definition: KVGroup.h:77
void RemoveHit(KVNucleus *kvd)
Definition: KVGroup.cpp:150
void PrintData() const
list detectors of group with any data they contain
Definition: KVGroup.cpp:297
KVGroup()
Definition: KVGroup.cpp:18
KVList * fReconstructedNuclei
Particles reconstructed in this group.
Definition: KVGroup.h:26
Bool_t IsRemoving()
Definition: KVGroup.h:73
Int_t CalculateReconstructionTrajectories()
Definition: KVGroup.cpp:237
Extended version of ROOT THashList.
Definition: KVHashList.h:29
Extended TList class which owns its objects by default.
Definition: KVList.h:28
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
const Char_t * GetStringValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:126
virtual Int_t GetSize() const
virtual TObject * First() const
virtual TObject * FindObjectByTitle(const Char_t *) const
Will return object with given title (value of TObject::GetTitle() method).
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
virtual void AddAll(const TCollection *col)
virtual void SetName(const char *name)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
const Int_t n