KaliVeda
Toolkit for HIC analysis
KVINDRADSTConverter.h
1 
8 #ifndef KVDSTTreeConverter_h
9 #define KVDSTTreeConverter_h
10 
11 #include "KVReconstructedEvent.h"
12 #include <TSelector.h>
13 #include <TTreeReader.h>
14 #include <TTreeReaderValue.h>
15 #include <TTreeReaderArray.h>
16 #include "KVINDRA.h"
17 
19 
20 
22 
26  bool camp1 = false;
27  bool camp2 = false;
28  bool camp4 = false;
30 
31 public :
33  TTree* fChain = 0;
34 
68 
69 
70  KVINDRADSTConverter(TTree* /*tree*/ = 0) { }
71  virtual ~KVINDRADSTConverter() { }
72  virtual Int_t Version() const
73  {
74  return 2;
75  }
76  virtual void Begin(TTree* tree);
77  virtual void SlaveBegin(TTree* tree);
78  virtual void Init(TTree* tree);
79  virtual Bool_t Notify();
80  virtual Bool_t Process(Long64_t entry);
81  virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0)
82  {
83  return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0;
84  }
85  virtual void SetOption(const char* option)
86  {
87  fOption = option;
88  }
89  virtual void SetObject(TObject* obj)
90  {
91  fObject = obj;
92  }
93  virtual void SetInputList(TList* input)
94  {
95  fInput = input;
96  }
97  virtual TList* GetOutputList() const
98  {
99  return fOutput;
100  }
101  virtual void SlaveTerminate();
102  virtual void Terminate();
103 
104  bool with_phoswich = true;
105  bool csi_fired(int i)
106  {
107  return std::abs(de3[i]) > 0 || csi_l[i] > 0 || csi_r[i] > 0;
108  }
109  bool si_fired(int i)
110  {
111  return std::abs(de2[i]) > 0 || si_gg[i] > 0 || si_pg[i] > 0;
112  }
113  bool ci_fired(int i)
114  {
115  return (icou[i] > 1 && std::abs(de1[i]) > 0) || ci_gg[i] > 0 || ci_pg[i] > 0;
116  }
117  bool phos_fired(int i)
118  {
119  return with_phoswich && icou[i] == 1 && (std::abs(de1[i]) > 0 || ci_gg[i] > 0 || ci_pg[i] > 0);
120  }
121  bool si75_fired(int i)
122  {
123  return icou[i] > 9 && (std::abs(de4[i]) > 0 || si75_gg[i] > 0 || si75_pg[i] > 0);
124  }
125  bool sili_fired(int i)
126  {
127  return icou[i] > 9 && (std::abs(de5[i]) > 0 || sili_gg[i] > 0 || sili_pg[i] > 0);
128  }
129  bool stopped_in_phos(int i)
130  {
131  return phos_fired(i);
132  }
133  bool stopped_in_csi(int i)
134  {
135  return csi_fired(i) && (icou[i] > 1 || !with_phoswich);
136  }
137  bool stopped_in_si(int i)
138  {
139  return si_fired(i) && !stopped_in_csi(i) && (icou[i] > 1 || !with_phoswich) && icou[i] < 10;
140  }
141  bool stopped_in_sili(int i)
142  {
143  return sili_fired(i) && !stopped_in_csi(i);
144  }
145  bool stopped_in_si75(int i)
146  {
147  return si75_fired(i) && !stopped_in_sili(i) && !stopped_in_csi(i);
148  }
149  bool stopped_in_ci(int i)
150  {
151  return ci_fired(i) && !stopped_in_csi(i) && !stopped_in_si(i) && !stopped_in_si75(i) && !stopped_in_sili(i);
152  }
154  {
155  return gIndra->GetDetectorByType(icou[i], imod[i], CsI_R);
156  }
158  {
159  return gIndra->GetDetectorByType(icou[i], imod[i], Si_PG);
160  }
162  {
163  auto ci = gIndra->GetDetectorByType(icou[i], imod[i], ChIo_PG);
164  if (!ci) {
166  ci = get_csi(i)->GetChIo();
167  }
168  return ci;
169  }
171  {
172  return gIndra->GetDetectorByType(icou[i], imod[i], Phos_R);
173  }
175  {
176  return gIndra->GetDetectorByType(icou[i], imod[i], Si75_GG);
177  }
179  {
180  return gIndra->GetDetectorByType(icou[i], imod[i], SiLi_GG);
181  }
182 
184 
186 };
187 
188 #endif
189 
190 #ifdef KVDSTTreeConverter_cxx
192 {
199 
201  total_events = tree->GetEntries();
202 }
203 
205 {
211 
212  return kTRUE;
213 }
214 
215 
216 #endif // #ifdef KVDSTTreeConverter_cxx
int Int_t
bool Bool_t
constexpr Bool_t kTRUE
#define ClassDef(name, id)
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Headers needed by this particular selector.
TTreeReaderArray< Float_t > si_gg
virtual void SetOption(const char *option)
TTreeReaderArray< Int_t > z
TTreeReaderArray< Float_t > si75_gg
TTreeReaderArray< Int_t > mt
TTreeReaderArray< Float_t > sili_mt
TTreeReaderArray< Float_t > de1
virtual Int_t Version() const
virtual void Begin(TTree *tree)
TTreeReaderArray< Float_t > z_indra
KVINDRADetector * get_sili(int i)
virtual Bool_t Process(Long64_t entry)
TTreeReaderValue< Int_t > npart_traite
pointer to the analyzed TTree or TChain
TTreeReaderArray< Float_t > a_indra
KVINDRADetector * get_ci(int i)
virtual void SetObject(TObject *obj)
virtual void SlaveBegin(TTree *tree)
TTreeReaderArray< Float_t > de5
TTreeReaderArray< Float_t > de3
TTreeReaderArray< Float_t > de4
TTreeReaderArray< Float_t > ci_gg
TTreeReaderArray< Float_t > si_pg
TTreeReaderArray< Int_t > a
TTreeReaderArray< Float_t > csi_r
KVINDRADetector * get_phos(int i)
KVINDRADetector * get_si75(int i)
virtual Bool_t Notify()
TTreeReaderArray< Float_t > csi_l
TTreeReaderArray< Float_t > sili_pg
TTreeReaderArray< Float_t > si75_pg
virtual void Init(TTree *tree)
TTreeReaderArray< Float_t > ci_pg
TTreeReaderArray< Float_t > si_mt
TTreeReaderArray< Int_t > icou
TTreeReaderArray< Float_t > si75_mt
virtual void SetInputList(TList *input)
KVINDRADetector * get_csi(int i)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual TList * GetOutputList() const
TTreeReaderArray< Float_t > de_mylar
TTreeReaderArray< Int_t > imod
KVReconstructedEvent * the_event
TTreeReaderArray< Float_t > csi_mt
TTreeReaderArray< Int_t > idcode
TTreeReaderArray< Float_t > ener
TTreeReader fReader
the tree reader
TTreeReaderArray< Float_t > sili_gg
TTreeReaderArray< Float_t > ci_mt
KVINDRADetector * get_si(int i)
TTreeReaderArray< Float_t > de2
TTreeReaderArray< Int_t > ecode
Base class for detectors of INDRA array.
KVINDRADetector * GetChIo() const
virtual KVINDRADetector * GetDetectorByType(UInt_t cou, UInt_t mod, UInt_t type) const
Definition: KVINDRA.cpp:639
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
TList * fInput
TString fOption
TSelectorList * fOutput
TObject * fObject
void SetTree(const char *keyname, TDirectory *dir, TEntryList *entryList=nullptr)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual TTree * GetTree() const
long long Long64_t