51 fActiveLayer =
nullptr;
53 fIDTelescopes->SetCleanup(
kTRUE);
55 fIDTelAlign->SetCleanup(
kTRUE);
57 fIdentP = fUnidentP = 0;
59 fDepthInTelescope = 0.;
61 fELossF = fEResF = fRangeF = 0;
63 fAlignedDetectors[0] = 0;
64 fAlignedDetectors[1] = 0;
68 fParentStrucList.SetCleanup();
70 fNode.SetDetector(
this);
71 SetKVDetectorFiredACQParameterListFormatString();
73 fDetSignals.SetOwner();
76 fDetSignals.ReplaceObjects();
94 fKVDetectorFiredACQParameterListFormatString.Form(
"%s.Fired.ACQParameterList.",
96 fKVDetectorFiredACQParameterListFormatString +=
"%s";
140 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
148 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
164 TIter next(fAbsorbers);
170 Int_t in_actif = fAbsorbers->IndexOf(fActiveLayer);
179 KVDetector::~KVDetector()
245 if (kvp->
GetKE() <= 0.)
256 std::vector<Double_t> thickness;
316 std::vector<Double_t> thickness;
381 clone_part.
SetKE(Einc);
398 if (!strcmp(opt,
"data")) {
411 cout <<
"(Belongs to an unidentified particle)";
414 else if (!strcmp(opt,
"all")) {
425 cout <<
" ### ACTIVE LAYER ### " << endl;
426 cout << option << option;
429 cout <<
" #################### " << endl;
431 cout << option <<
"Gain: " <<
GetGain() << endl;
433 cout << option <<
" --- Detected particles:" << endl;
437 cout << option <<
" --- Detector belongs to the following Identification Telescopes:" << endl;
441 cout << option <<
" --- Identification Telescopes in front of detector:" << endl;
445 cout << option <<
" --- Identification Telescopes used to identify particles stopping in this detector:" << endl;
536 Warning(
"AddCalibrator",
"%s : input signal %s not found for calibrator %s. No output signal created.",
549 Warning(
"AddCalibrator",
"%s : output signal not defined for calibrator %s. No output signal created.",
675 return (par ? par->
GetData() : -1.);
722 if (strncmp(opt,
"N", 1)) {
779 Error(
"GetAbsorber",
"No absorber list");
783 Error(
"GetAbsorber",
"Nothing in absorber list");
787 Error(
"GetAbsorber",
"i=%d but only %d absorbers in list", i,
821 if (
K->GetOutputSignalType() !=
"") {
910 while ((idt = next())) {
989 if (!transmission) solution =
kEmin;
1004 if (transmission && ERES > 0.) {
1021 return (EINC - ERES);
1064 ELOSS = (ELOSS < 0. ?
GetEnergy() : ELOSS);
1065 if (ELOSS <= 0)
return 0;
1072 UInt_t last_positive_difference_z = 1;
1074 if (mass_formula > -1)
1079 while (zmax > zmin + 1) {
1085 if (difference < 0.0) {
1088 z += (
UInt_t)((zmax - z) / 2 + 0.5);
1094 last_positive_difference_z = z;
1095 z -= (
UInt_t)((z - zmin) / 2 + 0.5);
1099 if (difference < 0) {
1102 z = last_positive_difference_z;
1174 if (!mat)
return 0.;
1184 range += this_range;
1186 Einc = mat->
GetERes(Z, A, Einc);
1190 range += this_range;
1278 if (!(ph =
LoadPlugin(
"KVDetector", name))) {
1279 if (!(ph =
LoadPlugin(
"KVDetector", det_type))) {
1317 Double_t dist_to_back = depth + layer_thickness;
1396 if (thick == 0.0)
continue;
1398 for (
int i = 0; i < 8; i++) {
1399 vertices[2 * i] = coords[i].
X();
1400 vertices[2 * i + 1] = coords[i].
Y();
1411 Double_t trans_z = -tot_thick_det / 2. + depth_in_det + dz;
1413 mother_vol->
AddNode(vol, 1, tr);
1419 depth_in_det += thick;
1557 cout <<
"(" <<
v.X() <<
"," <<
v.Y() <<
"," <<
v.Z() <<
")";
1586 cout <<
"DETECTOR COORDINATES (in cm):" << endl;
1587 cout <<
"=================================" << endl;
1601 cout <<
"DETECTOR DIMENSIONS (in cm):" << endl;
1602 cout <<
"================================" << endl;
1607 cout <<
" AB = " <<
c << endl;
1608 cout <<
" BC = " <<
b << endl;
1609 cout <<
" CD = " <<
d << endl;
1610 cout <<
" AD = " <<
a << endl;
1612 cout <<
"DETECTOR SURFACE AREA = ";
1614 surf =
sqrt(surf) / 400.0;
1615 cout << surf <<
" cm2" << endl;
1635 0., 1.e+04, 2,
"KVDetector",
"EResDet");
1660 0., 1.e+04, 2,
"KVDetector",
"RangeDet");
1685 0., 1.e+04, 2,
"KVDetector",
"ELossActive");
1756 return Einc -
GetERes(Z, A, Einc);
1772 if (Einc <= 0.)
return 0.;
1776 if (eres < 0.) eres = 0.;
1829 if (Z < 1)
return 0.;
1884 if (Z < 1 || Eres <= 0.)
return 0.;
1886 if (Einc <= 0.)
return 0.;
1907 if (Z < 1 || Eres <= 0.)
return 0.;
1980 TEnv fEnvFile(envrc);
1984 while (!layers.
End()) {
1991 thick = dens = press = 0.;
1993 if (pS !=
"" && tS !=
"") {
2000 else if (tS !=
"") {
2005 else if (dS !=
"") {
2057 if (!
GetGroup() || direction > 1)
return 0x0;
2069 if (!
GetGroup() || direction > 1)
return;
2137 punch->
SetTitle(
Form(
"Simple Punch-through %s (MeV) (mass formula %d)",
GetName(), massform));
2140 for (
int Z = 1; Z <= 92; Z++) {
2162 punch->
SetTitle(
Form(
"Simple Punch-through %s (AMeV) (mass formula %d)",
GetName(), massform));
2165 for (
int Z = 1; Z <= 92; Z++) {
2220 if (strcmp(name,
"")) {
2321 if (shape->IsA() == TGeoBBox::Class()) {
2324 else if (shape->IsA() == TGeoTube::Class()) {
2329 Error(
"SetThickness",
"No implementation for %s (%s)", shape->IsA()->
GetName(),
GetName());
2332 pn->
Align(
nullptr, newshape);
2333 Info(
"SetThickness",
"Modified ROOT geometry for %s: new thickness=%g cm",
GetName(), thick);
2358 for (
int iabs = 0; iabs < nabs; ++iabs) {
2397 return (ds !=
nullptr);
void printvec(TVector3 &v)
KVIonRangeTableMaterial * M
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kIterBackward
R__EXTERN TGeoManager * gGeoManager
double pow(double, double)
char * Form(const char *fmt,...)
Wrapper signal for KVACQParam objects.
GANIL VXI/VME acquisition parameter.
void SetPedestal(Float_t ped)
Float_t GetPedestal() const
void SetDetector(KVDetector *kd)
void Clear(Option_t *="")
Clear object properties : name, type/title, number, label.
virtual Bool_t IsType(const Char_t *typ) const
const Char_t * GetType() 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")
Calibrated output from detector.
virtual Bool_t IsAvailableFor(const KVNameValueList ¶ms) const
Base class for all detector calibrations.
TString GetInputSignalType() const
void SetDetector(KVDetector *d)
TString GetOutputSignalType() const
Detector output from a mathematical combination of other signals.
Output signal data produced by a detector.
virtual Bool_t IsExpression() const
virtual Bool_t IsRaw() const
Base class for detector geometry description, interface to energy-loss calculations.
virtual KVDetectorSignal * GetDetectorSignal(const TString &type) const
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
Bool_t AddDetectorSignalExpression(const TString &type, const KVString &_expr)
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 void SetPedestal(const Char_t *, Float_t)
Set value of pedestal associated to parameter with given name.
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)
Binary8_t fFiredMask
bitmask used by Fired to determine which parameters to take into account
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
virtual void SetACQParams()
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)
virtual Float_t GetACQData(const Char_t *) const
Bool_t HasSameStructureAs(const KVDetector *) const
void SetThickness(Double_t thick)
virtual void AddToGeometry()
KVList * fACQParams
list of raw data parameters read from coders
virtual Double_t GetIncidentEnergy(Int_t Z, Int_t A, Double_t delta_e=-1.0, enum SolType type=kEmax)
virtual void ReadDefinitionFromFile(const Char_t *)
Double_t GetTotalThicknessInCM()
Bool_t IsCalibrated() const
void AddACQParam(KVACQParam *)
Add given acquisition parameter to this detector.
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
virtual void SetFiredBitmask(KVString &)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
virtual void SetEResAfterDetector(Double_t e)
void SetActiveLayerMatrix(const TGeoHMatrix *)
virtual void Copy(TObject &obj) const
virtual KVACQParam * GetACQParam(const Char_t *) const
void RemoveParentStructure(KVGeoStrucElement *elem)
const KVSeqCollection & GetListOfDetectorSignals() const
virtual Float_t GetPedestal(const Char_t *) const
Access pedestal value associated to parameter with given name.
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
void SetKVDetectorFiredACQParameterListFormatString()
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; 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.
virtual Double_t GetEmaxValid(Int_t Z, Int_t A)
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
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 energy lost by particles to zero.
Double_t GetEffectiveThickness(TVector3 &norm, TVector3 &direction)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
virtual Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc)
Double_t GetMass() const
Returns atomic mass of material. Will be isotopic mass if set.
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
void SetName(const char *name)
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
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
TObjArray * Tokenize(const TString &delim) const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
RooCmdArg ClassName(const char *name)
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)