4 #include "KVINDRAForwardGroupReconstructor.h"
5 #include "KVINDRACodeMask.h"
6 #include "KVIDGChIoSi.h"
10 #include <KVSilicon.h>
23 if (PART.GetStoppingDetector()->IsType(
"CSI")) {
26 ok = CoherencySiCsI(PART);
32 PART.SetParameter(
"UseFullChIoEnergyForCalib", CoherencyChIoSiCsI(PART));
37 ok = PART.IsIdentified() && identifying_telescope;
39 PART.SetParameter(
"UseFullChIoEnergyForCalib", !(theChio->GetNHits() > 1));
128 if (PART->
GetIDCode() == KVINDRA::IDCodes::ID_NEUTRON) {
129 DoNeutronCalibration(PART);
135 auto si = GetSi(PART);
136 auto csi = GetCsI(PART);
138 stopped_in_silicon =
kFALSE;
139 if (csi->IsCalibrated(
Form(
"Z=%d,A=%d",PART->
GetZ(),PART->
GetA())) && csi->GetDetectorSignalValue(
"TotLight") > 0) {
142 fECsI = DoBeryllium8Calibration(PART);
145 fECsI = csi->GetCorrectedEnergy(PART, -1.,
kFALSE);
147 else if ((PART->
GetIDCode()!=KVINDRA::IDCodes::ID_GAMMA) && si && !fPileup && fCoherent && si->IsCalibrated()) {
149 fESi = si->GetCorrectedEnergy(PART);
152 SetBadCalibrationStatus(PART);
155 fECsI = si->GetEResFromDeltaE(PART->
GetZ(), PART->
GetA());
157 auto de_max = csi->GetMaxDeltaE(PART->
GetZ(), PART->
GetA());
159 SetCalibrationStatus(*PART, KVINDRA::ECodes::WARNING_CSI_MAX_ENERGY);
161 SetCalibrationStatus(*PART, KVINDRA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
165 SetNoCalibrationStatus(PART);
168 if (fECsI <= 0 && (PART->
GetECode() != KVINDRA::ECodes::SOME_ENERGY_LOSSES_CALCULATED)) {
169 SetBadCalibrationStatus(PART);
173 if (si && (PART->
GetIDCode()!=KVINDRA::IDCodes::ID_GAMMA)) {
180 if (PART->
GetIDCode() == KVINDRA::IDCodes::ID_STOPPED_IN_FIRST_STAGE && stopped_in_silicon) {
183 if (si->IsCalibrated())
186 SetNoCalibrationStatus(PART);
190 if (!fPileup && fCoherent && si->IsCalibrated()) {
193 if (stopped_in_silicon) {
199 fESi = si->GetCorrectedEnergy(PART, -1., si_transmission);
203 if (!stopped_in_silicon && (
TMath::Abs(fECsI) > 0.0)) {
204 if (!CalculateSiliconDEFromResidualEnergy(PART, si))
return;
208 SetBadCalibrationStatus(PART);
214 if (!stopped_in_silicon && (
TMath::Abs(fECsI) > 0.0)) {
215 if (!CalculateSiliconDEFromResidualEnergy(PART, si))
return;
219 SetNoCalibrationStatus(PART);
225 if (theChio && (PART->
GetIDCode()!=KVINDRA::IDCodes::ID_GAMMA)) {
229 if (fUseFullChIoEnergyForCalib && theChio->IsCalibrated()) {
232 theChio->SetEResAfterDetector(ERES);
233 fEChIo = theChio->GetCorrectedEnergy(PART);
237 fEChIo = theChio->GetCorrectedEnergy(PART, -1.,
kFALSE);
242 if (!CalculateChIoDEFromResidualEnergy(PART, ERES))
return;
248 if (!CalculateChIoDEFromResidualEnergy(PART, ERES))
return;
252 SetNoCalibrationStatus(PART);
273 auto csi = GetCsI(PART);
274 if (csi && csi->IsCalibrated(
Form(
"Z=%d,A=%d",IDcsi->
Z,IDcsi->
A))) {
275 fECsI = csi->GetCorrectedEnergy(&tmp, -1., kFALSE);
277 SetCalibrationStatus(*PART, KVINDRA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
280 SetNoCalibrationStatus(PART);
311 if (theChio && theChio->GetNHits() > 1) {
369 bool fCoherent =
kTRUE;
378 for(
int i_id=2; i_id<=nid; ++i_id)
381 if(next_idr && next_idr->IDattempted && next_idr->IDOK)
386 if(next_idt->HasDetector(the_CsI))
390 identifying_telescope = next_idt;
393 PART.
SetParameter(
"No CsI id",
Form(
"Replaced with %s id", partID.GetIDType()));
399 auto new_stop_det = next_idt->GetDetector(next_idt->GetSize());
400 auto traj = (
KVGeoDNTrajectory*)new_stop_det->GetNode()->GetTrajectories()->First();
404 identifying_telescope = next_idt;
407 PART.
SetParameter(
"No CsI id",
Form(
"Replaced with %s id, stopping detector changed to %s", partID.GetIDType(), new_stop_det->GetName()));
423 identifying_telescope = idt_csi;
430 for(
int i_id=2; i_id<=nid; ++i_id)
433 if(next_idr && next_idr->IDattempted && next_idr->IDOK)
438 if(next_idt->HasDetector(the_CsI))
445 identifying_telescope = next_idt;
448 PART.
SetParameter(
"Bad gamma id",
Form(
"switched to %s id: Z=%d A=%d",next_idr->GetIDType(),next_idr->Z,next_idr->A));
456 auto new_stop_det = next_idt->GetDetector(next_idt->GetSize());
457 coherency_particles.push_back(
465 PART.
SetParameter(
"Gamma pileup",
Form(
"added new particle identified in %s", next_idt->GetName()));
477 if ((IDcsi->
Z == 1 || IDcsi->
Z == 2) && IDsicsi->
IDattempted) {
481 identifying_telescope = idt_sicsi;
483 partID.Zident =
kTRUE;
484 partID.Aident =
kTRUE;
487 partID.IDcode = KVINDRA::IDCodes::ID_NEUTRON;
539 identifying_telescope = idt_sicsi;
548 if(IDcsi->
Z==1 && IDsicsi->
Z==1)
551 identifying_telescope = idt_sicsi;
556 if (IDcsi->
Z == 4 && IDcsi->
A == 8) {
560 if (IDsicsi->
Z < 2 || (IDsicsi->
Z == 2 && IDsicsi->
A < 7)) {
562 IDsicsi->
SetComment(
"CsI-R/L & Si-CsI identifications not coherent");
567 else if (IDsicsi->
Z == 2 && IDsicsi->
A > 6 && IDsicsi->
A < 10) {
570 identifying_telescope = idt_sicsi;
575 else if ((IDsicsi->
Z == 2 && IDsicsi->
A > 9) || (IDsicsi->
Z == 3 && IDsicsi->
A < 6)) {
577 IDsicsi->
SetComment(
"CsI-R/L & Si-CsI identifications not coherent");
582 else if (IDsicsi->
Z == 3 && IDsicsi->
A > 5 && IDsicsi->
A < 9) {
588 else if ((IDsicsi->
Z == 3 && IDsicsi->
A > 8) || IDsicsi->
Z > 3) {
590 IDsicsi->
SetComment(
"Second particle stopping in Si, identification ChIo-Si required");
597 if ((IDsicsi->
Z == Zref) && (IDsicsi->
A == (Aref + 1))
600 identifying_telescope = idt_sicsi;
606 if ((IDsicsi->
Z == Zref) && (IDsicsi->
A == (Aref - 1))
609 identifying_telescope = idt_sicsi;
615 if((IDsicsi->
Z == Zref) && (IDsicsi->
A < Aref)
619 identifying_telescope = idt_sicsi;
625 if (IDsicsi->
Z == Zref &&
TMath::Abs(IDsicsi->
A - Aref) < 2) {
630 else if (IDsicsi->
Z < Zref || (IDsicsi->
Z == Zref && IDsicsi->
A < (Aref - 1))) {
632 IDsicsi->
SetComment(
"CsI-R/L & Si-CsI identifications not coherent");
637 else if (IDsicsi->
Z > Zref || (IDsicsi->
Z == Zref && IDsicsi->
A > (Aref + 1))) {
639 IDsicsi->
SetComment(
"Second particle stopping in Si");
646 if (IDcsi->
Z == 4 && IDcsi->
A == 8) {
650 if (IDsicsi->
Z < 3) {
652 IDsicsi->
SetComment(
"CsI-R/L & Si-CsI identifications not coherent");
657 else if (IDsicsi->
Z == 3) {
664 IDsicsi->
SetComment(
"Second particle stopping in Si, identification ChIo-Si required");
671 if (IDsicsi->
Z == Zref) {
676 else if (IDsicsi->
Z < Zref) {
678 IDsicsi->
SetComment(
"CsI-R/L & Si-CsI identifications not coherent");
686 IDsicsi->
SetComment(
"Second particle stopping in Si, identification ChIo-Si required");
698 identifying_telescope = idt_csi;
703 else if (IDsi && IDsi->
IDOK)
710 coherency_particles.push_back(
729 if (IDsicsi->
Z < Zref) fCoherent =
kFALSE;
730 else fPileup =
kTRUE;
737 if (IDsicsi->
Z > Zref) fPileup =
kTRUE;
777 SetBadCalibrationStatus(n);
784 SetCalibrationStatus(*n, KVINDRA::ECodes::SOME_ENERGY_LOSSES_CALCULATED);
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
virtual Bool_t IsType(const Char_t *typ) const
Base class for detector geometry description, interface to energy-loss calculations.
virtual void SetEResAfterDetector(Double_t e)
KVGeoDetectorNode * GetNode()
Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres) override
virtual Double_t GetCorrectedEnergy(KVNucleus *, Double_t e=-1., Bool_t transmission=kTRUE)
Path taken by particles through multidetector geometry.
const KVSeqCollection * GetIDTelescopes() const
const KVSeqCollection * GetTrajectories() const
KVGroup * GetGroup() 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...
KVDetector * GetDetector(UInt_t n) const
Reconstruct data in rings 1-9 of INDRA.
void DoCalibration(KVReconstructedNucleus *PART) override
Full result of one attempted particle identification.
Bool_t IDattempted
=kTRUE if identification was attempted
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
void SetComment(const Char_t *c)
Bool_t Aident
= kTRUE if A of particle established
Int_t deltaEpedestal
special code for handling particles which give no signal in deltaE
Int_t A
A of particle found (if Aident==kTRUE)
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDquality
specific quality code returned by identification procedure
Bool_t GetBoolValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Bool_t IsIsotope(Int_t Z, Int_t A) const
Int_t GetZ() const
Return the number of proton / atomic number.
KVNameValueList * GetParameters() const
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 .
virtual Int_t GetECode() const
Int_t GetNumberOfIdentificationResults() const
KVIdentificationResult * GetIdentificationResult(Int_t i)
const KVReconNucTrajectory * GetReconstructionTrajectory() const
Bool_t IsIdentified() const
virtual Int_t GetIDCode() const
KVDetector * GetStoppingDetector() const
void ModifyReconstructionTrajectory(const KVReconNucTrajectory *t)
TObject * First() const override
virtual TObject * FindObjectByType(const Char_t *) const
const char * GetName() const override