KaliVeda
Toolkit for HIC analysis
KVGroupReconstructor.h
1 #ifndef __KVGROUPRECONSTRUCTOR_H
2 #define __KVGROUPRECONSTRUCTOR_H
3 
4 #include "KVBase.h"
5 #include "KVGroup.h"
6 #include "KVReconstructedEvent.h"
7 #include <unordered_map>
8 #include <string>
9 
26 class KVGroupReconstructor : public KVBase {
27 
28  static bool fDoIdentification;
29  static bool fDoCalibration;
30 
31  KVGroup* fGroup;
32  KVReconstructedEvent* fGrpEvent;
33  TString fPartSeedCond;
34  Bool_t fSecondaryAnalysis;
35 protected:
36  mutable int nfireddets;
38  KVIDTelescope* identifying_telescope;
39  std::unordered_map<std::string, KVIdentificationResult*> id_by_type;
40 
41  virtual KVReconstructedNucleus* ReconstructTrajectory(const KVGeoDNTrajectory* traj, const KVGeoDetectorNode* node);
42  virtual void ReconstructParticle(KVReconstructedNucleus* part, const KVGeoDNTrajectory* traj, const KVGeoDetectorNode* node);
43  virtual void PostReconstructionProcessing();
44  virtual void IdentifyParticle(KVReconstructedNucleus&);
45  virtual void CalibrateCoherencyParticle(KVReconstructedNucleus*)
46  {
47  AbstractMethod("CalibrateCoherencyParticle(KVReconstructedNucleus*)");
48  }
49  void SetCalibrationStatus(KVReconstructedNucleus& PART, UShort_t code)
50  {
52  PART.SetIsCalibrated();
53  PART.SetECode(code);
54  }
55 
56  Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus* ion);
57  TString GetPartSeedCond() const
58  {
59  return fPartSeedCond;
60  }
61  void TreatStatusStopFirstStage(KVReconstructedNucleus&);
62 
67  struct particle_to_add_from_coherency_analysis {
68  KVReconstructedNucleus* original_particle;
69  KVGeoDetectorNode* stopping_detector_node;
70  KVGeoDNTrajectory* stopping_trajectory;
71  KVIDTelescope* identifying_telescope;
72  Int_t first_id_result_to_copy;
73  Int_t max_id_result_index;
74  };
75  std::vector<particle_to_add_from_coherency_analysis> coherency_particles;
76  virtual void AddCoherencyParticles() {}
77 
78  virtual KVReconNucTrajectory* get_recon_traj_for_particle(const KVGeoDNTrajectory* traj, const KVGeoDetectorNode* node);
79  virtual void identify_particle(KVIDTelescope* idt, KVIdentificationResult* IDR, KVReconstructedNucleus&)
80  {
81  idt->Identify(IDR);
82  }
83 
84 public:
85  KVGroupReconstructor(const KVGroup* g = nullptr);
86  virtual ~KVGroupReconstructor();
87 
89  int GetNFiredDets() const
90  {
91  return nfireddets;
92  }
93 
95  {
96  return fGrpEvent;
97  }
99  {
102  }
103  virtual void SetGroup(const KVGroup* g);
104  KVGroup* GetGroup() const
105  {
106  return fGroup;
107  }
108 
109  static KVGroupReconstructor* Factory(const TString& plugin = "", const KVGroup* g = nullptr);
110 
111  void Process();
112  virtual void Reconstruct();
113  virtual void Identify();
114  void Calibrate();
116  {
117  AbstractMethod("CalibrateParticle(KVReconstructedNucleus*)");
118  }
119 
120  void AnalyseParticles();
122  {
124  Int_t n = 0;
125  if (GetEventFragment()->GetMult()) {
126  for (KVReconstructedEvent::Iterator it = GetEventFragment()->begin(); it != GetEventFragment()->end(); ++it) {
127  KVReconstructedNucleus& nuc = it.get_reference();
128  n += (Int_t) nuc.IsIdentified();
129  }
130  }
131  return n;
132  }
134  {
136  return (GetEventFragment()->GetMult() - GetNIdentifiedInGroup());
137  }
138  static void SetDoIdentification(bool on = kTRUE)
139  {
141  fDoIdentification = on;
142  }
143  static void SetDoCalibration(bool on = kTRUE)
144  {
146  fDoCalibration = on;
147  }
148  void Clear(Option_t* = "") override
149  {
151  }
152 
153  ClassDefOverride(KVGroupReconstructor, 0) //Base class for handling event reconstruction in detector groups
154 };
155 
156 #endif
int Int_t
unsigned int UInt_t
#define c(i)
bool Bool_t
unsigned short UShort_t
double Double_t
const char Option_t
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
Base class for KaliVeda framework.
Definition: KVBase.h:140
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:216
Path taken by particles through multidetector geometry.
Information on relative positions of detectors & particle trajectories.
Base class for particle reconstruction in one group of a detector array.
void SetEventNumber(UInt_t en)
void Clear(Option_t *="") override
KVGroup * GetGroup() const
KVReconstructedEvent * GetEventFragment() const
virtual void CalibrateParticle(KVReconstructedNucleus *)
static KVGroupReconstructor * Factory(const TString &plugin="", const KVGroup *g=nullptr)
void Calibrate()
Calculate and set energies of all Z-identified but uncalibrated particles in event.
static void SetDoCalibration(bool on=kTRUE)
virtual void SetGroup(const KVGroup *g)
virtual ~KVGroupReconstructor()
Destructor.
static void SetDoIdentification(bool on=kTRUE)
KVGroupReconstructor(const KVGroup *g=nullptr)
Default constructor.
void SetReconEventClass(TClass *c)
Instantiate event fragment object.
Group of detectors which can be treated independently of all others in array.
Definition: KVGroup.h:20
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:85
virtual Bool_t Identify(KVIdentificationResult *, Double_t x=-1., Double_t y=-1.)
Full result of one attempted particle identification.
Path through detector array used to reconstruct detected particle.
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual void SetECode(UChar_t s)
Iterator end() const
void AbstractMethod(const char *method) const
const Int_t n