24 PART->SetIsUncalibrated();
25 PART->SetECode(KVFAZIA::ECodes::NO_CALIBRATION_ATTEMPTED);
27 if (det == csi && PART->GetIDCode() == KVFAZIA::IDCodes::ID_GAMMA) {
34 SetCalibrationStatus(*PART, KVFAZIA::ECodes::NORMAL_CALIBRATION);
35 PART->SetParameter(
"FAZIA.ECSI", Ep);
40 if (PART->GetIDCode() == KVFAZIA::IDCodes::ID_STOPPED_IN_FIRST_STAGE) {
44 SetCalibrationStatus(*PART, KVFAZIA::ECodes::NORMAL_CALIBRATION);
45 PART->SetParameter(
"FAZIA.ESI1", Ep);
50 if (PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI1_PSA) {
51 if (si1->IsCalibrated()) {
52 double e1 = si1->GetCorrectedEnergy(PART, -1.,
kFALSE);
55 "IDCODE=11 Z=%d A=%d calibrated SI1 E=%f",
56 PART->GetZ(), PART->GetA(), e1);
59 PART->SetParameter(
"FAZIA.ESI1", e1);
61 SetCalibrationStatus(*PART, KVFAZIA::ECodes::NORMAL_CALIBRATION);
66 if (PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI1_SI2
67 || PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI1_SI2_MAYBE_PUNCH_THROUGH
68 || PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI1_SI2_PUNCH_THROUGH) {
69 if (si1->IsCalibrated() && si2->IsCalibrated()) {
71 bool calc_e1(
false), calc_e2(
false);
72 if ((e2 = si2->GetEnergy()) > 0) {
73 if (!((e1 = si1->GetEnergy()) > 0)) {
74 e1 = si1->GetDeltaEFromERes(PART->GetZ(), PART->GetA(), e2);
78 else if ((e1 = si1->GetEnergy()) > 0) {
80 e2 = si1->GetEResFromDeltaE(PART->GetZ(), PART->GetA());
84 PART->SetParameter(
"FAZIA.ESI1", (calc_e1 ? -e1 : e1));
85 PART->SetParameter(
"FAZIA.ESI2", (calc_e2 ? -e2 : e2));
86 if (e1 > 0 && e2 > 0) {
87 PART->SetEnergy(e1 + e2);
88 SetCalibrationStatus(*PART, (calc_e1 || calc_e2) ? KVFAZIA::ECodes::SOME_ENERGY_LOSSES_CALCULATED : KVFAZIA::ECodes::NORMAL_CALIBRATION);
94 if (PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI2_CSI || PART->GetIDCode() == KVFAZIA::IDCodes::ID_SI12_CSI) {
98 if (csi->IsCalibrated(part_id) && si1->IsCalibrated() && si2->IsCalibrated()) {
100 double esi1 = si1->GetEnergy();
101 double esi2 = si2->GetEnergy();
102 double ecsi = csi->GetDetectorSignalValue(
"Energy", part_id);
103 PART->SetParameter(
"FAZIA.ESI1", esi1);
104 PART->SetParameter(
"FAZIA.ESI2", esi2);
105 PART->SetParameter(
"FAZIA.ECSI", ecsi);
106 PART->SetEnergy(esi1 + esi2 + ecsi);
107 SetCalibrationStatus(*PART, KVFAZIA::ECodes::NORMAL_CALIBRATION);
116 bool si1_pileup = PART->GetParameters()->GetBoolValue(
"si1_pileup");
118 if (si1->IsCalibrated() && si1->GetEnergy() && si2->IsCalibrated() && si2->GetEnergy() && !si1_pileup) {
120 double deltaE = si1->GetEnergy() + si2->GetEnergy();
121 KVDetector si1si2(
"Si", si1->GetThickness() + si2->GetThickness());
123 PART->SetParameter(
"FAZIA.ESI1", si1->GetEnergy());
124 PART->SetParameter(
"FAZIA.ESI2", si2->GetEnergy());
125 PART->SetParameter(
"FAZIA.ECSI", -ecsi);
126 PART->SetEnergy(deltaE + ecsi);
127 if (PART->GetZ() > 2) SetCalibrationStatus(*PART, KVFAZIA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
128 else SetCalibrationStatus(*PART, KVFAZIA::ECodes::ENERGY_LOSSES_TENTATIVELY_CALCULATED);
134 if (PART->GetIDCode() == KVFAZIA::IDCodes::ID_CSI_PSA) {
136 bool si1_pileup = PART->GetParameters()->GetBoolValue(
"si1_pileup");
137 bool si2_pileup = PART->GetParameters()->GetBoolValue(
"si2_pileup");
144 std::unordered_map<std::string, bool> is_calculated;
145 is_calculated[
"csi"] = is_calculated[
"si2"] = is_calculated[
"si1"] =
false;
146 if (csi->IsCalibrated(part_id)) ecsi = csi->GetDetectorSignalValue(
"Energy", part_id);
147 if (!si2_pileup && si2->IsCalibrated()) esi2 = si2->GetEnergy();
148 if (!si1_pileup && si1->IsCalibrated()) esi1 = si1->GetEnergy();
150 if (si2_pileup && csi->IsCalibrated(part_id) && ecsi > 0) {
151 esi2 = si2->GetDeltaEFromERes(PART->GetZ(), PART->GetA(), ecsi);
152 is_calculated[
"si2"] =
true;
153 esi1 = si1->GetDeltaEFromERes(PART->GetZ(), PART->GetA(), esi2 + ecsi);
154 is_calculated[
"si1"] =
true;
157 else if (si1_pileup && csi->IsCalibrated(part_id) && si2->IsCalibrated() && ecsi > 0 && esi2 > 0) {
158 esi1 = si1->GetDeltaEFromERes(PART->GetZ(), PART->GetA(), esi2 + ecsi);
159 is_calculated[
"si1"] =
true;
165 if (!csi->IsCalibrated(part_id) &&
166 (si1->IsCalibrated() && si1->GetEnergy() && si2->IsCalibrated() && si2->GetEnergy())
167 && !si1_pileup && !si2_pileup && PART->GetZ() > 2) {
169 double deltaE = esi1 + esi2;
170 KVDetector si1si2(
"Si", si1->GetThickness() + si2->GetThickness());
172 is_calculated[
"csi"] =
true;
175 if (ecsi > 0 && esi1 > 0 && esi2 > 0) {
176 if (is_calculated[
"si1"] || is_calculated[
"si2"] || is_calculated[
"csi"])
177 SetCalibrationStatus(*PART, KVFAZIA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
179 SetCalibrationStatus(*PART, KVFAZIA::ECodes::NORMAL_CALIBRATION);
180 PART->SetEnergy(esi1 + esi2 + ecsi);
181 PART->SetParameter(
"FAZIA.ESI1", is_calculated[
"si1"] ? -esi1 : esi1);
182 PART->SetParameter(
"FAZIA.ESI2", is_calculated[
"si2"] ? -esi2 : esi2);
183 PART->SetParameter(
"FAZIA.ECSI", is_calculated[
"csi"] ? -ecsi : ecsi);
187 if (PART->IsCalibrated()) {
191 if (PART->GetZ() && PART->GetEnergy() > 0) {
192 E_targ = GetTargetEnergyLossCorrection(PART);
193 PART->SetTargetEnergyLoss(E_targ);
195 Double_t E_tot = PART->GetEnergy() + E_targ;
196 PART->SetEnergy(E_tot);
199 PART->GetAnglesFromReconstructionTrajectory();
203 avatar.
SetZAandE(PART->GetZ(), PART->GetA(), PART->GetKE());
211 PART->GetReconstructionTrajectory()->IterateBackFrom();
212 while ((node = PART->GetReconstructionTrajectory()->GetNextNode())) {
215 PART->SetParameter(
Form(
"FAZIA.avatar.E%s", det->
GetLabel()), temp);
242 PART->
SetECode(KVFAZIA::ECodes::NO_CALIBRATION_ATTEMPTED);
245 if (PART->
GetIDCode() == KVFAZIA::IDCodes::ID_SI1_PSA) {
250 "IDCODE=11 Z=%d A=%d calibrated SI1 E=%f",
261 if (PART->
GetIDCode() == KVFAZIA::IDCodes::ID_SI1_SI2) {
276 if (e1 > 0 && e2 > 0) {
391 bool si1_pileup(
false), si2_pileup(
false);
406 bool coherency_particle_added_in_si1si2 =
false;
411 if (si1si2->second->IDOK) {
415 partID = *(si1si2->second);
435 if ((si2csi->second->Z >
partID.
Z)) {
448 if (si1si2->second->Z >
partID.
Z) {
451 if (si1si2->second->IDOK) {
461 coherency_particle_added_in_si1si2 =
true;
468 if ((sipsa->second->Z >
partID.
Z)) {
470 if (sipsa->second->IDOK && !coherency_particle_added_in_si1si2) {
498 if (idr_si1si2->
IDOK && idr_si1si2->
IDcode == KVFAZIA::IDCodes::ID_SI1_SI2) {
499 if (zz < idr_si1si2->Z) {
503 partID = *(si1si2->second);
515 if (si1si2->second->IDOK) {
520 partID = *(si1si2->second);
535 if (sipsa->second->IDOK) {
538 partID = *(sipsa->second);
543 partID.
SetComment(
"particle partially identified by pulse shape analysis in SI1, although it is punching through (no SI2 signal or SI1-SI2 id)");
626 bool treat_punch_through =
true;
632 assert(!pt_flag.
End());
635 treat_punch_through = zrange.
Contains(idr->
Z);
637 if (treat_punch_through) {
638 bool pt_treated =
false;
641 idr->
IDcode = KVFAZIA::IDCodes::ID_SI1_SI2_MAYBE_PUNCH_THROUGH;
642 idr->
SetComment(
"Apparently well-identified particle, but could be punching through to CsI (in which case Z is a minimum)");
647 idr->
IDcode = KVFAZIA::IDCodes::ID_SI1_SI2_PUNCH_THROUGH;
648 idr->
SetComment(
"Particle punching through SI2, identified Z is only a minimum estimation");
671 assert(
csi !=
nullptr);
677 assert(
si1 !=
nullptr);
678 assert(
si2 !=
nullptr);
710 TMath::Abs(part.original_particle->GetParameters()->GetDoubleValue(
"FAZIA.ESI1"))
712 auto ESI2_parent = part.original_particle->GetParameters()->HasDoubleParameter(
"FAZIA.ESI2") ?
713 TMath::Abs(part.original_particle->GetParameters()->GetDoubleValue(
"FAZIA.ESI2"))
727 rnuc->SetReconstructionTrajectory(Rtraj);
729 rnuc->SetParameter(
"COHERENCY",
730 "Particle added to event after consistency checks between identifications and calibrations of other nuclei");
733 for (
int i = part.first_id_result_to_copy; i <= part.max_id_result_index; ++i) {
734 auto IDR = rnuc->GetIdentificationResult(idnumber++);
736 part.original_particle->GetIdentificationResult(i)->
Copy(*IDR);
738 rnuc->SetIsIdentified();
739 rnuc->SetIdentification(rnuc->GetIdentificationResult(1), part.identifying_telescope);
755 double new_q2{0}, new_qh1{0}, new_ql1{0};
769 if (rnuc->GetIDCode() == KVFAZIA::IDCodes::ID_SI1_SI2) {
777 part.identifying_telescope->Identify(&IDR);
781 *(rnuc->GetIdentificationResult(1)) = IDR;
782 rnuc->SetIdentification(rnuc->GetIdentificationResult(1), part.identifying_telescope);
792 if (part.original_particle->GetIdentificationResult(5)->IDOK) {
795 rnuc->ModifyReconstructionTrajectory(Rtraj);
796 part.original_particle->GetIdentificationResult(5)->
Copy(*rnuc->GetIdentificationResult(1));
797 auto idt = (
KVIDTelescope*)Rtraj->GetIDTelescopes()->First();
798 rnuc->SetIdentification(rnuc->GetIdentificationResult(1), idt);
815 if (rnuc->IsIdentified()) {
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
virtual Bool_t IsType(const Char_t *typ) const
const Char_t * GetLabel() const
virtual void SetNumber(UInt_t num)
Bool_t IsLabelled(const Char_t *l) const
Base class for output signal data produced by a detector.
virtual Bool_t IsExpression() const
virtual Bool_t IsRaw() const
virtual Double_t GetValue(const KVNameValueList ¶ms="") const
Base class for detector geometry description.
void SetDetectorSignalValue(const KVString &type, Double_t val) const
Double_t GetInverseDetectorSignalValue(const KVString &output, Double_t value, const KVString &input, const KVNameValueList ¶ms="") const
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
virtual Double_t GetEnergy() const
Bool_t HasDetectorSignal(const KVString &type) const
Bool_t IsCalibrated() const
Double_t GetDetectorSignalValue(const KVString &type, const KVNameValueList ¶ms="") const
virtual Double_t GetCalibratedEnergy() const
const KVSeqCollection & GetListOfDetectorSignals() const
KVGeoDetectorNode * GetNode()
virtual Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres)
Base class for FAZIA detectors.
Reconstruction of particles detected in FAZIA telescopes.
KVGeoDNTrajectory * theTrajectory
1 FAZIA group = 1 telescope with 1 unique trajectory SI1 - SI2 - CSI
KVIDTelescope * fSi1Si2IDTelescope
SI1-SI2 ID Telescope.
void AddCoherencyParticles()
void CalibrateCoherencyParticle(KVReconstructedNucleus *PART)
void ChangeReconstructedTrajectory(KVReconstructedNucleus &PART)
void SetGroup(KVGroup *g)
void IdentifyParticle(KVReconstructedNucleus &PART)
void HandleSI1SI2PunchThrough(KVIdentificationResult *, KVReconstructedNucleus &)
void PostReconstructionProcessing()
Path taken by particles through multidetector geometry.
KVGeoDetectorNode * GetNextNode() const
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
const KVSeqCollection * GetIDTelescopes() const
void IterateBackFrom(const KVGeoDetectorNode *node0=nullptr) const
void Copy(TObject &obj) const
Make a copy of this object.
Information on relative positions of detectors & particle trajectories.
KVSeqCollection * GetTrajectories() const
KVSeqCollection * GetForwardTrajectories() const
KVDetector * GetDetector() const
KVGroup * GetGroup() const
std::unordered_map< std::string, KVIdentificationResult * > id_by_type
identification results by type for current particle
KVReconstructedEvent * GetEventFragment() const
virtual void IdentifyParticle(KVReconstructedNucleus &PART)
Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus *ion)
void SetCalibrationStatus(KVReconstructedNucleus &PART, UShort_t code)
KVIdentificationResult partID
identification to be applied to current particle
void TreatStatusStopFirstStage(KVReconstructedNucleus &)
virtual void SetGroup(KVGroup *g)
std::vector< particle_to_add_from_coherency_analysis > coherency_particles
Group of detectors which can be treated independently of all others in array.
KVGeoStrucElement * GetArray() const
const KVGeoDNTrajectory * GetTrajectoryForReconstruction(const KVGeoDNTrajectory *t, const KVGeoDetectorNode *n) const
Base class for all detectors or associations of detectors in array which can identify charged particl...
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)
Bool_t IdentifyingGridHasFlagWhichBegins(TString flag_beginning)
Bool_t Aident
= kTRUE if A of particle established
TString IdentifyingGridGetFlagWhichBegins(TString flag_beginning)
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDquality
specific quality code returned by identification procedure
Int_t IDcode
a general identification code for this type of identification
Bool_t Zident
=kTRUE if Z of particle established
virtual Double_t GetEResFromDeltaE(Int_t Z, Int_t A, Double_t dE=-1.0, enum SolType type=kEmax)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
Bool_t HasDoubleParameter(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
Int_t GetZ() const
Return the number of proton / atomic number.
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
KVNameValueList * GetParameters() const
Double_t GetEnergy() const
void SetKE(Double_t ecin)
void SetParameter(const Char_t *name, ValType value) const
void SetEnergy(Double_t e)
Path through detector array used to reconstruct detected particle.
Nuclei reconstructed from data measured by a detector array .
Int_t GetNumberOfIdentificationResults() const
Bool_t IsCalibrated() const
const KVReconNucTrajectory * GetReconstructionTrajectory() const
void SetIdentification(KVIdentificationResult *, KVIDTelescope *)
Bool_t IsIdentified() const
virtual Int_t GetIDCode() const
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
virtual void SetTargetEnergyLoss(Double_t e)
void ModifyReconstructionTrajectory(const KVReconNucTrajectory *t)
virtual void GetAnglesFromReconstructionTrajectory(Option_t *opt="random")
@ kStatusStopFirstStage
(arbitrarily) between this and the other particle(s) with Status=2
virtual TObject * Last() const
virtual TObject * First() const
virtual TObject * FindObjectByType(const Char_t *) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
Int_t GetNValues(TString delim) const
virtual const char * GetName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
const long double g
masses
Double_t Max(Double_t a, Double_t b)