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);
921 if (n_grids_to_write) {
924 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Saving %d grids in SQL-ROOT database file %s\n",
925 n_grids_to_write, filepath.
Data());
929 if (!db) db = gExpDB;
932 auto rl =
gr->GetRuns().GetListDividedBy(index_multiplier);
933 if (rl.IsEmpty() && db) rl = db->
GetRunList();
936 {
"IDLabel",
gr->GetIDTelescopeLabel()},
937 {
"IDTelescopes",
gr->GetParameters()->GetStringValue(
"IDTelescopes")},
938 {
"VarX",
gr->GetVarX()},
939 {
"VarY",
gr->GetVarY()},
940 {
"Runlist",
gr->GetRunList()},
944 if (!(n_grids_to_write % 1000)) printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: ...%d grids left...\n",
953 mda = gMultiDetArray;
1021 if (gDataSetManager)
1047 if (gDataSetManager)
1073 if (gDataSetManager)
1139 filepath +=
"/idgrids_DB";
1142 delete gIDGridManager;
1151 Info(
"SetIdentifications",
"No active identifications");
1155 id_labels.
Begin(
" ");
1158 while (!id_labels.
End()) {
1164 Info(
"SetIdentifications",
"Initialising %s identifications...", idt->
GetLabel());
1166 Info(
"SetIdentifications",
"OK");
1173 Warning(
"SetIdentfications",
"No telescopes found with labels given in %s.ActiveIdentifications list: %s",
1250 cout << endl <<
"-----STATUS OF IDENTIFICATION TELESCOPES";
1253 cout <<
"------" << endl << endl;
1256 if (gDataSet) id_labels = gDataSet->
GetDataSetEnv(
"ActiveIdentifications");
1262 if (id_labels ==
"") id_labels +=
type->GetString().Data();
1264 id_labels +=
Form(
" %s",
type->GetString().Data());
1268 if (id_labels ==
"") {
1269 cout <<
" *** No active identifications *** " << endl;
1273 unique_ptr<TObjArray> toks(id_labels.
Tokenize(
' '));
1279 TList* id_type_list = 0;
1280 while ((id_type_list = (
TList*)next_type())) {
1282 cout <<
" *** " << id_type_list->
GetName() <<
" Identifications -------------------" << endl;
1283 if (!toks->FindObject(id_type_list->
GetName())) {
1284 cout <<
" [NOT ACTIVE]" << endl;
1288 TList* print_list = 0;
1292 if (Nok < Notok) print_list = ok_list;
1293 else print_list = notok_list;
1295 if (Nok && (!Notok)) cout <<
" ALL telescopes are OK" << endl;
1296 else if (Notok && (!Nok)) cout <<
" NO telescopes are OK" << endl;
1298 cout <<
" " << ok_list->
GetEntries() <<
" telescopes are OK, "
1299 << notok_list->
GetEntries() <<
" telescopes are NOT OK" << endl;
1300 cout <<
" " << print_list->
GetName() <<
" :" << endl;
1301 TIter it(print_list);
1304 while ((ob = it())) cout <<
"," << ob->
GetName();
1346 if (!id_type_list) {
1347 id_type_list =
new TList;
1444 KVDetector* det = 0;
1445 while ((det = (KVDetector*)next())) {
1450 type_list =
new TList;
1459 if (det->IsCalibrated())
1480 Info(
"PrintCalibStatusOfDetectors",
"Cannot know status without knowing RUN NUMBER");
1484 cout << endl <<
"-----------STATUS OF CALIBRATIONS FOR RUN "
1491 TList* id_type_list = 0;
1492 while ((id_type_list = (
TList*)next_type())) {
1494 cout <<
" *** " << id_type_list->
GetName() <<
" Detectors -------------------" << endl;
1497 TList* print_list = 0;
1501 if (Nok < Notok) print_list = ok_list;
1502 else print_list = notok_list;
1504 if (Nok && (!Notok)) cout <<
" ALL calibrations are OK" << endl;
1505 else if (Notok && (!Nok)) cout <<
" NO calibrations are OK" << endl;
1507 cout <<
" " << ok_list->
GetEntries() <<
" calibrations are OK, "
1508 << notok_list->
GetEntries() <<
" calibrations are NOT OK" << endl;
1509 cout <<
" " << print_list->
GetName() <<
" :" << endl;
1510 TIter it(print_list);
1513 while ((ob = it())) cout <<
"," << ob->
GetName();
1623 auto find_a_file = [
this](
const TString & _base_filename) {
1637 auto fullpath = find_a_file(
"DetectorThicknessFiles.dat");
1638 if (!fullpath.IsNull()) {
1650 fullpath = find_a_file(
"DetectorThicknesses.dat");
1697 Error(
"SetDetectorThicknesses",
"Problem opening file %s", fullpath.
Data());
1700 Info(
"SetDetectorThicknesses",
"Setting thicknesses of detectors from file %s", fullpath.
Data());
1703 while ((det = (KVDetector*)next())) {
1704 if (thickdat.
Defined(det->GetName())) {
1707 det->SetThickness(thick);
1713 absname.
Form(
"%s.Abs%d", det->GetName(), (
Int_t)i);
1717 while ((
abs = det->GetAbsorber(i))) {
1719 abs->SetThickness(thick);
1722 absname.
Form(
"%s.Abs%d", det->GetName(), (
Int_t)i);
1820 trans.
SetDz(distance) ;
1822 if (postTrans)
h = (*postTrans) * rot * trans ;
1823 else h = rot * trans;
1848 if (!
gr->GetRuns().Contains((
Int_t) run))
1854 TIter nxtid(
gr->GetIDTelescopes());
1872 gr->ClearListOfTelescopes();
1873 if (
gr->GetParameters()->HasParameter(
"IDTelescopes")) {
1874 KVString tel_list =
gr->GetParameters()->GetStringValue(
"IDTelescopes");
1875 tel_list.
Begin(
",");
1876 while (!tel_list.
End()) {
1879 if (idt)
gr->AddIDTelescope(idt);
1910 if (opt.
Next() ==
"tracks") {
1953 name.ReplaceAll(
"-",
"_");
1971 name.ReplaceAll(
"-",
"_");
2003 TIter it(groups.get());
2006 Info(
"CalculateReconstructionTrajectories",
"Calculating trajectories for particle reconstruction:");
2008 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
2010 ntr +=
group->CalculateReconstructionTrajectories();
2012 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
2015 std::cout <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::endl;
2017 std::cout << std::endl;
2037 Info(
"DeduceIdentificationTelescopesFromGeometry",
"Calculating...");
2039 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
2049 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
2053 std::cout <<
" -- created " << count <<
" telescopes" << std::endl;
2055 std::cout << std::endl;
2074 int len_tr = tr->
GetN();
2078 if ((tr2 != tr) && (len_tr < tr2->GetN()) && (tr2->
ContainsPath(tr))) {
2086 TIter it_dup(&duplicates);
2090 Info(
"AssociateTrajectoriesAndNodes",
"Removed %d duplicated sub-trajectories", duplicates.
GetEntries());
2105 if (
N->GetNTraj() > 1) {
2108 multitraj_nodes.
Add(
N);
2109 TIter tr(
N->GetTrajectories());
2112 if (tried_trajectories.
FindObject(traj))
continue;
2113 tried_trajectories.
Add(traj);
2117 detectors_of_group.
Add(node);
2123 else if (
N->GetNTraj() == 1) {
2127 if (tried_trajectories.
FindObject(traj))
return;
2128 tried_trajectories.
Add(traj);
2132 detectors_of_group.
Add(node);
2138 detectors_of_group.
Add(
N);
2187 #ifdef WITH_BUILTIN_GRU
2188 if (
r->GetDataFormat() ==
"EBYEDAT")
2206 Info(
"DeduceGroupsFromTrajectories",
"Deducing groups of detectors from trajectories");
2207 Int_t number_of_groups = 0;
2210 if (stl.get() && stl->GetEntries()) {
2211 Info(
"DeduceGroupsFromTrajectories",
"Deleting existing %d groups in array", stl->GetEntries());
2213 Info(
"DeduceGroupsFromTrajectories",
"Done");
2218 while ((det = (KVDetector*) next_det())) {
2219 if (det->GetGroup())
continue;
2222 if (!detectors_of_group.
GetEntries())
continue;
2226 TIter next_node(&detectors_of_group);
2232 Info(
"DeduceGroupsFromTrajectories",
"Filling group trajectory lists");
2255 DetNames.
Begin(
"/");
2256 while (!DetNames.
End()) {
2258 if (det) DetList->
Add(det);
2312 #ifdef WITH_BUILTIN_GRU
2443 #ifdef WITH_PROTOBUF
2448 #ifdef WITH_BUILTIN_GRU
2517 det_signal = detector->GetDetectorSignal(sig_type);
2519 det_signal = detector->AddDetectorSignal(sig_type);
2526 if (detname !=
"") sig_name =
Form(
"%s.%s", detname.
Data(), sig_type.
Data());
2527 else sig_name = sig_type;
2557 int N =
l.GetNpar();
2558 for (
int i = 0; i <
N; ++i) {
2562 if (
name.BeginsWith(
"ACQPAR")) {
2565 int dots =
name.GetNValues(
".");
2566 bool with_det = (dots == 4);
2567 assert(with_det || (dots == 3));
2573 KVDetector* det =
nullptr;
2575 det_name =
name.Next();
2576 sig_type =
name.Next();
2580 sig_type =
name.Next();
2640 if (basic_name ==
"") {
2641 Info(meth,
"No name found for \"%s\" file", keyw);
2648 Info(meth,
"\tNo file found ...");
2662 return unique_ptr<KVFileReader>();
2665 if (!fr->OpenFileToRead(fp.
Data())) {
2666 Error(meth,
"Error in opening file %s", fp.
Data());
2670 Info(meth,
"Reading %s file", fp.
Data());
2681 unique_ptr<KVFileReader> fr =
GetKVFileReader(db,
"ReadCalibrationFiles()",
"CalibrationFiles");
2686 while (fr->IsOK()) {
2688 if (fr->GetCurrentLine().BeginsWith(
"#") || fr->GetCurrentLine() ==
"") {}
2690 ReadCalibFile(fr->GetCurrentLine().Data(), db, calib_table);
2784 Info(
"ReadCalibFile",
"%s does not exist or not found",
filename);
2788 Info(
"ReadCalibFile",
"file : %s found", fullpath.
Data());
2794 KVString opt_list =
"RunList SignalIn SignalOut CalibType CalibClass CalibOptions ZRange";
2795 opt_list.
Begin(
" ");
2796 while (!opt_list.
End()) {
2804 Warning(
"ReadCalibFile",
"Calibration has 'Runlist' parameter (ignored): %s, did you mean 'RunList'?", env.
GetValue(
"Runlist",
""));
2808 Error(
"ReadCalibFile",
"No input signal defined : SignalIn");
2812 Error(
"ReadCalibFile",
"No output signal defined : SignalOut");
2816 Error(
"ReadCalibFile",
"No calibration type defined : CalibType");
2823 if (ph) calibrator_class = ph->
GetClass();
2825 Error(
"ReadCalibFile",
"No calibrator plugin of type %s", options.
GetStringValue(
"CalibClass"));
2839 Info(
"ReadCalibFile",
"Calibration used for runs %s", run_list.
AsString());
2842 Info(
"ReadCalibFile",
"Calibration used for all runs in database");
2862 if (clop !=
"") par->
SetParameter(
"CalibOptions", clop);
2866 while (!lval.
End()) {
2891 if (mfmreader.IsFrameReadMerge()) {
2912 while (mergeframe.ReadNextFrame()) {
2944 if (mfmframe.GetFrameType() == MFM_MESYTEC_FRAME_TYPE)
2947 if (mfmframe.GetFrameType() == MFM_EBY_EN_FRAME_TYPE
2948 || mfmframe.GetFrameType() == MFM_EBY_TS_FRAME_TYPE
2949 || mfmframe.GetFrameType() == MFM_EBY_EN_TS_FRAME_TYPE)
2985 #ifdef WITH_PROTOBUF
3031 Int_t ndet_absent = 0;
3033 TString absent_dets, ooo_dets;
3035 while ((det = (KVDetector*)next())) {
3043 if (ndet_absent) absent_dets +=
",";
3044 absent_dets += det->GetName();
3051 if (det->IsPresent()) {
3054 det->SetDetecting();
3058 det->SetDetecting(
kFALSE);
3059 if (ndet_ooo) ooo_dets +=
",";
3060 ooo_dets += det->GetName();
3064 det->SetDetecting();
3070 if (ndet_absent)
Info(
"CheckStatusOfDetectors",
"%d detectors absent during run : %s", ndet_absent, absent_dets.
Data());
3071 else Info(
"CheckStatusOfDetectors",
"All detectors present during run");
3072 if (ndet_ooo)
Info(
"CheckStatusOfDetectors",
"%d detectors malfunctioned during run : %s", ndet_ooo, ooo_dets.
Data());
3073 else Info(
"CheckStatusOfDetectors",
"All detectors functioning during run");
3121 Info(
"ReadOoODetectors()",
"Reading lists of out-of-order detectors...");
3122 auto fOoODet = db->
AddTable(
Form(
"%s.OoO Detectors",
GetName()),
"Name of out of order detectors");
3135 while (!srec.
End()) {
3137 dbrec->
AddKey(
"Runs",
"List of Runs");
3138 fOoODet->AddRecord(dbrec);
3144 dbrec->
AddKey(
"Runs",
"List of Runs");
3145 fOoODet->AddRecord(dbrec);
3186 Info(
"ReadAbsentDetectors()",
"Reading lists of absent/dismounted detectors... file=[%s]", fullpath.
Data());
3187 auto fAbsDet = db->
AddTable(
Form(
"%s.Absent Detectors",
GetName()),
"Name of out of order detectors");
3200 while (!srec.
End()) {
3202 dbrec->
AddKey(
"Runs",
"List of Runs");
3203 fAbsDet->AddRecord(dbrec);
3209 dbrec->
AddKey(
"Runs",
"List of Runs");
3210 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
void Error(const char *method, const char *msgfmt,...) const override
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")
void Warning(const char *method, const char *msgfmt,...) const override
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
ValType GetDataSetEnv(const Char_t *type, const ValType &defval) const
Bool_t HasCalibIdentInfos() 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()
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray", KVExpDB *db=nullptr)
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.
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 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)