1#include "KVReconstructedNucleus.h"
2#include "KVIDTelescope.h"
4#include "KVMultiDetArray.h"
52 :
KVNucleus(), fIDResults(
"KVIdentificationResult", 5)
56#if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
93 for (R__i = 0; R__i < 5; R__i++) {
103 if (gMultiDetArray) {
144 "Particle alone in group, or identification independently of other particles in group is directly possible." << endl;
149 "Particle reconstructed after identification of others in group and subtraction of their calculated energy losses in common detectors."
155 "Particle identification estimated after arbitrary sharing of energy lost in common detectors between several reconstructed particles."
161 "Particle stopped in first stage of telescope. Estimation of minimum Z."
167 "Undetectable pile-up in first member of identifying telesscope (apparent status=OK). Would lead to incorrect identification by DE-E method (Z and/or A overestimated)."
173 "Undetectable ghost particle in filtered simulation. Another particle passed through all of the same detectors (pile-up)."
218 for (
int i = ndets - 1; i >= 0; i--) {
220 if (det) det->
Print(
"data");
232 cout <<
" =======> ";
233 cout <<
" Z=" <<
GetZ() <<
" A=" <<
GetA();
235 else cout <<
" Zreal=" <<
GetRealZ();
238 cout <<
"(unidentified)" << endl;
245 cout <<
"(uncalibrated)" << endl;
247 cout <<
"RECONSTRUCTION STATUS : " << endl;
255#if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
282 Int_t nidres = GetNumberOfIdentificationResults();
283 for (
int i = 1; i <= nidres; ++i) {
286 robj.
SetBit(kIsIdentified, TestBit(kIsIdentified));
287 robj.
SetBit(kIsCalibrated, TestBit(kIsCalibrated));
288 robj.
SetBit(kCoherency, TestBit(kCoherency));
289 robj.
SetBit(kZMeasured, TestBit(kZMeasured));
290 robj.
SetBit(kAMeasured, TestBit(kAMeasured));
313 d->GetHits()->Add(
this);
329 if (
GetGroup() && strncmp(opt,
"N", 1))
430 TIter next_aligned(aligned);
466 if (idt_list && idt_list->
GetSize() > 0) {
469 TIter next(idt_list);
471 Int_t n_success_id = 0;
481 if (IDR->
IDOK) n_success_id++;
486 if (n_success_id < 1 &&
532 ::Error(
"KVReconstructedNucleus::AnalyseParticlesInGroup",
"No particles in group ?");
613 Info(
"AnalyseGroups",
"OK after analysis of particles in groups");
654 double small_solid = 1.e+09;
658 if (
n->GetDetector()->GetSolidAngle() < small_solid) {
659 angle_det =
n->GetDetector();
660 small_solid =
n->GetDetector()->GetSolidAngle();
663 if (!strcmp(opt,
"random")) {
758 if (gMultiDetArray) {
767 if (in_streamer)
gr->AddHit(
this);
773 n->GetDetector()->AddHit(
this);
774 if (
IsIdentified())
n->GetDetector()->IncrementIdentifiedParticles();
775 else n->GetDetector()->IncrementUnidentifiedParticles();
806 n->GetDetector()->RemoveHit(
this);
807 if (
IsIdentified())
n->GetDetector()->IncrementIdentifiedParticles(-1);
808 else n->GetDetector()->IncrementUnidentifiedParticles(-1);
814 n->GetDetector()->AddHit(
this);
815 if (
IsIdentified())
n->GetDetector()->IncrementIdentifiedParticles();
816 else n->GetDetector()->IncrementUnidentifiedParticles();
874 if (Edet < 0.1) Edet = 0.;
877 if (Einc < 0.1)
break;
889 if (Edet < 0.1) Edet = 0.;
892 if (Einc < 0.1)
break;
912 if (
GetParameters()->IsValue(
"Coherent",
false)) printf(
"/not coherent/");
913 if (
GetParameters()->IsValue(
"Pileup",
true)) printf(
"/pileup/");
const Bool_t kIterBackward
Base class for detector geometry description.
void IncrementIdentifiedParticles(Int_t n=1)
void IncrementUnidentifiedParticles(Int_t n=1)
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
KVList * GetAlignedIDTelescopes()
KVGroup * GetGroup() const
virtual void SetEnergyLoss(Double_t e) const
virtual Double_t GetEnergy() const
const Char_t * GetNameOfArray() const
UShort_t GetSegment() const
virtual Bool_t IsDetecting() const
virtual TList * GetAlignedDetectors(UInt_t direction=1)
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
void AddHit(KVNucleus *part)
TVector3 GetRandomDirection(Option_t *t="isotropic")
virtual void Print(Option_t *option="") const
TString GetPathString() const
void AddUnidentifiedParticle(int modify_identified=-1) const
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
void IterateBackFrom(const KVGeoDetectorNode *node0=nullptr) const
KVGeoDetectorNode * GetNextNode() const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Group of detectors which can be treated independently of all others in array.
void Reset(Option_t *opt="")
const KVGeoDNTrajectory * FindReconTraj(const KVString &path)
void AddHit(KVNucleus *kvd)
KVGeoStrucElement * GetArray() const
Base class for all detectors or associations of detectors in array which can identify charged particl...
virtual Bool_t IsReadyForID()
@ kCalibStatus_NoCalibrations
virtual Bool_t Identify(KVIdentificationResult *, Double_t x=-1., Double_t y=-1.)
virtual void CalculateParticleEnergy(KVReconstructedNucleus *nuc)
virtual Int_t GetCalibStatus() const
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 Print(Option_t *opt="") const
void Copy(TObject &) const
Copy this to obj.
Bool_t Aident
= kTRUE if A of particle established
Double_t PID
= "real" Z if Zident==kTRUE and Aident==kFALSE, "real" A if Zident==Aident==kTRUE
Int_t A
A of particle found (if Aident==kTRUE)
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDcode
a general identification code for this type of identification
Bool_t Zident
=kTRUE if Z of particle established
Extended TList class which owns its objects by default.
virtual Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus *)
virtual void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
virtual void Print(Option_t *opt="") const
const Char_t * GetStringValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
virtual void Clear(Option_t *opt="")
void SetZ(Int_t z, Char_t mt=-1)
virtual void Copy(TObject &) const
Copy this KVNucleus into the KVNucleus object referenced by "obj".
Int_t GetZ() const
Return the number of proton / atomic number.
Double_t GetTheta() const
const Char_t * GetName() const
return the field fName
Double_t GetEnergy() const
void SetMomentum(const TVector3 *v)
void SetParameter(const Char_t *name, ValType value) const
KVNameValueList * GetParameters() const
void SetEnergy(Double_t e)
Path through detector array used to reconstruct detected particle.
void ls(Option_t *="") const
Int_t GetNumberOfIndependentIdentifications() const
Nuclei reconstructed from data measured by a detector array .
virtual void SetIDCode(UShort_t s)
virtual void Reconstruct(KVDetector *kvd)
void PrintStatusString() const
virtual Bool_t IsZMeasured() const
virtual void SetAMeasured(Bool_t yes=kTRUE)
Float_t fRealZ
Z returned by identification routine.
void SetReconstructionTrajectory(const KVReconNucTrajectory *t)
Method called in initial reconstruction of particle.
virtual Double_t GetTargetEnergyLoss() const
void CopyAndMoveReferences(const KVReconstructedNucleus *)
KVIdentificationResult * GetIdentificationResult(Int_t i)
void SetNSegDet(Int_t seg)
Bool_t InArray(const TString &) const
Returns kTRUE if particle was detected in array with given name.
const KVReconNucTrajectory * fReconTraj
trajectory used to reconstruct particle
void ls(Option_t *="") const
Int_t GetNumberOfIdentificationResults() const
virtual void Print(Option_t *option="") const
virtual void Copy(TObject &) const
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
Bool_t IsCalibrated() const
virtual void SubtractEnergyFromAllDetectors()
KVHashList fDetList
non-persistent list of pointers to detectors
Float_t fRealA
A returned by identification routine.
void SetIdentification(KVIdentificationResult *, KVIDTelescope *)
static UInt_t GetNUnidentifiedInGroup(KVGroup *grp)
KVReconstructedNucleus()
default ctor.
Bool_t IsIdentified() const
void RebuildReconTraj(bool in_streamer=true)
virtual Int_t GetIDCode() const
KVGroup * GetGroup() const
TClonesArray fIDResults
results of every identification attempt made for this nucleus, in order of the ID telescopes used
virtual void SetTargetEnergyLoss(Double_t e)
KVString fDetNames
list of names of detectors through which particle passed
void ModifyReconstructionTrajectory(const KVReconNucTrajectory *t)
virtual void GetAnglesFromReconstructionTrajectory(Option_t *opt="random")
KVDetector * GetDetector(const TString &label) const
const KVSeqCollection * GetIDTelescopes() const
void init()
default initialisation
KVString fIDTelName
name of identification telescope which identified this particle (if any)
TString GetArrayName() const
Returns name of array particle was detected in (if known)
void SetRealZ(Float_t zz)
virtual void SetZMeasured(Bool_t yes=kTRUE)
Int_t fNSegDet
number of segmented/independent detectors hit by particle
void ReplaceReconTraj(const TString &traj_name)
void AddDetector(KVDetector *)
Double_t fTargetEnergyLoss
calculated energy lost in target
KVIDTelescope * GetIdentifyingTelescope() const
virtual void Clear(Option_t *option="")
static void AnalyseParticlesInGroup(KVGroup *grp)
const KVSeqCollection * GetDetectorList() const
@ kStatusOKafterShare
of energy losses of other particles in the same group which have Status=0
@ kStatusStopFirstStage
(arbitrarily) between this and the other particle(s) with Status=2
@ kStatusPileupDE
telescope; a minimum Z could be estimated from the measured energy loss.
void SetIdentifyingTelescope(KVIDTelescope *i)
KVIDTelescope * fIDTelescope
non-persistent pointer to identification telescope
const KVReconNucTrajectory * GetReconstructionTrajectory() const
virtual Bool_t IsAMeasured() const
Int_t fAnalStatus
status of particle after analysis of reconstructed event
virtual void Clear(Option_t *option="")
virtual Int_t GetSize() const
virtual void Add(TObject *obj)
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
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void Clear(Option_t *option="") override
TClass * IsA() const override
void Streamer(TBuffer &) override
const char * GetName() const override
void Streamer(TBuffer &) override
const char * GetTitle() const override
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
virtual void Streamer(TBuffer &)
TString & Remove(EStripType s, char c)
Double_t Max(Double_t a, Double_t b)