45 fActiveLayer =
nullptr;
47 fIDTelescopes->SetCleanup(
kTRUE);
49 fIDTelAlign->SetCleanup(
kTRUE);
51 fIdentP = fUnidentP = 0;
53 fDepthInTelescope = 0.;
54 fELossF = fEResF = fRangeF = 0;
56 fAlignedDetectors[0] = 0;
57 fAlignedDetectors[1] = 0;
61 fParentStrucList.SetCleanup();
63 fNode.SetDetector(
this);
65 fDetSignals.SetOwner();
68 fDetSignals.ReplaceObjects();
112 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
120 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
136 TIter next(fAbsorbers);
142 Int_t in_actif = fAbsorbers->IndexOf(fActiveLayer);
151 KVDetector::~KVDetector()
216 if (kvp->
GetKE() <= 0.)
227 std::vector<Double_t> thickness;
287 std::vector<Double_t> thickness;
352 clone_part.
SetKE(Einc);
369 if (!strcmp(opt,
"data")) {
388 cout <<
"(Belongs to an unidentified particle)";
391 else if (!strcmp(opt,
"all")) {
402 cout <<
" ### ACTIVE LAYER ### " << endl;
403 cout << option << option;
406 cout <<
" #################### " << endl;
409 cout << option <<
" --- Detected particles:" << endl;
413 cout << option <<
" --- Detector belongs to the following Identification Telescopes:" << endl;
516 Warning(
"AddCalibrator",
"%s : output signal not defined for calibrator %s. No output signal created.",
605 if (strncmp(opt,
"N", 1)) {
655 Error(
"GetAbsorber",
"No absorber list");
659 Error(
"GetAbsorber",
"Nothing in absorber list");
663 Error(
"GetAbsorber",
"i=%d but only %d absorbers in list", i,
682 if (
K->GetOutputSignalType() !=
"") {
771 while ((idt = next())) {
850 if (!transmission) solution =
kEmin;
865 if (transmission && ERES > 0.) {
882 return (EINC - ERES);
925 ELOSS = (ELOSS < 0. ?
GetEnergy() : ELOSS);
926 if (ELOSS <= 0)
return 0;
933 UInt_t last_positive_difference_z = 1;
935 if (mass_formula > -1)
940 while (zmax > zmin + 1) {
946 if (difference < 0.0) {
949 z += (
UInt_t)((zmax - z) / 2 + 0.5);
955 last_positive_difference_z = z;
956 z -= (
UInt_t)((z - zmin) / 2 + 0.5);
960 if (difference < 0) {
963 z = last_positive_difference_z;
1035 if (!mat)
return 0.;
1045 range += this_range;
1047 Einc = mat->
GetERes(Z, A, Einc);
1051 range += this_range;
1139 if (!(ph =
LoadPlugin(
"KVDetector", name))) {
1140 if (!(ph =
LoadPlugin(
"KVDetector", det_type))) {
1178 Double_t dist_to_back = depth + layer_thickness;
1257 if (thick == 0.0)
continue;
1259 for (
int i = 0; i < 8; i++) {
1260 vertices[2 * i] = coords[i].
X();
1261 vertices[2 * i + 1] = coords[i].
Y();
1272 Double_t trans_z = -tot_thick_det / 2. + depth_in_det + dz;
1274 mother_vol->
AddNode(vol, 1, tr);
1280 depth_in_det += thick;
1350 cout <<
"(" <<
v.X() <<
"," <<
v.Y() <<
"," <<
v.Z() <<
")";
1378 auto printvec = [](
const TVector3 &
v) {
1379 cout <<
"(" <<
v.X() <<
"," <<
v.Y() <<
"," <<
v.Z() <<
")";
1385 cout <<
"DETECTOR COORDINATES (in cm):" << endl;
1386 cout <<
"=================================" << endl;
1388 printvec(coords[0]);
1391 printvec(coords[1]);
1394 printvec(coords[2]);
1397 printvec(coords[3]);
1400 cout <<
"DETECTOR DIMENSIONS (in cm):" << endl;
1401 cout <<
"================================" << endl;
1406 cout <<
" AB = " <<
c << endl;
1407 cout <<
" BC = " <<
b << endl;
1408 cout <<
" CD = " <<
d << endl;
1409 cout <<
" AD = " <<
a << endl;
1411 cout <<
"DETECTOR SURFACE AREA = ";
1413 surf =
sqrt(surf) / 400.0;
1414 cout << surf <<
" cm2" << endl;
1434 0., 1.e+04, 2,
"KVDetector",
"EResDet");
1459 0., 1.e+04, 2,
"KVDetector",
"RangeDet");
1484 0., 1.e+04, 2,
"KVDetector",
"ELossActive");
1555 return Einc -
GetERes(Z, A, Einc);
1571 if (Einc <= 0.)
return 0.;
1575 if (eres < 0.) eres = 0.;
1628 if (Z < 1)
return 0.;
1683 if (Z < 1 || Eres <= 0.)
return 0.;
1685 if (Einc <= 0.)
return 0.;
1706 if (Z < 1 || Eres <= 0.)
return 0.;
1779 TEnv fEnvFile(envrc);
1783 while (!layers.
End()) {
1790 thick = dens = press = 0.;
1792 if (pS !=
"" && tS !=
"") {
1799 else if (tS !=
"") {
1804 else if (dS !=
"") {
1856 if (!
GetGroup() || direction > 1)
return 0x0;
1868 if (!
GetGroup() || direction > 1)
return;
1936 punch->
SetTitle(
Form(
"Simple Punch-through %s (MeV) (mass formula %d)",
GetName(), massform));
1939 for (
int Z = 1; Z <= 92; Z++) {
1961 punch->
SetTitle(
Form(
"Simple Punch-through %s (AMeV) (mass formula %d)",
GetName(), massform));
1964 for (
int Z = 1; Z <= 92; Z++) {
2019 if (strcmp(name,
"")) {
2098 if (shape->IsA() == TGeoBBox::Class()) {
2101 else if (shape->IsA() == TGeoTube::Class()) {
2106 Error(
"SetThickness",
"No implementation for %s (%s)", shape->IsA()->
GetName(),
GetName());
2109 pn->
Align(
nullptr, newshape);
2135 for (
int iabs = 0; iabs < nabs; ++iabs) {
2172 return (ds !=
nullptr);
KVIonRangeTableMaterial * M
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kIterBackward
R__EXTERN TGeoManager * gGeoManager
double pow(double, double)
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
virtual Bool_t IsType(const Char_t *typ) const
virtual void SetType(const Char_t *str)
Double_t ProtectedGetX(const TF1 *func, Double_t val, int &status, Double_t xmin=0.0, Double_t xmax=0.0) const
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Output signal from detector obtained by calibration.
virtual Bool_t IsAvailableFor(const KVNameValueList ¶ms) const
Base class for all detector calibrations.
TString GetInputSignalType() const
void SetDetector(KVDetector *d)
TString GetOutputSignalType() const
Signal output from a mathematical combination of other signals.
Base class for output signal data produced by a detector.
virtual Bool_t IsExpression() const
virtual Bool_t IsRaw() const
virtual Bool_t GetValueNeedsExtraParameters() const
virtual Double_t GetValue(const KVNameValueList ¶ms="") const
Base class for detector geometry description.
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
virtual const Char_t * GetArrayName()
virtual Bool_t IsOK() const
void SetMatrix(const TGeoHMatrix *m)
KVPosition fEWPosition
position of entrance window i.e. first volume in detector geometry
virtual Double_t GetMaxDeltaE(Int_t Z, Int_t A)
KVUniqueNameList fParentStrucList
list of geometry structures which directly contain this detector
Int_t GetNumberOfAbsorberLayers() const
virtual void GetVerticesInOwnFrame(TVector3 *, Double_t, Double_t)
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Double_t ELossActive(Double_t *x, Double_t *par)
TList * GetTelescopesForIdentification()
virtual void AddIDTelescope(TObject *idt)
Add ID telescope to list of telescopes to which detector belongs.
KVList * GetAlignedIDTelescopes()
KVList * fCalibrators
list of associated calibrator objects
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
KVGroup * GetGroup() const
void AddDetectorSignal(KVDetectorSignal *ds)
virtual Double_t GetRange(Int_t Z, Int_t A, Double_t Einc)
virtual void SetEnergyLoss(Double_t e) const
Bool_t ReplaceCalibrator(const Char_t *type, KVCalibrator *cal, const KVNameValueList &opts="")
virtual Double_t GetTotalDeltaE(Int_t Z, Int_t A, Double_t Einc)
virtual TGeoVolume * GetGeoVolume()
virtual Double_t GetEnergy() const
virtual TF1 * GetEResFunction(Int_t Z, Int_t A)
virtual Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A)
virtual TGraph * DrawPunchThroughEsurAVsZ(Int_t massform=KVNucleus::kBetaMass)
void AddAbsorber(KVMaterial *)
virtual Double_t GetEnergyLoss() const
virtual Double_t GetEResAfterDetector() const
KVList * fIDTelescopes
list of ID telescopes to which detector belongs
void SetShape(TGeoBBox *s)
void AddParentStructure(KVGeoStrucElement *elem)
Double_t GetTheta() const
Double_t fEResforEinc
used by GetIncidentEnergy & GetCorrectedEnergy
KVList * fIDTelAlign
list of ID telescopes made of this detector and all aligned detectors placed in front of it
virtual Int_t FindZmin(Double_t ELOSS=-1., Char_t mass_formula=-1)
TF1 * fELossF
parametric function dE in active layer vs. incident energy
TList * fAlignedDetectors[2]
stores lists of aligned detectors in both directions
virtual void Clear(Option_t *opt="")
const KVPosition & GetEntranceWindow() const
KVMaterial * GetAbsorber(Int_t i) const
Returns pointer to the i-th absorber in the detector (i=0 first absorber, i=1 second,...
void remove_signal_for_calibrator(KVCalibrator *K)
KVList * fAbsorbers
list of absorbers making up the detector
TList * fIDTele4Ident
list of ID telescopes used for particle ID
TF1 * fEResF
parametric function Eres residual energy after all layers of detector
virtual Double_t GetSmallestEmaxValid(Int_t Z, Int_t A)
Bool_t HasSameStructureAs(const KVDetector *) const
void SetThickness(Double_t thick)
virtual void AddToGeometry()
virtual Double_t GetIncidentEnergy(Int_t Z, Int_t A, Double_t delta_e=-1.0, enum SolType type=kEmax)
virtual KVDetectorSignal * GetDetectorSignal(const KVString &type) const
virtual void ReadDefinitionFromFile(const Char_t *)
Double_t GetTotalThicknessInCM()
Bool_t IsCalibrated() const
virtual TF1 * GetELossFunction(Int_t Z, Int_t A)
void SetActiveLayer(KVMaterial *actif)
Bool_t BelongsToUnidentifiedParticle() const
Double_t RangeDet(Double_t *x, Double_t *par)
KVMaterial * GetActiveLayer() const
virtual void RemoveCalibrators()
virtual Double_t GetEntranceWindowSurfaceArea()
Return surface area of first layer of detector in cm2.
virtual TGraph * DrawPunchThroughEnergyVsZ(Int_t massform=KVNucleus::kBetaMass)
KVUniqueNameList fDetSignals
list of signals associated with detector
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
Int_t fUnidentP
temporary counters, determine state of identified/unidentified particle flags
TF1 * fRangeF
parametric function range of particles in detector
Bool_t AddDetectorSignalExpression(const KVString &type, const KVString &_expr)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
virtual void SetEResAfterDetector(Double_t e)
void SetActiveLayerMatrix(const TGeoHMatrix *)
Set ROOT geometry global matrix transformation to coordinate frame of active layer volume.
virtual void Copy(TObject &obj) const
void RemoveParentStructure(KVGeoStrucElement *elem)
const KVSeqCollection & GetListOfDetectorSignals() const
KVList * fParticles
list of particles hitting detector in an event
virtual TList * GetAlignedDetectors(UInt_t direction=1)
KVGeoDetectorNode * GetNode()
void SetEntranceWindowMatrix(const TGeoHMatrix *)
Set ROOT geometry global matrix transformation to coordinate frame of entrance window.
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
Double_t EResDet(Double_t *x, Double_t *par)
Double_t fDepthInTelescope
used to store depth of detector in parent telescope
KVMaterial * fActiveLayer
The active absorber in the detector.
void AddHit(KVNucleus *part)
KVCalibrator * GetCalibrator(const Char_t *name, const Char_t *type) const
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres)
Int_t fIdentP
temporary counters, determine state of identified/unidentified particle flags
virtual Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres)
void SetEntranceWindowShape(TGeoBBox *)
Set ROOT geometry shape of entrance window.
void ResetAlignedDetectors(UInt_t direction=1)
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
void SetActiveLayerShape(TGeoBBox *)
Set ROOT geometry shape of active layer volume.
void SetAnalysed(Bool_t b=kTRUE)
TString fFName
dynamically generated full name of detector
virtual void Print(Option_t *option="") const
Bool_t fSingleLayer
=kTRUE if detector has a single absorber layer
virtual Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc)
virtual TF1 * GetRangeFunction(Int_t Z, Int_t A)
virtual Double_t GetCorrectedEnergy(KVNucleus *, Double_t e=-1., Bool_t transmission=kTRUE)
void init()
default initialisations
Bool_t AddCalibrator(KVCalibrator *cal, const KVNameValueList &opts="")
Double_t fTotThickness
used to store value calculated by GetTotalThicknessInCM
TGeoBBox * GetShape() const
virtual void SetMaterial(const Char_t *type)
Path taken by particles through multidetector geometry.
const KVSeqCollection * GetIDTelescopes() const
const Char_t * GetFullPathToNode() const
Base class describing elements of array geometry.
Group of detectors which can be treated independently of all others in array.
const KVGeoDNTrajectory * GetTrajectoryForReconstruction(const KVGeoDNTrajectory *t, const KVGeoDetectorNode *n) const
Extended TList class which owns its objects by default.
Description of physical materials used to construct detectors & targets; interface to range tables.
virtual void SetThickness(Double_t thick)
virtual Double_t GetThickness() const
virtual TGeoMedium * GetGeoMedium(const Char_t *="")
virtual void Print(Option_t *option="") const
Show information on this material.
Double_t GetEmaxValid(Int_t Z, Int_t A)
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=nullptr)
virtual void SetMaterial(const Char_t *type)
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
virtual void Clear(Option_t *opt="")
Reset absorber - set stored energy lost by particles in absorber to zero.
Double_t GetEffectiveThickness(TVector3 &norm, TVector3 &direction)
virtual Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
void SetZ(Int_t z, Char_t mt=-1)
void SetMassFormula(UChar_t mt)
Int_t GetZ() const
Return the number of proton / atomic number.
TVector3 * GetPInitial() const
TVector3 GetMomentum() const
KVNameValueList * GetParameters() const
void SetMomentum(const TVector3 &v)
Double_t GetEnergy() const
void SetKE(Double_t ecin)
void SetE0(TVector3 *e=0)
void SetEnergy(Double_t e)
Base class used for handling geometry in a multidetector array.
virtual void SetShape(TGeoBBox *)
Bool_t ROOTGeo() const
Returns kTRUE if ROOT geometry is used, kFALSE if not.
void GetCornerCoordinates(TVector3 *, Double_t=0)
virtual Double_t GetDistance(void) const
virtual Double_t GetSurfaceArea(int npoints=100000) const
virtual void SetMatrix(const TGeoHMatrix *)
virtual TGeoBBox * GetShape() const
void GetCornerCoordinatesInOwnFrame(TVector3 *, Double_t=0)
KaliVeda extensions to ROOT collection classes.
virtual void Clear(Option_t *option="")
virtual Int_t GetSize() const
virtual TObject * At(Int_t idx) const
KVSeqCollection * GetSubListWithType(const Char_t *retvalue) const
virtual TObject * FindObjectByType(const Char_t *) const
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual void Delete(Option_t *option="")
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
void RBegin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
KVString RNext(Bool_t strip_whitespace=kFALSE) const
Associates two detectors placed one behind the other.
Int_t GetDetectorRank(KVDetector *kvd)
returns position (1=front, 2=next, etc.) detector in the telescope structure
Double_t GetDepthInCM(Int_t ndet) const
virtual void Add(TObject *obj)
Handle several calibrations valid for different Z ranges.
virtual void ls(Option_t *option="") const
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
virtual void AddAll(const TCollection *col)
virtual Int_t GetEntries() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetTitle(const char *title="")
virtual void SetRange(Double_t xmin, Double_t xmax)
virtual void SetNpx(Int_t npx=100)
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual void GetRange(Double_t &xmin, Double_t &xmax) const
virtual void SetParameters(const Double_t *params)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual Double_t GetMaximum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual Double_t GetMaximumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
virtual Double_t GetDX() const
virtual Double_t GetFacetArea(Int_t index=0) const
virtual Double_t GetDY() const
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
void RefreshPhysicalNodes(Bool_t lock=kTRUE)
TObjArray * GetListOfPhysicalNodes()
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
TGeoVolume * GetTopVolume() const
TGeoPhysicalNode * MakePhysicalNode(const char *path=0)
virtual Int_t GetDefaultColor() const
TGeoMaterial * GetMaterial() const
Bool_t Align(TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE, Double_t ovlp=0.001)
TGeoShape * GetShape(Int_t level=-1) const
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
virtual const char * GetName() const
virtual Double_t GetRmin() const
virtual Double_t GetRmax() const
virtual void SetLineColor(Color_t lcolor)
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual void SetName(const char *name="")
virtual void SetTitle(const char *title="")
virtual void Add(TObject *obj)
virtual void Clear(Option_t *option="")
virtual const char * GetName() const
virtual void SetName(const char *name)
virtual TObject * Clone(const char *newname="") const
virtual TObject * FindObject(const char *name) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
VecExpr< UnaryOp< Sqrt< T >, SVector< T, D >, T >, T, D > sqrt(const SVector< T, D > &rhs)
T Mag(const SVector< T, D > &rhs)
double dist(AxisAngle const &r1, AxisAngle const &r2)