157 bool mass_id =
false;
160 if (
gr->HasMassIDCapability()) mass_id =
true;
166 "ID tel. %s: grid %s has undefined VarX(%s:%p) or VarY(%s:%p) - WILL NOT USE",
177 Warning(
"Initialize",
"ID telescope %s has %d grids but no %s variable defined",
180 Warning(
"Initialize",
"ID telescope %s has %d grids but %d grids appear in variable %s",
184 grid_list.
Begin(
",");
185 while (!grid_list.
End()) {
186 auto gr_name = grid_list.
Next();
189 Info(
"Initialize",
"IDtel=%s grid %s missing",
GetName(), gr_name.Data());
234 d->AddIDTelescope(
this);
243 Warning(
"AddDetector",
"Called with null pointer");
261 if (!strcmp(opt,
"fired")) {
269 cout <<
"\n" << opt <<
"Structure of KVIDTelescope object: " <<
272 "--------------------------------------------------------" <<
275 cout << opt <<
"Detector: " << obj->
GetName() << endl;
292 Warning(
"GetDetector(const Char_t *name)",
293 "Detector %s not found in telescope %s", name,
GetName());
351 Estep = (Emax - Emin) / 100.;
353 Int_t nsteps = 1 + (
Int_t)((Emax - Emin) / Estep);
367 TIter next_det(detectors);
378 x[step] =
y[step] = -1;
390 if (E1 < 1.e-3)
break;
397 if (
x[step] > 0 &&
y[step] > 0) {
478 if (idr->
IDOK)
break;
569 KVString det_labels_x, det_labels_y;
682 Warning(
"GetSignalFromGridVar",
683 "No VAR%s defined for grid for telescope %s. KVIDTelescope-derived class handling identification must override GetIDMapX/GetIDMapY",
696 bool explicit_det_ref =
false;
697 bool multidetexpr =
false;
704 det_label = t.
Next();
707 explicit_det_ref =
true;
710 if (_det->GetDetectorSignal(sig_type)) {
711 if (det_labels.
Length()) {
712 if (!det_labels.
Contains(det_label)) det_labels +=
Form(
",%s", det_label.
Data());
715 det_labels = det_label;
718 if (det && (_det != det)) multidetexpr =
true;
723 if (explicit_det_ref) {
726 if (!is_expression) {
744 Error(
"GetSignalFromGridVar",
745 "Problem initialising ID-grid %s coordinate for telescope %s."
746 " Check definition of VAR%s for grid (=%s)",
766 Error(
"GetSignalFromGridVar",
767 "Problem initialising ID-grid %s coordinate for telescope %s. Request for unknown signal %s for detector %s. Check definition of VAR%s for grid (=%s)",
792 Int_t npoi_bragg = 0;
835 E1 = (E1min + E1max) / 2.;
837 while ((E1max - E1min) > SeuilE) {
848 E1 = (E1max + E1min) / 2.;
853 E1 = (E1max + E1min) / 2.;
863 if (B_line) B_line->
SetPoint(B_line->
GetN(), Eres_B, dE_B);
868 E2 = (E2min + E2max) / 2.;
870 while ((E2max - E2min > SeuilE)) {
881 E2 = (E2max + E2min) / 2.;
886 E2 = (E2max + E2min) / 2.;
890 if ((!strcmp(det_eres->
GetType(),
"CSI")) && (E2 > 5000)) E2 = 5000;
899 Double_t dLog = (logE2 - logE1) / (npoints - 1.);
901 for (
Int_t i = 0; i < npoints; i++) {
907 while (Eres < SeuilE && niter <= 20) {
923 line->GetPoint(i - 1, gEres, gdE);
924 line->SetPoint(i, Eres, dE);
957 if (_axis !=
"X" && _axis !=
"Y") {
958 Error(
"GetDetectorLabelsForGridCoord",
"Called with illegal axis name '%s'", axis.
Data());
965 if (_axis ==
"X") labs = __gc.second.fDetLabelsX;
966 else labs = __gc.second.fDetLabelsY;
967 if (lab_list.
Length() && lab_list != labs) {
968 Error(
"GetDetectorLabelsForGridCoord",
"Grids for telescope %s use different detector types for %s-coordinate: "
1001 Error(
"GetIDGrid(int)",
"Index must be >=1!");
1166 if (!(ph =
LoadPlugin(
"KVIDTelescope", uri)))
1236 if (filename !=
"") {
1242 if (filename ==
"") {
1243 Warning(
"SetIdentificationParameters",
1244 "No filename defined. Should be given by %s.IdentificationParameterFile.%s or %s.IdentificationParameterFile.%s",
1299 Error(
"LoadIdentificationParameters",
1300 "File %s not found. Should be in %s",
1306 Info(
"LoadIdentificationParameters",
"Using file %s", path.
Data());
1340 while ((grid = (
KVIDGrid*)next_grid())) {
1409 if ((d1 && d2) && !d1_cal && !d2_cal)
1426 e1 = e2 = einc = 0.0;
1442 if (e1 < 0.0) e1 = 0.0;
1457 if (d2 && !d2_cal) {
1467 if (e2 < 0.0) e2 = 0.0;
1488 if (coherence_tolerance < 1) coherence_tolerance += 1.00;
1500 while (idet < ndets) {
1510 if (e1 < 0.0) e1 = 0.0;
1519 if (e1 < 0.0) e1 = 0.0;
1574 specific.
Form(
"KVIDTelescope.DefaultGrid.%s",
GetLabel());
1598 Info(
"CalculateDeltaE_EGrid",
"called with KVNameValueList");
1602 for (
auto par : AperZ) {
1604 int zz = tmp.
Atoi();
1606 for (
auto aa : alist) {
1641 Info(
"CalculateDeltaE_EGrid",
"called with KVNumberList");
1647 while (!Zrange.
End()) {
1649 part.
SetZ(zz, massformula);
1651 for (
Int_t aa = aref - deltaA; aa <= aref + deltaA; aa += 1) {
1682 Info(
"CalculateDeltaE_EGrid",
"called with TH2");
1704 Warning(
"CalculateDeltaE_EGrid",
"no count for Z=%d", zz);
1720 while (!nlA.
End()) {
1772 while ((grid = (
KVIDGrid*)next())) {
1792 return idline->
Eval(
x);
1821 if (EINC > 0.0)
return (EINC > emin);
1886 double e =
n->GetE();
1892 else n->SetAMeasured();
1893 if (!
n->IsAMeasured()) {
1895 double e =
n->GetE();
KVIDGridManager * gIDGridManager
KVTemplateParticleCondition< KVNucleus > KVParticleCondition
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
void SetLabel(const Char_t *lab)
virtual const Char_t * GetType() const
const Char_t * GetLabel() const
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
const Char_t * GetDataSetDir() const
Bool_t HasCalibIdentInfos() const
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
TString GetFullPathToDataSetFile(const Char_t *filename)
Signal output from a mathematical combination of other signals.
Base class for output signal data produced by a detector.
virtual Bool_t IsValid() const
virtual Double_t GetValue(const KVNameValueList ¶ms="") const
Base class for detector geometry description.
virtual Bool_t IsOK() const
virtual Double_t GetMaxDeltaE(Int_t Z, Int_t A)
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
virtual void SetEnergyLoss(Double_t e) const
virtual Double_t GetEnergy() const
Int_t GetNHits() const
Return the number of particles hitting this detector in an event.
virtual Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A)
virtual void Clear(Option_t *opt="")
void SetThickness(Double_t thick)
virtual Bool_t Fired(Option_t *opt="any") const
virtual KVDetectorSignal * GetDetectorSignal(const KVString &type) const
Bool_t IsCalibrated() const
Bool_t AddDetectorSignalExpression(const KVString &type, const KVString &_expr)
virtual void SetEResAfterDetector(Double_t e)
virtual TList * GetAlignedDetectors(UInt_t direction=1)
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
virtual Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres)
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
virtual void Print(Option_t *option="") const
virtual Double_t GetCorrectedEnergy(KVNucleus *, Double_t e=-1., Bool_t transmission=kTRUE)
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Bool_t OpenFileToRead(const KVString &filename)
Group of detectors which can be treated independently of all others in array.
Line in ID grid used to delimit regions where no identification is possible.
virtual void SetName(const char *name)
This is redeclared to make it appear in context menus for KVIDCutLines.
virtual void SetAcceptedDirection(const Char_t *dir)
Base class for particle identification in a 2D map.
void Add(TString, KVIDentifier *)
void SetRunList(const char *runlist)
virtual void SetName(const char *name)
void AddIDTelescope(KVBase *t)
KVIDentifier * GetCut(const Char_t *name) const
virtual void Identify(Double_t, Double_t, KVIdentificationResult *) const =0
KVIDentifier * GetIdentifier(Int_t Z, Int_t A) const
virtual Bool_t IsIdentifiable(Double_t, Double_t, TString *rejected_by=nullptr) const
const Char_t * GetName() const
virtual void SetOnlyZId(Bool_t yes=kTRUE)
void DeleteGrid(KVIDGraph *, Bool_t update=kTRUE)
Abstract base class for 2D identification grids in e.g. (dE,E) maps.
Base class for lines/cuts used for particle identification in 2D data maps.
void GetStartPoint(Double_t &x, Double_t &y) const
void GetEndPoint(Double_t &x, Double_t &y) const
Base class for all detectors or associations of detectors in array which can identify charged particl...
KVIDGrid * newGrid(bool onlyZ)
void LoadIdentificationParameters(const Char_t *filename, const KVMultiDetArray *multidet)
This method add to the gIDGridManager list the identification grids.
virtual Double_t GetIDMapY(Option_t *opt="")
KVIDGrid * CalculateDeltaE_EGrid(const KVNameValueList &AperZ, Int_t npoints=30, Double_t xfactor=1.)
void SetGroup(KVGroup *kvg)
KVList fMultiDetExpressions
used to clean up any multi-detector signal expressions generated to calculate X/Y coordinates
void SetLabelFromURI(const Char_t *uri)
@ kCalibStatus_Calculated
@ kCalibStatus_NoCalibrations
Double_t GetIDGridYCoord(KVIDGraph *) const
virtual Bool_t Identify(KVIdentificationResult *, Double_t x=-1., Double_t y=-1.)
virtual Double_t GetIDMapX(Option_t *opt="")
static KVIDTelescope * MakeIDTelescope(const Char_t *name)
virtual Double_t GetPedestalY(Option_t *opt="")
virtual Bool_t SetIdentificationParameters(const KVMultiDetArray *)
void SetIDGrid(KVIDGraph *)
KVDetector * GetDetector(UInt_t n) const
void ReadIdentificationParameterFiles(const Char_t *filename, const KVMultiDetArray *multidet)
virtual Bool_t CheckTheoreticalIdentificationThreshold(KVNucleus *, Double_t=0.0)
void addLineToGrid(KVIDGrid *gg, int zz, int aa, int npoints)
KVGroup * GetGroup() const
Int_t fCalibStatus
temporary variable holding status code for last call to Calibrate(KVReconstructedNucleus*)
virtual Double_t GetPedestalX(Option_t *opt="")
virtual void CalculateParticleEnergy(KVReconstructedNucleus *nuc)
virtual void AddDetector(KVDetector *d)
virtual Double_t GetMeanDEFromID(Int_t &status, Int_t Z, Int_t A=-1, Double_t Eres=-1.0)
const KVList * GetDetectors() const
KVDetectorSignal * GetSignalFromGridVar(const KVString &var, const KVString &axe, KVString &det_labels)
virtual void Print(Option_t *opt="") const
std::unordered_map< KVIDGraph *, GraphCoords > fGraphCoords
X/Y coordinates from detector signals for ID maps.
virtual UShort_t GetIDCode()
void CheckIdentificationBilan(const TString &system)
Set status of ID Telescope for given system.
virtual void RemoveIdentificationParameters()
static void OpenIdentificationBilan(const TString &path)
Open IdentificationBilan.dat file with given path.
void SetHasMassID(Bool_t yes=kTRUE)
virtual void Initialize(void)
Double_t GetIDGridXCoord(KVIDGraph *) const
const Char_t * GetDefaultIDGridClass()
virtual void SetIdentificationStatus(KVReconstructedNucleus *)
void GetIDGridCoords(Double_t &X, Double_t &Y, KVIDGraph *grid, Double_t x=-1, Double_t y=-1)
KVUnownedList fIDGrids
identification grid(s)
KVUnownedList fDetectors
list of detectors in telescope
KVString GetDetectorLabelsForGridCoord(const KVString &axis) const
const KVList * GetListOfIDGrids() const
std::unique_ptr< KVParticleCondition > fMassIDValidity
may be used to limit mass identification to certain Z and/or A range
KVGroup * fGroup
group to which telescope belongs
static TEnv * fgIdentificationBilan
virtual void RemoveGrids()
virtual TGraph * MakeIDLine(KVNucleus *nuc, Double_t Emin, Double_t Emax, Double_t Estep=0.0)
Base class for identification ridge lines corresponding to different nuclear species.
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 SetGridName(const Char_t *n)
void Clear(Option_t *opt="")
Reset to initial values.
TString Rejecting_Cut
name of cut in grid which rejected particle for identification
Int_t IDquality
specific quality code returned by identification procedure
Int_t IDcode
a general identification code for this type of identification
void SetIDType(const Char_t *t)
virtual Double_t GetThickness() const
Double_t GetEmaxValid(Int_t Z, Int_t A)
virtual Double_t GetEResFromDeltaE(Int_t Z, Int_t A, Double_t dE=-1.0, enum SolType type=kEmax)
Base class for describing the geometry of a detector array.
Bool_t ReadGridsFromAsciiFile(const Char_t *) const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Description of properties and kinematics of atomic nuclei.
Bool_t IsKnown(int z=-1, int a=-1) const
void SetZ(Int_t z, Char_t mt=-1)
Int_t GetZ() const
Return the number of proton / atomic number.
Double_t GetLifeTime(Int_t z=-1, Int_t a=-1) const
Strings used to represent a set of ranges of values.
void Add(Int_t)
Add value 'n' to the list.
void Clear(Option_t *="")
Empty number list, reset it to initial state.
Int_t Last() const
Returns largest number included in list.
Double_t GetEnergy() const
void SetEnergy(Double_t e)
Nuclei reconstructed from data measured by a detector array .
KVDetector * GetDetector(const TString &label) const
virtual TObject * FindObjectByLabel(const Char_t *) const
virtual void Clear(Option_t *option="")
virtual TObject * At(Int_t idx) const
virtual TObject * First() const
virtual void SetCleanup(Bool_t enable=kTRUE)
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
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
Int_t GetNValues(TString delim) const
Optimised list in which named objects can only be placed once.
virtual void Add(TObject *obj)
virtual void SetLineColor(Color_t lcolor)
virtual Double_t GetBinCenter(Int_t bin) const
static TClass * GetClass(Bool_t load=kTRUE, Bool_t silent=kFALSE)
const char * GetVarY() const
const char * GetVarX() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsX() const
virtual Double_t GetBinContent(Int_t bin) const
virtual const char * GetName() const
virtual void SetName(const char *name)
void AbstractMethod(const char *method) const
virtual void Warning(const char *method, const char *msgfmt,...) 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)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
const char * Data() const
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
const long double g
masses