23 #ifndef KVD_RECPRC_CNXN
24 #define KVD_RECPRC_CNXN 1
26 #ifndef KVD_NORECPRC_CNXN
27 #define KVD_NORECPRC_CNXN 0
30 #include "KVMaterial.h"
31 #include "KVPosition.h"
33 #include "KVNucleus.h"
34 #include "KVGeoDetectorNode.h"
35 #include "KVUniqueNameList.h"
36 #include "KVDetectorSignal.h"
163 static Int_t fDetCounter;
168 kIsAnalysed =
BIT(14),
169 kActiveSet =
BIT(15),
170 kUnidentifiedParticle =
BIT(16),
171 kIdentifiedParticle =
BIT(17),
226 template<
typename AbsorberStack>
229 auto z = nuc->
GetZ();
230 auto a = nuc->
GetA();
231 enum SolType solution =
kEmax;
232 if (!transmission) solution =
kEmin;
233 Double_t EINC, ERES = GetEResAfterDetector();
234 if (transmission && ERES > 0.) {
236 EINC = stack->GetIncidentEnergyFromERes(z, a, ERES);
241 EINC = stack->GetIncidentEnergy(z, a, e, solution);
243 SetEResAfterDetector(-1.);
246 ERES = stack->GetERes(z, a, EINC);
248 SetEResAfterDetector(-1.);
249 return (EINC - ERES);
282 if (use_signal_for_raw_data_tree(ds->
GetType())) fDetSignalsForRawTree.
Add(ds);
284 virtual Bool_t use_signal_for_raw_data_tree(
const TString&)
const
293 KVDetector(
const KVDetector&);
295 virtual ~ KVDetector();
303 fActiveLayer = actif;
306 void SetActiveLayer(
Int_t i)
309 if (
auto mat = GetAbsorber(i)) SetActiveLayer(mat);
322 const KVList* GetListOfAbsorbers()
const
326 Int_t GetNumberOfAbsorberLayers()
const
330 void RemoveAllAbsorbers();
332 Double_t GetTotalThicknessInCM()
const
337 double fTotThickness = 0;
338 TIter next(&fAbsorbers);
341 return fTotThickness;
348 const Char_t* GetMaterialName()
const
358 virtual Double_t GetCalibratedEnergy()
const
361 return GetDetectorSignalValue(
"Energy");
368 if (IsSimMode())
return ELoss;
369 if (ELoss > 0)
return ELoss;
370 ELoss = GetCalibratedEnergy();
371 if (ELoss < 0) ELoss = 0;
375 virtual void SetEnergy(
Double_t e)
const
392 -1.,
Bool_t transmission = kTRUE);
398 const Char_t* type)
const;
400 KVList* GetListOfCalibrators()
const
404 Bool_t IsCalibrated()
const
407 return (IsSimMode() && IsDetecting()) || (HasDetectorSignal(
"Energy") && IsOK());
412 virtual void Reset(
Option_t* opt =
"")
423 fParticles =
new KVList(kFALSE);
426 fParticles->
Add(part);
434 if (!fParticles->
GetEntries()) SetAnalysed(kFALSE);
445 if (fParticles) fParticles->
Clear();
448 Int_t GetNHits()
const
450 return (fParticles ? fParticles->
GetEntries() : 0);
457 void SetAnalysed(
Bool_t b = kTRUE)
478 if (!IsDetecting())
return kFALSE;
485 TIter raw_it(&GetListOfDetectorSignals());
492 if (!all)
return kTRUE;
499 return all && count_raw;
501 virtual void RemoveCalibrators();
514 return (s ?
s->GetValue(params) : 0);
525 if (s)
s->SetValue(val);
541 return (s ?
s->GetInverseValue(value, input, params) : 0);
556 return (GetDetectorSignal(type) !=
nullptr);
559 inline void IncrementUnidentifiedParticles(
Int_t n = 1)
562 fUnidentP = (fUnidentP > 0) * fUnidentP;
565 inline void IncrementIdentifiedParticles(
Int_t n = 1)
568 fIdentP = (fIdentP > 0) * fIdentP;
571 Bool_t BelongsToUnidentifiedParticle()
const
573 return TestBit(kUnidentifiedParticle);
575 Bool_t BelongsToIdentifiedParticle()
const
577 return TestBit(kIdentifiedParticle);
580 static KVDetector* MakeDetector(
const Char_t* name,
Float_t thick);
582 virtual Double_t GetEntranceWindowSurfaceArea();
583 TVector3 GetActiveLayerSurfaceCentre()
const
587 return GetSurfaceCentre();
589 TVector3 GetActiveLayerVolumeCentre()
const
594 TGeoBBox* GetActiveLayerShape()
const
611 -1.0,
enum SolType type = kEmax)
override;
627 virtual void SetEResAfterDetector(
Double_t e)
631 virtual Double_t GetEResAfterDetector()
const
636 virtual void ReadDefinitionFromFile(
const Char_t*);
638 virtual void SetSimMode(
Bool_t on = kTRUE)
647 virtual Bool_t IsSimMode()
const
657 virtual Bool_t IsPresent()
const
662 void SetPresent(
Bool_t yes = kTRUE)
666 virtual Bool_t IsDetecting()
const
671 void SetDetecting(
Bool_t yes = kTRUE)
676 virtual Bool_t IsOK()
const
679 return (fPresent && fDetecting);
690 void SetActiveLayerShape(
TGeoBBox*);
692 void SetEntranceWindowShape(
TGeoBBox*);
699 const TVector3 GetCentreOfEntranceWindow()
const
704 return GetEntranceWindow().GetSurfaceCentre();
706 Double_t GetSolidAngle()
const override
730 Double_t GetDistance()
const override
739 if (ROOTGeo())
return fEWPosition.
GetTheta();
742 Double_t GetSinTheta()
const override
748 Double_t GetCosTheta()
const override
757 if (ROOTGeo())
return fEWPosition.
GetPhi();
761 void SetThickness(
Double_t thick)
override;
762 Bool_t IsSingleLayer()
const
767 Bool_t IsMultiLayer()
const
770 return !IsSingleLayer();
772 Bool_t IsGasDetector()
const
777 Bool_t HasSameStructureAs(
const KVDetector*)
const;
778 void SetNameOfArray(
const TString& n)
782 const Char_t* GetNameOfArray()
const
794 return fDetSignalsForRawTree;
804 fDetSignals.
Add(signal);
805 if (use_signal_for_raw_data_tree(type)) fDetSignalsForRawTree.
Add(signal);
810 virtual Int_t GetIndex()
const
819 void SetPressure(
Double_t P)
override;
820 void SetTemperature(
Double_t T)
override;
822 virtual Bool_t IsSegmented()
const
826 virtual void AddEnergyLossInSubDetector(
int,
double) {}
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Base class for all detector calibrations.
Base class for output signal data produced by a detector.
const Char_t * GetType() const override
virtual Bool_t IsRaw() const
void SetDetector(const KVDetector *d)
Information on relative positions of detectors & particle trajectories.
Base class describing elements of array geometry.
Group of detectors which can be treated independently of all others in array.
Extended TList class which owns its objects by default.
Description of physical materials used to construct detectors & targets; interface to range tables.
virtual void SetEnergyLoss(Double_t e) const
virtual Double_t GetThickness() const
virtual Double_t GetEnergyLoss() const
virtual Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A)
void Clear(Option_t *opt="") override
Reset absorber - set stored energy lost by particles in absorber to zero.
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=nullptr)
virtual void DetectParticle(KVNucleus *, TVector3 *norm=nullptr)
virtual void SetMaterial(const Char_t *type)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=nullptr)
void Copy(TObject &obj) const override
Make a copy of this material object.
void Print(Option_t *option="") const override
Show information on this material.
virtual KVMaterial * GetActiveLayer() const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Description of properties and kinematics of atomic nuclei.
Int_t GetZ() const
Return the number of proton / atomic number.
Base class used for handling geometry in a multidetector array.
virtual void GetRandomAngles(Double_t &th, Double_t &ph, Option_t *t="isotropic")
virtual TVector3 GetRandomDirection(Option_t *t="isotropic")
virtual void SetShape(TGeoBBox *)
virtual Double_t GetSolidAngle(void) const
virtual Double_t GetTheta() const
virtual TVector3 GetSurfaceCentre() const
virtual TGeoHMatrix * GetMatrix() const
virtual Double_t GetPhi() const
virtual Double_t GetDistance(void) const
virtual TVector3 GetVolumeCentre() const
virtual Double_t GetSurfaceArea(int npoints=100000) const
virtual Double_t GetSinTheta() const
virtual TVector3 GetSurfaceNormal() const
virtual Double_t GetMisalignmentAngle() const
virtual void SetMatrix(const TGeoHMatrix *)
virtual TGeoBBox * GetShape() const
virtual Double_t GetCosTheta() const
virtual TVector3 GetDirection()
virtual TVector3 GetRandomPointOnSurface() const
KaliVeda extensions to ROOT collection classes.
T * get_object(const TString &name) const
TObject * Remove(TObject *obj) override
Remove object from list.
void Add(TObject *obj) override
TObject * FindObject(const char *name) const override
void Clear(Option_t *option="") override
virtual void SetCleanup(Bool_t enable=kTRUE)
virtual TObject * FindObjectByType(const Char_t *) const
virtual TObject * FindObjectWithNameAndType(const Char_t *name, const Char_t *type) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Optimised list in which named objects can only be placed once.
void Add(TObject *obj) override
virtual Int_t GetEntries() const
const char * GetName() const override
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const