KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVCsI.cpp
Go to the documentation of this file.
1 #include "KVCsI.h"
2 
3 #include <KVCalibratedSignal.h>
4 
5 using namespace std;
6 
8 //_______________________________________________________________________________________
9 
10 
11 
14 void KVCsI::init()
15 {
16  //initialise non-persistent pointers
17  fSegment = 2;
18  fPinLaser = 0;
19 }
20 
21 
22 
23 
30 
32 {
33  //Default ctor
34  //This ctor (which in turn calls the KVDetector default ctor) must exist in
35  //order for Cloning of detectors to work (as used in KVTelescope::AddDetector).
36  //Do not replace this ctor by giving a default value for the argument of KVCsI(Float_t).
37  //
38  init();
39 }
40 
41 
42 
48 
49 KVCsI::KVCsI(Float_t thick, Float_t thickAl): KVINDRADetector("CsI", thick)
50 {
51  //Make a CsI detector "thick" cm long
52  //with a Al dead layer "thickAl" um long
53  //Set type of detector to "CSI"
54  //By default 'thick'=0
55 
56  if (thickAl > 0.0) {
57  KVMaterial* mat = new KVMaterial("Al", thickAl * KVUnits::um);
58  fAbsorbers->AddFirst(mat);
60  }
61  SetType("CSI");
62  SetLabel("CSI");//for use with KVReconNucTrajectory
63  init();
64 }
65 
66 
67 
69 
70 void KVCsI::SetAlThickness(Float_t thickAl /* um */)
71 {
72  KVMaterial* mat = 0;
73  if (!(mat = GetAbsorber("Al"))) {
74  mat = new KVMaterial("Al", thickAl * KVUnits::um);
75  fAbsorbers->AddFirst(mat);
77  }
78  else mat->SetThickness(thickAl * KVUnits::um);
79 }
80 
81 
82 
83 
85 
86 KVCsI::~KVCsI()
87 {
88 }
89 
90 
91 
92 
96 
98 {
99  // Calculate calibrated energy loss for a nucleus (Z,A) giving total light output "lum".
100  // By default we use the current value of the detector's `TotLight` signal.
101 
102  if (!(GetDetectorSignalValue("TotLight") > 0)) return -1;
103 
104  Int_t Z = nuc->GetZ();
105  Int_t A = nuc->GetA();
106 
107  Double_t eloss;
108  if (lum > -1) eloss = GetDetectorSignalValue("Energy", Form("INPUT=%g,Z=%d,A=%d", lum, Z, A));
109  else eloss = GetDetectorSignalValue("Energy", Form("Z=%d,A=%d", Z, A));
110  if (((KVCalibratedSignal*)GetDetectorSignal("Energy"))->InversionFailure()) {
111  Info("GetCorrectedEnergy", "Failed to invert Light-Energy calibration for %s with Z=%d A=%d LIGHT=%f",
112  GetName(), Z, A, GetDetectorSignalValue("TotLight"));
113  return -1;
114  }
115 
116  // If TotLight is calculated from fast and slow components (INDRA data before Mesytec acquisition upgrade)
117  // we check that the calculation went well
118  if (!GetDetectorSignal("TotLight")->IsRaw() && !GetDetectorSignal("TotLight")->GetStatus("LightIsGood")) return -1.;
119 
120  if (eloss > 0) {
121  SetEnergy(eloss);
122  return eloss;
123  }
124 
125  return -1.;
126 }
127 
128 
129 
131 
133 {
134  AbstractMethod("DeduceACQParameters");
135 
136  // Deduce fast & slow acquisition parameters for particles hitting CsI in given
137  // (simulated) event. The KVNumberList contains the indices of particles in the event.
138 // GetACQParam("R")->SetData(-1);
139 // GetACQParam("L")->SetData(-1);
140 // GetACQParam("T")->SetData(-1);
141 
142 // UShort_t Mt = 110;
143 // Double_t Xlen_sum = 0;
144 // Double_t Yrap_sum = 0;
145 
146 // KVIDTelescope* idcsi = (KVIDTelescope*)GetIDTelescopes()->At(0);
147 
148 // KVIDZAGrid* idgcsi = (KVIDZAGrid*)idcsi->GetIDGrid();
149 // if (!idgcsi) {
150 // //Warning("DeduceACQParameters","%s, No grid available",GetName());
151 // return;
152 // }
153 
154 // index.Begin();
155 // while (!index.End()) { // loop over all particles hitting CsI
156 // KVNucleus* nunuc = e->GetParticle(index.Next());
157 // Int_t zz = nunuc->GetZ();
158 // Int_t aa = nunuc->GetA();
159 // // calculate total light output corresponding to this particle and its individual energy loss
160 // Double_t lumiere = GetLightFromEnergy(zz, aa, nunuc->GetParameters()->GetDoubleValue(GetName()));
161 
164 
165 // KVIDZALine* idline = (KVIDZALine*)idgcsi->GetIdentifier(zz, aa);
166 // if (!idline && zz <= idgcsi->GetZmax()) {
167 // // Z within limits of grid, but we don't have the isotope
168 // // Look for line with closest mass
169 // Int_t closest_a = 1000;
170 // Int_t closest_index = -1;
171 // Int_t nids = idgcsi->GetNumberOfIdentifiers();
172 // for (Int_t iid = 0; iid < nids; iid++) {
173 // KVIDZALine* ll = (KVIDZALine*)idgcsi->GetIdentifierAt(iid);
174 // if (ll->GetZ() == zz) {
175 // if (TMath::Abs(ll->GetA() - aa) < TMath::Abs(closest_a - aa)) {
176 // closest_index = iid;
177 // closest_a = ll->GetA();
178 // }
179 // }
180 // }
181 // idline = (KVIDZALine*)idgcsi->GetIdentifierAt(closest_index);
182 // }
183 // Double_t Xlen = 0;
184 // Double_t Yrap = 0;
185 
186 // if (idline) {
187 // Double_t Yrap1, Yrap2, Xlen1, Xlen2;
188 // idline->GetStartPoint(Xlen1, Yrap1);
189 // idline->GetEndPoint(Xlen2, Yrap2);
190 
191 // Double_t lumcalc1 = Calculate(kLumiere, Yrap1, Xlen1);
192 // Double_t lumcalc2 = Calculate(kLumiere, Yrap2, Xlen2);
195 // if (lumiere < lumcalc1) {
196 // Xlen2 = Xlen1;
197 // Yrap2 = Yrap1;
198 // lumcalc2 = lumcalc1;
199 // Xlen1 = GetPedestal("L");
200 // Yrap1 = idline->Eval(Xlen1, 0, "S");
201 // lumcalc1 = Calculate(kLumiere, Yrap1, Xlen1);
202 // //cout << "Extrapolating before start of ID line" << endl;
203 // }
204 // else if (lumiere > lumcalc2) {
205 // Xlen1 = Xlen2;
206 // Yrap1 = Yrap2;
207 // lumcalc1 = lumcalc2;
208 // Xlen2 = 4095;
209 // Yrap2 = idline->Eval(Xlen2, 0, "S");
210 // lumcalc2 = Calculate(kLumiere, Yrap2, Xlen2);
211 // //cout << "Extrapolating after end of ID line" << endl;
212 // }
213 // //cout << "Xlen1=" << Xlen1 << " Yrap1="<<Yrap1<< " Lum_min = " << lumcalc1 << endl;
214 // //cout << "Xlen2=" << Xlen2 << " Yrap2=" << Yrap2<< " Lum_max = " << lumcalc2 << endl;
215 
216 // Xlen = (Xlen1 + Xlen2) / 2.;
217 // Yrap = idline->Eval(Xlen, 0, "S");
218 // Double_t lumcalc = Calculate(kLumiere, Yrap, Xlen);
219 // //cout << "-1 : Rapide = " << Yrap << " Lente = " << Xlen << " lumcalc = " << lumcalc << endl;
220 
221 // Int_t niter = 0;
222 // while (niter < 20 && TMath::Abs(lumcalc - lumiere) / lumiere > 0.01) {
223 // if (lumcalc > lumiere) {
224 // Xlen2 = Xlen;
225 // }
226 // else {
227 // Xlen1 = Xlen;
228 // }
229 // Xlen = (Xlen1 + Xlen2) / 2.;
230 // Yrap = idline->Eval(Xlen, 0, "S");
231 // lumcalc = Calculate(kLumiere, Yrap, Xlen);
232 // //cout << niter << " : Rapide = " << Yrap << " Lente = " << Xlen << " lumcalc = " << lumcalc << endl;
233 // niter++;
234 
235 // }
236 // // TMarker *mrk = new TMarker(Xlen,Yrap,2);
237 // // mrk->SetMarkerSize(2);
238 // // mrk->SetMarkerColor(kRed);
239 // // if(idgcsi->IsDrawn()) idgcsi->IsDrawn()->cd();
240 // // else {new TCanvas; idgcsi->Draw();}
241 // // mrk->Draw();
242 // }
243 // else {
244 // KVIDCutLine* imf_line = (KVIDCutLine*)idgcsi->GetCut("IMF_line");
245 // if (!imf_line) {
246 // //Warning("DeduceACQParameters","%s, No IMF_line defined",GetName());
247 // return;
248 // }
249 // else {
250 // Double_t Yrap1, Yrap2, Xlen1, Xlen2;
251 // imf_line->GetStartPoint(Xlen1, Yrap1);
252 // imf_line->GetEndPoint(Xlen2, Yrap2);
253 // Yrap1 += 10.; //au-dessus de la ligne fragment
254 // Yrap2 += 10.; //au-dessus de la ligne fragment
255 // Double_t lumcalc1 = Calculate(kLumiere, Yrap1, Xlen1);
256 // Double_t lumcalc2 = Calculate(kLumiere, Yrap2, Xlen2);
257 // if (lumiere < lumcalc1) {
258 // Xlen2 = Xlen1;
259 // Yrap2 = Yrap1;
260 // lumcalc2 = lumcalc1;
261 // Xlen1 = GetPedestal("L");
262 // Yrap1 = imf_line->Eval(Xlen1, 0, "S") + 10.;
263 // lumcalc1 = Calculate(kLumiere, Yrap1, Xlen1);
264 // //cout << "Extrapolating before start of IMF line" << endl;
265 // }
266 // else if (lumiere > lumcalc2) {
267 // Xlen1 = Xlen2;
268 // Yrap1 = Yrap2;
269 // lumcalc1 = lumcalc2;
270 // Xlen2 = 4095;
271 // Yrap2 = imf_line->Eval(Xlen2, 0, "S") + 10.;
272 // lumcalc2 = Calculate(kLumiere, Yrap2, Xlen2);
273 // //cout << "Extrapolating after end of IMF line" << endl;
274 // }
275 // //cout << "Xlen1=" << Xlen1 << " Yrap1="<<Yrap1<< " Lum_min = " << lumcalc1 << endl;
276 // //cout << "Xlen2=" << Xlen2 << " Yrap2=" << Yrap2<< " Lum_max = " << lumcalc2 << endl;
277 
278 // Xlen = (Xlen1 + Xlen2) / 2.;
279 // Yrap = imf_line->Eval(Xlen) + 10.;//au-dessus de la ligne fragment
280 // Double_t lumcalc = Calculate(kLumiere, Yrap, Xlen);
281 // //cout << "-1 : Rapide = " << Yrap << " Lente = " << Xlen << " lumcalc = " << lumcalc << endl;
282 
283 // Int_t niter = 0;
284 // while (niter < 20 && TMath::Abs(lumcalc - lumiere) / lumiere > 0.01) {
285 // if (lumcalc > lumiere) {
286 // Xlen2 = Xlen;
287 // }
288 // else {
289 // Xlen1 = Xlen;
290 // }
291 // Xlen = (Xlen1 + Xlen2) / 2.;
292 // Yrap = imf_line->Eval(Xlen) + 10.;//au-dessus de la ligne fragment
293 // lumcalc = Calculate(kLumiere, Yrap, Xlen);
294 // //cout << niter << " : Rapide = " << Yrap << " Lente = " << Xlen << " lumcalc = " << lumcalc << endl;
295 // niter++;
296 // }
297 // if (niter == 20) {
298 // Xlen = -1;
299 // Yrap = -1;
300 // Mt = -1;
301 // }
302 // // TMarker *mrk = new TMarker(Xlen,Yrap,2);
303 // // mrk->SetMarkerSize(2);
304 // // mrk->SetMarkerColor(kBlue);
305 // // if(idgcsi->IsDrawn()) idgcsi->IsDrawn()->cd();
306 // // else {new TCanvas; idgcsi->Draw();}
307 // // mrk->Draw();
308 // }
309 
310 // }
311 // if (Xlen > 0) Xlen_sum += Xlen;
312 // if (Yrap > 0) Yrap_sum += Yrap;
313 // }
314 // GetACQParam("R")->SetData((UShort_t)Yrap_sum);
315 // GetACQParam("L")->SetData((UShort_t)Xlen_sum);
316 // GetACQParam("T")->SetData(Mt);
317 
318 }
319 
320 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
bool Bool_t
double Double_t
float Float_t
char * Form(const char *fmt,...)
void SetLabel(const Char_t *lab)
Definition: KVBase.h:194
Output signal from detector obtained by calibration.
CsI(Tl) scintillation detectors of the INDRA multidetector array.
Definition: KVCsI.h:15
void DeduceACQParameters(KVEvent *, KVNumberList &)
Definition: KVCsI.cpp:132
Double_t GetCorrectedEnergy(KVNucleus *, Double_t lum=-1., Bool_t transmission=kTRUE)
void SetACQParams();
Definition: KVCsI.cpp:97
KVCsI()
Definition: KVCsI.cpp:31
void init()
initialise non-persistent pointers
Definition: KVCsI.cpp:14
virtual KVDetectorSignal * GetDetectorSignal(const KVString &type) const
Definition: KVCsI.h:45
void SetAlThickness(Float_t thickAl)
Definition: KVCsI.cpp:70
KVMaterial * GetAbsorber(Int_t i) const
Returns pointer to the i-th absorber in the detector (i=0 first absorber, i=1 second,...
Definition: KVDetector.cpp:645
KVList * fAbsorbers
list of absorbers making up the detector
Definition: KVDetector.h:235
void SetActiveLayer(KVMaterial *actif)
Definition: KVDetector.h:284
Double_t GetDetectorSignalValue(const KVString &type, const KVNameValueList &params="") const
Definition: KVDetector.h:492
virtual void SetEnergy(Double_t e) const
Definition: KVDetector.h:360
Abstract base class container for multi-particle events.
Definition: KVEvent.h:66
Base class for detectors of INDRA array.
void SetType(const Char_t *t)
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:93
virtual void SetThickness(Double_t thick)
Definition: KVMaterial.cpp:454
KVMaterial()
default ctor
Definition: KVMaterial.cpp:77
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Int_t GetA() const
Definition: KVNucleus.cpp:799
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:770
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
virtual void AddFirst(TObject *obj)
virtual TObject * FindObject(const char *name) const
virtual const char * GetName() const
void AbstractMethod(const char *method) const
virtual void Info(const char *method, const char *msgfmt,...) const
const long double um
Definition: KVUnits.h:68