KaliVeda
Toolkit for HIC analysis
KVFAZIA.cpp
1 //Created by KVClassFactory on Tue Jan 27 11:37:39 2015
2 //Author: ,,,
3 
4 #include "KVFAZIA.h"
5 #include "KVGeoImport.h"
6 #include "KVFAZIADetector.h"
7 #include "KVGroup.h"
8 #include "KVDetectorEvent.h"
9 #include "KVTarget.h"
10 #include "KVDataSet.h"
11 #include "KVConfig.h"
12 #include "KVFAZIAIDSiPSA.h"
13 #include "KVFAZIAIDCsI.h"
14 #include "KVFAZIAIDSiCsI.h"
15 #include "KVFAZIAIDSiSi.h"
16 
17 #include "TGeoCompositeShape.h"
18 #include "TGeoEltu.h"
19 
20 #include <KVFAZIAIDSiSiCsI.h>
21 #include <KVReconstructedNucleus.h>
22 
23 #ifdef WITH_MFM
24 #include "MFMFaziaFrame.h"
25 #endif
26 
27 #ifdef WITH_PROTOBUF
28 #include "FzEventSet.pb.h"
29 #include "KVFzDataReader.h"
30 #endif
31 
33 
34 // BEGIN_HTML <!--
36 /* -->
37 <h2>KVFAZIA</h2>
38 <h4>Base class for description of the FAZIA set up</h4>
39 <!-- */
40 // --> END_HTML
42 KVFAZIA* gFazia;
43 
44 static Char_t const* const FzDataType_str[] = { "QH1", "I1", "QL1", "Q2", "I2", "Q3", "ADC", "UNK" };
45 static Char_t const* const FzDetector_str[] = { "SI1", "SI1", "SI1", "SI2", "SI2", "CSI" };
46 
47 
50 
51 KVFAZIA::KVFAZIA(const Char_t* title)
52  : KVMultiDetArray("FAZIA", title)
53 {
54  // Default constructor
56  gFazia = this;
57  fDetectorLabels = "";
58  fSignalTypes = "QL1,I1,QH1,Q2,I2,Q3";
61 
62  // values of trapezoidal filter rise time set in the fpgas to be linked with a database...
63  fQH1risetime = GetSetupParameter("QH1.FPGARiseTime");
64  fQ2risetime = GetSetupParameter("Q2.FPGARiseTime");
65  fQ3slowrisetime = GetSetupParameter("Q3.slow.FPGARiseTime");
66  fQ3fastrisetime = GetSetupParameter("Q3.fast.FPGARiseTime");
67 
68  Info("KVFAZIA", "fpga shapers: %lf %lf %lf %lf", fQH1risetime, fQ2risetime, fQ3slowrisetime, fQ3fastrisetime);
69 }
70 
71 
72 
74 
76 {
77 
78  Double_t lval = -1;
79  if (gDataSet) lval = gDataSet->GetDataSetEnv(parname, 0.0);
80  else lval = gEnv->GetValue(parname, 0.0);
81  return lval;
82 }
83 
84 
85 
88 
90 {
91  // Set values of all raw data parameters and the value of the trigger bit pattern for the event
92 
94  auto parlist = recev.GetParameters();
95  if (parlist->HasIntParameter("FAZIA.TRIGPAT")) SetTriggerPattern(parlist->GetIntValue("FAZIA.TRIGPAT"));
96  else {
97  SetTriggerPattern(0);// FAZIA absent from event
98  return;
99  }
100  // loop over all nuclei in event
101  for(auto& rnuc : recev)
102  {
103  // loop over all nodes in reconstruction trajectory
104  rnuc.GetReconstructionTrajectory()->IterateFrom();
105  while( auto rnod = rnuc.GetReconstructionTrajectory()->GetNextNode() )
106  {
107  // loop over all signals of associated detector
108  for(auto ds_p : rnod->GetDetector()->GetListOfDetectorSignals())
109  {
110  auto ds = dynamic_cast<KVDetectorSignal&>(*ds_p);
111  TString parname = Form("%s.%s", rnod->GetName(), ds.GetName());
112  if(rnuc.GetParameters()->HasParameter(parname))
113  {
114  add_and_set_detector_signal(rnod->GetDetector(),rnod->GetName(),
115  rnuc.GetParameters()->GetDoubleValue(parname),ds.GetType());
116  }
117  }
118  }
119  }
120 }
121 
122 
123 
126 
128 {
129  // Override base method in order to read FAZIA trigger for each run
130 
133 }
134 
135 
136 
150 
152 {
153  // Returns the symbolic name for the principal DAQ trigger used for the current run
154  // e.g. 'Mult2', 'Mult1/100', etc. (see SetTriggerPatternsForDataSet()).
155  //
156  // This can be used to test if the actual DAQ trigger for an event was consistent
157  // with the principal trigger by doing:
158  //
159  //~~~~{.cpp}
160  // if( gFazia->GetTrigger().IsTrigger( gFazia->GetTriggerForCurrentRun() ) )
161  // {
162  // ===ok in this case trigger is consistent==
163  // }
164  //~~~~
165 
166  if (gExpDB) {
167  if (gExpDB->GetTable("FAZIA.Triggers")) {
168  auto rundb = gExpDB->GetDBRun(GetCurrentRunNumber());
169  if (rundb) {
170  auto links = rundb->GetLinks("FAZIA.Triggers");
171  if (links && links->GetEntries())
172  return links->First()->GetName();
173  }
174  }
175  }
176  return "";
177 }
178 
179 
180 
204 
206 {
207  // Set identification telescope objects for FAZIA geometry by hand.
208  //
209  // The actual telescope classes used depends on the value of the variable:
210  //
211  //~~~
212  //[dataset].FAZIA.IDTelescopes
213  //~~~
214  //
215  // which can be different for different datasets.
216  //
217  // The default value is
218  //~~~
219  //FAZIA.IDTelescopes: SI1-PSA SI1-SI2 SI2-CSI CSI-PSA
220  //~~~
221  //
222  // The possible values are:
223  // - CSI-PSA
224  // - SI2-CSI
225  // - SI1+SI2-CSI (name: ID_SI_CSI_xxxx)
226  // - SI2-PSA
227  // - SI1-SI2
228  // - SI1-PSA
229 
230 
231  auto id_tel_list = GetDataSetEnv<KVString>(fDataSet, "FAZIA.IDTelescopes");
232 
234  TIter next_traj(GetTrajectories());
235  KVGeoDNTrajectory* traj;
236  while ((traj = (KVGeoDNTrajectory*)next_traj())) { // loop over all trajectories
237 
238  traj->IterateBackFrom(); // from closest-in to furthest-out detector
239 
241  KVDetector* csi{nullptr}, *si2{nullptr}, *si1{nullptr};
242  while ((N = traj->GetNextNode())) {
243  auto d = N->GetDetector();
244  if (d->IsLabelled("SI1") && d->IsOK()) si1 = d;
245  else if (d->IsLabelled("SI2") && d->IsOK()) si2 = d;
246  else if (d->IsLabelled("CSI") && d->IsOK()) csi = d;
247  }
248 
249  auto add_telescope = [ = ](KVIDTelescope * idt, KVGroup * g) {
250  idt->SetGroup(g);
251  traj->AccessIDTelescopeList()->Add(idt);
252  fIDTelescopes->Add(idt);
253  };
254 
255  if (csi) {
256  // add CSI, SI2-CSI and/or SI1-SI2-CSI telescopes
257  if (id_tel_list.Contains("CSI-PSA")) {
258  auto idt = new KVFAZIAIDCsI;
259  idt->AddDetector(csi);
260  add_telescope(idt, csi->GetGroup());
261  }
262  if (si2) {
263  if (!id_tel_list.Contains("SI1+SI2-CSI") && id_tel_list.Contains("SI2-CSI")) {
264  auto idt = new KVFAZIAIDSiCsI;
265  idt->AddDetector(si2);
266  idt->AddDetector(csi);
267  add_telescope(idt, csi->GetGroup());
268  }
269  if (si1) {
270  if (id_tel_list.Contains("SI1+SI2-CSI")) {
271  auto idt = new KVFAZIAIDSiSiCsI;
272  idt->AddDetector(si1);
273  idt->AddDetector(si2);
274  idt->AddDetector(csi);
275  // change naming of Si-CsI telescopes
276  fSiCsI_idtype = "SI_CSI";
277  idt->SetName(Form("ID_SI_CSI_%d", csi->GetIndex()));
278  add_telescope(idt, csi->GetGroup());
279  }
280  }
281  }
282  }
283  if (si2) {
284  if (id_tel_list.Contains("SI2-PSA")) {
285  auto idt = new KVFAZIAIDSiPSA;
286  idt->AddDetector(si2);
287  add_telescope(idt, si2->GetGroup());
288  }
289  }
290  if (si1 && si2) {
291  if (id_tel_list.Contains("SI1-SI2")) {
292  auto idt = new KVFAZIAIDSiSi;
293  idt->AddDetector(si1);
294  idt->AddDetector(si2);
295  add_telescope(idt, si2->GetGroup());
296  }
297  }
298  if (si1) {
299  if (id_tel_list.Contains("SI1-PSA")) {
300  auto idt = new KVFAZIAIDSiPSA;
301  idt->AddDetector(si1);
302  add_telescope(idt, si1->GetGroup());
303  }
304  }
305  }
306 }
307 
308 
309 
315 
317 {
318  // Check for weird trajectories: any misalignment of FAZIA telescopes w.r.t.
319  // theoretical geometry will lead to weird trajectories being generated
320  //
321  // We discard any trajectory with > 3 nodes
322 
323  TIter it(&fTrajectories);
324  KVGeoDNTrajectory* geo_dn_traj;
325  KVList rubbish;
326  while ((geo_dn_traj = (KVGeoDNTrajectory*)it())) {
327  if (geo_dn_traj->GetN() != 3) {
328  Warning("AssociateNodesAndTrajectories",
329  "Discarding garbage trajectory: %s", geo_dn_traj->GetPathString().Data());
330  rubbish.Add(geo_dn_traj);
331  }
332  else {
333  // check all detectors have same index
334  geo_dn_traj->IterateFrom();
335  KVGeoDetectorNode* gdn;
336  std::optional<int> index;
337  while ((gdn = geo_dn_traj->GetNextNode())) {
338  if (index) {
339  if (*index != gdn->GetDetector()->GetIndex()) {
340  Warning("AssociateNodesAndTrajectories",
341  "Discarding garbage trajectory: %s", geo_dn_traj->GetPathString().Data());
342  rubbish.Add(geo_dn_traj);
343  break;
344  }
345  }
346  else
347  index = gdn->GetDetector()->GetIndex();
348  }
349  }
350  }
351 
352  for (auto tr : rubbish) {
353  fTrajectories.Remove(tr);
354  }
356 }
357 
358 
359 
360 
363 
365 {
366  // Destructor
367 
368  if (gFazia == this) gFazia = nullptr;
369 }
370 
371 
372 
374 
376 {
377  if (fDetectorLabels == "") fDetectorLabels += label;
378  else if (!fDetectorLabels.Contains(label)) fDetectorLabels += Form(",%s", label);
379 }
380 
381 
382 
393 
395 {
396  // Look for the geometry object <-> detector name correspondance file in the dataset directory
397  // or in the user's working directory
398  //
399  // If not found, we create it.
400  //
401  // Historical files which were added to the datasets have the name '[classname].names', where
402  // [classname] is the name of the specific daughter class used for the dataset.
403  //
404  // If we generate a new file now, we call it '[dataset].names.dat'
405 
406  TString filename = Form("%s.names", ClassName());
408  if (fCorrespondanceFile != "") return;
409 
410  // now look for new format filename in dataset directory
411  filename.Form("%s.names.dat", fDataSet.Data());
413  if (fCorrespondanceFile != "") return;
414 
415  // now look for new format filename in KaliVeda working directory
417  {
418  Info("GenerateCorrespondanceFile", "Opening correspondence file %s", fCorrespondanceFile.Data());
419  return;
420  }
421 
422  // create new file
424 
425  Info("GenerateCorrespondanceFile", "Creating correspondence file %s", fCorrespondanceFile.Data());
426  KVEnv env;
427 
428  fDetectorLabels = "SI1,SI2,CSI";
429 
430  SetNameOfDetectors(env);
431  if (env.GetTable() && env.GetTable()->GetEntries() > 0) {
432  env.AddCommentLine(Form("Automatic generated file by %s::GenerateCorrespondanceFile", ClassName()));
433  env.AddCommentLine("Make link between geometric ROOT objects and detector names");
435  }
436  fDetectorLabels = "";
437 }
438 
439 
440 
448 
450 {
451  //define the format of detectors name
452  // label-index
453  // where index = block*100+quartet*10+telescope
454  // example :
455  // SI1-123 is the Silicon 1 of the block 1, the quartet 2 and the telescope 3
456  //
457 
458  for (Int_t bb = fStartingBlockNumber; bb < fNblocks; bb += 1) {
459  for (Int_t qq = 1; qq <= 4; qq += 1) {
460  for (Int_t tt = 1; tt <= 4; tt += 1) {
461  fDetectorLabels.Begin(",");
462  while (!fDetectorLabels.End()) {
463  KVString sdet = fDetectorLabels.Next();
464  env.SetValue(
465  Form("BLOCK_%d_QUARTET_%d_%s-T%d", bb, qq, sdet.Data(), tt),
466  Form("%s-%d", sdet.Data(), bb * 100 + qq * 10 + tt)
467  );
468  }
469  }
470  }
471  }
472 }
473 
474 
475 
479 
481 {
482  // Finalise description of array performing all operations which require ROOT
483  // geometry to be closed
484 
487  imp.SetDetectorPlugin(GetDataSetEnv<TString>(GetDataSet(), "FAZIADetectorPlugin", "FAZIADetector"));
489  // any additional structure name formatting definitions
491  imp.AddAcceptedDetectorName("SI1-");
492  imp.AddAcceptedDetectorName("SI2-");
493  imp.AddAcceptedDetectorName("CSI-");
494 
495  // the following parameters are optimized for a 12-block compact
496  // geometry placed at 80cm with rings 1-5 of INDRA removed.
497  // make sure that the expected number of detectors get imported!
499 
501 
503  SetBit(kIsBuilt);
504 }
505 
506 
507 
510 
512 {
513  //Called by the Build method
514  AbstractMethod("GetGeometryParameters");
515 }
516 
517 
518 
538 
540 {
541  // Read and set up definitions of trigger patterns for this dataset.
542  // These should be given by variables such as:
543  //
544  //~~~~
545  // +[dataset].FAZIA.TriggerPatterns: [name1]
546  // [dataset].FAZIA.TriggerPattern.[name1]: [value1]
547  // +[dataset].FAZIA.TriggerPatterns: [name2]
548  // [dataset].FAZIA.TriggerPattern.[name2]: [value2]
549  //~~~~
550  //
551  // where [name*]='Mult1','Mult1/100','Mult2', etc. (see KVFAZIATrigger for known trigger patterns).
552  //
553  // and [value*] is the value of the corresponding bit pattern, e.g. if bit '3' (0b100) corresponds to
554  // 'Mult2' (i.e. multiplicity >= 2) then this would give
555  //
556  //~~~~
557  // [dataset].FAZIA.TriggerPattern.Mult2: 4
558  //~~~~
559 
560  auto patterns = GetDataSetEnv<KVString>(dataset, "FAZIA.TriggerPatterns");
561  if (patterns.Length()) {
562  patterns.Begin(" ");
563  while (!patterns.End()) {
564  auto pattern = patterns.Next(kTRUE);
565  uint16_t val = (uint16_t)GetDataSetEnv(dataset, Form("FAZIA.TriggerPattern.%s", pattern.Data()), 0.);
566  fTrigger.AddTriggerPattern(pattern, val);
567  }
568  }
569 }
570 
571 
572 
575 
577 {
578  //Called by the Build method
579  Info("BuildFAZIA", "to be defined in child class ...");
580 
581 }
582 
583 
584 
586 
588 {
589 
590  KVMaterial target_holder_mat("Al");
591  new TGeoBBox("TARGET_FRAME", 3., 3., 0.1 / 2.);
592  new TGeoEltu("TARGET_HOLE", 2., 2., 0.1 / 2.);
593  TGeoCompositeShape* cs = new TGeoCompositeShape("TARGET_FRAME", "TARGET_FRAME - TARGET_HOLE");
594  TGeoVolume* target_frame = new TGeoVolume("TARGET_FRAME", cs, target_holder_mat.GetGeoMedium());
595  gGeoManager->GetTopVolume()->AddNode(target_frame, 1);
596 
597  KVTarget* T = GetTarget();
598  if (T) {
599  KVMaterial* targMat = (KVMaterial*)T->GetLayers()->First();
600  TGeoVolume* target = gGeoManager->MakeEltu("TARGET", targMat->GetGeoMedium(), 2., 2., targMat->GetThickness() / 2.);
602  }
603 }
604 
605 
606 
609 
611 {
612  // Build the FAZIA array
615 
617 
618  BuildFAZIA();
619 
620  if (fBuildTarget)
621  BuildTarget();
622 
623  if (fCloseGeometryNow) {
626  }
627 
629 }
630 
631 
632 
644 
646 {
647  // First step in event reconstruction based on current status of detectors in array.
648  //
649  // Fills the given KVDetectorEvent with the list of all groups which have fired.
650  // i.e. loop over all groups of the array and test whether KVGroup::Fired() returns true or false.
651  //
652  // This can be made more efficient if the detectors which were hit in the event are already known:
653  // then their list should be given to argument dets
654  //
655  // If the list of fired detectors dets is not given, we use the internal fFiredDetectors list
656  // which is filled with all hit detectors when raw data is treated in treat_event()
657 
658  if (!IsSimMode() && !fHandledRawData) {
659  //Info("GetDetectorEvent","i didnt handle any data...");
660  return;
661  }
662  if (!dets || !dets->GetEntries()) {
663  if (fFiredDetectors.GetEntries()) {
664  dets = &fFiredDetectors;
665  //Info("GetDetectorEvent", "using internal list");
666  }
667  }
668  if (dets && dets->GetEntries()) {
669  TIter next_det(dets);
670 
671  KVDetector* det = 0;
672  while ((det = (KVDetector*)next_det())) {
673 
674  if (det->GetGroup()->Fired()) detev->AddGroup(det->GetGroup());
675 
676  }
677  }
678  else {
679  //Info("GetDetectorEvent", "Calling base method");
681  }
682 }
683 
684 
685 
690 
692 {
693  // Protected method, called when required to fill fDetList with pointers to
694  // the detectors whose names are stored in fDetNames.
695  // Also set all raw data values in the detectors.
696 
697  KVFAZIADetector* det = 0;
698 
699  DetList->Clear();
700  DetNames.Begin("/");
701  while (!DetNames.End()) {
702  KVString sdet = DetNames.Next(kTRUE);
703  det = (KVFAZIADetector*)GetDetector(sdet.Data());
704  if (!det) {
706  }
707 
708  if (det) {
709  DetList->Add(det);
710  // read and set from the particle's parameter list any relevant detector signal values
711  // each signal is stored with a name "[detname].[signal name]"
712  // except GTTag and DetTag which have the same value for all detectors of the same telescope
713  // and so are only stored once with name "DetTag" or "GTTag".
714 
715  TIter it(&det->GetListOfDetectorSignals());
716  KVDetectorSignal* ds;
717  while ((ds = (KVDetectorSignal*)it())) {
718  if (ds->IsRaw() && !ds->IsExpression())
719  // only look for raw data, excluding any expressions based only on raw data
720  {
721  TString pname = Form("%s.%s", det->GetName(), ds->GetName());
722  if (rnuc->GetParameters()->HasParameter(pname))
723  ds->SetValue(rnuc->GetParameters()->GetDoubleValue(pname));
724  }
725  }
726  if (rnuc->GetParameters()->HasParameter("GTTag"))
727  det->SetGTTag(rnuc->GetParameters()->GetIntValue("GTTag"));
728  if (rnuc->GetParameters()->HasParameter("DetTag"))
729  det->SetDetTag(rnuc->GetParameters()->GetIntValue("DetTag"));
730  }
731  }
732 }
733 
734 
735 
738 
740 {
741  // Specialized group reconstructor for FAZIA
742  KVGroupReconstructor* gr(nullptr);
743  if (GetGroup(g->GetName())) { // make sure group belongs to us
744  if (IsSimMode())
745  gr = KVGroupReconstructor::Factory("FAZIA.Filter", g);
746  else
747  gr = KVGroupReconstructor::Factory("FAZIA", g);
748  }
749  return gr;
750 }
751 
752 
753 
755 
757 {
758 
759  TString sname;
760  if (bb == 4) {
761  if (fDataSet == "FAZIASYM") {
762  sname.Form("%s-RUTH", FzDataType_str[idsig]);
763  }
764  else {
765  sname.Form("%s-%d", FzDataType_str[idsig], 100 * bb + 10 * qq + tt);
766  }
767  }
768  else if (bb == 6) {
769  if (fDataSet == "FAZIAPRE") {
770  sname.Form("%s-RUTH", FzDataType_str[idsig]);
771  }
772  else {
773  sname.Form("%s-%d", FzDataType_str[idsig], 100 * bb + 10 * qq + tt);
774  }
775  }
776  else {
777  sname.Form("%s-%d", FzDataType_str[idsig], 100 * bb + 10 * qq + tt);
778  }
779  return sname;
780 
781 }
782 
783 
784 #ifdef WITH_PROTOBUF
785 
787 
789 {
790  return treat_event(((KVFzDataReader&)R).get_fazia_event());
791 }
792 
793 
794 
796 
798 {
799  Int_t value = (val << 2);
800  value >>= 2;
801  Double_t dval = -1.;
802  switch (sigid) {
803  case DAQ::FzData_FzDataType_QH1:
804  if (eid == 0) dval = value / (fQH1risetime * 1e3 / 10.);
805  break;
806  case DAQ::FzData_FzDataType_I1:
807  break;
808  case DAQ::FzData_FzDataType_QL1:
809  break;
810  case DAQ::FzData_FzDataType_Q2:
811  if (eid == 0) dval = value / (fQ2risetime * 1e3 / 10.);
812  break;
813  case DAQ::FzData_FzDataType_I2:
814  break;
815  case DAQ::FzData_FzDataType_Q3:
816  if (eid == 0) dval = value / (fQ3slowrisetime * 1e3 / 10.);
817  if (eid == 1) dval = value / (fQ3fastrisetime * 1e3 / 10.);
818  break;
819  }
820  return dval;
821 }
822 
823 
824 
827 
828 Bool_t KVFAZIA::treat_event(const DAQ::FzEvent& e)
829 {
830  // Read raw data for an event
831 
832  Bool_t good = kTRUE;
833 
834  //get info from trigger
835  int ts = e.trinfo_size();
836  double dt = 0;
837  uint64_t tot = 0;
838  for (Int_t tr = ts - 1; tr >= 0; tr--) {
839  const DAQ::FzTrigInfo& rdtrinfo = e.trinfo(tr);
840  uint64_t triggervalue = rdtrinfo.value();
841  if (tr == ts - 5) {
842  fReconParameters.SetValue("FAZIA.TRIGPAT", (int)triggervalue);
843  SetTriggerPattern((uint16_t)triggervalue);
844  }
845  else if (tr == ts - 6) fReconParameters.SetValue64bit("FAZIA.EC", ((triggervalue << 12) + e.ec()));
846  else if (tr == ts - 8) {
847  dt = triggervalue / (1e6);
848  fReconParameters.SetValue("FAZIA.TRIGRATE.DT", dt);
849  double faziats = fReconParameters.GetValue64bit("FAZIA.TS") * 1.e-8;
850  if (oldfaziats > 0.) fReconParameters.SetValue("FAZIA.CENTRUM.DT", faziats - oldfaziats);
851  oldfaziats = faziats;
852  }
853  else if (tr == ts - 9) fReconParameters.SetValue("FAZIA.TRIGRATE.EXT", 1.*triggervalue / dt);
854  else if (tr == ts - 10) fReconParameters.SetValue("FAZIA.TRIGRATE.MAN", 1.*triggervalue / dt);
855  else if (tr == ts - 11) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
856  else if (tr == ts - 12) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
857  else if (tr == ts - 13) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
858  else if (tr == ts - 14) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
859  else if (tr == ts - 15) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
860  else if (tr == ts - 16) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
861  else if (tr == ts - 17) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
862  else if (tr == ts - 18) fReconParameters.SetValue(Form("FAZIA.TRIGRATE.PAT%d", tr - 2), 1.*triggervalue / dt);
863  else if (tr == ts - 19) {
864  fReconParameters.SetValue("FAZIA.TRIGRATE.TOT", 1.*triggervalue / dt);
865  tot = triggervalue;
866  }
867  else if (tr == ts - 20) {
868  fReconParameters.SetValue("FAZIA.TRIGRATE.VAL", 1.*triggervalue / dt);
869  fReconParameters.SetValue("FAZIA.DEADTIME", 100.*(1. - 1.*triggervalue / tot));
870  }
871  else {}
872  }
873 
874 // if (tot > 0) fReconParameters.ls();
875 
876  for (int b = 0; b < e.block_size(); ++b) {
877 
878  // check block errors
879  if (e.block(b).len_error() || e.block(b).crc_error() || (!good)) {
880  //Warning("treat_event", "BLOCK LEN OR CRC ERROR B%03d", e.block(b).blkid());
881  good = kFALSE;
882  break; //stop iteration on blocks
883  }
884  int fIdBlk = e.block(b).blkid();
885 
886  for (int f = 0; f < e.block(b).fee_size(); ++f) {
887 
888  const DAQ::FzFee& rdfee = e.block(b).fee(f);
889 
890  for (int h = 0; h < rdfee.hit_size(); ++h) {
891 
892  const DAQ::FzHit& rdhit = rdfee.hit(h);
893  // check fee errors
894  if (rdfee.len_error() || rdfee.crc_error() || (!good)) {
895  Warning("treat_event", "FEE LEN OR CRC ERROR B%03d-FE%d", e.block(b).blkid(), rdfee.feeid());
896  good = kFALSE;
897  break; //stop iteration on hits
898  }
899  int fIdFee = rdhit.feeid();
900  int fIdTel = rdhit.telid();
901 
902  for (Int_t mm = 0; mm < rdhit.data_size(); mm++) {
903  const DAQ::FzData& rdata = rdhit.data(mm);
904  int fIdSignal = rdata.type();
905 
906  int DetTag = rdhit.dettag();
907  int GTTag = rdhit.gttag();
908  if (DetTag >= 16384 && GTTag < 16384) GTTag += 32768;
909 
910  //on decompile le HIT
911  int fIdQuartet = fQuartet[fIdFee][fIdTel];
912  int fIdTelescope = fTelescope[fIdFee][fIdTel];
913 
914  KVFAZIADetector* det = (KVFAZIADetector*)GetDetector(Form("%s-%d", FzDetector_str[fIdSignal], 100 * fIdBlk + 10 * fIdQuartet + fIdTelescope));
915  if (!det) {
916  Error("treat_event", "No detector %s-%d found in FAZIA geometry...", FzDetector_str[fIdSignal], 100 * fIdBlk + 10 * fIdQuartet + fIdTelescope);
917  continue;
918  }
919  det->SetDetTag(DetTag);
920  det->SetGTTag(GTTag);
921 
922  if (!rdata.has_energy() && !rdata.has_waveform()) {
923  if (FzDataType_str[fIdSignal] != "I2") Warning("treat_event", "[NO DATA] [%s %s]", det->GetName(), FzDataType_str[fIdSignal]);
924  continue;
925  }
926 
927  if (rdata.has_energy()) {
928  const DAQ::Energy& ren = rdata.energy();
929  for (Int_t ee = 0; ee < ren.value_size(); ee++) {
930  Double_t energy = TreatEnergy(fIdSignal, ee, ren.value(ee));
931  auto esig = det->SetFPGAEnergy(fIdSignal, ee, energy);
932  if (esig)
933  fFiredSignals.Add(esig);
934  else
935  Warning("treat_event", "FPGAEnergy signal not found for %s", det->GetName());
936  }
937  fFiredDetectors.Add(det);
938  }
939  if (rdata.has_baseline()) {
940  Float_t bl = rdata.baseline();
941  auto bsig = det->SetBaseLine(fIdSignal, bl);
942  if (bsig)
943  fFiredSignals.Add(bsig);
944  else
945  Warning("treat_event", "BaseLine signal not found for %s", det->GetName());
946  }
947  if (rdata.has_waveform()) {
948  const DAQ::Waveform& rwf = rdata.waveform();
949  Int_t supp;
950 
951  if (fIdSignal <= 5) {
952  TString sname = GetSignalName(fIdBlk, fIdQuartet, fIdTelescope, fIdSignal);//QH1-123 etc.
953  if (sname == "")
954  Warning("treat_event", "signal name is empty !!! blk=%d qua=%d tel=%d\n", fIdBlk, fIdQuartet, fIdTelescope);
955 
956  TGraph sig(rwf.sample_size());
957 
958  for (Int_t nn = 0; nn < rwf.sample_size(); nn++) {
959  if (fIdSignal != DAQ::FzData::ADC) {
960  if (rwf.sample(nn) > 8191) {
961  supp = rwf.sample(nn) | 0xFFFFC000;
962  }
963  else {
964  supp = rwf.sample(nn);
965  }
966  }
967  else {
968  supp = rwf.sample(nn);
969  }
970  sig.SetPoint(nn, nn, supp);
971  }
972  det->SetSignal(&sig, sname);
973  }
974  else {
975  if (fIdSignal > 5)
976  Warning("treat_event", "datatype %d>5 - taille = %d\n", fIdSignal, rwf.sample_size());
977  }
978  }
979  }
980  }
981  }
982  }
983 
984 // cout << "good=" << good << endl;
985 // fFPGAParameters.ls();
986 // fSignals.ls();
987 
988  return good;
989 }
990 
991 #endif
992 
993 #ifdef WITH_MFM
994 
999 
1001 {
1002  // Treatment of raw data in MFM frames with type MFM_FAZIA_FRAME_TYPE
1003  // The timestamp is extracted from the frame header and added to fReconParameters
1004  // in a 64 bit parameter with name "FAZIA.TS"
1005 
1006  if (f.GetFrameType() != MFM_FAZIA_FRAME_TYPE) return kFALSE;
1007  fReconParameters.SetValue64bit("FAZIA.TS", f.GetTimeStamp());
1008 
1009 #ifdef WITH_PROTOBUF
1010  DAQ::FzEventSet fazia_set;
1011  DAQ::FzEvent fazia_event;
1012  // Parse protobuf data in MFM frame
1013  if (fazia_set.ParseFromArray(f.GetPointUserData(), ((MFMFaziaFrame&)f).GetEventSize())) {
1014  // Parsed an event set
1015  if (fazia_set.ev_size() > 1) {
1016  Warning("handle_raw_data_event_mfmframe",
1017  "Got a FzEventSet from data: cannot handle multiple events at once!");
1018  return kFALSE;
1019  }
1020  return treat_event(fazia_set.ev(0));
1021  }
1022  else if (fazia_event.ParseFromArray(f.GetPointUserData(), ((MFMFaziaFrame&)f).GetEventSize())) {
1023  // Parsed an event
1024  return treat_event(fazia_event);
1025  }
1026 #endif
1027  return kTRUE;
1028 }
1029 
1030 #endif
1031 
1032 
1036 
1038 {
1039  // set up correspondence between FPGA number/FEE number (from acquisition)
1040  // and Quartet/Telescope numbers
1041 
1042  TString DataFilePath;
1043  if (!KVBase::SearchKVFile("ElecDetLink.env", DataFilePath, "data")) {
1044  Error("CreateCorrespondence", "ElecDetLink.env not found");
1045  return;
1046  }
1047  KVEnv DetLink;
1048  DetLink.ReadFile(DataFilePath, kEnvUser);
1049  for (int t = 1; t <= 4; t++) {
1050  for (int q = 1; q <= 4; q++) {
1051  TString elec = DetLink.GetValue(Form("T%1d-Q%1d", t, q), " ");
1052  if (!elec.IsWhitespace()) {
1053  int fee, fpga;
1054  sscanf(elec.Data(), "FPGA%d-FE%d", &fpga, &fee);
1055  fQuartet[fee][fpga] = q;
1056  fTelescope[fee][fpga] = t;
1057  }
1058  else {
1059  Error("CreateCorrespondence", "Problem reading FAZIA ElecDetLink.env file : T%1d-Q%1d = %s", t, q, elec.Data());
1060  }
1061  }
1062  }
1063 }
1064 
1065 
1066 
1081 
1083 {
1084  // Read a file containing runlists for each principal trigger used during an experiment
1085  //
1086  // The file should be in TEnv format like so:
1087  //
1088  //~~~~
1089  // Mult1: 100-122,541-1938
1090  // Mult2: 91-765
1091  //~~~~
1092  //
1093  // where each trigger pattern name must be known and declared to occur during the dataset
1094  // (see SetTriggerPatternsForDataSet()) and the list of runs are given using KVNumberList syntax.
1095  //
1096  // The data is added to the database in a table 'FAZIA.Triggers'.
1097 
1098  TString fullpath;
1099  if (!db->FindCalibFile("Triggers", fullpath)) return;
1100 
1101  Info("ReadTriggerPatterns()", "Reading FAZIA triggers used during runs...");
1102  auto trigs = db->AddTable("FAZIA.Triggers", "Principal triggers used by FAZIA");
1103 
1104  KVDBRecord* dbrec = 0;
1105  TEnv env;
1106  TEnvRec* rec = 0;
1107  env.ReadFile(fullpath.Data(), kEnvAll);
1108  TIter it(env.GetTable());
1109 
1110  while ((rec = (TEnvRec*)it.Next())) {
1111  KVString srec(rec->GetName());
1112  KVNumberList nl(rec->GetValue());
1113  dbrec = new KVDBRecord(rec->GetName(), "FAZIA Trigger");
1114  dbrec->AddKey("Runs", "List of Runs");
1115  trigs->AddRecord(dbrec);
1116  db->LinkRecordToRunRange(dbrec, nl);
1117  }
1118 }
1119 
1120 
1121 
1124 
1126 {
1127  // Set the FAZIA-specific general identification code for the given telescope
1128 
1129  if (idt->InheritsFrom(KVFAZIAIDSiPSA::Class())) {
1130  if (idt->GetDetector(1)->IsLabelled("SI1")) idt->SetIDCode(IDCodes::ID_SI1_PSA);
1131  else idt->SetIDCode(IDCodes::ID_SI2_PSA);
1132  }
1133  else if (idt->InheritsFrom(KVFAZIAIDSiSi::Class())) idt->SetIDCode(IDCodes::ID_SI1_SI2);
1134  else if (idt->InheritsFrom(KVFAZIAIDSiCsI::Class())) idt->SetIDCode(IDCodes::ID_SI2_CSI);
1135  else if (idt->InheritsFrom(KVFAZIAIDSiSiCsI::Class())) {
1136  // ID code for these telescopes depends on what detectors the grid's VARY uses
1137  auto labsY = idt->GetDetectorLabelsForGridCoord("y");
1138  if (labsY.Contains("SI1") && labsY.Contains("SI2"))
1139  idt->SetIDCode(IDCodes::ID_SI12_CSI);
1140  else if (labsY.Contains("SI1"))
1141  idt->SetIDCode(IDCodes::ID_SI1_CSI);
1142  else if (labsY.Contains("SI2"))
1143  idt->SetIDCode(IDCodes::ID_SI2_CSI);
1144  }
1145  else if (idt->InheritsFrom(KVFAZIAIDCsI::Class())) idt->SetIDCode(IDCodes::ID_CSI_PSA);
1146  else {
1147  Error("SetIDCodeForIDTelescope", "Request for telescope name=%s of unknown class=%s",
1148  idt->GetName(), idt->IsA()->GetName());
1149  }
1150 }
1151 
1152 
int Int_t
unsigned int UInt_t
#define d(i)
#define f(i)
#define e(i)
bool Bool_t
char Char_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
R__EXTERN TEnv * gEnv
kEnvUser
kEnvAll
#define N
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 b
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 target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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
R__EXTERN TGeoManager * gGeoManager
float * q
char * Form(const char *fmt,...)
void Error(const char *method, const char *msgfmt,...) const override
Definition: KVBase.cpp:1709
static const Char_t * GetWORKDIRFilePath(const Char_t *namefile="")
Definition: KVBase.cpp:121
Bool_t IsLabelled(const Char_t *l) const
Definition: KVBase.h:206
static ValType GetDataSetEnv(const KVString &dataset, const KVString &type, const ValType &defval={})
Definition: KVBase.h:305
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:541
void Warning(const char *method, const char *msgfmt,...) const override
Definition: KVBase.cpp:1696
Record folder for the database.
Definition: KVDBRecord.h:43
virtual Bool_t AddKey(KVDBKey *key, Bool_t check=kTRUE)
Definition: KVDBRecord.cpp:65
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Definition: KVDBRecord.cpp:206
virtual KVDBTable * GetTable(const Char_t *table) const
Definition: KVDataBase.h:159
virtual Bool_t AddTable(KVDBTable *table)
Definition: KVDataBase.cpp:84
TString GetFullPathToDataSetFile(const Char_t *filename) const
Definition: KVDataSet.cpp:2068
ValType GetDataSetEnv(const Char_t *type, const ValType &defval={}) const
Definition: KVDataSet.h:269
List of hit groups in a multidetector array.
void AddGroup(KVGroup *grp)
Base class for output signal data produced by a detector.
virtual Bool_t IsExpression() const
virtual void SetValue(Double_t x)
virtual Bool_t IsRaw() const
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:160
KVGroup * GetGroup() const
virtual Int_t GetIndex() const
Definition: KVDetector.h:804
const KVSeqCollection & GetListOfDetectorSignals() const
Definition: KVDetector.h:779
Extension of TEnv to allow the writing of comments in the file.
Definition: KVEnv.h:18
void AddCommentLine(const Char_t *line)
Definition: KVEnv.cpp:70
Int_t WriteFile(const char *fname, EEnvLevel level=kEnvAll) override
Definition: KVEnv.cpp:140
KVNameValueList * GetParameters() const
Definition: KVEvent.h:180
Base class to describe database of an experiment ,,.
Definition: KVExpDB.h:61
KVDBRun * GetDBRun(Int_t number) const
Definition: KVExpDB.h:144
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
Definition: KVExpDB.cpp:290
Bool_t FindCalibFile(const Char_t *type, TString &fullpath, const TString &array_name="") const
Definition: KVExpDB.cpp:672
Base class for FAZIA detectors.
void SetSignal(TGraph *signal, const Char_t *signal_name)
KVDetectorSignal * SetFPGAEnergy(int sigid, Int_t idx, Double_t energy)
void SetGTTag(Int_t t)
void SetDetTag(Int_t t)
KVDetectorSignal * SetBaseLine(int sigid, Float_t baseline)
static const Char_t * GetNewName(KVString oldname)
Telescope for FAZIA identification using SI1 and/or SI2 with CSI.
void AddTriggerPattern(const TString &name, uint16_t value)
Description of a FAZIA detector geometry.
Definition: KVFAZIA.h:33
Double_t fImport_Xorg
for geometry import
Definition: KVFAZIA.h:50
void PerformClosedROOTGeometryOperations() override
Definition: KVFAZIA.cpp:480
Double_t fImport_ThetaMin
for geometry import
Definition: KVFAZIA.h:46
Double_t fQ2risetime
Definition: KVFAZIA.h:58
Double_t fQH1risetime
values of trapezoidal filter rise time set in the fpgas defined in .kvrootrc
Definition: KVFAZIA.h:57
TString fSiCsI_idtype
Definition: KVFAZIA.h:68
Double_t TreatEnergy(Int_t sigid, Int_t eid, UInt_t val)
Definition: KVFAZIA.cpp:797
Double_t fQ3slowrisetime
Definition: KVFAZIA.h:59
void SetTriggerPatternsForDataSet(const TString &dataset)
used to name Si-CsI idtelescopes 'ID_[fSiCsI_idtype]_xxxx'
Definition: KVFAZIA.cpp:539
void SetGeometryImportParameters(Double_t dt=0.25, Double_t dp=1.0, Double_t tmin=2., Double_t pmin=0, Double_t tmax=20., Double_t pmax=360., Double_t xorg=0, Double_t yorg=0, Double_t zorg=0)
Definition: KVFAZIA.h:245
int fQuartet[8][2]
quartet number from #FEE and #FPGA
Definition: KVFAZIA.h:53
Double_t GetSetupParameter(const Char_t *parname)
Definition: KVFAZIA.cpp:75
Double_t fImport_dTheta
for geometry import
Definition: KVFAZIA.h:44
Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &) override
Definition: KVFAZIA.cpp:1000
void SetIDCodeForIDTelescope(KVIDTelescope *) const override
Set the FAZIA-specific general identification code for the given telescope.
Definition: KVFAZIA.cpp:1125
std::string GetTriggerForCurrentRun() const
Definition: KVFAZIA.cpp:151
void AddDetectorLabel(const Char_t *label)
Definition: KVFAZIA.cpp:375
void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *dets) override
Definition: KVFAZIA.cpp:645
virtual void BuildTarget()
Definition: KVFAZIA.cpp:587
void AssociateTrajectoriesAndNodes() override
Definition: KVFAZIA.cpp:316
void Build(Int_t=-1) override
Build the FAZIA array.
Definition: KVFAZIA.cpp:610
Int_t fStartingBlockNumber
Definition: KVFAZIA.h:39
TString fCorrespondanceFile
Bool_t fBuildTarget; //kTRUE to include target frame in the geometry.
Definition: KVFAZIA.h:41
Double_t fImport_PhiMax
for geometry import
Definition: KVFAZIA.h:49
virtual void SetNameOfDetectors(KVEnv &env)
Definition: KVFAZIA.cpp:449
Double_t fImport_Zorg
for geometry import
Definition: KVFAZIA.h:52
virtual void BuildFAZIA()
methods to be implemented in child classes
Definition: KVFAZIA.cpp:576
void DeduceIdentificationTelescopesFromGeometry() override
Definition: KVFAZIA.cpp:205
KVFAZIA(const Char_t *title="")
Default constructor.
Definition: KVFAZIA.cpp:51
void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames) override
Definition: KVFAZIA.cpp:691
void ReadTriggerPatterns(KVExpDB *db)
Definition: KVFAZIA.cpp:1082
virtual void DefineStructureFormats(KVGeoImport &)
Definition: KVFAZIA.h:85
void GenerateCorrespondanceFile()
Definition: KVFAZIA.cpp:394
Double_t fQ3fastrisetime
Definition: KVFAZIA.h:60
KVString fSignalTypes
Definition: KVFAZIA.h:43
Bool_t treat_event(const DAQ::FzEvent &)
Read raw data for an event.
Definition: KVFAZIA.cpp:828
virtual ~KVFAZIA()
Destructor.
Definition: KVFAZIA.cpp:364
Double_t fImport_dPhi
for geometry import
Definition: KVFAZIA.h:45
Double_t fImport_ThetaMax
for geometry import
Definition: KVFAZIA.h:47
int fTelescope[8][2]
telescope number from #FEE and #FPGA
Definition: KVFAZIA.h:54
KVFAZIATrigger fTrigger
trigger pattern read from data for each event
Definition: KVFAZIA.h:63
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const override
Specialized group reconstructor for FAZIA.
Definition: KVFAZIA.cpp:739
virtual void GetGeometryParameters()
Called by the Build method.
Definition: KVFAZIA.cpp:511
void SetTriggerPattern(uint16_t fp)
Definition: KVFAZIA.h:71
double oldfaziats
dummy ts to control trigger info transmission rate
Definition: KVFAZIA.h:66
Bool_t handle_raw_data_event_protobuf(KVProtobufDataReader &) override
Definition: KVFAZIA.cpp:788
TString GetSignalName(Int_t bb, Int_t qq, Int_t tt, Int_t idsig)
Definition: KVFAZIA.cpp:756
Double_t fImport_PhiMin
for geometry import
Definition: KVFAZIA.h:48
Int_t fNblocks
number of blocks
Definition: KVFAZIA.h:38
void prepare_to_handle_new_raw_data()
Definition: KVFAZIA.h:115
void SetRawDataFromReconEvent(const KVReconstructedEvent &recev) override
Set values of all raw data parameters and the value of the trigger bit pattern for the event.
Definition: KVFAZIA.cpp:89
Double_t fImport_Yorg
for geometry import
Definition: KVFAZIA.h:51
KVString fDetectorLabels
Definition: KVFAZIA.h:42
void CreateCorrespondence()
Definition: KVFAZIA.cpp:1037
void MakeCalibrationTables(KVExpDB *) override
Override base method in order to read FAZIA trigger for each run.
Definition: KVFAZIA.cpp:127
Handle FAZIA protobuf-format raw data files.
Path taken by particles through multidetector geometry.
KVGeoDetectorNode * GetNextNode() const
KVSeqCollection * AccessIDTelescopeList()
KVString GetPathString() const
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
void IterateBackFrom(const KVGeoDetectorNode *node0=nullptr) const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
Import detector array described by ROOT geometry and set up corresponding KVMultiDetArray object.
Definition: KVGeoImport.h:69
void AddAcceptedDetectorName(const char *name)
void SetOrigin(double x, double y, double z)
Definition: KVGeoImport.h:117
void SetDetectorPlugin(const TString &name)
Definition: KVGeoImport.h:111
void ImportGeometry(Double_t dTheta=0.1, Double_t dPhi=1.0, Double_t ThetaMin=0.0, Double_t PhiMin=0.0, Double_t ThetaMax=180.0, Double_t PhiMax=360.0)
void SetNameCorrespondanceList(const Char_t *)
virtual Bool_t Fired(Option_t *opt="any") const
virtual KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
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.
Definition: KVGroup.h:20
Extended version of ROOT THashList.
Definition: KVHashList.h:29
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:85
void SetGroup(KVGroup *kvg)
KVDetector * GetDetector(UInt_t n) const
virtual void SetIDCode(UShort_t c)
KVGroup * GetGroup() const
virtual void AddDetector(KVDetector *d)
KVString GetDetectorLabelsForGridCoord(const KVString &axis) const
Extended TList class which owns its objects by default.
Definition: KVList.h:22
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:90
virtual Double_t GetThickness() const
Definition: KVMaterial.cpp:484
virtual TGeoMedium * GetGeoMedium(const Char_t *="")
static KVIonRangeTable * GetRangeTable()
Definition: KVMaterial.cpp:158
Base class for describing the geometry of a detector array.
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
static Bool_t fCloseGeometryNow
void CreateGeoManager(Double_t dx=500, Double_t dy=500, Double_t dz=500)
Bool_t fHandledRawData
set to true if multidetector handles data in last call to HandleRawData
KVTarget * GetTarget()
KVSeqCollection * fIDTelescopes
deltaE-E telescopes in groups
Bool_t IsSimMode() const
TString GetDataSet() const
KVGroup * GetGroup(const Char_t *name) const
virtual void MakeCalibrationTables(KVExpDB *)
UInt_t GetCurrentRunNumber() const
virtual void SetIdentifications()
const TSeqCollection * GetTrajectories() const
static Bool_t fBuildTarget
void add_and_set_detector_signal(KVDetector *det, KVString detname, Double_t sig_data, KVString sig_type)
KVUniqueNameList fFiredDetectors
list of fired detectors after reading raw data event
KVUniqueNameList fTrajectories
list of all possible trajectories through detectors of array
KVNameValueList fReconParameters
general purpose list of parameters for storing information on data reconstruction
TString fDataSet
name of associated dataset, used with MakeMultiDetector()
virtual void AssociateTrajectoriesAndNodes()
KVUnownedList fFiredSignals
list of fired signals after reading raw data event
Int_t GetIntValue(const Char_t *name) const
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
void SetValue64bit(const Char_t *name, ULong64_t)
ULong64_t GetValue64bit(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
Read Google Protobuf DAQ files.
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
TObject * Remove(TObject *obj) override
Remove object from list.
void Add(TObject *obj) override
void Clear(Option_t *option="") override
void Delete(Option_t *option="") override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
Calculation/correction of energy losses of particles through an experimental target.
Definition: KVTarget.h:128
void Add(TObject *obj) override
virtual Int_t GetEntries() const
THashList * GetTable() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
void CloseGeometry(Option_t *option="d")
TGeoVolume * GetTopVolume() const
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
TObject * Next()
const char * GetName() const override
static TClass * Class()
virtual void SetName(const char *name)
TClass * IsA() const override
void AbstractMethod(const char *method) const
virtual const char * GetName() const
void SetBit(UInt_t f)
virtual const char * ClassName() const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Info(const char *method, const char *msgfmt,...) const
TObject * First() const override
const char * Data() const
Bool_t IsWhitespace() const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TGraphErrors * gr
TH1 * h
double T(double x)
rec
constexpr Double_t R()
auto * tt
ClassImp(TPyArg)