153 bool mass_id =
false;
156 if (
gr->HasMassIDCapability()) mass_id =
true;
162 "ID tel. %s: grid %s has undefined VarX(%s:%p) or VarY(%s:%p) - WILL NOT USE",
173 Warning(
"Initialize",
"ID telescope %s has %d grids but no %s variable defined",
176 Warning(
"Initialize",
"ID telescope %s has %d grids but %d grids appear in variable %s",
180 grid_list.
Begin(
",");
207 KVIDTelescope::~KVIDTelescope()
228 d->AddIDTelescope(
this);
234 Warning(
"AddDetector",
"Called with null pointer");
252 if (!strcmp(opt,
"fired")) {
260 cout <<
"\n" << opt <<
"Structure of KVIDTelescope object: " <<
263 "--------------------------------------------------------" <<
266 cout << opt <<
"Detector: " << obj->
GetName() << endl;
283 Warning(
"GetDetector(const Char_t *name)",
284 "Detector %s not found in telescope %s", name,
GetName());
342 Estep = (Emax - Emin) / 100.;
344 Int_t nsteps = 1 + (
Int_t)((Emax - Emin) / Estep);
358 TIter next_det(detectors);
369 x[step] =
y[step] = -1;
381 if (E1 < 1.e-3)
break;
388 if (
x[step] > 0 &&
y[step] > 0) {
469 if (idr->
IDOK)
break;
636 Warning(
"GetSignalFromGridVar",
637 "No VAR%s defined for grid for telescope %s. KVIDTelescope-derived class handling identification must override GetIDMapX/GetIDMapY",
648 sig_type = var.
Next();
651 Error(
"GetSignalFromGridVar",
652 "Problem initialising ID-grid %s coordinate for telescope %s. Request for unknown detector label %s. Check definition of VAR%s for grid (=%s)",
667 Error(
"GetSignalFromGridVar",
668 "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)",
933 if (filename !=
"") {
939 if (filename ==
"") {
940 Warning(
"SetIdentificationParameters",
941 "No filename defined. Should be given by %s.IdentificationParameterFile.%s or %s.IdentificationParameterFile.%s",
996 Error(
"LoadIdentificationParameters",
997 "File %s not found. Should be in %s",
1003 Info(
"LoadIdentificationParameters",
"Using file %s", path.
Data());
1037 while ((grid = (
KVIDGrid*)next_grid())) {
1106 if ((d1 && d2) && !d1_cal && !d2_cal)
1123 e1 = e2 = einc = 0.0;
1139 if (e1 < 0.0) e1 = 0.0;
1154 if (d2 && !d2_cal) {
1164 if (e2 < 0.0) e2 = 0.0;
1185 if (coherence_tolerance < 1) coherence_tolerance += 1.00;
1197 while (idet < ndets) {
1207 if (e1 < 0.0) e1 = 0.0;
1216 if (e1 < 0.0) e1 = 0.0;
1271 specific.
Form(
"KVIDTelescope.DefaultGrid.%s",
GetLabel());
1315 if (!det_de)
return 0;
1317 if (!det_eres)
return 0;
1320 Info(
"CalculateDeltaE_EGrid",
1321 "Calculating dE-E grid: dE detector = %s, E detector = %s",
1325 Int_t npoi_bragg = 0;
1326 B_line->
SetName(
"Bragg_line");
1332 while (!Zrange.
End()) {
1334 part.
SetZ(zz, massformula);
1337 for (
Int_t aa = aref - deltaA; aa <= aref + deltaA; aa += 1) {
1353 E1 = (E1min + E1max) / 2.;
1355 while ((E1max - E1min) > SeuilE) {
1366 E1 = (E1max + E1min) / 2.;
1371 E1 = (E1max + E1min) / 2.;
1379 B_line->
SetPoint(npoi_bragg++, Eres_B, dE_B);
1384 E2 = (E2min + E2max) / 2.;
1386 while ((E2max - E2min > SeuilE)) {
1397 E2 = (E2max + E2min) / 2.;
1402 E2 = (E2max + E2min) / 2.;
1406 if ((!strcmp(det_eres->
GetType(),
"CSI")) && (E2 > 5000)) E2 = 5000;
1415 Double_t dLog = (logE2 - logE1) / (npoints - 1.);
1417 for (
Int_t i = 0; i < npoints; i++) {
1423 while (Eres < SeuilE && niter <= 20) {
1436 if (!(niter > 20)) {
1439 line->GetPoint(i - 1, gEres, gdE);
1440 line->SetPoint(i, Eres, dE);
1500 if (!det_de)
return 0;
1502 if (!det_eres)
return 0;
1505 Info(
"CalculateDeltaE_EGrid",
1506 "Calculating dE-E grid: dE detector = %s, E detector = %s",
1510 Int_t npoi_bragg = 0;
1511 B_line->
SetName(
"Bragg_line");
1533 Warning(
"CalculateDeltaE_EGrid",
"no count for Z=%d", zz);
1550 while (!nlA.
End()) {
1567 E1 = (E1min + E1max) / 2.;
1569 while ((E1max - E1min) > SeuilE) {
1580 E1 = (E1max + E1min) / 2.;
1585 E1 = (E1max + E1min) / 2.;
1593 B_line->
SetPoint(npoi_bragg++, Eres_B, dE_B);
1598 E2 = (E2min + E2max) / 2.;
1600 while ((E2max - E2min > SeuilE)) {
1611 E2 = (E2max + E2min) / 2.;
1616 E2 = (E2max + E2min) / 2.;
1623 line->SetAandZ(aa, zz);
1627 Double_t dLog = (logE2 - logE1) / (npoints - 1.);
1629 for (
Int_t i = 0; i < npoints; i++) {
1633 while (Eres < SeuilE && niter <= 20) {
1647 if (!(niter > 20)) {
1650 line->GetPoint(i - 1, gEres, gdE);
1651 line->SetPoint(i, Eres, dE);
1706 while ((grid = (
KVIDGrid*)next())) {
1726 return idline->
Eval(
x);
1755 if (EINC > 0.0)
return (EINC > emin);
1820 double e =
n->GetE();
1826 else n->SetAMeasured();
1827 if (!
n->IsAMeasured()) {
1829 double e =
n->GetE();
KVIDGridManager * gIDGridManager
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
void SetLabel(const Char_t *lab)
const Char_t * GetLabel() const
const Char_t * GetType() 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)
Output signal data produced by a detector.
virtual Double_t GetValue(const KVNameValueList &="") const
Base class for detector geometry description, interface to energy-loss calculations.
virtual KVDetectorSignal * GetDetectorSignal(const TString &type) const
virtual Bool_t IsOK() const
Bool_t AddDetectorSignalExpression(const TString &type, const KVString &_expr)
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="")
Bool_t IsCalibrated() const
virtual Bool_t Fired(Option_t *opt="any") const
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 text files.
KVString GetCurrentLine()
Bool_t OpenFileToRead(KVString filename)
void ReadLine(const Char_t *pattern)
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)
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...
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="")
KVList fIDGrids
identification grid(s)
void SetGroup(KVGroup *kvg)
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.)
KVIDGrid * CalculateDeltaE_EGrid(const KVNumberList &Zrange, Int_t deltaMasse, Int_t npoints, Double_t lifetime=-10, UChar_t massformula=0, Double_t xfactor=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)
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
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()
KVDetectorSignal * GetSignalFromGridVar(const KVString &var, const KVString &axe)
void CheckIdentificationBilan(const TString &system)
Set status of ID Telescope for given system.
virtual void RemoveIdentificationParameters()
KVParticleCondition * fMassIDValidity
may be used to limit mass identification to certain Z and/or A range
static void OpenIdentificationBilan(const TString &path)
Open IdentificationBilan.dat file with given path.
void SetHasMassID(Bool_t yes=kTRUE)
virtual void Initialize(void)
KVList fDetectors
list of detectors in telescope
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)
const KVList * GetListOfIDGrids() const
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 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
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.
Handles particle selection criteria for data analysis classes ,.
Bool_t Test(const KVNucleus *nuc) const
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)
TString & ReplaceAll(const char *s1, const char *s2)
const long double g
masses