4 #include "KVMultiDetArray.h"
5 #include "KVDetector.h"
6 #include "KVDetectorEvent.h"
7 #include "KVReconstructedEvent.h"
8 #include "KVReconstructedNucleus.h"
10 #include "KVNucleus.h"
12 #include "KVMaterial.h"
14 #include "KVIDTelescope.h"
18 #include <KVIDGridManager.h>
19 #include <KVDataSetManager.h>
20 #include <KVUpDater.h>
22 #include "KVDataSet.h"
24 #include "KVHashList.h"
25 #include "KVNameValueList.h"
26 #include "KVUniqueNameList.h"
27 #include "KVIonRangeTable.h"
28 #include "KVRangeTableGeoNavigator.h"
29 #include <KVDataAnalyser.h>
30 #include <KVNamedParameter.h>
31 #include <KVCalibrator.h>
32 #include <KVDBParameterSet.h>
34 #include <KVSQLROOTIDGridManager.h>
40 #ifdef WITH_BUILTIN_GRU
41 #include "KVGANILDataReader.h"
43 #include "KVRawDataReader.h"
46 #include "KVMFMDataFileReader.h"
47 #include "MFMEbyedatFrame.h"
50 #include "KVProtobufDataReader.h"
73 gMultiDetArray =
this;
86 gMultiDetArray =
this;
165 if (gMultiDetArray ==
this)
166 gMultiDetArray =
nullptr;
255 if (
de && (
de->GetDetector() !=
e)) {
367 TString uri = de_type + de_thick +
"-" + e_type + e_thick;
371 uri = de_type + de_thick +
"-" + e_type;
375 uri = de_type +
"-" + e_type + e_thick;
379 uri = de_type +
"-" + e_type;
385 uri = de_type +
"-" + e_type;
530 if (
de->GetGroup()) {
619 unique_ptr<KVSeqCollection> fGroups(
GetStructures()->GetSubListWithType(
"GROUP"));
621 TIter next(fGroups.get());
623 while ((grp = (
KVGroup*) next())) {
648 while ((kvd = (KVDetector*) next())) kvd->RemoveCalibrators();
650 TString tabname = (myname !=
"" ?
Form(
"%s.Calibrations", myname.
Data()) :
"Calibrations");
652 KVRList* run_links =
r->GetLinks(tabname);
653 if (run_links)
Info(
"SetCalibratorParameters",
"Found %d calibrations for this run", run_links->
GetEntries());
659 TIter nxt_link(run_links);
665 Warning(
"SetCalibratorParameters",
"Got parameters for unknown detector: %s", dbps->
GetName());
674 while (!clop.
End()) {
687 catch (std::exception&
e) {
688 Error(
"SetCalibratorParameters",
689 "Problem for %s [%s] : %s", det->GetName(), cal->
GetType(),
e.what());
703 Warning(
"SetCalibratorParameters",
"Wrong number of parameters (%d) for calibrator %s for detector %s : should be %d",
759 while ((det = (KVDetector*)it())) {
761 if (s.IsNull())
continue;
764 det->AddDetectorSignal(s.Next(
kTRUE));
794 if (!fired_dets || !fired_dets->
GetEntries()) {
799 TIter next_det(fired_dets);
802 while ((det = (KVDetector*)next_det())) {
808 unique_ptr<KVSeqCollection> fGroups(
GetStructures()->GetSubListWithType(
"GROUP"));
810 TIter next_grp(fGroups.get());
812 while ((grp = (
KVGroup*) next_grp())) {
863 if (gDataSetManager && (!gDataSet || (gDataSet != gDataSetManager->
GetDataSet(dataset_name)))) {
864 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Changing dataset\n");
868 if (gMultiDetArray && gMultiDetArray->
GetDataSet() != dataset_name) {
869 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Deleting existing array %s\n", gMultiDetArray->
GetName());
870 if (gIDGridManager) {
871 delete gIDGridManager;
872 gIDGridManager =
nullptr;
874 delete gMultiDetArray;
875 gMultiDetArray =
nullptr;
882 if (!gMultiDetArray) {
911 filepath +=
"/idgrids_DB";
917 auto index_multiplier = gDataSet->
GetDataSetEnv(
"DataSet.RunFileIndexMultiplier.raw", 1);
919 if (n_grids_to_write) {
922 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Saving %d grids in SQL-ROOT database file %s\n",
923 n_grids_to_write, filepath.
Data());
929 auto rl =
gr->GetRuns().GetListDividedBy(index_multiplier);
932 {
"IDLabel",
gr->GetIDTelescopeLabel()},
933 {
"IDTelescopes",
gr->GetParameters()->GetStringValue(
"IDTelescopes")},
934 {
"VarX",
gr->GetVarX()},
935 {
"VarY",
gr->GetVarY()},
936 {
"Runlist",
gr->GetRunList()},
940 if (!(n_grids_to_write % 1000)) printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: ...%d grids left...\n",
949 mda = gMultiDetArray;
1017 if (gDataSetManager)
1043 if (gDataSetManager)
1069 if (gDataSetManager)
1135 filepath +=
"/idgrids_DB";
1138 delete gIDGridManager;
1147 Info(
"SetIdentifications",
"No active identifications");
1151 id_labels.
Begin(
" ");
1154 while (!id_labels.
End()) {
1160 Info(
"SetIdentifications",
"Initialising %s identifications...", idt->
GetLabel());
1162 Info(
"SetIdentifications",
"OK");
1169 Warning(
"SetIdentfications",
"No telescopes found with labels given in %s.ActiveIdentifications list: %s",
1246 cout << endl <<
"-----STATUS OF IDENTIFICATION TELESCOPES";
1249 cout <<
"------" << endl << endl;
1252 if (gDataSet) id_labels = gDataSet->
GetDataSetEnv(
"ActiveIdentifications");
1258 if (id_labels ==
"") id_labels +=
type->GetString().Data();
1260 id_labels +=
Form(
" %s",
type->GetString().Data());
1264 if (id_labels ==
"") {
1265 cout <<
" *** No active identifications *** " << endl;
1269 unique_ptr<TObjArray> toks(id_labels.
Tokenize(
' '));
1275 TList* id_type_list = 0;
1276 while ((id_type_list = (
TList*)next_type())) {
1278 cout <<
" *** " << id_type_list->
GetName() <<
" Identifications -------------------" << endl;
1279 if (!toks->FindObject(id_type_list->
GetName())) {
1280 cout <<
" [NOT ACTIVE]" << endl;
1284 TList* print_list = 0;
1288 if (Nok < Notok) print_list = ok_list;
1289 else print_list = notok_list;
1291 if (Nok && (!Notok)) cout <<
" ALL telescopes are OK" << endl;
1292 else if (Notok && (!Nok)) cout <<
" NO telescopes are OK" << endl;
1294 cout <<
" " << ok_list->
GetEntries() <<
" telescopes are OK, "
1295 << notok_list->
GetEntries() <<
" telescopes are NOT OK" << endl;
1296 cout <<
" " << print_list->
GetName() <<
" :" << endl;
1297 TIter it(print_list);
1300 while ((ob = it())) cout <<
"," << ob->
GetName();
1342 if (!id_type_list) {
1343 id_type_list =
new TList;
1440 KVDetector* det = 0;
1441 while ((det = (KVDetector*)next())) {
1446 type_list =
new TList;
1455 if (det->IsCalibrated())
1476 Info(
"PrintCalibStatusOfDetectors",
"Cannot know status without knowing RUN NUMBER");
1480 cout << endl <<
"-----------STATUS OF CALIBRATIONS FOR RUN "
1487 TList* id_type_list = 0;
1488 while ((id_type_list = (
TList*)next_type())) {
1490 cout <<
" *** " << id_type_list->
GetName() <<
" Detectors -------------------" << endl;
1493 TList* print_list = 0;
1497 if (Nok < Notok) print_list = ok_list;
1498 else print_list = notok_list;
1500 if (Nok && (!Notok)) cout <<
" ALL calibrations are OK" << endl;
1501 else if (Notok && (!Nok)) cout <<
" NO calibrations are OK" << endl;
1503 cout <<
" " << ok_list->
GetEntries() <<
" calibrations are OK, "
1504 << notok_list->
GetEntries() <<
" calibrations are NOT OK" << endl;
1505 cout <<
" " << print_list->
GetName() <<
" :" << endl;
1506 TIter it(print_list);
1509 while ((ob = it())) cout <<
"," << ob->
GetName();
1619 auto find_a_file = [
this](
const TString& _base_filename)
1634 auto fullpath = find_a_file(
"DetectorThicknessFiles.dat");
1635 if(!fullpath.IsNull())
1648 fullpath = find_a_file(
"DetectorThicknesses.dat");
1695 Error(
"SetDetectorThicknesses",
"Problem opening file %s", fullpath.
Data());
1698 Info(
"SetDetectorThicknesses",
"Setting thicknesses of detectors from file %s", fullpath.
Data());
1701 while ((det = (KVDetector*)next())) {
1702 if (thickdat.
Defined(det->GetName())) {
1705 det->SetThickness(thick);
1711 absname.
Form(
"%s.Abs%d", det->GetName(), (
Int_t)i);
1715 while ((
abs = det->GetAbsorber(i))) {
1717 abs->SetThickness(thick);
1720 absname.
Form(
"%s.Abs%d", det->GetName(), (
Int_t)i);
1818 trans.
SetDz(distance) ;
1820 if (postTrans)
h = (*postTrans) * rot * trans ;
1821 else h = rot * trans;
1846 if (!
gr->GetRuns().Contains((
Int_t) run))
1852 TIter nxtid(
gr->GetIDTelescopes());
1870 gr->ClearListOfTelescopes();
1871 if (
gr->GetParameters()->HasParameter(
"IDTelescopes")) {
1872 KVString tel_list =
gr->GetParameters()->GetStringValue(
"IDTelescopes");
1873 tel_list.
Begin(
",");
1874 while (!tel_list.
End()) {
1877 if (idt)
gr->AddIDTelescope(idt);
1908 if (opt.
Next() ==
"tracks") {
1951 name.ReplaceAll(
"-",
"_");
1969 name.ReplaceAll(
"-",
"_");
2001 TIter it(groups.get());
2004 Info(
"CalculateReconstructionTrajectories",
"Calculating trajectories for particle reconstruction:");
2006 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
2008 ntr +=
group->CalculateReconstructionTrajectories();
2010 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
2013 std::cout <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::endl;
2015 std::cout << std::endl;
2035 Info(
"DeduceIdentificationTelescopesFromGeometry",
"Calculating...");
2037 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
2047 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
2051 std::cout <<
" -- created " << count <<
" telescopes" << std::endl;
2053 std::cout << std::endl;
2072 int len_tr = tr->
GetN();
2076 if ((tr2 != tr) && (len_tr < tr2->GetN()) && (tr2->
ContainsPath(tr))) {
2084 TIter it_dup(&duplicates);
2088 Info(
"AssociateTrajectoriesAndNodes",
"Removed %d duplicated sub-trajectories", duplicates.
GetEntries());
2103 if (
N->GetNTraj() > 1) {
2106 multitraj_nodes.
Add(
N);
2107 TIter tr(
N->GetTrajectories());
2110 if (tried_trajectories.
FindObject(traj))
continue;
2111 tried_trajectories.
Add(traj);
2115 detectors_of_group.
Add(node);
2121 else if (
N->GetNTraj() == 1) {
2125 if (tried_trajectories.
FindObject(traj))
return;
2126 tried_trajectories.
Add(traj);
2130 detectors_of_group.
Add(node);
2136 detectors_of_group.
Add(
N);
2185 #ifdef WITH_BUILTIN_GRU
2186 if (
r->GetDataFormat() ==
"EBYEDAT")
2204 Info(
"DeduceGroupsFromTrajectories",
"Deducing groups of detectors from trajectories");
2205 Int_t number_of_groups = 0;
2208 if (stl.get() && stl->GetEntries()) {
2209 Info(
"DeduceGroupsFromTrajectories",
"Deleting existing %d groups in array", stl->GetEntries());
2211 Info(
"DeduceGroupsFromTrajectories",
"Done");
2216 while ((det = (KVDetector*) next_det())) {
2217 if (det->GetGroup())
continue;
2220 if (!detectors_of_group.
GetEntries())
continue;
2224 TIter next_node(&detectors_of_group);
2230 Info(
"DeduceGroupsFromTrajectories",
"Filling group trajectory lists");
2253 DetNames.
Begin(
"/");
2254 while (!DetNames.
End()) {
2256 if (det) DetList->
Add(det);
2310 #ifdef WITH_BUILTIN_GRU
2441 #ifdef WITH_PROTOBUF
2446 #ifdef WITH_BUILTIN_GRU
2515 det_signal = detector->GetDetectorSignal(sig_type);
2517 det_signal = detector->AddDetectorSignal(sig_type);
2524 if (detname !=
"") sig_name =
Form(
"%s.%s", detname.
Data(), sig_type.
Data());
2525 else sig_name = sig_type;
2555 int N =
l.GetNpar();
2556 for (
int i = 0; i <
N; ++i) {
2560 if (
name.BeginsWith(
"ACQPAR")) {
2563 int dots =
name.GetNValues(
".");
2564 bool with_det = (dots == 4);
2565 assert(with_det || (dots == 3));
2571 KVDetector* det =
nullptr;
2573 det_name =
name.Next();
2574 sig_type =
name.Next();
2578 sig_type =
name.Next();
2638 if (basic_name ==
"") {
2639 Info(meth,
"No name found for \"%s\" file", keyw);
2646 Info(meth,
"\tNo file found ...");
2660 return unique_ptr<KVFileReader>();
2663 if (!fr->OpenFileToRead(fp.
Data())) {
2664 Error(meth,
"Error in opening file %s", fp.
Data());
2668 Info(meth,
"Reading %s file", fp.
Data());
2679 unique_ptr<KVFileReader> fr =
GetKVFileReader(db,
"ReadCalibrationFiles()",
"CalibrationFiles");
2684 while (fr->IsOK()) {
2686 if (fr->GetCurrentLine().BeginsWith(
"#") || fr->GetCurrentLine() ==
"") {}
2688 ReadCalibFile(fr->GetCurrentLine().Data(), db, calib_table);
2782 Info(
"ReadCalibFile",
"%s does not exist or not found",
filename);
2786 Info(
"ReadCalibFile",
"file : %s found", fullpath.
Data());
2792 KVString opt_list =
"RunList SignalIn SignalOut CalibType CalibClass CalibOptions ZRange";
2793 opt_list.
Begin(
" ");
2794 while (!opt_list.
End()) {
2802 Warning(
"ReadCalibFile",
"Calibration has 'Runlist' parameter (ignored): %s, did you mean 'RunList'?", env.
GetValue(
"Runlist",
""));
2806 Error(
"ReadCalibFile",
"No input signal defined : SignalIn");
2810 Error(
"ReadCalibFile",
"No output signal defined : SignalOut");
2814 Error(
"ReadCalibFile",
"No calibration type defined : CalibType");
2821 if (ph) calibrator_class = ph->
GetClass();
2823 Error(
"ReadCalibFile",
"No calibrator plugin of type %s", options.
GetStringValue(
"CalibClass"));
2837 Info(
"ReadCalibFile",
"Calibration used for runs %s", run_list.
AsString());
2840 Info(
"ReadCalibFile",
"Calibration used for all runs in database");
2860 if (clop !=
"") par->
SetParameter(
"CalibOptions", clop);
2864 while (!lval.
End()) {
2889 if (mfmreader.IsFrameReadMerge()) {
2910 while (mergeframe.ReadNextFrame()) {
2942 if (mfmframe.GetFrameType() == MFM_MESYTEC_MDPP_FRAME_TYPE)
2945 if (mfmframe.GetFrameType() == MFM_EBY_EN_FRAME_TYPE
2946 || mfmframe.GetFrameType() == MFM_EBY_TS_FRAME_TYPE
2947 || mfmframe.GetFrameType() == MFM_EBY_EN_TS_FRAME_TYPE)
2983 #ifdef WITH_PROTOBUF
3029 Int_t ndet_absent = 0;
3031 TString absent_dets, ooo_dets;
3033 while ((det = (KVDetector*)next())) {
3041 if (ndet_absent) absent_dets +=
",";
3042 absent_dets += det->GetName();
3049 if (det->IsPresent()) {
3052 det->SetDetecting();
3056 det->SetDetecting(
kFALSE);
3057 if (ndet_ooo) ooo_dets +=
",";
3058 ooo_dets += det->GetName();
3062 det->SetDetecting();
3068 if (ndet_absent)
Info(
"CheckStatusOfDetectors",
"%d detectors absent during run : %s", ndet_absent, absent_dets.
Data());
3069 else Info(
"CheckStatusOfDetectors",
"All detectors present during run");
3070 if (ndet_ooo)
Info(
"CheckStatusOfDetectors",
"%d detectors malfunctioned during run : %s", ndet_ooo, ooo_dets.
Data());
3071 else Info(
"CheckStatusOfDetectors",
"All detectors functioning during run");
3119 Info(
"ReadOoODetectors()",
"Reading lists of out-of-order detectors...");
3120 auto fOoODet = db->
AddTable(
Form(
"%s.OoO Detectors",
GetName()),
"Name of out of order detectors");
3133 while (!srec.
End()) {
3135 dbrec->
AddKey(
"Runs",
"List of Runs");
3136 fOoODet->AddRecord(dbrec);
3142 dbrec->
AddKey(
"Runs",
"List of Runs");
3143 fOoODet->AddRecord(dbrec);
3184 Info(
"ReadAbsentDetectors()",
"Reading lists of absent/dismounted detectors... file=[%s]", fullpath.
Data());
3185 auto fAbsDet = db->
AddTable(
Form(
"%s.Absent Detectors",
GetName()),
"Name of out of order detectors");
3198 while (!srec.
End()) {
3200 dbrec->
AddKey(
"Runs",
"List of Runs");
3201 fAbsDet->AddRecord(dbrec);
3207 dbrec->
AddKey(
"Runs",
"List of Runs");
3208 fAbsDet->AddRecord(dbrec);
winID h TVirtualViewer3D TVirtualGLPainter p
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 filename
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 np
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 UChar_t Atom_t typelist
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 g
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
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
void SetLabel(const Char_t *lab)
virtual const Char_t * GetType() const
static const Char_t * GetWORKDIRFilePath(const Char_t *namefile="")
const Char_t * GetLabel() const
static bool is_gnuinstall()
void Print(Option_t *option="") const override
virtual void SetType(const Char_t *str)
static ValType GetDataSetEnv(const KVString &dataset, const KVString &type, const ValType &defval)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Base class for all detector calibrations.
Int_t GetNumberParams() const
virtual void SetOptions(const KVNameValueList &)
void SetParameter(int i, Double_t par_val) const
void SetStatus(Bool_t ready)
void SetOutputSignalType(const TString &type)
void SetInputSignalType(const TString &type)
static KVCalibrator * MakeCalibrator(const Char_t *type)
To store calibration parameters in a database ,.
Bool_t HasParameter(const Char_t *name) const
TString GetStringParameter(const TString &name) const
Double_t GetParameter(UShort_t i=0) const
void Print(Option_t *option="") const override
Int_t GetParamNumber() const
void SetParameter(UShort_t i, Double_t val)
const KVNameValueList & GetParameters() const
Record folder for the database.
virtual Bool_t AddKey(KVDBKey *key, Bool_t check=kTRUE)
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Description of an experimental run in database ,,.
virtual Bool_t AddRecord(KVDBRecord *add)
static Bool_t IsRunningBatchAnalysis()
virtual Bool_t AddTable(KVDBTable *table)
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Manage an experimental dataset corresponding to a given experiment or campaign.
const Char_t * GetDataSetDir() const
Bool_t HasCalibIdentInfos() const
KVString GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
TString GetFullPathToDataSetFile(const Char_t *filename)
Bool_t DataBaseUpdateInProgress() const
static Bool_t FindDataSetFile(const TString &dataset, const Char_t *filename)
List of hit groups in a multidetector array.
void AddGroup(KVGroup *grp)
Base class for output signal data produced by a detector.
virtual void SetValue(Double_t x)
virtual Double_t GetValue(const KVNameValueList ¶ms="") const
TString GetFullName() const
void SetFired(Bool_t yes=true)
Base class to describe database of an experiment ,,.
void SetDBType(const TString &s)
TString GetCalibFileName(const Char_t *type) const
const KVNumberList & GetRunList() const
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
Bool_t FindCalibFile(const Char_t *type, TString &fullpath, const TString &array_name="") const
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Bool_t OpenFileToRead(const KVString &filename)
Reads GANIL acquisition files (EBYEDAT)
Path taken by particles through multidetector geometry.
KVGeoDetectorNode * GetNextNode() const
KVSeqCollection * AccessIDTelescopeList()
void AddToNodes()
Add reference to this trajectory to all nodes on it.
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
KVGeoDetectorNode * GetNodeInFront(const KVGeoDetectorNode *n) const
Bool_t ContainsPath(const KVGeoDNTrajectory *other) const
KVGeoDetectorNode * GetNodeAt(Int_t i) const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
Base class for propagation of particles through array geometry.
void DrawTracks(KVNumberList *=nullptr)
Base class describing elements of array geometry.
virtual Bool_t Fired(Option_t *opt="any") const
void SetOwnsDetectors(Bool_t yes=kTRUE)
virtual KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
const KVSeqCollection * GetDetectors() const
const KVSeqCollection * GetStructures() const
virtual void Add(KVBase *)
KVSeqCollection * GetStructureTypeList(const Char_t *type) const
void ClearStructures(const Char_t *type="")
const KVSeqCollection * GetParents() const
Base class for particle reconstruction in one group of a detector array.
static KVGroupReconstructor * Factory(const TString &plugin="", const KVGroup *g=nullptr)
Group of detectors which can be treated independently of all others in array.
void SetNumber(UInt_t num) override
void Reset(Option_t *opt="")
Extended version of ROOT THashList.
Base class for particle identification in a 2D map.
Handles a stock of identification grids to be used by one or more identification telescopes.
virtual void LoadGridsForRun(UInt_t)
Bool_t ReadAsciiFile(const Char_t *filename)
const TList * GetLastReadGrids() const
virtual bool IsSQLROOT() const
Base class for all detectors or associations of detectors in array which can identify charged particl...
virtual Double_t GetIDMapY(Option_t *opt="")
virtual Bool_t IsReadyForID()
KVIDGrid * CalculateDeltaE_EGrid(const KVNameValueList &AperZ, Int_t npoints=30, Double_t xfactor=1.)
void SetGroup(KVGroup *kvg)
virtual Double_t GetIDMapX(Option_t *opt="")
static KVIDTelescope * MakeIDTelescope(const Char_t *name)
virtual Bool_t SetIdentificationParameters(const KVMultiDetArray *)
void SetIDGrid(KVIDGraph *)
virtual void AddDetector(KVDetector *d)
virtual void Initialize(void)
Extended TList class which owns its objects by default.
Read MFM format acquisition data.
Description of physical materials used to construct detectors & targets; interface to range tables.
static KVIonRangeTable * GetRangeTable()
Base class for describing the geometry of a detector array.
const KVSeqCollection * GetFiredSignals() const
KVNumberList fAcceptECodes
list of acceptable calibration codes for reconstructed nuclei
bool try_a_singleIDtelescope(TString uri, KVDetector *d, TCollection *l)
KVUniqueNameList fExtraRawDataSignals
any signals read from raw data not associated with a detector
KVSeqCollection * GetListOfIDTelescopes() const
KVUniqueNameList * GetIDTelescopeTypes()
void FillListOfIDTelescopes(KVIDGraph *gr) const
virtual Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
Read a raw data event from a EBYEDAT MFM Frame.
KVNumberList fAcceptIDCodes
list of acceptable identification codes for reconstructed nuclei
void SetDetectorThicknesses()
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
virtual Bool_t handle_raw_data_event_protobuf(KVProtobufDataReader &)
void MakeHistogramsForAllIDTelescopes(KVSeqCollection *list, Int_t dimension=100)
TList * GetStatusOfIDTelescopes()
int try_all_singleID_telescopes(KVDetector *d, TCollection *l)
static Bool_t fCloseGeometryNow
void Draw(Option_t *option="") override
virtual void DeduceIdentificationTelescopesFromGeometry()
std::unique_ptr< KVFileReader > GetKVFileReader(KVExpDB *db, const Char_t *meth, const Char_t *keyw)
virtual Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus *)
virtual Bool_t handle_raw_data_event_mfmmergeframe(const MFMMergeFrameManager &)
virtual Bool_t handle_raw_data_event_mfmfile(MFMBufferReader &)
void ReadOoODetectors(KVExpDB *db)
Bool_t fHandledRawData
set to true if multidetector handles data in last call to HandleRawData
KVSeqCollection * GetIDTelescopesWithType(const Char_t *type)
TList * fCalibStatusDets
used by GetStatusIDTelescopes
KVDetectorEvent * fHitGroups
list of hit groups in simulation
void ReadAbsentDetectors(KVExpDB *db)
void RecursiveTrajectoryClustering(KVGeoDetectorNode *N, KVUniqueNameList &tried_trajectories, KVUniqueNameList &multitraj_nodes, KVUniqueNameList &detectors_of_group)
KVSeqCollection * fIDTelescopes
deltaE-E telescopes in groups
UInt_t fCurrentRun
Number of the current run used to call SetParameters.
static Bool_t fMakeMultiDetectorSetParameters
void Clear(Option_t *opt="") override
void CalculateIdentificationGrids()
For each IDtelescope in array, calculate an identification grid.
void prepare_to_handle_new_raw_data()
reset acquisition parameters etc. before reading new raw data event
int try_all_doubleID_telescopes(KVDetector *de, KVDetector *e, TCollection *l)
void FillHistogramsForAllIDTelescopes(KVSeqCollection *list)
Fill TH2F histograms for all IDTelescopes of the array.
virtual void set_detector_thicknesses(const TString &)
Bool_t ReadGridsFromAsciiFile(const Char_t *) const
virtual void InitialiseRawDataReading(KVRawDataReader *)
virtual void SetExpectedDetectorSignalNames()
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
virtual void SetDetectorParametersForRun(KVDBRun *, const TString &="")
virtual void copy_fired_parameters_to_recon_param_list()
TString GetDataSet() const
KVGroup * GetGroup(const Char_t *name) const
static TGeoHMatrix * GetVolumePositioningMatrix(Double_t distance, Double_t theta, Double_t phi, TGeoTranslation *postTrans=nullptr)
KVGeoNavigator * GetNavigator() const
KVUpDater * fUpDater
used to set parameters for multidetector
void SetGeometry(TGeoManager *)
virtual void MakeCalibrationTables(KVExpDB *)
virtual ~KVMultiDetArray()
destroy (delete) the MDA and all the associated structure, detectors etc.
virtual void SetRunIdentificationParameters(UShort_t n)
Bool_t HandleRawDataBuffer(MFMBufferReader &)
TString GetFileName(KVExpDB *, const Char_t *meth, const Char_t *keyw)
void CheckStatusOfDetectors(KVDBRun *, const TString &="")
virtual void PerformClosedROOTGeometryOperations()
UInt_t GetCurrentRunNumber() const
void SetDetectorTransparency(Char_t)
Modify the transparency of detector volumes in OpenGL view.
virtual KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
virtual void SetIdentifications()
static Bool_t fMakeMultiDetectorPhysicsParametersOnly
TList * fStatusIDTelescopes
used by GetStatusIDTelescopes
Bool_t fSimMode
=kTRUE in "simulation mode" (use for calculating response to simulated events)
virtual void Build(Int_t run=-1)
virtual void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
virtual Bool_t handle_raw_data_event_ebyedat(KVGANILDataReader &)
General method for reading raw data in old GANIL ebyedat format.
const TSeqCollection * GetTrajectories() const
static Bool_t fBuildTarget
KVTarget * fTarget
target used in experiment
virtual void set_up_telescope(KVDetector *de, KVDetector *e, KVIDTelescope *idt, TCollection *l)
Set up detectors in de-e identification telescope and add to fIDTelescopes and to l.
TList * GetCalibrationStatusOfDetectors()
bool try_upper_and_lower_singleIDtelescope(TString uri, KVDetector *d, TCollection *l)
virtual Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &)
TGeoManager * GetGeometry() const
Return pointer to the (ROOT) geometry of the array.
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
KVRawDataReader * fRawDataReader
last raw data reader object used in call to HandleRawData
virtual void SetRawDataFromReconEvent(KVNameValueList &)
void add_and_set_detector_signal(KVDetector *det, KVString detname, Double_t sig_data, KVString sig_type)
static Int_t fMakeMultiDetectorRunNumber
virtual Bool_t HandleRawDataEvent(KVRawDataReader *)
virtual void InitializeIDTelescopes()
KVUniqueNameList fFiredDetectors
list of fired detectors after reading raw data event
virtual void RenumberGroups()
virtual void SetRunCalibrationParameters(UShort_t n)
void PrintStatusOfIDTelescopes()
bool try_upper_and_lower_doubleIDtelescope(TString uri, KVDetector *de, KVDetector *e, TCollection *l)
void PrintCalibStatusOfDetectors()
void ReadCalibrationFiles(KVExpDB *db)
virtual void SetCalibratorParameters(KVDBRun *, const TString &="")
Int_t fFilterType
type of filtering (used by DetectEvent)
virtual void SetPartSeedCond(const Char_t *cond)
std::unique_ptr< KVGeoNavigator > fNavigator
for propagating particles through array geometry
void SetGridsInTelescopes(UInt_t run)
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
void CalculateReconstructionTrajectories()
KVUniqueNameList fTrajectories
list of all possible trajectories through detectors of array
virtual void SetIDCodeForIDTelescope(KVIDTelescope *) const
virtual void SetReconParametersInEvent(KVReconstructedEvent *) const
Copy any parameters in fReconParameters in to the reconstructed event parameter list.
KVNameValueList fReconParameters
general purpose list of parameters for storing information on data reconstruction
TString fDataSet
name of associated dataset, used with MakeMultiDetector()
void AssociateTrajectoriesAndNodes()
void ReadCalibFile(const Char_t *filename, KVExpDB *db, KVDBTable *calib_table)
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
Int_t GetIDTelescopes(KVGeoDetectorNode *, KVDetector *, TCollection *list)
void SetNavigator(KVGeoNavigator *geo)
KVMultiDetArray()
Default constructor.
void DeduceGroupsFromTrajectories()
virtual void set_up_single_stage_telescope(KVDetector *det, KVIDTelescope *idt, TCollection *l)
Set up detector in single-stage identification telescope and add to fIDTelescopes and to l.
bool try_a_doubleIDtelescope(TString uri, KVDetector *de, KVDetector *e, TCollection *l)
virtual Bool_t handle_raw_data_event_mfmframe_mesytec_mdpp(const MFMMesytecMDPPFrame &)
Read a raw data event from a Mesytec MFM Frame.
KVUnownedList fFiredSignals
list of fired signals after reading raw data event
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
void Clear(Option_t *opt="") override
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
TString GetTStringValue(const Char_t *name) const
A generic named parameter storing values of different types.
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
const Char_t * AsString(Int_t maxchars=0) const
void Set(const TString &l)
void SetIsOK(Bool_t flag=kTRUE)
Double_t GetEnergy() const
Read Google Protobuf DAQ files.
Wrapper for TRefArray adding some functionality.
KVBase * FindObject(const Char_t *name, const Char_t *type) const
Propagate particles through array geometry calculating energy losses.
Abstract base class for reading raw (DAQ) data.
virtual TString GetDataFormat() const =0
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual Int_t GetECode() const
virtual Int_t GetIDCode() const
Combine ROOT file containing objects with SQLite database with info on the objects.
ID grid manager using KVSQLROOTFile backend.
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObjectByLabel(const Char_t *) const
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
KVSeqCollection * GetSubListWithType(const Char_t *retvalue) const
void Clear(Option_t *option="") override
virtual void SetCleanup(Bool_t enable=kTRUE)
void SetOwner(Bool_t enable=kTRUE) override
void Delete(Option_t *option="") override
KVSeqCollection * GetSubListWithLabel(const Char_t *retvalue) 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
Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0) override
void Clear(Option_t *opt="") override
Optimised list in which named objects can only be placed once.
void Add(TObject *obj) override
Abstract class implementing necessary methods for setting multidetector parameters for each run of th...
virtual void SetParameters(UInt_t, Bool_t physics_parameters_only=kFALSE)
static KVUpDater * MakeUpDater(const Char_t *uri, KVMultiDetArray *)
virtual void SetCalibrationParameters(UInt_t)
Set calibration parameters for this run.
virtual void SetIdentificationParameters(UInt_t)
void SetName(const char *name)
const char * GetName() const override
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Bool_t Contains(const char *name) const
THashList * GetTable() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
Bool_t Defined(const char *name) const
void SetStyle(Short_t st)
void SetCurrentCamera(ECameraType camera)
void SetSmoothPoints(Bool_t s)
void SetSmoothLines(Bool_t s)
TGeoVolume * GetTopVolume() const
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
void SetDz(Double_t dz) override
void Draw(Option_t *option="") override
void SetTransparency(Char_t transparency=0)
virtual Int_t Fill(const char *name, Double_t w)
TObject * FindObject(const char *name) const override
void Add(TObject *obj) override
void Delete(Option_t *option="") override
TObject * At(Int_t idx) const override
virtual void SetTitle(const char *title="")
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
void AbstractMethod(const char *method) const
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) 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
const char * GetClass() const
Longptr_t ExecPlugin(int nargs)
Int_t GetEntries() const override
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
RVec< PromoteType< T > > abs(const RVec< T > &v)