KaliVeda
Toolkit for HIC analysis
KVINDRAFilterGroupReconstructor.h
1 #ifndef __KVINDRAFILTERGROUPRECONSTRUCTOR_H
2 #define __KVINDRAFILTERGROUPRECONSTRUCTOR_H
3 
4 #include "KVFilterGroupReconstructor.h"
5 #include "KVChIo.h"
6 #include "KVINDRA.h"
7 
20 
21  KVChIo* theChIo = nullptr;
22  mutable bool translate_csi_id_names = false;
23  mutable bool check_translate = true;
24  mutable std::unordered_map<KVIDTelescope*,TString> idcsi_name_translation;
25 protected:
27 
29  {
33 
35  return idt->GetName();
36 
37  if(std::strncmp(idt->GetType(),"CS",2))
38  return idt->GetName();
39 
40  if(check_translate)
41  {
43  {
47  TString idt_name(idt->GetName()), new_name;
48  bool old_array = idt_name.Length()>8;//array telescopes have old "CSI_R_L_xxxx" names
49  if(old_array)
50  new_name = idt->GetDetector(1)->GetName();//new name is same as name of CsI
51  else
52  new_name = Form("CSI_R_L_%04d", idt->GetDetector(1)->GetIndex());
53  if(audit_has_telescope_with_name(new_name))
54  {
56  auto name_to_return = new_name;//no need to do the job twice
57  check_translate=false;
60  std::unique_ptr<KVSeqCollection> csi_list(GetGroup()->GetDetectorTypeList("CSI"));
61  TIter it_csi(csi_list.get());
62  KVDetector* dcsi;
63  while( (dcsi = (KVDetector*)it_csi()) )
64  {
65  if(old_array)
66  {
67  idt_name = Form("CSI_R_L_%04d", dcsi->GetIndex());
68  new_name = dcsi->GetName();
69  }
70  else
71  {
72  idt_name = dcsi->GetName();
73  new_name = Form("CSI_R_L_%04d", dcsi->GetIndex());
74  }
75  auto iidt = gIndra->GetIDTelescope(idt_name);
76  if(iidt)
77  idcsi_name_translation[iidt] = new_name;
78  }
79  return name_to_return;
80  }
81  else
82  {
84  return idt->GetName();
85  }
86  }
87  else
88  {
90  check_translate=false;
92  return idt->GetName();
93  }
94  }
95  return idcsi_name_translation[idt];
96  }
97 public:
100  {
101  if (g) theChIo = dynamic_cast<KVChIo*>(g->GetDetectorByType("CI"));
102  }
103 
104  void Reconstruct() override;
106 
107  ClassDefOverride(KVINDRAFilterGroupReconstructor, 1) //Reconstruct simulated events after filtering with INDRA
108 };
109 
110 #endif
#define ClassDefOverride(name, id)
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
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
Definition: KVBase.h:176
Ionisation chamber detectors of the INDRA multidetector array.
Definition: KVChIo.h:30
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:159
virtual Int_t GetIndex() const
Definition: KVDetector.h:812
Reconstruct particles in group of detectors after filtering simulated events.
bool audit_has_telescope_with_name(const TString &n) const
KVGroup * GetGroup() const
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
KVDetector * GetDetector(UInt_t n) const
Reconstruct simulated events after filtering with INDRA.
void identify_particle(KVIDTelescope *idt, KVIdentificationResult *IDR, KVReconstructedNucleus &nuc) override
Treat special case of code 5 in CI-SI/SI75/CSI identifications.
bool translate_csi_id_names
pointer to ChIo in group, if present
KVINDRAFilterGroupReconstructor(const KVGroup *g=nullptr)
void IdentifyParticle(KVReconstructedNucleus &) override
std::unordered_map< KVIDTelescope *, TString > idcsi_name_translation
check if need to translate only once
bool check_translate
if idtelescope name translation for data quality audit required
TString get_id_telescope_name_for_audit(KVIDTelescope *idt) const override
Full result of one attempted particle identification.
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
Nuclei reconstructed from data measured by a detector array .
const char * GetName() const override