KaliVeda
Toolkit for HIC analysis
KVDataPatch_E789_FAZIABadCsICalibFragments.h
1 #ifndef __KVDATAPATCH_E789_FAZIABADCSICALIBFRAGMENTS_H
2 #define __KVDATAPATCH_E789_FAZIABADCSICALIBFRAGMENTS_H
3 
4 #include "KVDataPatch.h"
5 #include "KVReconstructedNucleus.h"
6 #include "KVFAZIA.h"
7 
29 public:
31  {
33  SetName(ClassName());
34  SetTitle(Class()->GetTitle());
35  }
36 
37  Bool_t IsRequired(TString dataset, TString datatype, Int_t,
38  TString dataseries, Int_t datareleasenumber, const TList*)
39  {
40  return (dataset == "INDRAFAZIA.E789") && (datatype == "recon") && (dataseries == "1.12") && (datareleasenumber == 5);
41  }
42 
44  {
45  return false;
46  }
48  {
49  return true;
50  }
53  {
54  if (rnuc->InArray("FAZIA") && rnuc->IsZMeasured() && rnuc->IsCalibrated()
55  && rnuc->GetStoppingDetector()->IsType("CsI") && rnuc->GetZ() > 2)
56  correct_ecsi(rnuc);
57  }
58 
59  void PrintPatchInfo() const;
60 
62  {
70 
71  double ecsi, esi1, esi2;
72  if ((ecsi = rnuc->GetParameters()->GetDoubleValue("FAZIA.ECSI")) > 0
73  && (esi1 = rnuc->GetParameters()->GetDoubleValue("FAZIA.ESI1")) > 0
74  && (esi2 = rnuc->GetParameters()->GetDoubleValue("FAZIA.ESI2")) > 0) {
77  auto si1 = rnuc->GetReconstructionTrajectory()->GetDetector("SI1");
78  auto si2 = rnuc->GetReconstructionTrajectory()->GetDetector("SI2");
79  KVDetector si1si2("Si", si1->GetThickness() + si2->GetThickness());
80  auto new_ecsi = si1si2.GetEResFromDeltaE(rnuc->GetZ(), rnuc->GetA(), esi1 + esi2);
81  if (new_ecsi > 0) {
82  rnuc->SetParameter("DATAPATCH.E789_FAZIABadCsICalibFragments.APPLIED", true);
83  rnuc->SetParameter("FAZIA.ECSI_BAD", ecsi);
84  rnuc->SetParameter("FAZIA.ECSI", -new_ecsi); // calculated CsI energy
85  rnuc->SetECode(KVFAZIA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
87  rnuc->SetEnergy(esi1 + esi2 + new_ecsi);
89  rnuc->UpdateAllFrames();
90  return true;
91  }
92  }
93  return false;
94  }
95 
96  ClassDef(KVDataPatch_E789_FAZIABadCsICalibFragments, 1) //Correct mistaken use of Z=2 CsI calib for all fragments in FAZIA
97 };
98 
99 #endif
int Int_t
bool Bool_t
#define ClassDef(name, id)
virtual Bool_t IsType(const Char_t *typ) const
Definition: KVBase.h:185
Correct mistaken use of Z=2 CsI calib for all fragments in FAZIA.
Bool_t IsRequired(TString dataset, TString datatype, Int_t, TString dataseries, Int_t datareleasenumber, const TList *)
Correction to be applied to reconstructed calibrated data.
Definition: KVDataPatch.h:55
Base class for detector geometry description.
Definition: KVDetector.h:160
virtual Double_t GetEResFromDeltaE(Int_t Z, Int_t A, Double_t dE=-1.0, enum SolType type=kEmax)
Double_t GetDoubleValue(const Char_t *name) const
Int_t GetA() const
Definition: KVNucleus.cpp:802
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:773
void UpdateAllFrames()
Definition: KVParticle.cpp:923
KVNameValueList * GetParameters() const
Definition: KVParticle.h:815
void SetParameter(const Char_t *name, ValType value) const
Definition: KVParticle.h:819
void SetEnergy(Double_t e)
Definition: KVParticle.h:599
KVDetector * GetDetector(const TString &label) const
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual Bool_t IsZMeasured() const
Bool_t InArray(const TString &) const
Returns kTRUE if particle was detected in array with given name.
const KVReconNucTrajectory * GetReconstructionTrajectory() const
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
virtual void SetECode(UChar_t s)
virtual void SetTitle(const char *title="")
const char * GetTitle() const override
static TClass * Class()
virtual void SetName(const char *name)
virtual const char * ClassName() const