47 #ifdef WITH_BUILTIN_GRU
54 #include "MFMEbyedatFrame.h"
279 if (!
de->IsOK() && !
e->IsOK())
return ntels;
397 TString uri = de_type + de_thick +
"-" + e_type + e_thick;
401 uri = de_type + de_thick +
"-" + e_type;
405 uri = de_type +
"-" + e_type + e_thick;
409 uri = de_type +
"-" + e_type;
415 uri = de_type +
"-" + e_type;
560 if (
de->GetGroup()) {
610 unique_ptr<KVSeqCollection> fGroups(
GetStructures()->GetSubListWithType(
"GROUP"));
611 TIter ngrp(fGroups.get());
612 while ((grp = (
KVGroup*) ngrp())) {
665 for (
int j = 0; j < dethits; j++) {
904 Error(
"DetectEvent",
"the KVEvent object pointer has to be valid");
908 Error(
"DetectEvent",
"the KVReconstructedEvent object pointer has to be valid");
914 Error(
"DetectEvent",
"ROOT geometry is requested, but has not been set: gGeoManager=0x0");
918 Error(
"DetectEvent",
"Using ROOT geometry, but no navigator exists");
948 Int_t part_index = 0;
949 while ((part =
event->GetNextParticle())) {
954 cout <<
"DetectEvent(): looking at particle---->" << endl;
957 if (strcmp(detection_frame,
"")) _part = (
KVNucleus*)part->
GetFrame(detection_frame);
974 det_stat.
SetValue(
"UNDETECTED",
"NEUTRON");
979 else if (_part->
GetKE() < 1.e-3) {
980 det_stat.
SetValue(
"UNDETECTED",
"NO ENERGY");
993 eLostInTarget = ebef - _part->
GetKE();
994 if (_part->
GetKE() < 1.e-3) {
995 det_stat.
SetValue(
"UNDETECTED",
"STOPPED IN TARGET");
998 part->
AddGroup(
"STOPPED IN TARGET");
1009 if (part->
GetZ() == 0) {
1011 det_stat.
SetValue(
"UNDETECTED",
"NEUTRON");
1017 det_stat.
SetValue(
"UNDETECTED",
"NO HIT");
1024 else if (nvl->
GetNpar() == 0) {
1026 if (part->
GetZ() == 0) {
1028 det_stat.
SetValue(
"UNDETECTED",
"NEUTRON");
1037 det_stat.
SetValue(
"UNDETECTED",
"DEAD ZONE");
1097 det_stat.
SetValue(
"UNDETECTED",
"GEOMETRY INCOHERENCY");
1100 part->
AddGroup(
"GEOMETRY INCOHERENCY");
1109 det_stat.
SetValue(
"UNDETECTED",
"THRESHOLD");
1121 det_stat.
SetValue(
"DETECTED",
"OK");
1130 det_stat.
SetValue(
"DETECTED",
"INCOMPLETE");
1134 Warning(
"DetectEvent",
"Cas non prevu ....");
1135 printf(
"last_det->GetName()=%s, lidtel->GetEntries()=%d, last_det->GetEnergy()=%lf\n",
1144 if (_part->
GetKE() > 1.e-3) {
1157 det_stat.
SetValue(
"UNDETECTED",
"GEOMETRY INCOHERENCY");
1159 part->
AddGroup(
"GEOMETRY INCOHERENCY");
1162 else if (nbre_nvl) {
1169 det_stat.
SetValue(
"DETECTED",
"PUNCH THROUGH");
1188 TIter nextIDT(lidtel);
1193 for (
int i = 1; i <= ndet; i++) {
1197 if (ntouche < ndet)
continue;
1225 ppp.
Add(part_index);
1253 while ((grp_tch = (
KVGroup*) nxt_grp())) {
1256 while ((part =
event->GetNextParticle())) {
1268 if (!last_det)
continue;
1289 while ((grp_tch = (
KVGroup*) nxt_grp())) {
1332 while ((part =
event->GetNextParticle())) {
1337 if (!last_det || !(last_det->
IsOK()))
continue;
1378 while ((grp_tch = (
KVGroup*) nxt_grp())) {
1383 Int_t round = 1, nchanged;
1390 while ((grp_tch = (
KVGroup*) nxt_grp())) {
1416 while ((grp_tch = (
KVGroup*) nxt_grp())) {
1466 Error(
"DetectParticle_TGEO",
"No existing navigator ...");
1537 Warning(
"ReplaceDetector",
"Needs reimplementing");
1625 unique_ptr<KVSeqCollection> fGroups(
GetStructures()->GetSubListWithType(
"GROUP"));
1627 TIter next(fGroups.get());
1629 while ((grp = (
KVGroup*) next())) {
1663 Warning(
"AddACQParam",
"Null pointer passed as argument");
1784 TString tabname = (myname !=
"" ?
Form(
"%s.Calibrations", myname.
Data()) :
"Calibrations");
1785 Info(
"SetCalibratorParameters",
"For array %s in table %s",
GetName(), tabname.
Data());
1786 KVRList* run_links =
r->GetLinks(tabname);
1787 if (run_links)
Info(
"SetCalibratorParameters",
"Found %d calibrations for this run", run_links->
GetEntries());
1789 Warning(
"SetCalibratorParameters",
"Got no links for %s", tabname.
Data());
1793 TIter nxt_link(run_links);
1799 Warning(
"SetCalibratorParameters",
"Got parameters for unknown detector: %s", dbps->
GetName());
1808 while (!clop.
End()) {
1821 catch (std::exception&
e) {
1822 Error(
"SetCalibratorParameters",
1823 "Problem for %s [%s] : %s", det->
GetName(), cal->
GetType(),
e.what());
1837 Warning(
"SetCalibratorParameters",
"Wrong number of parameters (%d) for calibrator %s for detector %s : should be %d",
1879 if (!fired_params || !fired_params->
GetEntries()) {
1882 if (fired_params && fired_params->
GetEntries()) {
1884 TIter next_par(fired_params);
1896 unique_ptr<KVSeqCollection> fGroups(
GetStructures()->GetSubListWithType(
"GROUP"));
1898 TIter next_grp(fGroups.get());
1900 while ((grp = (
KVGroup*) next_grp())) {
1905 detev->AddGroup(grp);
1939 TIter nxt_grp(kvde->GetGroups());
1940 while ((grp_tch = (
KVGroup*) nxt_grp())) {
2064 Warning(
"RemoveGroup",
"Needs reimplementing");
2105 Error(
"DetectParticleIn",
"Detector %s not found", detname);
2141 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Changing dataset\n");
2146 printf(
"Info in <KVMultiDetArray::MakeMultiDetector>: Deleting existing array %s\n",
gMultiDetArray->
GetName());
2350 Info(
"SetIdentifications",
"No active identifications");
2354 id_labels.
Begin(
" ");
2357 while (!id_labels.
End()) {
2363 Info(
"SetIdentifications",
"Initialising %s identifications...", idt->
GetLabel());
2365 Info(
"SetIdentifications",
"OK");
2372 Warning(
"SetIdentfications",
"No telescopes found with labels given in %s.ActiveIdentifications list: %s",
2449 cout << endl <<
"-----STATUS OF IDENTIFICATION TELESCOPES";
2452 cout <<
"------" << endl << endl;
2458 TIter it(typelist.get());
2461 if (id_labels ==
"") id_labels +=
type->GetString().Data();
2463 id_labels +=
Form(
" %s",
type->GetString().Data());
2467 if (id_labels ==
"") {
2468 cout <<
" *** No active identifications *** " << endl;
2472 unique_ptr<TObjArray> toks(id_labels.
Tokenize(
' '));
2478 TList* id_type_list = 0;
2479 while ((id_type_list = (
TList*)next_type())) {
2481 cout <<
" *** " << id_type_list->
GetName() <<
" Identifications -------------------" << endl;
2482 if (!toks->FindObject(id_type_list->
GetName())) {
2483 cout <<
" [NOT ACTIVE]" << endl;
2487 TList* print_list = 0;
2491 if (Nok < Notok) print_list = ok_list;
2492 else print_list = notok_list;
2494 if (Nok && (!Notok)) cout <<
" ALL telescopes are OK" << endl;
2495 else if (Notok && (!Nok)) cout <<
" NO telescopes are OK" << endl;
2497 cout <<
" " << ok_list->
GetEntries() <<
" telescopes are OK, "
2498 << notok_list->
GetEntries() <<
" telescopes are NOT OK" << endl;
2499 cout <<
" " << print_list->
GetName() <<
" :" << endl;
2500 TIter it(print_list);
2503 while ((ob = it())) cout <<
"," << ob->
GetName();
2545 if (!id_type_list) {
2546 id_type_list =
new TList;
2649 type_list =
new TList;
2679 Info(
"PrintCalibStatusOfDetectors",
"Cannot know status without knowing RUN NUMBER");
2683 cout << endl <<
"-----------STATUS OF CALIBRATIONS FOR RUN "
2690 TList* id_type_list = 0;
2691 while ((id_type_list = (
TList*)next_type())) {
2693 cout <<
" *** " << id_type_list->
GetName() <<
" Detectors -------------------" << endl;
2696 TList* print_list = 0;
2700 if (Nok < Notok) print_list = ok_list;
2701 else print_list = notok_list;
2703 if (Nok && (!Notok)) cout <<
" ALL calibrations are OK" << endl;
2704 else if (Notok && (!Nok)) cout <<
" NO calibrations are OK" << endl;
2706 cout <<
" " << ok_list->
GetEntries() <<
" calibrations are OK, "
2707 << notok_list->
GetEntries() <<
" calibrations are NOT OK" << endl;
2708 cout <<
" " << print_list->
GetName() <<
" :" << endl;
2709 TIter it(print_list);
2712 while ((ob = it())) cout <<
"," << ob->
GetName();
2835 if (filename ==
"") {
2836 Error(
"SetDetectorThicknesses",
"*.KVMultiDetArray.DetectorThicknesses not defined in .kvrootrc");
2841 if (fullpath ==
"") {
2842 Info(
"SetDetectorThicknesses",
"File %s not found", filename.
Data());
2847 Error(
"SetDetectorThicknesses",
"Problem opening file %s", fullpath.
Data());
2850 Info(
"SetDetectorThicknesses",
"Setting thicknesses of detectors from file %s", filename.
Data());
2913 Error(
"GetPunchThroughEnergy",
"Detector %s not found in array", detector);
2942 punch->
SetName(
Form(
"KVMultiDetpunchthrough_%s_mass%d", detector, massform));
2943 punch->
SetTitle(
Form(
"Array Punch-through %s (MeV) (mass formula %d)", detector, massform));
2946 for (
int Z = 1; Z <= 92; Z++) {
2967 punch->
SetName(
Form(
"KVMultiDetpunchthroughEsurA_%s_mass%d", detector, massform));
2968 punch->
SetTitle(
Form(
"Array Punch-through %s (AMeV) (mass formula %d)", detector, massform));
2971 for (
int Z = 1; Z <= 92; Z++) {
2994 punch->
SetName(
Form(
"KVMultiDetpunchthroughV_%s_mass%d", detector, massform));
2995 punch->
SetTitle(
Form(
"Array Punch-through %s (cm/ns) (mass formula %d)", detector, massform));
2998 for (
int Z = 1; Z <= 92; Z++) {
3020 Error(
"SetROOTGeometry",
"ROOT geometry is requested, but has not been set: gGeoManager=0x0,\n Call CreateGeoManager() method first");
3095 trans.
SetDz(distance) ;
3097 if (postTrans)
h = (*postTrans) * rot2 * trans * rot1 ;
3098 else h = rot2 * trans * rot1;
3125 if (
d->GetNode()->GetNDetsBehind() > 1)
d->SetSegment(0);
3126 else d->SetSegment(1);
3148 if (!(det->
IsOK()))
return;
3166 for (
int i = 0; i < (aligned->
GetSize() - 1); i++) {
3186 TIter next_tel(list);
3276 TIter nextdet(lgrdet);
3282 for (
Int_t ii = 0; ii < ntel; ii += 1) {
3298 for (
Int_t kk = 0; kk <
id->GetListOfIDGrids()->GetEntries(); kk += 1) {
3305 delete lidtel->
Remove(
id);
3357 gr->Remove(fTelescope);
3363 Warning(
"SetPresent",
"Method implemented only in case detector is alone in telescope");
3374 gr->Add(fTelescope);
3441 if (
gr->GetRuns().Contains((
Int_t) run)) {
3443 TIter nxtid(
gr->GetIDTelescopes());
3462 gr->ClearListOfTelescopes();
3463 if (
gr->GetParameters()->HasParameter(
"IDTelescopes")) {
3464 KVString tel_list =
gr->GetParameters()->GetStringValue(
"IDTelescopes");
3465 tel_list.
Begin(
",");
3466 while (!tel_list.
End()) {
3469 if (idt)
gr->AddIDTelescope(idt);
3500 if (opt.
Next() ==
"tracks") {
3516 else Error(
"Draw",
"Only ROOT geometries can be viewed");
3547 list->
Add(
new TH2F(name,
Form(
"Hits in %s", idt->
GetName()), dimension, 0., 0., dimension, 0., 0.));
3596 TIter it(groups.get());
3599 Info(
"CalculateReconstructionTrajectories",
"Calculating trajectories for particle reconstruction:");
3601 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
3603 ntr +=
group->CalculateReconstructionTrajectories();
3605 std::cout <<
"\xd" <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::flush;
3608 std::cout <<
" -- calculated " << ntr <<
" reconstruction trajectories" << std::endl;
3610 std::cout << std::endl;
3634 Info(
"DeduceIdentificationTelescopesFromGeometry",
"Calculating...");
3636 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
3648 std::cout <<
"\xd" <<
" -- created " << count <<
" telescopes" << std::flush;
3653 std::cout <<
" -- created " << count <<
" telescopes" << std::endl;
3655 std::cout << std::endl;
3674 int len_tr = tr->
GetN();
3678 if ((tr2 != tr) && (len_tr < tr2->GetN()) && (tr2->
ContainsPath(tr))) {
3686 TIter it_dup(&duplicates);
3690 Info(
"AssociateTrajectoriesAndNodes",
"Removed %d duplicated sub-trajectories", duplicates.
GetEntries());
3705 if (
N->GetNTraj() > 1) {
3708 multitraj_nodes.
Add(
N);
3709 TIter tr(
N->GetTrajectories());
3712 if (tried_trajectories.
FindObject(traj))
continue;
3713 tried_trajectories.
Add(traj);
3717 detectors_of_group.
Add(node);
3723 else if (
N->GetNTraj() == 1) {
3727 if (tried_trajectories.
FindObject(traj))
return;
3728 tried_trajectories.
Add(traj);
3732 detectors_of_group.
Add(node);
3738 detectors_of_group.
Add(
N);
3779 #ifdef WITH_BUILTIN_GRU
3797 Info(
"DeduceGroupsFromTrajectories",
"Deducing groups of detectors from trajectories");
3798 Int_t number_of_groups = 0;
3801 if (stl.get() && stl->GetEntries()) {
3802 Info(
"DeduceGroupsFromTrajectories",
"Deleting existing %d groups in array", stl->GetEntries());
3804 Info(
"DeduceGroupsFromTrajectories",
"Done");
3813 if (!detectors_of_group.
GetEntries())
continue;
3817 TIter next_node(&detectors_of_group);
3823 Info(
"DeduceGroupsFromTrajectories",
"Filling group trajectory lists");
3846 DetNames.
Begin(
"/");
3847 while (!DetNames.
End()) {
3849 if (det) DetList->
Add(det);
3900 e->SetMinimumOKMultiplicity(1);
3904 #ifdef WITH_BUILTIN_GRU
3929 while ((obj = it())) obj->
Clear();
3974 while ((o = it())) {
4009 #ifdef WITH_PROTOBUF
4014 #ifdef WITH_BUILTIN_GRU
4067 int N =
l.GetNpar();
4068 for (
int i = 0; i <
N; ++i) {
4072 if (name.
Next() ==
"ACQPAR") {
4127 if (basic_name ==
"") {
4128 Info(meth,
"No name found for \"%s\" file", keyw);
4135 Info(meth,
"\tNo file found ...");
4149 return unique_ptr<KVFileReader>();
4152 if (!fr->OpenFileToRead(fp.
Data())) {
4153 Error(meth,
"Error in opening file %s", fp.
Data());
4157 Info(meth,
"Reading %s file", fp.
Data());
4168 unique_ptr<KVFileReader> fr =
GetKVFileReader(db,
"ReadCalibrationFiles()",
"CalibrationFiles");
4173 while (fr->IsOK()) {
4175 if (fr->GetCurrentLine().BeginsWith(
"#") || fr->GetCurrentLine() ==
"") {}
4177 ReadCalibFile(fr->GetCurrentLine().Data(), db, calib_table);
4271 Info(
"ReadCalibFile",
"%s does not exist or not found", filename);
4275 Info(
"ReadCalibFile",
"file : %s found", fullpath.
Data());
4281 KVString opt_list =
"RunList SignalIn SignalOut CalibType CalibClass CalibOptions ZRange";
4282 opt_list.
Begin(
" ");
4283 while (!opt_list.
End()) {
4291 Error(
"ReadCalibFile",
"No input signal defined : SignalIn");
4295 Error(
"ReadCalibFile",
"No output signal defined : SignalOut");
4299 Error(
"ReadCalibFile",
"No calibration type defined : CalibType");
4306 if (ph) calibrator_class = ph->
GetClass();
4308 Error(
"ReadCalibFile",
"No calibrator plugin of type %s", options.
GetStringValue(
"CalibClass"));
4327 while ((rec = (
TEnvRec*)next())) {
4340 if (clop !=
"") par->
SetParameter(
"CalibOptions", clop);
4344 while (!lval.
End()) {
4369 if (mfmreader.IsFrameReadMerge()) {
4390 while (mergeframe.ReadNextFrame()) {
4418 if (mfmframe.GetFrameType() == MFM_EBY_EN_FRAME_TYPE
4419 || mfmframe.GetFrameType() == MFM_EBY_TS_FRAME_TYPE
4420 || mfmframe.GetFrameType() == MFM_EBY_EN_TS_FRAME_TYPE)
4454 for (
int i = 0; i < ebyframe.GetNbItems(); ++i) {
4455 ebyframe.GetDataItem(i, lab, val);
4470 #ifdef WITH_PROTOBUF
4516 Int_t ndet_absent = 0;
4518 TString absent_dets, ooo_dets;
4528 if (ndet_absent) absent_dets +=
",";
4529 absent_dets += det->
GetName();
4544 if (ndet_ooo) ooo_dets +=
",";
4555 if (ndet_absent)
Info(
"CheckStatusOfDetectors",
"%d detectors absent during run : %s", ndet_absent, absent_dets.
Data());
4556 else Info(
"CheckStatusOfDetectors",
"All detectors present during run");
4557 if (ndet_ooo)
Info(
"CheckStatusOfDetectors",
"%d detectors malfunctioned during run : %s", ndet_ooo, ooo_dets.
Data());
4558 else Info(
"CheckStatusOfDetectors",
"All detectors functioning during run");
4597 Info(
"ReadOoODetectors()",
"Reading lists of out-of-order detectors...");
4598 auto fOoODet = db->
AddTable(
Form(
"%s.OoO Detectors",
GetName()),
"Name of out of order detectors");
4611 while (!srec.
End()) {
4613 dbrec->
AddKey(
"Runs",
"List of Runs");
4614 fOoODet->AddRecord(dbrec);
4620 dbrec->
AddKey(
"Runs",
"List of Runs");
4621 fOoODet->AddRecord(dbrec);
KVDataSetManager * gDataSetManager
KVIDGridManager * gIDGridManager
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
GANIL VXI/VME acquisition parameter.
void SetWorking(Bool_t on=kTRUE)
KVDetector * GetDetector() const
void SetData(UShort_t val)
void SetLabel(const Char_t *lab)
const Char_t * GetLabel() const
const Char_t * GetType() const
virtual void Print(Option_t *option="") const
virtual void SetType(const Char_t *str)
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *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
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.
Bool_t HasCalibIdentInfos() const
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
TString GetFullPathToDataSetFile(const Char_t *filename)
Base class for detector geometry description, interface to energy-loss calculations.
virtual Bool_t IsOK() const
TList * GetTelescopesForIdentification()
KVList * GetAlignedIDTelescopes()
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
KVGroup * GetGroup() const
virtual void SetEnergyLoss(Double_t e) const
KVList * GetHits() const
Return the list of particles hitting this detector in an event.
virtual Double_t GetEnergy() const
Int_t GetNHits() const
Return the number of particles hitting this detector in an event.
virtual const Char_t * GetFiredACQParameterListFormatString() const
virtual void SetACQParams()
KVList * GetIDTelescopes()
Double_t GetTheta() const
KVMaterial * GetAbsorber(Int_t i) const
Returns pointer to the i-th absorber in the detector (i=0 first absorber, i=1 second,...
virtual void DeduceACQParameters(KVEvent *, KVNumberList &)
void SetThickness(Double_t thick)
Bool_t IsCalibrated() const
void SetDetecting(Bool_t yes=kTRUE)
virtual void RemoveCalibrators()
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
virtual void SetFiredBitmask(KVString &)
virtual Bool_t IsDetecting() const
virtual TList * GetAlignedDetectors(UInt_t direction=1)
KVGeoDetectorNode * GetNode()
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres)
KVList * GetACQParamList() const
virtual Bool_t IsPresent() const
TVector3 GetRandomDirection(Option_t *t="isotropic")
void ResetAlignedDetectors(UInt_t direction=1)
virtual void Print(Option_t *option="") const
Bool_t AddCalibrator(KVCalibrator *cal, const KVNameValueList &opts="")
void SetPresent(Bool_t yes=kTRUE)
Base class container for multi-particle events.
KVNameValueList * GetParameters() const
virtual void Clear(Option_t *opt="")
Base class to describe database of an experiment ,.
Bool_t FindCalibFile(const Char_t *type, TString &fullpath) const
TString GetCalibFileName(const Char_t *type) const
const KVNumberList & GetRunList() const
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
Handle reading text files.
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
Bool_t ContainsPath(KVGeoDNTrajectory *other)
KVGeoDetectorNode * GetNodeInFront(const KVGeoDetectorNode *n) 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.
Bool_t IsTracking() const
void ResetTrackID(Int_t id=0)
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)
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
KVGeoStrucElement * GetStructure(const Char_t *name) const
void ClearStructures(const Char_t *type="")
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
const KVSeqCollection * GetParents() const
Base class for particle reconstruction in one group of a detector array.
static KVGroupReconstructor * Factory(const TString &plugin="")
Group of detectors which can be treated independently of all others in array.
void AddTrajectory(KVGeoDNTrajectory *t)
void Reset(Option_t *opt="")
virtual void SetNumber(UInt_t num)
virtual TList * GetDetectorsInLayer(UInt_t lay)
virtual UInt_t GetNumberOfDetectorLayers()
Extended version of ROOT THashList.
Base class for particle identification in a 2D map.
void RemoveIDTelescope(KVBase *t)
Handles a stock of identification grids to be used by one or more identification telescopes.
Bool_t ReadAsciiFile(const Char_t *filename)
const TList * GetLastReadGrids() 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()
void SetGroup(KVGroup *kvg)
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 Bool_t SetIdentificationParameters(const KVMultiDetArray *)
void SetIDGrid(KVIDGraph *)
KVDetector * GetDetector(UInt_t n) const
virtual Bool_t CheckTheoreticalIdentificationThreshold(KVNucleus *, Double_t=0.0)
virtual Bool_t CanIdentify(Int_t Z, Int_t)
virtual void AddDetector(KVDetector *d)
const KVList * GetDetectors() const
virtual UShort_t GetIDCode()
virtual void Initialize(void)
virtual void SetIdentificationStatus(KVReconstructedNucleus *)
const KVList * GetListOfIDGrids() const
Extended TList class which owns its objects by default.
Read MFM format acquisition data.
Description of physical materials used to construct detectors; interface to range tables.
virtual void SetThickness(Double_t thick)
static KVIonRangeTable * GetRangeTable()
Base class for describing the geometry of a detector array.
KVNumberList fAcceptECodes
list of acceptable calibration codes for reconstructed nuclei
virtual KVNameValueList * DetectParticle(KVNucleus *part)
Bool_t IsROOTGeometry() const
bool try_a_singleIDtelescope(TString uri, KVDetector *d, TCollection *l)
virtual KVGroup * GetGroupWithDetector(const Char_t *)
KVSeqCollection * GetListOfIDTelescopes() const
KVUniqueNameList * GetIDTelescopeTypes()
void FillListOfIDTelescopes(KVIDGraph *gr) const
virtual Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
KVNumberList fAcceptIDCodes
list of acceptable identification codes for reconstructed nuclei
virtual void DetectEvent(KVEvent *event, KVReconstructedEvent *rec_event, const Char_t *detection_frame="")
virtual 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)
virtual void GetIDTelescopesForGroup(KVGroup *grp, TCollection *tel_list)
static Bool_t fCloseGeometryNow
virtual KVGroup * GetGroup(const Char_t *) const
Return pointer to group with name.
const KVSeqCollection * GetACQParams() const
void DeduceIdentificationTelescopesFromGeometry()
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
virtual UShort_t GetCoherencyIDCode()
void RecursiveTrajectoryClustering(KVGeoDetectorNode *N, KVUniqueNameList &tried_trajectories, KVUniqueNameList &multitraj_nodes, KVUniqueNameList &detectors_of_group)
KVSeqCollection * fIDTelescopes
deltaE-E telescopes in groups
virtual Int_t FilteredEventCoherencyAnalysis(Int_t round, KVReconstructedEvent *rec_event)
virtual void SetMinimumOKMultiplicity(KVEvent *) const
UInt_t fCurrentRun
Number of the current run used to call SetParameters.
static Bool_t fMakeMultiDetectorSetParameters
void CalculateIdentificationGrids()
For each IDtelescope in array, calculate an identification grid.
virtual void prepare_to_handle_new_raw_data()
reset acquisition parameters etc. before reading new raw data event
virtual UChar_t GetNormalCalibrationCode()
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 TGraph * DrawPunchThroughEsurAVsZ(const Char_t *detector, Int_t massform=KVNucleus::kBetaMass)
Bool_t ReadGridsFromAsciiFile(const Char_t *) const
void InitialiseRawDataReading(KVRawDataReader *)
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
KVSeqCollection * fACQParams
list of data acquisition parameters associated to detectors
virtual void SetDetecting(KVDetector *det, Bool_t detecting=kTRUE)
virtual void copy_fired_parameters_to_recon_param_list()
TString GetDataSet() const
virtual void SetPresent(KVDetector *det, Bool_t present=kTRUE)
void CalculateDetectorSegmentationIndex()
virtual void AnalyseGroupAndReconstructEvent(KVReconstructedEvent *recev, KVGroup *grp)
static TGeoHMatrix * GetVolumePositioningMatrix(Double_t distance, Double_t theta, Double_t phi, TGeoTranslation *postTrans=nullptr)
KVGeoNavigator * GetNavigator() const
void DetectParticleIn(const Char_t *detname, KVNucleus *kvp)
KVUpDater * fUpDater
used to set parameters for multidetector
void SetTarget(const Char_t *material, const Float_t thickness)
virtual Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *list)
void SetGeometry(TGeoManager *)
virtual void MakeCalibrationTables(KVExpDB *)
virtual ~KVMultiDetArray()
destroy (delete) the MDA and all the associated structure, detectors etc.
KVUniqueNameList fFiredACQParams
list of fired acquisition parameters after reading raw data event
virtual void SetRunIdentificationParameters(UShort_t n)
Bool_t HandleRawDataBuffer(MFMBufferReader &)
TString GetFileName(KVExpDB *, const Char_t *meth, const Char_t *keyw)
virtual void Clear(Option_t *opt="")
virtual void CheckStatusOfDetectors(KVDBRun *, const TString &="")
virtual void SetArrayACQParams()
virtual void PerformClosedROOTGeometryOperations()
KVRangeTableGeoNavigator * fNavigator
for propagating particles through array geometry
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()
void RemoveGroup(KVGroup *)
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 UShort_t GetBadIDCode()
virtual Bool_t handle_raw_data_event_ebyedat(KVGANILDataReader &)
const TSeqCollection * GetTrajectories() const
virtual void MakeListOfDetectors()
void SetTargetMaterial(const Char_t *material)
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()
void Draw(Option_t *option="")
bool try_upper_and_lower_singleIDtelescope(TString uri, KVDetector *d, TCollection *l)
void ReplaceDetector(const Char_t *name, KVDetector *new_kvd)
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")
virtual void ReconstructEvent(KVReconstructedEvent *, KVDetectorEvent *)
virtual KVGroup * GetGroupWithAngles(Float_t, Float_t)
virtual void SetRawDataFromReconEvent(KVNameValueList &)
virtual TGraph * DrawPunchThroughZVsVpar(const Char_t *detector, Int_t massform=KVNucleus::kBetaMass)
Bool_t HandleRawDataEvent(KVRawDataReader *)
virtual Double_t GetPunchThroughEnergy(const Char_t *detector, Int_t Z, Int_t A)
virtual void InitializeIDTelescopes()
virtual void SetROOTGeometry(Bool_t on=kTRUE)
virtual void RenumberGroups()
virtual void SetRunCalibrationParameters(UShort_t n)
void PrintStatusOfIDTelescopes()
virtual void SetACQParams()
KVACQParam * GetACQParam(const Char_t *name) const
bool try_upper_and_lower_doubleIDtelescope(TString uri, KVDetector *de, KVDetector *e, TCollection *l)
void PrintCalibStatusOfDetectors()
virtual TGraph * DrawPunchThroughEnergyVsZ(const Char_t *detector, Int_t massform=KVNucleus::kBetaMass)
Bool_t fROOTGeometry
=kTRUE use ROOT geometry
void ReadCalibrationFiles(KVExpDB *db)
virtual UShort_t GetMultiHitFirstStageIDCode()
virtual void SetCalibratorParameters(KVDBRun *, const TString &="")
KVNameValueList * DetectParticle_TGEO(KVNucleus *part)
Int_t fFilterType
type of filtering (used by DetectEvent)
virtual void PrepareModifGroup(KVGroup *grp, KVDetector *dd)
virtual void SetPartSeedCond(const Char_t *cond)
virtual 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.
void AddACQParam(KVACQParam *)
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 SetTargetThickness(const Float_t thickness)
void ReadCalibFile(const Char_t *filename, KVExpDB *db, KVDBTable *calib_table)
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
virtual KVTelescope * GetTelescope(const Char_t *name) const
Return pointer to telescope in array with name given by "name".
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 void GetAlignedIDTelescopesForDetector(KVDetector *det, TCollection *list)
virtual void CreateIDTelescopesInGroups()
const KVSeqCollection * GetFiredDataParameters() const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
void RemoveParameter(const Char_t *name)
virtual void Clear(Option_t *opt="")
const Char_t * GetNameAt(Int_t idx) const
Int_t GetNpar() const
return the number of stored parameters
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
KVHashList * GetList() const
TString GetTStringValue(const Char_t *name) const
void Copy(TObject &nvl) const
A generic named parameter storing values of different types.
Double_t GetDouble() const
Description of properties and kinematics of atomic nuclei.
virtual void Print(Option_t *t="") const
Display nucleus parameters.
void SetZ(Int_t z, Char_t mt=-1)
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
void SetMassFormula(UChar_t mt)
Int_t GetZ() const
Return the number of proton / atomic number.
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 Add(Int_t)
Add value 'n' to the list.
void Set(const TString &l)
void SetIsOK(Bool_t flag=kTRUE)
void SetTheta(Double_t theta)
TVector3 * GetPInitial() const
void RemoveGroup(const Char_t *groupname)
void AddGroup(const Char_t *groupname, const Char_t *from="")
KVNameValueList * GetParameters() const
void SetMomentum(const TVector3 &v)
Double_t GetEnergy() const
void SetE0(TVector3 *e=0)
KVParticle const * GetFrame(const Char_t *frame, Bool_t warn_and_return_null_if_unknown=kTRUE) const
Bool_t BelongsToGroup(const Char_t *groupname) const
Bool_t IsSmallerThan(KVPosition *pos)
kTRUE if "this" is entirely contained within "pos"
Read Google Protobuf DAQ files.
Wrapper for TRefArray adding some functionality.
virtual KVBase * FindObject(const Char_t *name, const Char_t *type) const
Propagate particles through array geometry calculating energy losses.
Bool_t CheckIonForRangeTable(Int_t Z, Int_t A)
virtual void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=0)
We start a new track to represent the particle's trajectory through the array.
Abstract base class for reading raw (DAQ) data.
virtual TString GetDataFormat() const =0
Physical event reconstructed from data measured with a detector array using implemented identificatio...
virtual Bool_t AnalyseDetectors(TList *kvtl)
virtual void IdentifyEvent()
KVReconstructedNucleus * AddParticle()
virtual void SecondaryIdentCalib()
KVReconstructedNucleus * GetNextParticle(Option_t *opt="")
virtual void CalibrateEvent()
Nuclei reconstructed from data measured by a detector array ,.
virtual void Reconstruct(KVDetector *kvd)
virtual void SetAMeasured(Bool_t yes=kTRUE)
void SetNSegDet(Int_t seg)
virtual Int_t GetECode() const
static UInt_t GetNUnidentifiedInGroup(KVGroup *grp)
Bool_t IsIdentified() const
virtual Int_t GetIDCode() const
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
virtual void GetAnglesFromReconstructionTrajectory(Option_t *opt="random")
virtual void SetZMeasured(Bool_t yes=kTRUE)
KVIDTelescope * GetIdentifyingTelescope() const
static void AnalyseParticlesInGroup(KVGroup *grp)
void SetIDCode(UShort_t s)
KVGroup * GetGroup() const
@ kStatusPileupDE
telescope; a minimum Z could be estimated from the measured energy loss.
void SetIdentifyingTelescope(KVIDTelescope *i)
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObjectByLabel(const Char_t *) const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual TObject * At(Int_t idx) const
KVSeqCollection * GetSubListWithType(const Char_t *retvalue) const
virtual void SetCleanup(Bool_t enable=kTRUE)
virtual void Add(TObject *obj)
KVSeqCollection * GetSubListWithLabel(const Char_t *retvalue) const
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual void Delete(Option_t *option="")
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
Int_t GetNValues(TString delim) const
Calculation/correction of energy losses of particles through an experimental target.
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
void Clear(Option_t *opt="")
Reset absorber - set energy lost by particles to zero.
void SetOutgoing(Bool_t r=kTRUE)
KVMaterial * GetLayerByIndex(Int_t ilayer) const
Associates two detectors placed one behind the other.
Optimised list in which named objects can only be placed once.
virtual void Add(TObject *obj)
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)
virtual const char * GetName() const
void SetName(const char *name)
virtual Int_t GetEntries() const
virtual void Delete(Option_t *option="")=0
virtual void SetOwner(Bool_t enable=kTRUE)
Bool_t Contains(const char *name) const
virtual Int_t GetSize() const
const char * GetName() const
const char * GetValue() 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
THashList * GetTable() 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)
virtual void SetDz(Double_t dz)
void SetTransparency(Char_t transparency=0)
virtual void Draw(Option_t *option="")
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual void SetName(const char *name="")
virtual void SetTitle(const char *title="")
virtual void Sort(Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
virtual Int_t Fill(const char *name, Double_t w)
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
virtual TObject * At(Int_t idx) const
virtual void Delete(Option_t *option="")
virtual TObject * First() const
virtual const char * GetName() const
virtual void SetTitle(const char *title="")
virtual const char * GetTitle() const
virtual void SetName(const char *name)
virtual TObject * Clone(const char *newname="") const
void AbstractMethod(const char *method) const
virtual void Clear(Option_t *="")
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 Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void ls(Option_t *option="") const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * GetClass() const
Longptr_t ExecPlugin(int nargs, const T &... params)
virtual TObject * RemoveAt(Int_t idx)
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
const char * Data() 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
TString & ReplaceAll(const char *s1, const char *s2)
const long double g
masses
Double_t Max(Double_t a, Double_t b)