KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVFAZIAReconNuc.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 $Id: KVFAZIAReconNuc.cpp,v 1.61 2009/04/03 14:28:37 franklan Exp $
3  kvdetectedparticle.cpp - description
4  -------------------
5  begin : Thu Oct 10 2002
6  copyright : (C) 2002 by J.D. Frankland
7  email : frankland@ganil.fr
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #include "Riostream.h"
20 #include "TBuffer.h"
21 #include "TEnv.h"
22 #include "KVDataSet.h"
23 #include "KVFAZIAReconNuc.h"
24 #include "KVList.h"
25 #include "TCollection.h"
26 #include "KVDetector.h"
27 #include "KVMultiDetArray.h"
28 #include "KVFAZIADetector.h"
29 #include "KVIDZAGrid.h"
30 #include "KVLightEnergyCsIFull.h"
31 #include "KVLightEnergyCsI.h"
32 #include "KVIDGCsI.h"
33 
34 using namespace std;
35 
37 
38 //KVFAZIAReconNuc
40 //
41 //Nuclei reconstructed from data measured in the FAZIA array.
42 //Most useful methods are already defined in parent classes KVReconstructedNucleus,
43 //KVNucleus and KVParticle.
45 
46 
47 
48 
51 void KVFAZIAReconNuc::init()
52 {
53  //default initialisations
54  if (gDataSet)
55  SetMassFormula(UChar_t(gDataSet->GetDataSetEnv("KVFAZIAReconNuc.MassFormula", Double_t(kEALMass))));
56  fECSI = fESI1 = fESI2 = 0.;
57 }
58 
59 
60 
63 
65 {
66  //default ctor
67  init();
68 }
69 
70 
71 
74 
77 {
78  //copy ctor
79  init();
80  obj.Copy(*this);
81 
82 }
83 
84 
85 
88 
89 KVFAZIAReconNuc::~KVFAZIAReconNuc()
90 {
91  //dtor
92  init();
93 }
94 
95 
96 
101 
103 {
104  //
105  //Copy this to obj
106  //
108 }
109 
110 
111 
112 
115 
117 {
118  // Print information on particle
119 
120  if (IsIdentified()) {
121 
122  cout << " =======> ";
123  cout << " Z=" << GetZ() << " A=" << ((KVFAZIAReconNuc*) this)->
124  GetA();
125  if (((KVFAZIAReconNuc*) this)->IsAMeasured()) cout << " Areal=" << ((KVFAZIAReconNuc*) this)->GetRealA();
126  else cout << " Zreal=" << GetRealZ();
127 
128  }
129  else {
130  cout << "(unidentified)" << endl;
131  }
132  if (IsCalibrated()) {
133  cout << " Total Energy = " << GetEnergy() << " MeV, Theta=" << GetTheta() << " Phi=" << GetPhi() << endl;
134  cout << " Target energy loss correction : " << GetTargetEnergyLoss() << " MeV" << endl;
135 
136  }
137  else {
138  cout << "(uncalibrated)" << endl;
139  }
140 
141  cout << "Analysis : ";
142  switch (GetStatus()) {
143  case 0:
144  cout <<
145  "Particle alone in group, or identification independently of other"
146  << endl;
147  cout << "particles in group is directly possible." << endl;
148  break;
149 
150  default:
151  cout << "Particle status code" << GetStatus() << endl;
152  break;
153  }
154 
155  cout <<
156  "-------------------------------------------------------------------------------"
157  << endl;
158 }
159 
160 
161 
162 
165 
167 {
168  //reset nucleus' properties
170  init();
171 
172 }
173 
174 
175 
180 
182 {
183  // Access one of the detectors hit by this particle: "SI1", "SI2", or "CSI"
184  // If the requested detector type was not hit (i.e. requesting "CSI" for a particle
185  // which stopped in "SI1" or "SI2") then a null pointer will be returned.
186 
188  return det;
189 }
190 
191 
192 
196 
198 {
199  // Access CSI detector hit by particle. If particle stopped before CSI, returns null pointer.
200 // return Get("CSI");
201  int IDSTOP = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
202  // if(IDSTOP==KVFAZIADetector::kSI1) return (KVFAZIADetector*)GetDetector(0);
203  // if(IDSTOP==KVFAZIADetector::kSI2) return (KVFAZIADetector*)GetDetector(1);
204  if (IDSTOP == KVFAZIADetector::kCSI) return (KVFAZIADetector*)GetDetector(0);
205  return nullptr;
206 }
207 
208 
209 
213 
215 {
216  // Access SI1 detector hit by particle.
217  //return Get("SI1");
218  int IDSTOP = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
219  if (IDSTOP == KVFAZIADetector::kSI1) return (KVFAZIADetector*)GetDetector(0);
220  if (IDSTOP == KVFAZIADetector::kSI2) return (KVFAZIADetector*)GetDetector(1);
221  if (IDSTOP == KVFAZIADetector::kCSI) return (KVFAZIADetector*)GetDetector(2);
222  return nullptr;
223 }
224 
225 
226 
230 
232 {
233  // Access SI2 detector hit by particle. If particle stopped in SI1, returns null pointer.
234  //return Get("SI2");
235  int IDSTOP = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
236  // if(IDSTOP==KVFAZIADetector::kSI1) return (KVFAZIADetector*)GetDetector(0);
237  if (IDSTOP == KVFAZIADetector::kSI2) return (KVFAZIADetector*)GetDetector(0);
238  if (IDSTOP == KVFAZIADetector::kCSI) return (KVFAZIADetector*)GetDetector(1);
239  return nullptr;
240 }
241 
242 
243 
248 
250 {
251  // Return index of dectector in which particle stopped
252  // (see KVFaziaDetector::GetIndex for meaning of index).
253  // If no stopping detector defined (weird?), returns -1.
254 
255  KVFAZIADetector* det(nullptr);
256  if (!(det = (KVFAZIADetector*)GetStoppingDetector())) return -1;
257  return det->GetIndex();
258 }
259 
260 
261 
262 
265 
267 {
268  //Returns kTRUE if particle stopped in the given detector: "SI1", "SI2" or "CSI"
269  return (GetStoppingDetector() == Get(label));
270 }
271 
272 
273 
277 
279 {
280  // Return the identifier of the detector in which particle stopped.
281  // For the definition of possible returned values, see KVFAZIADetector::GetIdentifier
282 
283  return ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
284 }
285 
286 
287 
289 
291 {
292  return ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier() == KVFAZIADetector::kSI2;
293 // return StoppedIn("SI2");
294 }
295 
296 
298 
300 {
301  return ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier() == KVFAZIADetector::kSI1;
302  //return StoppedIn("SI1");
303 }
304 
305 
307 
309 {
310  return ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier() == KVFAZIADetector::kCSI;
311  //return StoppedIn("CSI");
312 }
313 
314 
315 
316 
317 
327 
329 {
330  // Try to identify this nucleus by calling the Identify() function of each
331  // ID telescope crossed by it, starting with the telescope where the particle stopped, in order
332  // - attempt identification only in ID telescopes containing the stopping detector
333  // - only telescopes which have been correctly initialised for the current run are used,
334  // i.e. those for which KVIDTelescope::IsReadyForID() returns kTRUE.
335  // This continues until a successful identification is achieved or there are no more ID telescopes to try.
336  // The identification code corresponding to the identifying telescope is set as the identification code of the particle.
337 
338  //cout << "Dentro il mio Identify" << endl;
339 
340  Obsolete("Identify", "1.13", "1.15");
341 
342 // KVList* idt_list = GetStoppingDetector()->GetIDTelescopes();
343 
344 // // GetStoppingDetector()->Print();
345 // int STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
346 
347 // //idt_list->Print();
348 
349 // KVIdentificationResult* IDR = 0;
350 // Int_t idnumber = 1;
351 
352 // if (idt_list && idt_list->GetSize() > 0) {
353 // // cout << "LOOP over telescopes\n";
354 // KVIDTelescope* idt;
355 // TIter next(idt_list);
356 
357 // while ((idt = (KVIDTelescope*) next())) { // && !IsIdentified()) {
358 // //cout << "NExt Telescope\n";
359 // //idt->Print();
360 // //printf("Checking stopped detector %s\n", idt->GetType());
361 // if (STOPID == KVFAZIADetector::kSI1 && !strcmp(idt->GetType(), "Si-Si")) continue; // why ?
362 // if (STOPID == KVFAZIADetector::kSI2 && !strcmp(idt->GetType(), "Si-CsI")) continue; // why ?
363 
364 // //printf("Initializing IDR\n");
365 // IDR = GetIdentificationResult(idnumber);
366 // //printf("Initialized IDR=%p\n", IDR);
367 // IDR->SetName(idt->GetName());
368 // IDR->SetType(idt->GetType());
369 // /* if(!strcmp(idt->GetType(), "Si-CsI")){
370 // printf("Attempting id with %s tel\n",idt->GetType());
371 // if(!idt->IsReadyForID()) printf("iDT not ready\n");
372 // }*/
373 // if (idt->IsReadyForID()) { // is telescope able to identify for this run ?
374 // // printf("Attempting id with telescope:\n");
375 // // idt->Print();
376 // IDR->IDattempted = kTRUE;
377 // IDR->IDOK = kFALSE;
378 // idt->Identify(IDR);
379 // // if (!strcmp(idt->GetType(), "Si-CsI")) IDR->Print();
380 // if (IDR->IDOK && !(IDR->Z >= 3 && IDR->IDcode == 33)) { //Correspond to Quality code <=3 !!!!!Condizione rigetto Z>3 da CSI
381 // SetIdentification(IDR);
382 // SetIdentifyingTelescope(idt);
383 // SetIsIdentified();
384 // //return;
385 // }
386 // else {
387 // SetIdentification(IDR);
388 // SetIdentifyingTelescope(idt);
389 // //SetIDCode(0);
390 // //SetZandA(0, 0);
391 // //SetIsIdentified();
392 // }
393 // }
394 // else {
395 // IDR->IDattempted = kFALSE;
396 // }
397 // idnumber += 1;
398 // }
399 
400 // KVIdentificationResult partID;
401 // Bool_t ok = kFALSE;
402 // //printf("Beginning Coherency check\n");
403 // if (STOPID == KVFAZIADetector::kSI1) {
404 // ok = CoherencySi(partID);
405 // }
406 // else if (STOPID == KVFAZIADetector::kSI2) {
407 // ok = CoherencySiSi(partID);
408 // }
409 // else if (STOPID == KVFAZIADetector::kCSI) {
410 // ok = CoherencySiCsI(partID);
411 // }
412 // if (ok) {
413 // SetIsIdentified();
414 // KVIDTelescope* idt = (KVIDTelescope*)GetIDTelescopes()->FindObjectByType(partID.GetType());
415 // // if (!idt) {
416 // // Warning("Identify", "cannot find ID telescope with type %s", partID.GetType());
417 // // GetIDTelescopes()->ls();
418 // // partID.Print();
419 // // }
420 // SetIdentifyingTelescope(idt);
421 // SetIdentification(&partID);
422 // //if(GetZ()==3 && IDCode==33) cout << "fine " << GetZ() << endl;
423 // }
424 
425 
426 
427 // }
428 
429 }
430 
431 
432 
434 
436 {
438  if (IDsi && IDsi->IDOK) {
439  theID = *IDsi;
440  //cout << "PSA IDCode" << theID.IDcode << endl;
441  return kTRUE;
442  }
443  else return kFALSE;
444 }
445 
446 
447 
449 
451 {
454  if (IDsisi && IDsisi->IDOK) {
455  theID = *IDsisi;
456  //cout << "SiSi IDCode" << theID.IDcode << endl;
457  return kTRUE;
458  }
459  else if (IDsi && IDsi->IDOK) {
460  theID = *IDsi;
461  // cout << "Si (daSiSi) IDCode" << theID.IDcode << endl;
462  return kTRUE;
463  }
464  else return kFALSE;
465 }
466 
467 
468 
471 
473 {
474  // printf("Check CSI\n");
476  KVIdentificationResult* IDsicsi = GetIdentificationResult("Si-CsI");
477  fCoherent = kTRUE;
478  fPileup = kFALSE;
479 
480  // the following procedure has been copied/adapted from KVINDRAReconNuc::CoherencySiCsI()
481 
482  // Unsuccessful/no CsI id attempt with successful Si-CsI id
483  // Then use Si-CsI identification result
484 
485  //Standard
486 
487  if (IDsicsi && IDsicsi->IDOK) {
488  theID = *IDsicsi;
489  return kTRUE;
490  }
491  else if (IDcsi && IDcsi->IDOK && IDcsi->Z <= 2) {
492  theID = *IDcsi;
493  return kTRUE;
494  }
495 
496 
497 
498  /* if (IDsicsi->IDOK && !IDcsi->IDOK) {
499  theID = *IDsicsi;
500  return kTRUE;
501  }
502 
503  // check coherency of CsI-R/L and Si-CsI identifications
504  if (IDcsi->IDOK) {
505  // gammas: if sicsi ok->sicsi; else keep csi id
506  if (IDcsi->IDcode == 0) {
507  theID = *IDcsi;
508  return kTRUE;
509  }
510 
511 
512  if (IDsicsi->IDOK) {
513 
514  // priority to Si-CsI identification (if any) for Z>=5
515  if (IDsicsi->Z >= 5) {
516  theID = *IDsicsi;
517  return kTRUE;
518  }
519 
520  theID = *IDcsi;
521  Int_t Zref = IDcsi->Z;
522  Int_t Aref = IDcsi->A;
523  if (IDsicsi->Aident) { // Si-CsI provides mass identification
524 
525  if (IDcsi->Z == 4 && IDcsi->A == 8) {
526  // traitement special 8Be
527  // if sicsi => 7Li, it is 8Be (2alpha)
528  // if sicsi => 8He, it is 8He
529  if (IDsicsi->Z < 2 || (IDsicsi->Z == 2 && IDsicsi->A < 7)) {
530  fCoherent = kFALSE;
531  IDsicsi->SetComment("CsI-R/L & Si-CsI identifications not coherent");
532  return kTRUE;
533  } else if (IDsicsi->Z == 2 && IDsicsi->A > 6 && IDsicsi->A < 10) {
534  // accept helium-7,8,9 as 8He
535  theID = *IDsicsi;
536  return kTRUE;
537  } else if ((IDsicsi->Z == 2 && IDsicsi->A > 9) || (IDsicsi->Z == 3 && IDsicsi->A < 6)) {
538  fCoherent = kFALSE;
539  IDsicsi->SetComment("CsI-R/L & Si-CsI identifications not coherent");
540  return kTRUE;
541  } else if (IDsicsi->Z == 3 && IDsicsi->A > 5 && IDsicsi->A < 9) {
542  // accept lithium-6,7,8 as 7Li
543  return kTRUE;
544  } else if ((IDsicsi->Z == 3 && IDsicsi->A > 8) || IDsicsi->Z > 3) {
545  fPileup = kTRUE;
546  IDsicsi->SetComment("Second particle stopping in Si, identification ChIo-Si required");
547  return kTRUE;
548  }
549  }
550  // if CsI says A could be bigger and Si-CsI gives same Z and A+1, use Si-CsI
551  if ((IDsicsi->Z == Zref) && (IDsicsi->A == (Aref + 1))
552  && (IDcsi->IDquality == KVIDGCsI::kICODE1 || IDcsi->IDquality == KVIDGCsI::kICODE3)) {
553  theID = *IDsicsi;
554  return kTRUE;
555  }
556  // if CsI says A could be smaller and Si-CsI gives same Z and A-1, use Si-CsI
557  if ((IDsicsi->Z == Zref) && (IDsicsi->A == (Aref - 1))
558  && (IDcsi->IDquality == KVIDGCsI::kICODE2 || IDcsi->IDquality == KVIDGCsI::kICODE3)) {
559  theID = *IDsicsi;
560  return kTRUE;
561  }
562  // everything else - Z must be same, A +/- 1 unit
563  if (IDsicsi->Z == Zref && TMath::Abs(IDsicsi->A - Aref) < 2) {
564  return kTRUE;
565  } else if (IDsicsi->Z < Zref || (IDsicsi->Z == Zref && IDsicsi->A < (Aref - 1))) {
566  fCoherent = kFALSE;
567  IDsicsi->SetComment("CsI-R/L & Si-CsI identifications not coherent");
568  return kTRUE;
569  } else if (IDsicsi->Z > Zref || (IDsicsi->Z == Zref && IDsicsi->A > (Aref + 1))) {
570  fPileup = kTRUE;
571  IDsicsi->SetComment("Second particle stopping in Si, identification ChIo-Si required");
572  return kTRUE;
573  }
574  } else { // only Z identification from Si-CsI
575  if (IDcsi->Z == 4 && IDcsi->A == 8) {
576  // traitement special 8Be
577  // we ask for Z to be equal 3 in SiCsI, but with no mass identification
578  // we do not try for 8He identification
579  if (IDsicsi->Z < 3) {
580  fCoherent = kFALSE;
581  IDsicsi->SetComment("CsI-R/L & Si-CsI identifications not coherent");
582  return kTRUE;
583  } else if (IDsicsi->Z == 3) {
584  return kTRUE;
585  } else {
586  fPileup = kTRUE;
587  IDsicsi->SetComment("Second particle stopping in Si, identification ChIo-Si required");
588  return kTRUE;
589  }
590  }
591  // everything else
592  if (IDsicsi->Z == Zref) {
593  return kTRUE;
594  } else if (IDsicsi->Z < Zref) {
595  fCoherent = kFALSE;
596  IDsicsi->SetComment("CsI-R/L & Si-CsI identifications not coherent");
597  return kTRUE;
598  } else {
599  fPileup = kTRUE;
600 
601  IDsicsi->SetComment("Second particle stopping in Si, identification ChIo-Si required");
602  return kTRUE;
603  }
604  }
605  }
606  // in all other cases accept CsI identification
607  theID = *IDcsi;
608  return kTRUE;
609  }
610  return kFALSE;
611  */
612  return kFALSE;
613 }
614 
615 
616 
617 
619 
621 {
622  Int_t STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
623  if (STOPID == KVFAZIADetector::kSI1) CalibrateSi1();
624  if (STOPID == KVFAZIADetector::kSI2) CalibrateSi2();
625  if (STOPID == KVFAZIADetector::kCSI) CalibrateCsI();
626 }
627 
628 
629 
631 
633 {
634  KVNucleus avatar;
635  Int_t STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
636  Int_t ntot = 0;
637 
638  if (STOPID == KVFAZIADetector::kSI1) ntot = 1;
639  if (STOPID == KVFAZIADetector::kSI2) return;
640  if (STOPID == KVFAZIADetector::kCSI) return;
641 
642  if (ntot < 1) {
643  return;
644  }
645 
646  Bool_t punch_through = kFALSE;
647  Bool_t incoherency = kFALSE;
648  Bool_t pileup = kFALSE;
649  Bool_t check_error = kFALSE;
650 
651 
652  // printf("Init variables, stopped in %s\n", ((KVFAZIADetector*)GetStoppingDetector())->GetType());
653  double error_si1 = 0;
654  Double_t* eloss = new Double_t[ntot];
655  for (Int_t ii = 0; ii < ntot; ii += 1) eloss[ii] = 0;
656  //TIter next(GetDetectorList());
657  KVFAZIADetector* det = 0;
658  Int_t ndet = 1;
659  Int_t ndet_calib = 0;
660  Double_t etot = 0;
661 
662  fESI1 = fESI2 = fECSI = 0;
663 
664  det = GetSI1();
665  if (det->IsCalibrated()) {
666  eloss[0] = det->GetEnergy();
667  etot = eloss[0];
668  ndet_calib = 1;
669  }
670 
671  //printf("Starting Eloss recon\n");
672  if (ndet_calib == 1) {
673  Double_t E_targ = 0;
674  SetEnergy(etot);
675  if (IsAMeasured()) {
676  Double_t etot_avatar = 0;
677  Double_t chi2 = 0;
678  avatar.SetZAandE(GetZ(), GetA(), GetKE());
679 
680  det = (KVFAZIADetector*)GetDetector(0);
681  Double_t temp = det->GetELostByParticle(&avatar);
682  etot_avatar += temp;
683  chi2 += TMath::Power((eloss[0] - temp) / eloss[0], 2.);
684  avatar.SetKE(avatar.GetKE() - temp);
685  error_si1 = (fESI1 - temp) / fESI1;
686 
687  chi2 /= ndet;
688 
689  if ((avatar.GetKE() / GetKE()) > 0.0) {
690  punch_through = kTRUE;
691  }
692  else if (chi2 > 10.) {
693  incoherency = kTRUE;
694  }
695  else if (TMath::Abs(error_si1) > 0.15) {
696  if (StoppedInCSI() && (fECSI / etot) < 0.03) pileup = kTRUE;
697  else check_error = kTRUE;
698  }
699  else {
700  // if(avatar.GetZ()==15 && avatar.GetA()==32 && detname==242 && sono_dentro==1) {cout << "CODE 0!!!!!!\n\n\n\n"; getchar();}
701  //chi2 /= ndet;
702  }
703 
704  }
705  if (GetZ() && GetEnergy() > 0) {
707  SetTargetEnergyLoss(E_targ);
708  }
709 
710  Double_t E_tot = GetEnergy() + E_targ;
711  SetEnergy(E_tot);
712  // set particle momentum from telescope dimensions (random)
714  SetECode(0);
715  if (punch_through) SetECode(2);
716  if (incoherency) SetECode(3);
717  if (check_error) SetECode(5); //
718  if (pileup) SetECode(4); //
719 
720  SetIsCalibrated();
721  }
722  delete [] eloss;
723 }
724 
725 
726 
730 
732 {
733  // Perform energy calibration of (previously identified) particle
734  //printf("In Calibrate\n");
735  KVNucleus avatar;
736  //printf("start Calibrate\n");
737  Int_t STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
738  Int_t ntot = 0;
739 
740  if (STOPID == KVFAZIADetector::kSI1) return;
741  if (STOPID == KVFAZIADetector::kSI2) ntot = 2;
742  if (STOPID == KVFAZIADetector::kCSI) return;
743 
744  Bool_t punch_through = kFALSE;
745  Bool_t incoherency = kFALSE;
746  Bool_t pileup = kFALSE;
747  Bool_t check_error = kFALSE;
748  Bool_t Si1Calib = false;
749 
750  // printf("Init variables, stopped in %s\n", ((KVFAZIADetector*)GetStoppingDetector())->GetType());
751  double error_si1 = 0, error_si2 = 0; // error_csi=0;
752  Double_t* eloss = new Double_t[ntot];
753  for (Int_t ii = 0; ii < ntot; ii += 1) eloss[ii] = 0;
754  //TIter next(GetDetectorList());
755  KVFAZIADetector* det = 0;
756  Int_t idet = 0;
757  Int_t ndet = 0;
758  Int_t ndet_calib = 0;
759  Double_t etot = 0;
760 
761  fESI1 = fESI2 = fECSI = 0;
762 
763  while ((det = (KVFAZIADetector*)GetDetector(idet))) {
764  // printf("Det %d of %d (%s)\n",idet,ntot,det->GetType());
765  if (det->IsCalibrated()) {
766  eloss[ntot - ndet - 1] = det->GetEnergy();
767  if (det->GetIdentifier() == KVFAZIADetector::kSI1) {
768  fESI1 = eloss[ntot - ndet - 1];
769  Si1Calib = true;
770  }
771  else if (det->GetIdentifier() == KVFAZIADetector::kSI2) {
772  fESI2 = eloss[ntot - ndet - 1];
773  }
774  etot += eloss[ntot - ndet - 1];
775  ndet_calib += 1;
776  }
777  ndet += 1;
778  idet += 1;
779  if (idet == ntot) break;
780  }
781 
782  if (ndet == ndet_calib) {
783  Double_t E_targ = 0;
784  SetEnergy(etot);
785 
786  if (IsAMeasured()) {
787  Double_t etot_avatar = 0;
788  Double_t chi2 = 0;
789  avatar.SetZAandE(GetZ(), GetA(), GetKE());
790  for (Int_t nn = ntot - 1; nn >= 0; nn -= 1) {
791  det = (KVFAZIADetector*)GetDetector(nn);
792  Double_t temp = det->GetELostByParticle(&avatar);
793  etot_avatar += temp;
794  chi2 += TMath::Power((eloss[ntot - 1 - nn] - temp) / eloss[ntot - 1 - nn], 2.);
795  avatar.SetKE(avatar.GetKE() - temp);
796  if (det->GetIdentifier() == KVFAZIADetector::kSI1) error_si1 = (fESI1 - temp) / fESI1;
797  else if (det->GetIdentifier() == KVFAZIADetector::kSI2) error_si2 = (fESI2 - temp) / fESI2;
798  }
799 
800  chi2 /= ndet;
801 
802  if ((avatar.GetKE() / GetKE()) > 0.0) {
803  punch_through = kTRUE;
804  }
805  else if (chi2 > 10.) {
806  incoherency = kTRUE;
807  }
808  else if (TMath::Abs(error_si1) > 0.15 || TMath::Abs(error_si1) + TMath::Abs(error_si2) > 0.15) {
809  if (StoppedInCSI() && (fECSI / etot) < 0.03) pileup = kTRUE;
810  else check_error = kTRUE;
811  }
812  else {
813  // if(avatar.GetZ()==15 && avatar.GetA()==32 && detname==242 && sono_dentro==1) {cout << "CODE 0!!!!!!\n\n\n\n"; getchar();}
814  //chi2 /= ndet;
815  }
816  }
817  if (GetZ() && GetEnergy() > 0) {
819  SetTargetEnergyLoss(E_targ);
820  }
821 
822  Double_t E_tot = GetEnergy() + E_targ;
823  SetEnergy(E_tot);
824  // set particle momentum from telescope dimensions (random)
826  SetECode(0);
827  if (punch_through) SetECode(2);
828  if (incoherency) SetECode(3);
829  if (check_error) SetECode(5); //
830  if (pileup) SetECode(4); //
831 
832  SetIsCalibrated();
833  }
834  else if (ndet_calib == 1) {
835  if (Si1Calib) {
836  //try to recover Si2 Energy loss from Si1
837  //Assign mass if not present
838  if (!IsAMeasured()) {
839  if (GetZ() == 1) SetA(1);
840  else if (GetZ() == 2) SetA(4);
841  else if (GetZ() == 20) SetA(48);
842  else {
843  SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
844  }
845  }
846  Double_t E_targ = 0;
848  SetEnergy(fESI1 + fESI2);
850  Double_t E_tot = GetEnergy() + E_targ;
851  SetECode(1);
852  SetIsCalibrated();
853  SetEnergy(E_tot);
855  }
856  else {
857  if (!IsAMeasured()) {
858  if (GetZ() == 1) SetA(1);
859  else if (GetZ() == 2) SetA(4);
860  else if (GetZ() == 20) SetA(48);
861  else {
862  SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
863  }
864  }
865  Double_t E_targ = 0;
867  SetEnergy(fESI1 + fESI2);
869  Double_t E_tot = GetEnergy() + E_targ;
870  SetECode(1);
871  SetIsCalibrated();
872  SetEnergy(E_tot);
874  }
875  }
876  delete [] eloss;
877 }
878 
879 
880 
882 
884 {
885  if (GetZ() <= 2) CalibrateCsI_Light();
886  else CalibrateCsI_Heavy();
887 }
888 
889 
890 
894 
896 {
897  // Perform energy calibration of (previously identified) particle
898  //printf("In Calibrate\n");
899  KVNucleus avatar;
900  //printf("start Calibrate\n");
901  Int_t STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
902  Int_t ntot = 0;
903 
904  if (STOPID == KVFAZIADetector::kSI1) return;
905  if (STOPID == KVFAZIADetector::kSI2) return;
906  if (STOPID == KVFAZIADetector::kCSI) ntot = 3;
907 
908  if (ntot < 1) {
909  return;
910  }
911  Bool_t punch_through = kFALSE;
912  Bool_t incoherency = kFALSE;
913  Bool_t pileup = kFALSE;
914  Bool_t check_error = kFALSE;
915  Bool_t Si2Calib = false;
916 
917  // printf("Init variables, stopped in %s\n", ((KVFAZIADetector*)GetStoppingDetector())->GetType());
918  double error_si1 = 0, error_si2 = 0; // error_csi=0;
919  Double_t* eloss = new Double_t[ntot];
920  for (Int_t ii = 0; ii < ntot; ii += 1) eloss[ii] = 0;
921  //TIter next(GetDetectorList());
922  KVFAZIADetector* det = 0;
923  Int_t idet = 0;
924  Int_t ndet = 0;
925  Int_t ndet_calib = 0;
926  Double_t etot = 0;
927 
928  fESI1 = fESI2 = fECSI = 0;
929 
930  while ((det = (KVFAZIADetector*)GetDetector(idet))) {
931  // printf("Det %d of %d (%s)\n",idet,ntot,det->GetType());
932  if (det->IsCalibrated()) {
933  //Csi calibration will always be ignored
934  if (det->GetIdentifier() != KVFAZIADetector::kCSI) {
935  eloss[ntot - ndet - 1] = det->GetEnergy();
936  if (det->GetIdentifier() == KVFAZIADetector::kSI1) {
937  fESI1 = eloss[ntot - ndet - 1];
938  }
939  else if (det->GetIdentifier() == KVFAZIADetector::kSI2) {
940  fESI2 = eloss[ntot - ndet - 1];
941  Si2Calib = true;
942  }
943  etot += eloss[ntot - ndet - 1];
944  ndet_calib += 1;
945  }
946  }
947  ndet += 1;
948  idet += 1;
949  if (idet == ntot) break;
950  }
951  //printf("Starting Eloss recon\n");
952  //this will never happen
953  if (ndet == ndet_calib) {
954  Double_t E_targ = 0;
955  SetEnergy(etot);
956 
957  if (IsAMeasured()) {
958  Double_t etot_avatar = 0;
959  Double_t chi2 = 0;
960  avatar.SetZAandE(GetZ(), GetA(), GetKE());
961  for (Int_t nn = ntot - 1; nn >= 0; nn -= 1) {
962  det = (KVFAZIADetector*)GetDetector(nn);
963  Double_t temp = det->GetELostByParticle(&avatar);
964  etot_avatar += temp;
965  chi2 += TMath::Power((eloss[ntot - 1 - nn] - temp) / eloss[ntot - 1 - nn], 2.);
966  avatar.SetKE(avatar.GetKE() - temp);
967  if (det->GetIdentifier() == KVFAZIADetector::kSI1) error_si1 = (fESI1 - temp) / fESI1;
968  else if (det->GetIdentifier() == KVFAZIADetector::kSI2) error_si2 = (fESI2 - temp) / fESI2;
969  }
970 
971  chi2 /= ndet;
972 
973  if ((avatar.GetKE() / GetKE()) > 0.0) {
974  punch_through = kTRUE;
975  }
976  else if (chi2 > 10.) {
977  incoherency = kTRUE;
978  }
979  else if (TMath::Abs(error_si1) > 0.15 || TMath::Abs(error_si1) + TMath::Abs(error_si2) > 0.15) {
980  if (StoppedInCSI() && (fECSI / etot) < 0.03) pileup = kTRUE;
981  else check_error = kTRUE;
982  }
983  else {
984  // if(avatar.GetZ()==15 && avatar.GetA()==32 && detname==242 && sono_dentro==1) {cout << "CODE 0!!!!!!\n\n\n\n"; getchar();}
985  //chi2 /= ndet;
986  }
987 
988  }
989  if (GetZ() && GetEnergy() > 0) {
991  SetTargetEnergyLoss(E_targ);
992  }
993 
994  Double_t E_tot = GetEnergy() + E_targ;
995  SetEnergy(E_tot);
996  // set particle momentum from telescope dimensions (random)
998  SetECode(0);
999  if (punch_through) SetECode(2);
1000  if (incoherency) SetECode(3);
1001  if (check_error) SetECode(5); //
1002  if (pileup) SetECode(4); //
1003 
1004  SetIsCalibrated();
1005  }
1006  else if (ndet_calib == 2) {
1007  //both Si1 and Si2 are calibrated
1008  if (!IsAMeasured()) {
1009 
1010  if (GetZ() == 1) SetA(1);
1011  else if (GetZ() == 2) SetA(4);
1012  else if (GetZ() == 20) SetA(48);
1013  else {
1014  SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1015  }
1016  }
1017 
1018  Double_t E_targ = 0;
1020  SetEnergy(fECSI + fESI1 + fESI2);
1021 
1023  Double_t E_tot = GetEnergy() + E_targ;
1024  SetECode(1);
1025  SetIsCalibrated();
1026  SetEnergy(E_tot);
1028  }
1029  else if (ndet_calib == 1) {
1030  if (Si2Calib) { //recover Esi1 and EcsI from Esi2
1031  if (!IsAMeasured()) {
1032 
1033  if (GetZ() == 1) SetA(1);
1034  else if (GetZ() == 2) SetA(4);
1035  else if (GetZ() == 20) SetA(48);
1036  else {
1037  SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1038  }
1039  }
1040 
1041  Double_t E_targ = 0;
1044  SetEnergy(fECSI + fESI2 + fESI1);
1045 
1047  Double_t E_tot = GetEnergy() + E_targ;
1048  SetECode(1);
1049  SetIsCalibrated();
1050  SetEnergy(E_tot);
1052  }
1053  else { //recover Esi2 and ECSI from ESi1
1054  if (!IsAMeasured()) {
1055 
1056  if (GetZ() == 1) SetA(1);
1057  else if (GetZ() == 2) SetA(4);
1058  else if (GetZ() == 20) SetA(48);
1059  else {
1060  SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1061  }
1062  }
1063  Double_t E_targ = 0;
1064  Double_t Eres = GetSI1()->GetEResFromDeltaE(GetZ(), GetA(), fESI1);
1065  avatar.SetZAandE(GetZ(), GetA(), Eres);
1066  fESI2 = GetSI2()->GetELostByParticle(&avatar);
1067  fECSI = Eres - fESI2;
1068  SetEnergy(fECSI + fESI2 + fESI1);
1070  Double_t E_tot = GetEnergy() + E_targ;
1071  SetECode(6);
1072  SetIsCalibrated();
1073  SetEnergy(E_tot);
1075  }
1076  }
1077  delete [] eloss;
1078 }
1079 
1080 
1081 
1085 
1087 {
1088  // Perform energy calibration of (previously identified) particle
1089  //printf("In Calibrate\n");
1090 
1091  Obsolete("CalibrateCsI_Light", "1.11", "1.12");
1092 
1093 // KVNucleus avatar;
1094 // //printf("start Calibrate\n");
1095 // Int_t STOPID = ((KVFAZIADetector*)GetStoppingDetector())->GetIdentifier();
1096 // Int_t ntot = 0;
1097 
1098 // if (STOPID == KVFAZIADetector::kSI1) return;
1099 // if (STOPID == KVFAZIADetector::kSI2) return;
1100 // if (STOPID == KVFAZIADetector::kCSI) ntot = 3;
1101 
1102 // if (ntot < 1) {
1103 // return;
1104 // }
1105 // Bool_t punch_through = kFALSE;
1106 // Bool_t incoherency = kFALSE;
1107 // Bool_t pileup = kFALSE;
1108 // Bool_t check_error = kFALSE;
1109 // Bool_t Si1Calib = false;
1110 // Bool_t Si2Calib = false;
1111 // Bool_t CsICalib = false;
1112 
1113 // // printf("Init variables, stopped in %s\n", ((KVFAZIADetector*)GetStoppingDetector())->GetType());
1114 // double error_si1 = 0, error_si2 = 0; // error_csi=0;
1115 // Double_t* eloss = new Double_t[ntot];
1116 // for (Int_t ii = 0; ii < ntot; ii += 1) eloss[ii] = 0;
1117 // //TIter next(GetDetectorList());
1118 // KVFAZIADetector* det = 0;
1119 // Int_t idet = 0;
1120 // Int_t ndet = 0;
1121 // Int_t ndet_calib = 0;
1122 // Double_t etot = 0;
1123 
1124 // fESI1 = fESI2 = fECSI = 0;
1125 
1126 // while (det = (KVFAZIADetector*)GetDetector(idet)) {
1127 // // printf("Det %d of %d (%s)\n",idet,ntot,det->GetType());
1128 // if (det->IsCalibrated()) {
1129 // if (det->GetIdentifier() == KVFAZIADetector::kCSI) {
1130 // CsICalib = true;
1131 // if (det->GetCalibrator("Channel-Energy")->InheritsFrom("KVLightEnergyCsIFull")) {
1132 // KVLightEnergyCsIFull* calib = (KVLightEnergyCsIFull*)det->GetCalibrator("Channel-Energy");
1133 // calib->SetZ(GetZ());
1134 // calib->SetA(GetA());
1135 // eloss[ntot - ndet - 1] = calib->Compute(det->GetDetectorSignalValue("Q3.Amplitude"));
1136 // //cout << detname << " " << calib->GetParameter(0) << endl;
1137 
1138 // }
1139 // else if (det->GetCalibrator("Channel-Energy")->InheritsFrom("KVLightEnergyCsI") && GetZ()) {
1140 // KVLightEnergyCsI* calib = (KVLightEnergyCsI*)det->GetCalibrator("Channel-Energy");
1141 // calib->SetZ(GetZ());
1142 // calib->SetA(GetA());
1143 // //cout << detname << " " << calib->GetParameter(0) << endl;
1144 // eloss[ntot - ndet - 1] = calib->Compute(det->GetDetectorSignalValue("Q3.Amplitude"));
1145 // }
1146 // }
1147 // else eloss[ntot - ndet - 1] = det->GetEnergy();
1148 
1149 // if (det->GetIdentifier() == KVFAZIADetector::kSI1) {
1150 // fESI1 = eloss[ntot - ndet - 1];
1151 // Si1Calib = true;
1152 // }
1153 // else if (det->GetIdentifier() == KVFAZIADetector::kSI2) {
1154 // fESI2 = eloss[ntot - ndet - 1];
1155 // Si2Calib = true;
1156 // }
1157 // else if (det->GetIdentifier() == KVFAZIADetector::kCSI) fECSI = eloss[ntot - ndet - 1];
1158 // etot += eloss[ntot - ndet - 1];
1159 // ndet_calib += 1;
1160 
1161 // }
1162 // ndet += 1;
1163 // idet += 1;
1164 // if (idet == ntot) break;
1165 // /*if(GetZ()==8&& (detname==234||detname==221)){
1166 // * cout << det->GetName() << " " <<GetZ() << " " << GetA() << " " << fESI1 << " " << fESI2 << " " << fECSI << endl;
1167 // * cout << ndet << " = " << ndet_calib << endl;
1168 // }*/
1169 // }
1170 // /* if (GetZ() == 3) {
1171 // cout << ndet << " " << ndet_calib << endl;
1172 // }*/
1173 // //printf("Starting Eloss recon\n");
1174 // if (ndet == ndet_calib) {
1175 // Double_t E_targ = 0;
1176 // SetEnergy(etot);
1177 
1178 // if (IsAMeasured()) {
1179 // Double_t etot_avatar = 0;
1180 // Double_t chi2 = 0;
1181 // avatar.SetZAandE(GetZ(), GetA(), GetKE());
1182 // for (Int_t nn = ntot - 1; nn >= 0; nn -= 1) {
1183 // det = (KVFAZIADetector*)GetDetector(nn);
1184 // Double_t temp = det->GetELostByParticle(&avatar);
1185 // etot_avatar += temp;
1186 // chi2 += TMath::Power((eloss[ntot - 1 - nn] - temp) / eloss[ntot - 1 - nn], 2.);
1187 // avatar.SetKE(avatar.GetKE() - temp);
1188 // if (det->GetIdentifier() == KVFAZIADetector::kSI1) error_si1 = (fESI1 - temp) / fESI1;
1189 // else if (det->GetIdentifier() == KVFAZIADetector::kSI2) error_si2 = (fESI2 - temp) / fESI2;
1190 // }
1191 
1192 // chi2 /= ndet;
1193 
1194 // if ((avatar.GetKE() / GetKE()) > 0.0) {
1195 // punch_through = kTRUE;
1196 // }
1197 // else if (chi2 > 10.) {
1198 // incoherency = kTRUE;
1199 // }
1200 // else if (TMath::Abs(error_si1) > 0.15 || TMath::Abs(error_si1) + TMath::Abs(error_si2) > 0.15) {
1201 // if (StoppedInCSI() && (fECSI / etot) < 0.03) pileup = kTRUE;
1202 // else check_error = kTRUE;
1203 // }
1204 // else {
1205 // // if(avatar.GetZ()==15 && avatar.GetA()==32 && detname==242 && sono_dentro==1) {cout << "CODE 0!!!!!!\n\n\n\n"; getchar();}
1206 // //chi2 /= ndet;
1207 // }
1208 
1209 // }
1210 // if (GetZ() && GetEnergy() > 0) {
1211 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1212 // SetTargetEnergyLoss(E_targ);
1213 // }
1214 
1215 // Double_t E_tot = GetEnergy() + E_targ;
1216 // SetEnergy(E_tot);
1217 // // set particle momentum from telescope dimensions (random)
1218 // GetAnglesFromStoppingDetector();
1219 // SetECode(0);
1220 // if (punch_through) SetECode(2);
1221 // if (incoherency) SetECode(3);
1222 // if (check_error) SetECode(5); //
1223 // if (pileup) SetECode(4); //
1224 
1225 // SetIsCalibrated();
1226 // }
1227 // else if (ndet_calib == 2) {
1228 // if (!CsICalib) { //Si1 and Si2 are calibrated
1229 // if (!IsAMeasured()) {
1230 
1231 // if (GetZ() == 1) SetA(1);
1232 // else if (GetZ() == 2) SetA(4);
1233 // else if (GetZ() == 20) SetA(48);
1234 // else {
1235 // SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1236 // }
1237 // }
1238 
1239 // Double_t E_targ = 0;
1240 // fECSI = GetSI2()->GetEResFromDeltaE(GetZ(), GetA(), fESI2);
1241 // SetEnergy(fECSI + fESI1 + fESI2);
1242 
1243 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1244 // Double_t E_tot = GetEnergy() + E_targ;
1245 // SetECode(1);
1246 // SetIsCalibrated();
1247 // SetEnergy(E_tot);
1248 // GetAnglesFromStoppingDetector();
1249 // }
1250 // else if (!Si2Calib) {
1251 // if (!IsAMeasured()) {
1252 
1253 // if (GetZ() == 1) SetA(1);
1254 // else if (GetZ() == 2) SetA(4);
1255 // else if (GetZ() == 20) SetA(48);
1256 // else {
1257 // SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1258 // }
1259 // }
1260 // Double_t E_targ = 0;
1261 // Double_t Eres = GetSI1()->GetEResFromDeltaE(GetZ(), GetA(), fESI1);
1262 // avatar.SetZAandE(GetZ(), GetA(), Eres);
1263 // fESI2 = GetSI2()->GetELostByParticle(&avatar);
1264 // // fECSI=Eres-fESI2;
1265 // SetEnergy(fECSI + fESI2 + fESI1);
1266 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1267 // Double_t E_tot = GetEnergy() + E_targ;
1268 // SetECode(8);
1269 // SetIsCalibrated();
1270 // SetEnergy(E_tot);
1271 // GetAnglesFromStoppingDetector();
1272 // }
1273 // else {
1274 // if (!IsAMeasured()) {
1275 
1276 // if (GetZ() == 1) SetA(1);
1277 // else if (GetZ() == 2) SetA(4);
1278 // else if (GetZ() == 20) SetA(48);
1279 // else {
1280 // SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1281 // }
1282 // }
1283 // Double_t E_targ = 0;
1284 // fESI1 = GetSI1()->GetDeltaEFromERes(GetZ(), GetA(), fESI2 + fECSI);
1285 // SetEnergy(fECSI + fESI2 + fESI1);
1286 
1287 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1288 // Double_t E_tot = GetEnergy() + E_targ;
1289 // SetECode(1);
1290 // SetIsCalibrated();
1291 // SetEnergy(E_tot);
1292 // GetAnglesFromStoppingDetector();
1293 
1294 
1295 
1296 
1297 // }
1298 // }
1299 // else if (ndet_calib == 1) {
1300 // if (Si2Calib) { //recover Esi1 and EcsI from Esi2
1301 // if (!IsAMeasured()) {
1302 
1303 // if (GetZ() == 1) SetA(1);
1304 // else if (GetZ() == 2) SetA(4);
1305 // else if (GetZ() == 20) SetA(48);
1306 // else {
1307 // SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1308 // }
1309 // }
1310 // Double_t E_targ = 0;
1311 // fECSI = GetSI2()->GetEResFromDeltaE(GetZ(), GetA(), fESI2);
1312 // fESI1 = GetSI1()->GetDeltaEFromERes(GetZ(), GetA(), fESI2 + fECSI);
1313 // SetEnergy(fECSI + fESI2 + fESI1);
1314 
1315 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1316 // Double_t E_tot = GetEnergy() + E_targ;
1317 // SetECode(1);
1318 // SetIsCalibrated();
1319 // SetEnergy(E_tot);
1320 // GetAnglesFromStoppingDetector();
1321 // }
1322 // else if (Si1Calib) { //recover Esi2 and ECSI from ESi1
1323 // if (!IsAMeasured()) {
1324 
1325 // if (GetZ() == 1) SetA(1);
1326 // else if (GetZ() == 2) SetA(4);
1327 // else if (GetZ() == 20) SetA(48);
1328 // else {
1329 // SetA(1.04735 + 1.99941 * GetZ() + 0.00683224 * TMath::Power(GetZ(), 2.));
1330 // }
1331 // }
1332 // Double_t E_targ = 0;
1333 // Double_t Eres = GetSI1()->GetEResFromDeltaE(GetZ(), GetA(), fESI1);
1334 // avatar.SetZAandE(GetZ(), GetA(), Eres);
1335 // fESI2 = GetSI2()->GetELostByParticle(&avatar);
1336 // fECSI = Eres - fESI2;
1337 // SetEnergy(fECSI + fESI2 + fESI1);
1338 // E_targ = gMultiDetArray->GetTargetEnergyLossCorrection(this);
1339 // Double_t E_tot = GetEnergy() + E_targ;
1340 // SetECode(6);
1341 // SetIsCalibrated();
1342 // SetEnergy(E_tot);
1343 // GetAnglesFromStoppingDetector();
1344 // }
1345 // else {
1346 // //this will never happen since CSI calibration requires at least Si1 or Si2 to be calibrated
1347 
1348 // }
1349 // }
1350 // delete [] eloss;
1351 }
1352 
1353 
1354 
1355 
1356 
1357 
1358 
1361 
1363 {
1364  // Perform Pulse Shape Analysis for all detectors hit by this particle
1365 
1366  KVFAZIADetector* det = 0;
1367 
1368  TIter nextd(GetDetectorList());
1369  while ((det = (KVFAZIADetector*)nextd())) {
1370  det->ComputePSA();
1371  }
1372 
1373 }
1374 
1375 
1376 
int Int_t
KVDataSet * gDataSet
Definition: KVDataSet.cpp:29
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
unsigned char UChar_t
char Char_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
const char Option_t
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Definition: KVDataSet.cpp:758
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVDetector.cpp:276
virtual Double_t GetEnergy() const
Definition: KVDetector.h:348
Bool_t IsCalibrated() const
Definition: KVDetector.h:389
virtual Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres)
Base class for FAZIA detectors.
Int_t GetIdentifier() const
Int_t GetIndex() const
void ComputePSA()
Perform Pulse Shape Analysis on all signals.
virtual void CalibrateCsI_Heavy()
Int_t GetIdentifierOfStoppingDetector() const
virtual void Identify()
Bool_t StoppedIn(const Char_t *dettype) const
Returns kTRUE if particle stopped in the given detector: "SI1", "SI2" or "CSI".
KVFAZIADetector * Get(const Char_t *label) const
virtual Bool_t CoherencySiSi(KVIdentificationResult &theID)
virtual Bool_t CoherencySiCsI(KVIdentificationResult &theID)
printf("Check CSI\n");
void ComputePSA()
Perform Pulse Shape Analysis for all detectors hit by this particle.
virtual void CalibrateCsI()
void init()
default initialisations
virtual void Calibrate()
virtual void Clear(Option_t *t="")
reset nucleus' properties
KVFAZIADetector * GetSI1() const
Float_t fECSI
csi contribution to energy
Bool_t StoppedInSI2() const
KVFAZIAReconNuc()
default ctor
Int_t GetIndex() const
virtual void CalibrateSi1()
virtual void Copy(TObject &) const
virtual void CalibrateCsI_Light()
KVFAZIADetector * GetSI2() const
virtual void CalibrateSi2()
KVFAZIADetector * GetCSI() const
Bool_t StoppedInCSI() const
Bool_t StoppedInSI1() const
void Print(Option_t *option="") const
Print information on particle.
Float_t fESI2
si2 contribution to energy
virtual Bool_t CoherencySi(KVIdentificationResult &theID)
Float_t fESI1
si1 contribution to energy
Full result of one attempted particle identification.
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
Int_t Z
Z of particle found (if Zident==kTRUE)
virtual Double_t GetEResFromDeltaE(Int_t Z, Int_t A, Double_t dE=-1.0, enum SolType type=kEmax)
virtual Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus *)
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Int_t GetA() const
Definition: KVNucleus.cpp:799
void SetA(Int_t a)
Definition: KVNucleus.cpp:655
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
Definition: KVNucleus.cpp:733
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:770
Double_t GetTheta() const
Definition: KVParticle.h:682
Double_t GetEnergy() const
Definition: KVParticle.h:623
void SetKE(Double_t ecin)
Definition: KVParticle.cpp:230
Double_t GetPhi() const
Definition: KVParticle.h:690
Double_t GetKE() const
Definition: KVParticle.h:616
void SetEnergy(Double_t e)
Definition: KVParticle.h:601
Nuclei reconstructed from data measured by a detector array .
KVDetector * GetDetector(const TString &label) const
virtual Double_t GetTargetEnergyLoss() const
const KVSeqCollection * GetDetectorList() const
virtual void Copy(TObject &) const
KVIdentificationResult * GetIdentificationResult(Int_t i)
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
virtual void SetTargetEnergyLoss(Double_t e)
virtual void GetAnglesFromReconstructionTrajectory(Option_t *opt="random")
virtual void Clear(Option_t *option="")
virtual Bool_t IsAMeasured() const
virtual TObject * FindObjectByLabel(const Char_t *) const
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
Double_t Power(Double_t x, Double_t y)
Double_t Abs(Double_t d)