KaliVeda
Toolkit for HIC analysis
KVINDRABackwardGroupReconstructor.cpp
1 //Created by KVClassFactory on Tue Feb 27 11:35:25 2018
2 //Author: John Frankland,,,
3 
4 #include "KVINDRABackwardGroupReconstructor.h"
5 
7 
8 
9 
13 {
14  // Coherency analysis for backward rings 10-17 of INDRA
15 
16  PART.SetParameter("UseFullChIoEnergyForCalib", !(theChio && theChio->GetNHits() > 1));
17  bool ok = false;
18  if (PART.GetStoppingDetector()->IsType("CSI")) {
19  // particles stopping in CsI detectors
20  // check coherency of CsI-R/L and Si-CsI identifications
21  ok = CoherencyChIoCsI(PART);
22  }
23  else {
24  // particle stopped in ChIo (=> Zmin)
25  ok = PART.IsIdentified() && identifying_telescope;
26  }
27 
28  return ok;
29 }
30 
31 
32 
47 
49 {
50  // Special calibration for particles in rings 10 to 17
51  // We set the energy calibration code for the particle here
52  // kECode0 = no calibration (e.g. gammas)
53  // kECode1 = everything OK
54  // kECode2 = small warning, for example if energy loss in a detector is calculated
55  // kECode15 = bad, calibration is no good
56  // The contributions from ChIo & CsI are stored in particle parameters
57  // INDRA.ECHIO and INDRA.ECSI
58  // If the contribution is calculated rather than measured, it is stored as a negative value
59 
60  // change fUseFullChioenergyforcalib for "coherency" particles
61  // we assume they are calibrated after all other particles in group have
62  // been identified, calibrated, and their energy contributions removed
63  // from the ChIo
64  if (PART->GetIDCode() == KVINDRA::IDCodes::ID_CI_SI_COHERENCY
65  || PART->GetIDCode() == KVINDRA::IDCodes::ID_CI_COHERENCY
66  || PART->GetIDCode() == KVINDRA::IDCodes::ID_CI_MULTIHIT)
67  PART->SetParameter("UseFullChIoEnergyForCalib", kTRUE);
68 
69  Bool_t stopped_in_chio = kTRUE;
70  auto csi = GetCsI(PART);
71  if (csi) {
72  stopped_in_chio = kFALSE;
73  if (csi->IsCalibrated(Form("Z=%d,A=%d",PART->GetZ(),PART->GetA())) && csi->GetDetectorSignalValue("TotLight") > 0) {
74  /* CSI ENERGY CALIBRATION */
75  if (PART->GetIDCode() == KVINDRA::IDCodes::ID_CSI_PSA && PART->IsIsotope(4, 8)) {
76  fECsI = DoBeryllium8Calibration(PART);
77  }
78  else
79  fECsI = csi->GetCorrectedEnergy(PART, -1., kFALSE);
80  }
81  else {
82  SetNoCalibrationStatus(PART);
83  return;
84  }
85  if (fECsI <= 0 && (PART->GetECode() != KVINDRA::ECodes::SOME_ENERGY_LOSSES_CALCULATED)) { // DoBeryllium8Calibration returns fECsI<0 with ECode=SOME_ENERGY_LOSSES_CALCULATED if OK
86  SetBadCalibrationStatus(PART);// problem with CsI energy - no calibration
87  return;
88  }
89  }
90 
91  if (theChio) {
92  /* IONISATION CHAMBER ENERGY CONTRIBUTION */
93  // if fUseFullChIoEnergyForCalib = kFALSE, ChIo was hit by other particles in group
94  // therefore we have to estimate the ChIo energy for this particle using the CsI energy
95  // if fPileupChIo = kTRUE, there appears to be another particle stopped in the ChIo
96  // therefore we have to estimate the ChIo energy for this particle using the CsI energy
97  Double_t ERES = TMath::Abs(fECsI);
98  if (!PART->GetParameters()->GetBoolValue("PileupChIo") &&
99  PART->GetParameters()->GetBoolValue("UseFullChIoEnergyForCalib")
100  && theChio->IsCalibrated()) {
101  // all is apparently well
102  Bool_t ci_transmission = kTRUE;
103  if (stopped_in_chio) {
104  ci_transmission = kFALSE;
105  }
106  else {
107  theChio->SetEResAfterDetector(ERES);
108  }
109  fEChIo = theChio->GetCorrectedEnergy(PART, -1., ci_transmission);
110  if (fEChIo <= 0) {
111  if (!stopped_in_chio && ERES > 0) {
112  if (!CalculateChIoDEFromResidualEnergy(PART, ERES)) return;
113  }
114  }
115  }
116  else {
117  if (!stopped_in_chio && ERES > 0) {
118  if (!CalculateChIoDEFromResidualEnergy(PART, ERES)) return;
119  }
120  else {
121  // particle stopped in ChIo, no calibration available
122  SetNoCalibrationStatus(PART);
123  return;
124  }
125  }
126  }
127 
128  PART->SetEnergy(TMath::Abs(fECsI) + TMath::Abs(fEChIo));
129 }
130 
131 
132 
141 
142 Bool_t KVINDRABackwardGroupReconstructor::CoherencyChIoCsI(KVReconstructedNucleus& PART)
143 {
144  // Called by Identify() for particles stopping in CsI detectors on rings 10-17,
145  // which have a ChIo detector just in front of them.
146  //
147  // fPileupChIo = kTRUE if ChIo-CsI identification gives Z >> CsI-R/L identification
148  // this means that the particle identified in CsI-R/L is correct,
149  // and there is probably a second particle which stopped in the ChIo
150  // detector at the same time (will be added as a Zmin/code5)
151 
156 
157  PART.SetParameter("PileupChIo", kFALSE);
158 
159  // Unsuccessful/no CsI id attempt with successful ChIo-CsI id ?
160  // Then use ChIo-CsI identification result
161  if (IDcsi && !IDcsi->IDOK) {
162  if (IDcicsi && IDcicsi->IDOK) {
163  partID = *IDcicsi;
164  identifying_telescope = idt_cicsi;
165  return kTRUE;
166  }
167  }
168 
169  // check coherency of CsI-R/L and ChIo-CsI identifications
170  if (IDcsi && IDcsi->IDOK) {
171 
172  // We check the coherency of the identifications
173  // Because ChIo-Csi identification is not of very high quality (compared to CsI R-L),
174  // we only check that the Z given by ChIo-CsI is < Zref+1
175  // If not, we can suspect the presence of another particle in the ChIo
176 
177  if (IDcicsi && IDcicsi->IDOK) {
178  Int_t Zref = IDcsi->Z;
179  if (IDcicsi->Z > (Zref + 1) && PART.GetParameters()->GetBoolValue("UseFullChIoEnergyForCalib")) {
180  PART.SetParameter("PileupChIo", kTRUE);
181  IDcicsi->SetComment("Possible pile-up in ChIo");
182  }
183  }
184 
185  // in all other cases accept CsI identification
186  partID = *IDcsi;
187  identifying_telescope = idt_csi;
188  return kTRUE;
189  }
190  return kFALSE;
191 }
192 
193 
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
Definition: KVBase.h:177
const KVSeqCollection * GetIDTelescopes() const
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:85
Reconstruct data in rings 10-17 of INDRA.
void DoCalibration(KVReconstructedNucleus *PART) override
Full result of one attempted particle identification.
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
void SetComment(const Char_t *c)
Int_t Z
Z of particle found (if Zident==kTRUE)
Bool_t GetBoolValue(const Char_t *name) const
Int_t GetA() const
Definition: KVNucleus.cpp:796
Bool_t IsIsotope(Int_t Z, Int_t A) const
Definition: KVNucleus.h:330
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:767
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
void SetParameter(const Char_t *name, ValType value) const
Definition: KVParticle.h:822
void SetEnergy(Double_t e)
Definition: KVParticle.h:602
Nuclei reconstructed from data measured by a detector array .
virtual Int_t GetECode() const
KVIdentificationResult * GetIdentificationResult(Int_t i)
const KVReconNucTrajectory * GetReconstructionTrajectory() const
virtual Int_t GetIDCode() const
virtual TObject * FindObjectByType(const Char_t *) const
Double_t Abs(Double_t d)
ClassImp(TPyArg)