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),
225 template<
typename AbsorberStack>
228 auto z = nuc->
GetZ();
229 auto a = nuc->
GetA();
230 enum SolType solution =
kEmax;
231 if (!transmission) solution =
kEmin;
232 Double_t EINC, ERES = GetEResAfterDetector();
233 if (transmission && ERES > 0.) {
236 EINC = stack->GetIncidentEnergyFromERes(z, a, ERES);
246 EINC = stack->GetIncidentEnergy(z, a, e, solution);
249 SetEResAfterDetector(-1.);
253 ERES = stack->GetERes(z, a, EINC);
256 SetEResAfterDetector(-1.);
257 return (EINC - ERES);
296 KVDetector(
const KVDetector&);
298 virtual ~ KVDetector();
306 fActiveLayer = actif;
309 void SetActiveLayer(
Int_t i)
312 if (
auto mat = GetAbsorber(i)) SetActiveLayer(mat);
325 const KVList* GetListOfAbsorbers()
const
329 Int_t GetNumberOfAbsorberLayers()
const
333 void RemoveAllAbsorbers();
335 Double_t GetTotalThicknessInCM()
const
340 double fTotThickness = 0;
341 TIter next(&fAbsorbers);
344 return fTotThickness;
351 const Char_t* GetMaterialName()
const
361 virtual Double_t GetCalibratedEnergy()
const
364 return GetDetectorSignalValue(
"Energy");
371 if (IsSimMode())
return ELoss;
372 if (ELoss > 0)
return ELoss;
373 ELoss = GetCalibratedEnergy();
374 if (ELoss < 0) ELoss = 0;
378 virtual void SetEnergy(
Double_t e)
const
395 -1.,
Bool_t transmission = kTRUE);
401 const Char_t* type)
const;
403 KVList* GetListOfCalibrators()
const
407 Bool_t IsCalibrated()
const
410 return (IsSimMode() && IsDetecting()) || (HasDetectorSignal(
"Energy") && IsOK());
415 virtual void Reset(
Option_t* opt =
"")
426 fParticles =
new KVList(kFALSE);
429 fParticles->
Add(part);
437 if (!fParticles->
GetEntries()) SetAnalysed(kFALSE);
448 if (fParticles) fParticles->
Clear();
451 Int_t GetNHits()
const
453 return (fParticles ? fParticles->
GetEntries() : 0);
460 void SetAnalysed(
Bool_t b = kTRUE)
481 if (!IsDetecting())
return kFALSE;
488 TIter raw_it(&GetListOfDetectorSignals());
495 if (!all)
return kTRUE;
502 return all && count_raw;
504 virtual void RemoveCalibrators();
517 return (s ?
s->GetValue(params) : 0);
528 if (s)
s->SetValue(val);
544 return (s ?
s->GetInverseValue(value, input, params) : 0);
559 return (GetDetectorSignal(type) !=
nullptr);
562 inline void IncrementUnidentifiedParticles(
Int_t n = 1)
565 fUnidentP = (fUnidentP > 0) * fUnidentP;
568 inline void IncrementIdentifiedParticles(
Int_t n = 1)
571 fIdentP = (fIdentP > 0) * fIdentP;
574 Bool_t BelongsToUnidentifiedParticle()
const
576 return TestBit(kUnidentifiedParticle);
578 Bool_t BelongsToIdentifiedParticle()
const
580 return TestBit(kIdentifiedParticle);
583 static KVDetector* MakeDetector(
const Char_t* name,
Float_t thick);
585 virtual Double_t GetEntranceWindowSurfaceArea();
586 TVector3 GetActiveLayerSurfaceCentre()
const
590 return GetSurfaceCentre();
592 TVector3 GetActiveLayerVolumeCentre()
const
597 TGeoBBox* GetActiveLayerShape()
const
614 -1.0,
enum SolType type = kEmax)
override;
630 virtual void SetEResAfterDetector(
Double_t e)
634 virtual Double_t GetEResAfterDetector()
const
639 virtual void ReadDefinitionFromFile(
const Char_t*);
641 virtual void SetSimMode(
Bool_t on = kTRUE)
650 virtual Bool_t IsSimMode()
const
660 virtual Bool_t IsPresent()
const
665 void SetPresent(
Bool_t yes = kTRUE)
669 virtual Bool_t IsDetecting()
const
674 void SetDetecting(
Bool_t yes = kTRUE)
679 virtual Bool_t IsOK()
const
682 return (fPresent && fDetecting);
693 void SetActiveLayerShape(
TGeoBBox*);
695 void SetEntranceWindowShape(
TGeoBBox*);
702 const TVector3 GetCentreOfEntranceWindow()
const
707 return GetEntranceWindow().GetSurfaceCentre();
709 Double_t GetSolidAngle()
const override
733 Double_t GetDistance()
const override
742 if (ROOTGeo())
return fEWPosition.
GetTheta();
745 Double_t GetSinTheta()
const override
751 Double_t GetCosTheta()
const override
760 if (ROOTGeo())
return fEWPosition.
GetPhi();
764 void SetThickness(
Double_t thick)
override;
765 Bool_t IsSingleLayer()
const
770 Bool_t IsMultiLayer()
const
773 return !IsSingleLayer();
775 Bool_t IsGasDetector()
const
780 Bool_t HasSameStructureAs(
const KVDetector*)
const;
781 void SetNameOfArray(
const TString& n)
785 const Char_t* GetNameOfArray()
const
803 fDetSignals.
Add(signal);
808 virtual Int_t GetIndex()
const
817 void SetPressure(
Double_t P)
override;
818 void SetTemperature(
Double_t T)
override;
820 virtual Bool_t IsSegmented()
const
824 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.
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