KaliVeda
Toolkit for HIC analysis
KVCsI.cpp
1 #include "KVCsI.h"
2 #include "KVUnits.h"
3 #include <KVCalibratedSignal.h>
4 
5 using namespace std;
6 
8 
9 
10 
16 Double_t KVCsI::GetCorrectedEnergy(KVNucleus* nuc, Double_t lum, Bool_t)
17 {
18  // Calculate calibrated energy loss for a nucleus (Z,A) giving total light output "lum".
19  // By default we use the current value of the detector's `TotLight` signal.
20  //
21  // If we are in simulation (filter) mode, this just returns the energy lost in the detector.
22 
23  if (IsSimMode()) return GetEnergy();
24 
25  if (!(GetDetectorSignalValue("TotLight") > 0)) return -1;
26 
27  Int_t Z = nuc->GetZ();
28  Int_t A = nuc->GetA();
29 
30  Double_t eloss;
31  if (lum > -1) eloss = GetDetectorSignalValue("Energy", Form("INPUT=%g,Z=%d,A=%d", lum, Z, A));
32  else eloss = GetDetectorSignalValue("Energy", Form("Z=%d,A=%d", Z, A));
33  if (((KVCalibratedSignal*)GetDetectorSignal("Energy"))->InversionFailure()) {
34  Info("GetCorrectedEnergy", "Failed to invert Light-Energy calibration for %s with Z=%d A=%d LIGHT=%f",
35  GetName(), Z, A, GetDetectorSignalValue("TotLight"));
36  return -1;
37  }
38 
39  // If TotLight is calculated from fast and slow components (INDRA data before Mesytec acquisition upgrade)
40  // we check that the calculation went well
41  if (!GetDetectorSignal("TotLight")->IsRaw() && !GetDetectorSignal("TotLight")->GetStatus("LightIsGood")) return -1.;
42 
43  if (eloss > 0) {
44  SetEnergy(eloss);
45  return eloss;
46  }
47 
48  return -1.;
49 }
50 
51 
int Int_t
bool Bool_t
double Double_t
char * Form(const char *fmt,...)
Output signal from detector obtained by calibration.
CsI(Tl) scintillation detectors of the INDRA multidetector array.
Definition: KVCsI.h:16
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
void Info(const char *location, const char *fmt,...)
ClassImp(TPyArg)