KaliVeda
Toolkit for HIC analysis
KVINDRA.cpp
1 /***************************************************************************
2 $Id: KVINDRA.cpp,v 1.68 2009/01/21 10:05:51 franklan Exp $
3  kvindra.cpp - description
4  -------------------
5  begin : Mon May 20 2002
6  copyright : (C) 2002 by J.D. Frankland
7  email : frankland@ganil.fr
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #include "KVINDRA.h"
20 #include "KVMaterial.h"
21 #include "KVDetector.h"
22 #include "KVTelescope.h"
23 #include "KVIDTelescope.h"
24 #include "KVIDSiCsI.h"
25 #include "KVIDINDRACsI.h"
26 #include "KVIDChIoSi.h"
27 #include "KVIDChIoCsI.h"
28 #include "KVIDChIoSi75.h"
29 #include "KVIDSi75SiLi.h"
30 #include "KVIDPhoswich.h"
31 #include "KVLayer.h"
32 #include "KVRing.h"
33 #include "KVGroup.h"
34 #include "KVChIo.h"
35 #include "KVCsI.h"
36 #include "KVNucleus.h"
37 #include "KVDetectorEvent.h"
38 #include "KVNucleusEvent.h"
39 #include "TEnv.h"
40 #include "INDRAGeometryBuilder.h"
41 #include <KVASGroup.h>
42 #include "KVGeoNavigator.h"
43 #ifdef WITH_BUILTIN_GRU
44 #include <KVGANILDataReader.h>
45 #endif
46 #include <KVDBChIoPressures.h>
47 #include <KVGeoImport.h>
48 #include <KVRangeTableGeoNavigator.h>
49 #include <KVRawDataReader.h>
50 #ifdef WITH_MFM
51 #include "KVMFMDataFileReader.h"
52 #include "MFMEbyedatFrame.h"
53 #ifdef WITH_MESYTEC
54 #include "MFMMesytecMDPPFrame.h"
55 #include "mesytec_buffer_reader.h"
56 #endif
57 #endif
58 #include "KVINDRAGroupReconstructor.h"
59 #include <cassert>
60 
61 using namespace std;
62 
64 
65 //Use this static array to translate EBaseIndra_type
66 //signal type to a string giving the signal type
67 
68 
71  "", //dummy for index=0
72  "GG", "PG", "T",
73  "GG", "PG", "T",
74  "R", "L", "T",
75  "GG", "PG", "T",
76  "GG", "PG", "T"
77 };
78 
79 
80 #define KV_DEBUG 1
81 
82 KVINDRA* gIndra;
83 
87 
89 {
90  //Default constructor
91  //Set up lists of ChIo, Si, CsI, Phoswich
92  fChIo = new KVHashList();
93  fChIo->SetCleanup(kTRUE);
94  fSi = new KVHashList();
95  fSi->SetCleanup(kTRUE);
96  fCsI = new KVHashList();
97  fCsI->SetCleanup(kTRUE);
98  fPhoswich = new KVHashList();
99  fPhoswich->SetCleanup(kTRUE);
100  fTrigger = 0;
101  gIndra = this;
102  fPHDSet = kFALSE;
103  fSelecteur = nullptr;
104  // unlike a normal multidetector, INDRA does not own its detectors
105  // they are owned by the TELESCOPE structures
106  SetOwnsDetectors(kFALSE);
107  fMesytecData = kFALSE;
108  fEbyedatData = kFALSE;
109 }
110 
111 
112 
116 
117 KVINDRA::~KVINDRA()
118 {
119  //Delets lists of ChIo, Si, etc.
120  //Resets global gIndra pointer.
121 
122  if (fChIo && fChIo->TestBit(kNotDeleted)) {
123  fChIo->Clear();
124  delete fChIo;
125  }
126  fChIo = 0;
127  if (fSi && fSi->TestBit(kNotDeleted)) {
128  fSi->Clear();
129  delete fSi;
130  }
131  fSi = 0;
132  if (fCsI && fCsI->TestBit(kNotDeleted)) {
133  fCsI->Clear();
134  delete fCsI;
135  }
136  fCsI = 0;
137  if (fPhoswich && fPhoswich->TestBit(kNotDeleted)) {
138  fPhoswich->Clear();
139  delete fPhoswich;
140  }
141  fPhoswich = 0;
142  if (fSelecteur) delete fSelecteur;
143  gIndra = 0;
144 }
145 
146 
147 
148 
162 
164 {
165  // Construction of INDRA detector array.
166  //
167  // Uses infos in file
168  // $KVROOT/KVFiles/data/indra_struct.[dataset].env
169  // or
170  // $KVROOT/KVFiles/data/indra_struct.env
171  //
172  // if no dataset-specific file found
173  //
174  // Alternatively, by defining the variable
175  //
176  // [dataset].INDRA.StructureFile: [path to file]
177 
178 
179  TString path = Form("indra-struct.%s.env", fDataSet.Data());
180  TString path2 = GetDataSetEnv(fDataSet, "INDRA.StructureFile", "");
181  if (path2 == "") {
182  if (!SearchKVFile(path.Data(), path2, "data")) {
183  path = "indra-struct.env";
184  SearchKVFile(path.Data(), path2, "data");
185  }
186  }
187  fStrucInfos.ReadFile(path2, kEnvAll);
188 
189  KVString lruns = fStrucInfos.GetValue("AddOnForRuns", "");
190  //test if additional geometrical specification exists
191  if (lruns != "") {
192  lruns.Begin(",");
193  while (!lruns.End()) {
194  KVString sruns = lruns.Next();
195  KVNumberList nlr(sruns.Data());
196  //the current run needs specific geometry
197  if (nlr.Contains(fCurrentRun)) {
198  path = fStrucInfos.GetValue(sruns.Data(), "");
199  Info("BuildGeometry", "Additional geometry for run=%d in file #%s#", fCurrentRun, path.Data());
200  SearchKVFile(path.Data(), path2, "data");
201  if (path2 == "") {
202  Warning("BuildGeometry", "fichier %s inconnu", path.Data());
203  }
204  else {
205  fStrucInfos.ReadFile(path2, kEnvChange);
206  }
207  }
208  }
209  }
210 
211  SetName(fStrucInfos.GetValue("INDRA.Name", ""));
212  SetTitle(fStrucInfos.GetValue("INDRA.Title", ""));
213 
214  KVString layers = fStrucInfos.GetValue("INDRA.Layers", "");
215  layers.Begin(" ");
216  while (!layers.End()) BuildLayer(layers.Next());
217 }
218 
219 
220 
223 
224 void KVINDRA::BuildLayer(const Char_t* name)
225 {
226  // Build layer 'name' with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
227 
228  KVLayer* layer = new KVLayer;
229  Int_t number = fStrucInfos.GetValue(Form("INDRA.Layer.%s.Number", name), 0);
230  layer->SetName(name);
231  layer->SetNumber(number);
232  Add(layer);
233  Info("BuildLayer", "Building layer %d:%s", number, name);
234  KVNumberList rings = fStrucInfos.GetValue(Form("INDRA.Layer.%s.Rings", name), "");
235  rings.Begin();
236  while (!rings.End()) {
237  Int_t ring_num = rings.Next();
238  TString prefix = Form("INDRA.Layer.%s.Ring.%d", name, ring_num);
239  KVRing* ring = BuildRing(ring_num, prefix);
240  layer->Add(ring);
241  }
242 }
243 
244 
245 
248 
249 KVRing* KVINDRA::BuildRing(Int_t number, const Char_t* prefix)
250 {
251  // Build ring with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
252 
253  KVRing* ring = new KVRing;
254  Info("BuildRing", "Building ring %d (%s)", number, prefix);
255 
256  Double_t thmin = fStrucInfos.GetValue(Form("%s.ThMin", prefix), 0.0);
257  Double_t thmax = fStrucInfos.GetValue(Form("%s.ThMax", prefix), 0.0);
258  Double_t phi_0 = fStrucInfos.GetValue(Form("%s.Phi0", prefix), 0.0);
259  Int_t ntel = fStrucInfos.GetValue(Form("%s.Ntel", prefix), 0);
260  Int_t step = fStrucInfos.GetValue(Form("%s.Step", prefix), 1);
261  Int_t num_first = fStrucInfos.GetValue(Form("%s.Nfirst", prefix), 1);
262  Double_t dphi = fStrucInfos.GetValue(Form("%s.Dphi", prefix), -1.0);
263  KVNumberList absent = fStrucInfos.GetValue(Form("%s.Absent", prefix), "");
264 
265  ring->SetPolarMinMax(thmin, thmax);
266  KVINDRATelescope* kvt = BuildTelescope(prefix, num_first);
267  Double_t phi_min = phi_0 - 0.5 * (kvt->GetAzimuthalWidth());
268  phi_min = (phi_min < 0. ? phi_min + 360. : phi_min);
269  dphi = (dphi < 0. ? 360. / ntel : dphi);
270  Double_t phi_max =
271  phi_0 + ((ntel - 1.0) * dphi) + 0.5 * (kvt->GetAzimuthalWidth());
272  phi_max = (phi_max > 360. ? phi_max - 360. : phi_max);
273  ring->SetAzimuthalMinMax(phi_min, phi_max);
274  ring->SetNumber(number);
275 
276  Double_t phi = phi_0;
277  UInt_t counter = num_first;
278  for (int i = 0; i < ntel; i++) {
279  kvt->SetPolarMinMax(thmin, thmax);
280  kvt->SetPhi(phi);
281  phi = (phi + dphi > 360. ? (phi + dphi - 360.) : (phi + dphi));
282  kvt->SetNumber(counter);
283  if (!absent.Contains(counter)) ring->Add(kvt);
284  else delete kvt;
285  counter += step;
286  if (i + 1 < ntel) kvt = BuildTelescope(prefix, counter);
287  }
288  ring->SetName(Form("RING_%d", number));
289  return ring;
290 }
291 
292 
293 
297 
299 {
300  // Build telescope from infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
301 
302  //Info("BuildTelescope", "Building telescope %s",name);
304  KVString telescopes = fStrucInfos.GetValue(Form("%s.Telescope", prefix), "");
305  telescopes.Begin(" ");
306  KVString name;
307  while (!telescopes.End()) {
308  name = telescopes.Next();
309  KVNumberList mods = fStrucInfos.GetValue(Form("%s.Telescope.%s.Modules", prefix, name.Data()), "1-100");
310  if (mods.Contains(module)) break;
311  }
312 
313  KVString detectors = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Detectors", name.Data()), "");
314  Double_t aziwidth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.AziWidth", name.Data()), 1.0);
315  Double_t dist = fStrucInfos.GetValue(Form("%s.Dist", prefix), 0.0);
316  kvt->SetDistance(dist);
317  detectors.Begin(" ");
318  Int_t idet = 1;
319  while (!detectors.End()) {
320  KVString detector = detectors.Next();
321  detector.Begin("()");
322  KVString dettype = detector.Next();
323  Double_t detthick = detector.Next().Atof();
324  KVDetector* det = KVDetector::MakeDetector(Form("%s.%s", fDataSet.Data(), dettype.Data()), detthick);
325  kvt->Add(det);
326  Double_t depth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Depth.%s", name.Data(), dettype.Data()), 0.);
327  kvt->SetDepth(idet, depth);
328  idet++;
329  }
330  kvt->SetAzimuthalWidth(aziwidth);
331  return kvt;
332 }
333 
334 
335 
344 
346 {
347  // Kludge to make INDRA ROOT geometry work like any other
348  // Normally ID telescopes are deduced from successive detectors on the different trajectories
349  // Each trajectory then possesses its list of ID telescopes
350  // These lists are then used when reconstruction trajectories are calculated
351  //
352  // When INDRA ROOT geometry is used, trajectory lists need to be filled
353  // by hand before reconstruction trajectories are calculated
354 
355  TIter it_traj(GetTrajectories());
356  KVGeoDNTrajectory* tr;
357  while ((tr = (KVGeoDNTrajectory*)it_traj())) {
358  // get first detector on trajectory
359  KVDetector* det = tr->GetNodeAt(0)->GetDetector();
360  // list of 'aligned' id telescopes
361  TIter it_idt(det->GetAlignedIDTelescopes());
362  KVIDTelescope* idt;
363  while ((idt = (KVIDTelescope*)it_idt())) {
364  if (tr->ContainsAll(idt->GetDetectors())) { // all detectors on trajectory
365  if (idt->GetDetectors()->GetEntries() > 1) {
366  // make sure dE and E detector are consecutive on trajectory
367  // i.e. dE has to be immediately in front of E on the trajectory
368  if (tr->GetNodeInFront(idt->GetDetector(2)->GetNode()) == idt->GetDetector(1)->GetNode())
369  tr->AccessIDTelescopeList()->Add(idt);
370  }
371  else
372  tr->AccessIDTelescopeList()->Add(idt);//single-detector telescope
373  }
374  }
375  }
376 }
377 
378 
379 
380 
384 
386 {
387  // Overrides KVASMultiDetArray::Build
388  // Correspondance between CsI detectors and pin lasers is set up if known.
389 
390  if (run != -1) {
391  fCurrentRun = run;
392  }
393  BuildGeometry();
394 
395  MakeListOfDetectors();
396 
397  SetGroupsAndIDTelescopes();
398 
399  SetNamesOfIDTelescopes();
400 
401  SetDetectorThicknesses();
402 
403  SetIdentifications();
404 
405  //set flag to say Build() was called
406  SetBit(kIsBuilt);
407 
408  SetPinLasersForCsI();
409 
410  SetExpectedDetectorSignalNames();
411 
412  // link EBYEDAT parameter names to detectors
413  TIter next_det(GetDetectors());
414  KVDetector* det;
415  while ((det = (KVDetector*)next_det())) {
416  TString det_name(det->GetName());
417  if (det_name.BeginsWith("CI") || det_name.BeginsWith("SI")) {
418  fEbyedatParamDetMap.SetValue(det_name + "_PG", det_name);
419  fEbyedatParamDetMap.SetValue(det_name + "_GG", det_name);
420  }
421  else if (det_name.BeginsWith("CSI")) {
422  fEbyedatParamDetMap.SetValue(det_name + "_R", det_name);
423  fEbyedatParamDetMap.SetValue(det_name + "_L", det_name);
424  }
425  // handle change of "time marker" parameter type for certain experiments
426  TString time_marker_type = gDataSet->GetDataSetEnv(Form("KVACQParam.%s.T", det_name.Data()), "T");
427  time_marker_type.Prepend("_");
428  fEbyedatParamDetMap.SetValue(det_name + time_marker_type, det_name);
429  }
430 }
431 
432 
433 //void KVINDRA::SetArrayACQParams()
434 //{
435 // // Overrides KVASMultiDetArray::SetArrayACQParams() in order to
436 // // add the following acquisition parameters which are not associated to a detector:
437 // //
438 // // STAT_EVE
439 // // R_DEC
440 // // CONFIG
441 // // PILA_01_PG
442 // // PILA_01_GG
443 // // PILA_02_PG
444 // // PILA_02_GG
445 // // PILA_03_PG
446 // // PILA_03_GG
447 // // PILA_04_PG
448 // // PILA_04_GG
449 // // PILA_05_PG
450 // // PILA_05_GG
451 // // PILA_06_PG
452 // // PILA_06_GG
453 // // PILA_07_PG
454 // // PILA_07_GG
455 // // PILA_08_PG
456 // // PILA_08_GG
457 // // SI_PIN1_PG
458 // // SI_PIN1_GG
459 // // SI_PIN2_PG
460 // // SI_PIN2_GG
461 // //
462 // // We also create and initialize the KVINDRATriggerInfo object (fSelecteur) used to read
463 // // the status of the DAQ trigger event by event (access through GetTriggerInfo()).
464 
465 // KVACQParam* ste = new KVACQParam("STAT_EVE");
466 // AddArrayACQParam(ste);
467 // KVACQParam* dec = new KVACQParam("R_DEC");
468 // AddArrayACQParam(dec);
469 // KVACQParam* conf = new KVACQParam("CONFIG");
470 // AddArrayACQParam(conf);
471 // fSelecteur = new KVINDRATriggerInfo;
472 // fSelecteur->SetSTAT_EVE_PAR(ste);
473 // fSelecteur->SetR_DEC_PAR(dec);
474 // fSelecteur->SetVXCONFIG_PAR(conf);
475 
476 // AddArrayACQParam(new KVACQParam("PILA_01_PG"));
477 // AddArrayACQParam(new KVACQParam("PILA_01_GG"));
478 // AddArrayACQParam(new KVACQParam("PILA_02_PG"));
479 // AddArrayACQParam(new KVACQParam("PILA_02_GG"));
480 // AddArrayACQParam(new KVACQParam("PILA_03_PG"));
481 // AddArrayACQParam(new KVACQParam("PILA_03_GG"));
482 // AddArrayACQParam(new KVACQParam("PILA_04_PG"));
483 // AddArrayACQParam(new KVACQParam("PILA_04_GG"));
484 // AddArrayACQParam(new KVACQParam("PILA_05_PG"));
485 // AddArrayACQParam(new KVACQParam("PILA_05_GG"));
486 // AddArrayACQParam(new KVACQParam("PILA_06_PG"));
487 // AddArrayACQParam(new KVACQParam("PILA_06_GG"));
488 // AddArrayACQParam(new KVACQParam("PILA_07_PG"));
489 // AddArrayACQParam(new KVACQParam("PILA_07_GG"));
490 // AddArrayACQParam(new KVACQParam("PILA_08_PG"));
491 // AddArrayACQParam(new KVACQParam("PILA_08_GG"));
492 // AddArrayACQParam(new KVACQParam("SI_PIN1_PG"));
493 // AddArrayACQParam(new KVACQParam("SI_PIN1_GG"));
494 // AddArrayACQParam(new KVACQParam("SI_PIN2_PG"));
495 // AddArrayACQParam(new KVACQParam("SI_PIN2_GG"));
496 //}
497 
498 
499 
502 
504 {
505  //Overrides KVASMultiDetArray method to add FillListsOfDetectorsByType()
506 
508  FillListsOfDetectorsByType();
509 }
510 
511 
512 
515 
517 {
518  //Fill lists of ChIo, Si, CsI and phoswich
519 
520  fChIo->Clear();
521  fSi->Clear();
522  fCsI->Clear();
523  fPhoswich->Clear();
524  TIter next_det(GetDetectors());
525  KVDetector* kvd;
526  while ((kvd = (KVDetector*) next_det())) {
527  kvd->SetNameOfArray("INDRA");
528  if (kvd->InheritsFrom("KVChIo")) {
529  fChIo->Add(kvd);
530  }
531  if (kvd->InheritsFrom("KVSilicon")) {
532  fSi->Add(kvd);
533  }
534  if (kvd->InheritsFrom("KVCsI")) {
535  fCsI->Add(kvd);
536  }
537  if (kvd->InheritsFrom("KVPhoswich")) {
538  fPhoswich->Add(kvd);
539  }
540  }
541 }
542 
543 
544 
545 
551 
553 {
554  //Find groups of telescopes in angular alignment placed on different layers.
555  //List is in fGroups.
556  //Also creates all ID telescopes in array and stores them in fIDTelescopes.
557  //Any previous groups/idtelescopes are deleted beforehand.
558  CalculateGroupsFromGeometry();
559 
560  //now read list of groups and create list of ID telescopes
561  CreateIDTelescopesInGroups();
562 }
563 
564 
565 
569 
571 {
572 
573  //Returns a pointer to the Ionisation Chamber placed directly in front of the
574  //detector "detname". If no ChIo is present, a null pointer is returned.
575 
576  KVINDRADetector* kvd;
577  kvd = dynamic_cast<KVINDRADetector*>(GetDetector(detname));
578  return (kvd ? (KVChIo*)kvd->GetChIo() : NULL);
579 }
580 
581 
582 
583 
587 
589 {
590  //Return pointer to layer in INDRA structure corresponding to ionisation
591  //chambers.
592 
593  return (KVLayer*)GetStructure("LAYER", "CHIO");
594 }
595 
596 
597 
598 
602 
604 {
605  // Define multiplicity trigger used for acquisition and filter.
606  // Events with multipicity >= trig are OK.
607 
608  fTrigger = trig;
609 }
610 
611 
612 
638 
640 {
641  //Find a detector based on the old BaseIndra type definitions:
642  //
643 //enum EBaseIndra_type {
644 // ChIo_GG=1,
645 // ChIo_PG,//=2
646 // ChIo_T,//=3
647 // Si_GG,//=4
648 // Si_PG,//=5
649 // Si_T,//=6
650 // CsI_R,//=7
651 // CsI_L,//=8
652 // CsI_T,//=9
653 // Si75_GG,//=10
654 // Si75_PG,//=11
655 // Si75_T,//=12
656 // SiLi_GG,//=13
657 // SiLi_PG,//=14
658 // SiLi_T//=15
659 //};
660 //enum EBaseIndra_typePhos {
661 // Phos_R=1,
662 // Phos_L,//=2
663 // Phos_T,//=3
664 //};
665 
666  KVINDRADetector* det = 0;
667 
668  char nom_det[20];
669  if (cou == 1) {
670  if (type >= Phos_R && type <= Phos_T) {
671  sprintf(nom_det, "PHOS_%02d", mod);
672  det =
673  (KVINDRADetector*) GetListOfPhoswich()->FindObjectByName(nom_det);
674  }
675  }
676  if (det)
677  return det;
678  else if (type >= ChIo_GG && type <= ChIo_T) {
679  sprintf(nom_det, "CI_%02d%02d", cou, mod);
680  det = (KVINDRADetector*) GetListOfChIo()->FindObject(nom_det);
681  return det;
682  }
683  else if (type >= Si_GG && type <= Si_T) {
684  sprintf(nom_det, "SI_%02d%02d", cou, mod);
685  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
686  return det;
687  }
688  else if (type >= SiLi_GG && type <= SiLi_T) {
689  sprintf(nom_det, "SILI_%02d", cou);
690  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
691  return det;
692  }
693  else if (type >= Si75_GG && type <= Si75_T) {
694  sprintf(nom_det, "SI75_%02d", cou);
695  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
696  return det;
697  }
698  else if (type >= CsI_R && type <= CsI_T) {
699  sprintf(nom_det, "CSI_%02d%02d", cou, mod);
700  det = (KVINDRADetector*) GetListOfCsI()->FindObject(nom_det);
701  return det;
702  }
703  return 0;
704 }
705 
706 
707 
708 
712 
714 {
715  //Override KVASMultiDetArray method for special case of "etalon" modules:
716  //we need to add ChIo-CsI identification telescope by hand
717 
719 
720  if (de->InheritsFrom("KVSiLi") && e->InheritsFrom("KVCsI")) {
721  KVChIo* chio = (KVChIo*)((KVINDRADetector*)e)->GetChIo();
722  if (chio) {
723  n += KVASMultiDetArray::GetIDTelescopes(chio, e, idtels);
724  }
725  }
726  return n;
727 }
728 
729 
730 
735 
737 {
738  // Change default names of ID telescopes to INDRA standard
739  //
740  // This method also sets the types of the ID telescopes
741 
742  TIter it(GetListOfIDTelescopes());
743  KVIDTelescope* idt;
744  const TString etalon_numbers[] = {"1002", "1102", "1202", "1304", "1403", "1503", "1602", "1702"};
745  while ((idt = (KVIDTelescope*)it())) {
746  KVString N = idt->GetDetector(1)->GetName();
747  N.Begin("_");
748  KVString de_type = N.Next();
749  KVString de_number = N.Next();
750  if (idt->GetSize() == 1) {
751  if (de_type == "PHOS") {
752  idt->SetName(Form("%s_R_L_%s", de_type.Data(), de_number.Data()));
753  idt->SetType(Form("%s_R_L", de_type.Data()));
754  }
755  else {
756  // CsI identification telescopes are called either CSI_R_L_RRMM (before 2021)
757  // or CSI_RRMM (for datasets from 2021 onwards)
758  TString csi_id_name_fmt = KVBase::GetDataSetEnv(fDataSet, "INDRA.CSI.IDTelescopeNameFormat", "CSI_%s");
759  idt->SetName(Form(csi_id_name_fmt, de_number.Data()));
760  // similarly, the type of CSI identifications was CSI_R_L before 2021, CSI from 2021 onwards
761  if (csi_id_name_fmt.Contains("R_L")) {
762  idt->SetType("CSI_R_L");
764  }
765  else idt->SetType("CSI");
766  }
767  }
768  else {
769  N = idt->GetDetector(2)->GetName();
770  N.Begin("_");
771  KVString e_type = N.Next();
772  KVString e_number = N.Next();
773  if (e_type == "SILI" || e_type == "SI75") {
774  e_number = etalon_numbers[dynamic_cast<KVINDRADetector*>(idt->GetDetector(2))->GetRingNumber() - 10];
775  }
776  idt->SetName(Form("%s_%s_%s", de_type.Data(), e_type.Data(), e_number.Data()));
777  idt->SetType(Form("%s_%s", de_type.Data(), e_type.Data()));
778  }
779  }
780  // changed names of all id telescope objects in hashlist: must rehash
781  dynamic_cast<KVHashList*>(GetListOfIDTelescopes())->Rehash();
782 }
783 
784 
785 
789 
791 {
792  // Finalise the ROOT geometry description by performing operations which can
793  // only be done once the geometry is closed
794  CreateROOTGeometry();
795 }
796 
797 
798 
800 
801 void KVINDRA::handle_ebyedat_raw_data_parameter(const char* param_name, uint16_t val)
802 {
803  KVString detname;
804  KVDetector* det = nullptr;
805  KVString sig_type;
806  // use look-up table parname => detectorname
807  if (fEbyedatParamDetMap.HasParameter(param_name)) {
808  det = GetDetector(fEbyedatParamDetMap.GetStringValue(param_name));
809  detname = det->GetName();
810  // parameter type given by whatever comes after final '_'
811  std::string lab(param_name);
812  sig_type = lab.substr(lab.rfind('_') + 1);
813  }
814  else { // no detector associated to parameter
815  sig_type = param_name;
816  }
817  add_and_set_detector_signal(det, detname, val, sig_type);
818 }
819 
820 
821 
829 
831 {
832  // Put values of all fired detector signals into the parameter list which will be copied
833  // into the reconstructed event.
834  //
835  // If Mesytec data is being read, we set the parameter "INDRA.MESYTEC", or if Ebyedat data, "INDRA.EBYEDAT".
836  // Note that in old reconstructed data these parameters did not exist, therefore in their
837  // absence EBYEDAT is assumed.
838 
839  if (fMesytecData) fReconParameters.SetValue("INDRA.MESYTEC", kTRUE);
840  else if (fEbyedatData) fReconParameters.SetValue("INDRA.EBYEDAT", kTRUE);
842 }
843 
844 
845 
869 
871 {
872  // Read ChIo pressures from a file with the following format:
873  //
874  //~~~
875  //PressureSet: A
876  //A.RunList: 1-22
877  //A.CI_02: 50.0
878  //A.CI_04: 30.0
879  //A.CI_06: 20.0
880  //
881  //+PressureSet: B
882  //B.Units: torr
883  //B.RunList: 23-50
884  //B.CI_08: 33.0
885  //B.CI_13: 11.6
886  //~~~
887  //
888  // `Units` can be either `mbar` or `torr`: `mbar` is used by default (e.g. for set `A` in the example).
889  //
890  // The different ionization chambers are designated by `CI_02`, `CI_04`, `CI_06`, `CI_08`, `CI_13`
891  // The same pressure will be applied to all cells of each ChIo which are present in the current geometry.
892  //
893  // If `RunList` is not given, the pressures will be applied to all runs in the database.
894 
895  TString fullpath;
896  if (!db->FindCalibFile("Pressures", fullpath, "INDRA")) return;
897  Info("ReadChIoPressures()", "Reading INDRA ChIo pressures used during runs...");
898 
899  auto pressure_table = db->AddTable("INDRA.ChIo Pressures", "INDRA ChIo gas pressures");
900 
901  KVString the_chios[] = {"CI_02", "CI_04", "CI_06", "CI_08", "CI_13"};
902 
903  TEnv env;
904  env.ReadFile(fullpath.Data(), kEnvAll);
905  KVString pressure_sets = env.GetValue("PressureSet", "");
906  pressure_sets.Begin(" ");
907  while (!pressure_sets.End()) {
908  auto pressure_set = pressure_sets.Next();
909  // set units
910  auto units = KVUnits::mbar;
911  if (KVString(env.GetValue(Form("%s.Units", pressure_set.Data()), "mbar")) != "mbar")
912  units = KVUnits::torr;
913  // set runlist if given
914  KVNumberList runlist(env.GetValue(Form("%s.RunList", pressure_set.Data()), ""));
915  if (runlist.IsEmpty()) runlist = db->GetRunList();
916  // get and set pressures
917  auto dbp = new KVDBChIoPressures;
918  int ichio = 0;
919  for (auto& chio : the_chios) {
920  Float_t P = 0;
921  if ((P = env.GetValue(Form("%s.%s", pressure_set.Data(), chio.Data()), 0.0)) > 0.0) {
922  dbp->SetPressure(ichio, P * units);
923  }
924  ++ichio;
925  }
926  pressure_table->AddRecord(dbp);
927  db->LinkRecordToRunRange(dbp, runlist);
928  }
929 }
930 
931 
932 
938 
940 {
941  //Update ChIo pressures for this run with values in database (if any)
942  //
943  //Any ChIo with zero pressure has KVDetector::IsDetecting() set to false
944  //(and hence KVDetector::IsOK() will also return false).
945 
946  KVRList* param_list = kvrun->GetLinks("INDRA.ChIo Pressures");
947  if (!param_list) {
948  return;
949  }
950  KVChIo* kvd;
951  KVDBChIoPressures* kvps;
952  TIter next_ps(param_list);
953  KVSeqCollection* chios = GetListOfChIo();
954  if (!chios) {
955  Error("SetChIoPressures",
956  "GetListOfChIo() returns null list pointer");
957  return;
958  }
959  cout << "--> Setting ChIo pressures" << endl;
960  TIter next_chio(chios);
961  while ((kvps = (KVDBChIoPressures*) next_ps())) {
962  if (kvps->GetPressure(CHIO_2_3))
963  cout << " Ring 2/3: " << kvps->
964  GetPressure(CHIO_2_3) / KVUnits::mbar << " mbar" << endl;
965  if (kvps->GetPressure(CHIO_4_5))
966  cout << " Ring 4/5: " << kvps->
967  GetPressure(CHIO_4_5) / KVUnits::mbar << " mbar" << endl;
968  if (kvps->GetPressure(CHIO_6_7))
969  cout << " Ring 6/7: " << kvps->
970  GetPressure(CHIO_6_7) / KVUnits::mbar << " mbar" << endl;
971  if (kvps->GetPressure(CHIO_8_12))
972  cout << " Ring 8/12: " << kvps->
973  GetPressure(CHIO_8_12) / KVUnits::mbar << " mbar" << endl;
974  if (kvps->GetPressure(CHIO_13_17))
975  cout << " Ring 13/17: " << kvps->
976  GetPressure(CHIO_13_17) / KVUnits::mbar << " mbar" << endl;
977  while ((kvd = (KVChIo*) next_chio())) {
978  if (!strcmp(kvd->GetType(), "CI")) {
979  //check detector type: ="CI" for standard INDRA chio
980  if (kvd->GetRingNumber() == 2)
981  kvd->SetPressure(kvps->GetPressure(CHIO_2_3) / KVUnits::mbar);
982  if (kvd->GetRingNumber() == 4)
983  kvd->SetPressure(kvps->GetPressure(CHIO_4_5) / KVUnits::mbar);
984  if (kvd->GetRingNumber() == 6)
985  kvd->SetPressure(kvps->GetPressure(CHIO_6_7) / KVUnits::mbar);
986  if (kvd->GetRingNumber() >= 8 && kvd->GetRingNumber() <= 12)
987  kvd->SetPressure(kvps->GetPressure(CHIO_8_12) / KVUnits::mbar);
988  if (kvd->GetRingNumber() >= 13 && kvd->GetRingNumber() <= 17)
989  kvd->SetPressure(kvps->GetPressure(CHIO_13_17) / KVUnits::mbar);
990  if (kvd->GetPressure() == 0.0) {
991  kvd->SetDetecting(kFALSE);
992  }
993  else {
994  kvd->SetDetecting(kTRUE);
995  }
996  }
997  }
998  next_chio.Reset();
999  }
1000 }
1001 
1002 
1003 
1006 
1008 {
1009  // Override base method in order to set ChIo pressures (if defined)
1011  SetChIoPressures(dbr);
1012 }
1013 
1014 
1015 #ifdef WITH_BUILTIN_GRU
1016 
1020 
1022 {
1023  // Set raw data in detectors/array coming from a GANIL EBYEDAT format
1024  // acquisition file.
1025 
1026  fEbyedatData = kTRUE;
1027  // loop over fired data parameters
1028  TIter nxt_frd(&rdr.GetFiredDataParameters());
1029  KVEBYEDAT_ACQParam* eby_par;
1030  while ((eby_par = (KVEBYEDAT_ACQParam*)nxt_frd())) {
1031  handle_ebyedat_raw_data_parameter(eby_par->GetName(), eby_par->GetData());
1032  }
1033 
1034  return kTRUE;
1035 }
1036 
1037 #endif
1038 
1039 #ifdef WITH_MFM
1040 
1056 
1058 {
1059  // General method for reading raw data in MFM-encapsulated ebyedat format
1060  // Fills list of hit acquisition parameters.
1061  // Returns kTRUE if at least one parameter belonging to the array is present.
1062  //
1063  // Any unknown parameters in the event (i.e. ones for which no KVACQParam object
1064  // has been defined) are written in the fReconParameters list with names
1065  // "ACQPAR.[array name].[parameter name]"
1066  //
1067  // Retrieve CENTRUM timestamp from data if present.
1068  // It will be added to fReconParameters as a 64-bit value "INDRA.TS" (if != 0)
1069  // Event number is retrieved and stored as "INDRA.EN" (if != 0)
1070  // Any parameter which appears as [name] and [name]_UP is an unsigned 32-bit value
1071  // split into two 16-bit words. We replace the two parameters with a 64-bit
1072  // value (to hold correctly all unsigned 32-bit values) with [name].
1073 
1074  fEbyedatData = kTRUE;
1075 
1076  uint16_t val;
1077  std::string lab;
1078 
1079  for (int i = 0; i < f.GetNbItems(); ++i) {
1080  f.GetDataItem(i, lab, val);
1081  handle_ebyedat_raw_data_parameter(lab.c_str(), val);
1082  }
1083 
1084  ULong64_t ts = f.GetCENTRUMTimestamp();
1085  if (ts != 0) fReconParameters.SetValue64bit("INDRA.TS", ts);
1086  ULong64_t en = f.GetEventNumber();
1087  if (en != 0) fReconParameters.SetValue64bit("INDRA.EN", en);
1088  int npars = fReconParameters.GetNpar();
1089  std::vector<TString> names;
1090  for (int i = 0; i < npars; ++i) {
1091  TString name = fReconParameters.GetParameter(i)->GetName();
1092  if (name.EndsWith("_UP")) names.push_back(name);
1093  }
1094  if (names.size()) {
1095  for (std::vector<TString>::iterator it = names.begin(); it != names.end(); ++it) {
1096  TString name = (*it);
1097  name.Remove(name.Index("_UP"), 3);
1098  TString name_up = (*it);
1099  ULong64_t par_up = fReconParameters.GetIntValue(name_up);
1100  ULong64_t par = fReconParameters.GetIntValue(name);
1101  UInt_t par32 = (par_up << 16) + par;
1102  fReconParameters.RemoveParameter(name_up);
1103  fReconParameters.RemoveParameter(name);
1104  fReconParameters.SetValue64bit(name, par32);
1105  }
1106  }
1107  return kTRUE;
1108 }
1109 
1110 #endif
1111 
1112 
1115 
1117 {
1118  // Set the INDRA-specific general identification code for the given telescope
1119 
1120  if (idt->InheritsFrom(KVIDPhoswich::Class())) idt->SetIDCode(IDCodes::ID_PHOSWICH);
1121  else if (idt->InheritsFrom(KVIDINDRACsI::Class())) idt->SetIDCode(IDCodes::ID_CSI_PSA);
1122  else if (idt->InheritsFrom(KVIDSiCsI::Class())) idt->SetIDCode(IDCodes::ID_SI_CSI);
1123  else if (idt->InheritsFrom(KVIDChIoSi::Class())) idt->SetIDCode(IDCodes::ID_CI_SI);
1124  else if (idt->InheritsFrom(KVIDChIoCsI::Class())) idt->SetIDCode(IDCodes::ID_CI_CSI);
1125  else if (idt->InheritsFrom(KVIDChIoSi75::Class())) idt->SetIDCode(IDCodes::ID_CI_SI75);
1126  else if (idt->InheritsFrom(KVIDSi75SiLi::Class())) idt->SetIDCode(IDCodes::ID_SI75_SILI);
1127  else if (idt->InheritsFrom(KVIDChIoSi75::Class())) idt->SetIDCode(IDCodes::ID_CI_SI75);
1128  else {
1129  Error("SetIDCodeForIDTelescope", "Request for telescope name=%s of unknown class=%s",
1130  idt->GetName(), idt->IsA()->GetName());
1131  }
1132 }
1133 
1134 
1135 
1161 
1163 {
1164  // Sets the KVCsI::fPinLaser member of each CsI detector with the number of the
1165  // pin laser associated for the stability control of these detectors.
1166  //
1167  // We look for a file with the following format:
1168  //
1169  // CSI_0101 1
1170  // CSI_0102 1
1171  // CSI_0103 1
1172  // CSI_0104 1
1173  // etc.
1174  //
1175  // i.e. 'name of CsI detector' 'number of pin laser (1-8)'
1176  // Comment lines must begin with '#'
1177  //
1178  // The default name of this file is defined in .kvrootrc by
1179  //
1180  // INDRADB.CsIPinCorr: CsI_PILA.dat
1181  //
1182  // Dataset-specific version can be specified:
1183  //
1184  // INDRA_e999.INDRADB.CsIPinCorr: CorrCsIPin_2054.dat
1185  //
1186  // This file should be in the directory corresponding to the current dataset,
1187  // i.e. in $KVROOT/KVFiles/name_of_dataset
1188 
1189  ifstream pila_file;
1190  if (gDataSet->OpenDataSetFile(gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""), pila_file)) {
1191 
1192  Info("SetPinLasersForCsI", "Setting correspondance CsI-PinLaser using file %s.",
1193  gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""));
1194  // read file, set correspondance
1195  KVString line;
1196  line.ReadLine(pila_file);
1197  while (pila_file.good()) {
1198  if (!line.BeginsWith("#")) {
1199  line.Begin(" ");
1200  KVString detname = line.Next(kTRUE);
1201  KVCsI* det = (KVCsI*)GetDetector(detname.Data());
1202  Int_t pila = line.Next(kTRUE).Atoi();
1203  if (det) {
1204  det->SetPinLaser(pila);
1205  }
1206  }
1207  line.ReadLine(pila_file);
1208  }
1209  pila_file.close();
1210  }
1211  else {
1212  Info("SetPinLasersForCsI", "File %s not found. Correspondance Csi-PinLaser is unknown.",
1213  gDataSet->GetDataSetEnv("CsIPinCorr", ""));
1214  }
1215 }
1216 
1217 
1218 
1219 //void KVINDRA::LinkToCodeurs()
1220 //{
1221 
1222 // // Link detectors with electronic modules
1223 // // for the moment only QDC for Si and ChIo are implemented
1224 // // This information is accessible via KVINDRADetector::GetNumeroCodeur()
1225 // // To be active one has to put in the dataset directory
1226 // // a file name Codeurs.dat containing the name of the file for the concerned type
1227 // // of electronic module
1228 // // for example see INDRA_e613 dataset
1229 // // [dataset name].INDRADB.Codeurs: ...
1230 
1231 
1232 // KVFileReader flist;
1233 // TString fp;
1234 // if (!KVBase::SearchKVFile(gDataSet->GetDataSetEnv("INDRADB.Codeurs", ""), fp, gDataSet->GetName())) {
1235 // Warning("LinkToCodeurs", "Fichier %s, inconnu au bataillon", gDataSet->GetDataSetEnv("INDRADB.Codeurs", ""));
1236 // return;
1237 // }
1238 
1239 // if (!flist.OpenFileToRead(fp.Data())) {
1240 // //Error("ReadGainList","Error opening file named %s",fp.Data());
1241 // return;
1242 // }
1243 // Info("LinkToCodeurs()", "Reading correspondance Codeur-Detecteur ...");
1244 
1245 // TEnv* env = 0;
1246 // KVINDRADetector* idet = 0;
1247 // while (flist.IsOK()) {
1248 // flist.ReadLine(NULL);
1249 // KVString file = flist.GetCurrentLine();
1250 // if (file != "") {
1251 // if (KVBase::SearchKVFile(file.Data(), fp, gDataSet->GetName())) {
1252 // env = new TEnv();
1253 // env->ReadFile(fp.Data(), kEnvAll);
1254 // TEnvRec* rec = 0;
1255 // TObjArray* toks = 0;
1256 // TIter it(env->GetTable());
1257 // while ((rec = (TEnvRec*)it.Next())) {
1258 // if (!strcmp(rec->GetName(), "type")) {
1259 // Info("LinkToCodeurs", "Module type %s", rec->GetValue());
1260 // }
1261 // else {
1262 // toks = TString(rec->GetValue()).Tokenize(",");
1263 // for (Int_t ii = 0; ii < toks->GetEntries(); ii += 1) {
1264 // idet = (KVINDRADetector*)gIndra->GetDetector(((TObjString*)toks->At(ii))->GetString().Data());
1265 // if (idet)
1266 // idet->SetNumeroCodeur(TString(rec->GetName()).Atoi());
1267 // }
1268 // delete toks;
1269 // }
1270 // }
1271 // delete env;
1272 // }
1273 // }
1274 // }
1275 
1276 // flist.CloseFile();
1277 
1278 
1279 //}
1280 
1281 
1282 
1283 
1289 
1291 {
1292  // Overrides KVASMultiDetArray::GetDetectorEvent.
1293  // If the list of fired detectors is given (meaning we are reading raw data)
1294  // then we check that what we have read is in fact an INDRA event
1295  // (see KVINDRATriggerInfo::IsINDRAEvent()) : if not, we do not try to find the hit groups.
1296 
1297  if (((fired_dets && fired_dets->GetEntries()) || fFiredDetectors.GetEntries())
1298  && (GetTriggerInfo() && !GetTriggerInfo()->IsINDRAEvent())) return;
1299  KVASMultiDetArray::GetDetectorEvent(detev, fired_dets);
1300 }
1301 
1302 
1303 
1304 //void KVINDRA::SetGGtoPGConversionFactors()
1305 //{
1306 // // Sets the parameters for linear conversion of silicon & ChIo coder values
1307 // // between GG and PG, using the following formula:
1308 // //
1309 // // PG = alpha + beta*(GG - GG_0) + PG_0
1310 // //
1311 // // where GG_0 and PG_0 are respectively GG and PG pedestals
1312 // //
1313 // // We look for the file whose name is given by the .kvrootrc variable
1314 // // [dataset].INDRADB.GGtoPGFactors:
1315 // // or by default
1316 // // INDRADB.GGtoPGFactors:
1317 // // and expect to find in it a line for each detector of the form:
1318 // // Det_Name alpha beta
1319 // // Comments in the file can be written on lines beginning with the character '#'
1320 
1321 // ifstream datfile;
1322 // if (!gDataSet->OpenDataSetFile(gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""), datfile)) {
1323 
1324 // Info("SetGGtoPGConversionFactors", "Cannot open file with parameters for conversion (%s).",
1325 // gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""));
1326 // return;
1327 // }
1328 // else {
1329 // Info("SetGGtoPGConversionFactors", "Reading parameters from file %s",
1330 // gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""));
1331 
1332 // Char_t detname[30];
1333 // Double_t a, b;
1334 // TString aline;
1335 // aline.ReadLine(datfile);
1336 // while (datfile.good()) {
1337 
1338 // if (aline[0] != '#') { //skip comments
1339 
1340 // sscanf(aline.Data(), "%s %lf %lf", detname, &a, &b);
1341 // KVINDRADetector* det = (KVINDRADetector*)GetDetector(detname);
1342 // if (!det) {
1343 // //no detector found with cou, mod and type
1344 // Error("SetGGtoPGConversionFactors", "Unknown detector : %s", detname);
1345 // }
1346 // else {
1347 // det->SetGGtoPGConversionFactors(a, b);
1348 // //Info("SetGGtoPGConversionFactors", "%s : PG = %f + %f * GG", detname, a, b);
1349 // }
1350 // }
1351 // aline.ReadLine(datfile);
1352 // } //while( datfile.good()
1353 // datfile.close();
1354 // }
1355 //}
1356 
1357 
1358 
1369 
1371 {
1372  // Overrides KVASMultiDetArray::CreateGeoManager in order to use INDRAGeometryBuilder
1373  // which builds the TGeo representation of INDRA using the Y. Huguet CAO data.
1374  //
1375  // The optional arguments (dx,dy,dz) are the half-lengths in centimetres of the "world"/"top" volume
1376  // into which all the detectors of the array are placed. This should be big enough so that all detectors
1377  // fit in. The default values of 500 give a "world" which is a cube 1000cmx1000cmx1000cm (with sides
1378  // going from -500cm to +500cm on each axis).
1379  //
1380  // If closegeo=kFALSE we leave the geometry open for other structures to be added.
1381 
1382  if (!IsBuilt()) {
1383  Error("CreateROOTGeometry", "gIndra has to be build first");
1384  return;
1385  }
1386  if (!GetNavigator()) {
1387  //Error("CreateROOTGeometry","No existing navigator"); return;
1389  GetNavigator()->SetNameCorrespondanceList("INDRA.names");
1390  }
1391 
1392  // set up shape & matrix pointers in detectors
1393  Info("CreateROOTGeometry", "Scanning geometry shapes and matrices...");
1395  gimp.SetNameCorrespondanceList("INDRA.names");
1396  KVNucleusEvent evt;
1397  KVNucleus* nuc = evt.AddNucleus();
1398  nuc->SetZAandE(1, 1, 1);
1399  KVINDRADetector* det;
1400  TIter next(GetDetectors());
1401  Int_t nrootgeo = 0;
1402  while ((det = (KVINDRADetector*)next())) {
1403  nuc->SetTheta(det->GetTheta());
1404  nuc->SetPhi(det->GetPhi());
1405  gimp.SetLastDetector(0);
1406  gimp.PropagateEvent(&evt);
1407  if (!(det->ROOTGeo())) {
1408  Info("CreateROOTGeometry", "Volume checking for %s", det->GetName());
1409  Double_t theta0 = det->GetTheta();
1410  Double_t phi0 = det->GetPhi();
1411  for (Double_t TH = theta0 - 0.5; TH <= theta0 + 0.5; TH += 0.1) {
1412  for (Double_t PH = phi0 - 10; PH <= phi0 + 10; PH += 1) {
1413  nuc->SetTheta(TH);
1414  nuc->SetPhi(PH);
1415  gimp.SetLastDetector(0);
1416  gimp.PropagateEvent(&evt);
1417  if (det->ROOTGeo()) break;
1418  }
1419  if (det->ROOTGeo()) break;
1420  }
1421  }
1422  if (!(det->ROOTGeo())) {
1423  Info("CreateROOTGeometry", "Volume checking failed for : %s", det->GetName());
1424  }
1425  // check etalon trajectories (if etalons are present)
1426  if (det->ROOTGeo() && det->GetRingNumber() > 9) {
1427  if (GetDetector(Form("SI75_%d", det->GetRingNumber())) || GetDetector(Form("SILI_%d", det->GetRingNumber()))) {
1428  if ((det->IsCalled("CSI_1002") || det->IsCalled("CSI_1102")
1429  || det->IsCalled("CSI_1202") || det->IsCalled("CSI_1304")
1430  || det->IsCalled("CSI_1403") || det->IsCalled("CSI_1503")
1431  || det->IsCalled("CSI_1602") || det->IsCalled("CSI_1702"))
1432  && det->GetNode()->GetNDetsInFront() < 2) {
1433  Info("CreateROOTGeometry", "Trajectory checking for %s", det->GetName());
1434  Double_t theta0 = det->GetTheta();
1435  Double_t phi0 = det->GetPhi();
1436  for (Double_t TH = theta0 - 0.5; TH <= theta0 + 0.5; TH += 0.1) {
1437  for (Double_t PH = phi0 - 10; PH <= phi0 + 10; PH += 1) {
1438  nuc->SetTheta(TH);
1439  nuc->SetPhi(PH);
1440  gimp.SetLastDetector(0);
1441  gimp.PropagateEvent(&evt);
1442  if (det->GetNode()->GetNDetsInFront() == 2) break;
1443  }
1444  if (det->GetNode()->GetNDetsInFront() == 2) break;
1445  }
1446  }
1447  }
1448  }
1449  nrootgeo += (det->ROOTGeo());
1450  }
1451 
1452  Info("CreateROOTGeometry", "ROOT geometry initialised for %d/%d detectors", nrootgeo, GetDetectors()->GetEntries());
1453 
1454  // Set up trajectories
1455  TIter it(GetDetectors());
1456  KVDetector* d;
1457  while ((d = (KVDetector*)it())) d->GetNode()->RehashLists();// make sure detector nodes are correct
1458  AssociateTrajectoriesAndNodes();
1459  DeduceGroupsFromTrajectories();
1460  FillTrajectoryIDTelescopeLists();
1461  CalculateReconstructionTrajectories();
1462  GetNavigator()->AbsorbDetectorPaths(&gimp);
1463 }
1464 
1465 
1466 
1470 
1472 {
1473  // Override base class method
1474  // If ROOT geometry is requested but has not been built, we create it
1475 
1476  if (on) {
1477  CreateGeoManager();
1479  igb.Build(kFALSE, fCloseGeometryNow);
1480  if (fCloseGeometryNow) PerformClosedROOTGeometryOperations();
1481  }
1482  else {
1484  }
1485 }
1486 
1487 
1488 
1494 
1496 {
1497  // Special INDRA group reconstructors:
1498  // KVINDRAForwardGroupReconstructor rings 1-9
1499  // KVINDRABackwardGroupReconstructor rings 10-17
1500  // KVINDRAEtalonGroupReconstructor for groups with etalon telescopes
1501 
1502  KVGroupReconstructor* gr(nullptr);
1503  if (GetGroup(g->GetName())) { // make sure group belongs to us
1504  // etalons ?
1505  if (g->GetDetectorByType("SILI") || g->GetDetectorByType("SI75"))
1506  gr = KVGroupReconstructor::Factory("INDRA.etalon");
1507  else {
1508  KVINDRADetector* id = (KVINDRADetector*)g->GetDetectors()->First();
1509  if (id->GetRingNumber() < 10) {
1510  gr = KVGroupReconstructor::Factory("INDRA.forward");
1511  }
1512  else {
1513  gr = KVGroupReconstructor::Factory("INDRA.backward");
1514  }
1515  }
1516  }
1517  return gr;
1518 }
1519 
1520 
1521 
1524 
1526 {
1527  // If "INDRA.EN" parameter has been set, we use it to set the event number
1528 
1530  if (GetReconParameters().HasValue64bit("INDRA.EN")) e->SetNumber(GetReconParameters().GetValue64bit("INDRA.EN"));
1531 }
1532 
1533 
1534 
1540 
1542 {
1543  // Overrides base method in KVMultiDetArray.
1544  //
1545  // If we are reading old reconstructed data with EBYEDAT parameters, we need special
1546  // treatment to decode the detector name & signal type.
1547 
1548  if (!l.GetBoolValue("INDRA.MESYTEC") && !l.GetBoolValue("INDRA.EBYEDAT")) {
1549  // assume we are reading old recon data with parameters in list such as "ACQPAR.INDRA.SI_0201_PG"
1550  fMesytecData = kFALSE;
1551  fEbyedatData = kTRUE;
1552  prepare_to_handle_new_raw_data();
1553 
1554  int N = l.GetNpar();
1555  for (int i = 0; i < N; ++i) {
1556  KVNamedParameter* np = l.GetParameter(i);
1557 
1558  KVString name(np->GetName());
1559  if (name.BeginsWith("ACQPAR")) {
1560  // 2 '.' => 3 values
1561  int dots = name.GetNValues(".");
1562  assert(dots == 3); // sanity check
1563  name.Begin(".");
1564  name.Next(); // "ACQPAR"
1565  if (name.Next() != "INDRA") continue; // check name of array - somebody else's parameter ?
1566  std::string parname(name.Next());
1567  KVString detname;
1568  KVString sig_type;
1569  KVDetector* det = nullptr;
1570  if (parname.find('_') != kNPOS) {
1571  // try to split into '[detname]_[partype]'
1572  detname = parname.substr(0, parname.rfind('_'));
1573  sig_type = parname.substr(parname.rfind('_') + 1);
1574  det = GetDetector(detname);
1575  }
1576  else {
1577  sig_type = parname;
1578  }
1579  add_and_set_detector_signal(det, detname, np->GetDouble(), sig_type);
1580  }
1581  }
1582  }
1583  else {
1584  fMesytecData = l.GetBoolValue("INDRA.MESYTEC");
1585  fEbyedatData = l.GetBoolValue("INDRA.EBYEDAT");
1587  }
1588 }
1589 
1590 
1591 
1594 
1596 {
1597  // Override base method in order to read ChIo pressures for each run
1599  // if the actual database class inherits from KVINDRADB (historic INDRA data),
1600  // the ChIo pressures have already been read (& from a file with a different format)
1601  if (!db->InheritsFrom("KVINDRADB")) ReadChIoPressures(db);
1602 }
1603 
1604 
1605 
1609 
1611 {
1612  // Call this method just after opening a raw data file in order to perform any
1613  // necessary initialisations, depending on the type of data
1614 
1616 
1617  fMesytecData = kFALSE;
1618  fEbyedatData = kFALSE;
1619 #ifdef WITH_MESYTEC
1620 #ifdef WITH_MFM
1621  if (r->GetDataFormat() == "MFM") {
1622  TString crate = gDataSet->GetDataSetEnv("MesytecCrateConf", "");
1623  if (crate != "") {
1624  Info("InitialiseRawDataReading", "Setting Mesytec crate config for run %d, raw run number=%d",
1625  GetCurrentRunNumber(), r->GetRunNumberReadFromFile());
1626 
1627  TString channel_conf_list = gDataSet->GetDataSetEnv("MesytecChannelsConf", "");
1628  if (channel_conf_list != "") {
1629  TEnv conf_list;
1630  if (conf_list.ReadFile(gDataSet->GetFullPathToDataSetFile(channel_conf_list), kEnvUser) == -1) {
1631  Fatal("InitialiseRawDataReading",
1632  "Could not open file containing names of Mesytec channel config for each run: %s",
1633  gDataSet->GetFullPathToDataSetFile(channel_conf_list).Data());
1634  }
1635  KVString files = conf_list.GetValue("File", "");
1636  files.Begin(" ");
1637  while (!files.End()) {
1638  KVString next_file = files.Next(kTRUE);
1639  KVNumberList runlist = conf_list.GetValue(Form("%s.RunList", next_file.Data()), "");
1640  if (runlist.Contains(r->GetRunNumberReadFromFile())) {
1641  // found file for this run
1642  Info("InitialiseRawDataReading", "Using file %s for raw run number %d",
1643  next_file.Data(), r->GetRunNumberReadFromFile());
1644  dynamic_cast<KVMFMDataFileReader*>(r)->InitialiseMesytecConfig(
1645  gDataSet->GetFullPathToDataSetFile(crate).Data(),
1646  gDataSet->GetFullPathToDataSetFile(next_file).Data()
1647  );
1648  }
1649  }
1650  }
1651  else {
1652  Fatal("InitialiseRawDataReading",
1653  "Name of file containing names of Mesytec channel config for each run should be defined in dataset variable %s.MesytecChannelsConf",
1654  GetDataSet().Data());
1655  }
1656  }
1657  }
1658 #endif
1659 #endif
1660 }
1661 
1662 
1663 #ifdef WITH_MFM
1664 #ifdef WITH_MESYTEC
1665 Bool_t KVINDRA::handle_raw_data_event_mfmframe_mesytec_mdpp(const MFMMesytecMDPPFrame& f)
1666 {
1667  // Read a raw data event from a Mesytec MFM Frame.
1668  //
1669  // All data is transferred to KVDetectorSignal objects, either associated to detectors of the
1670  // array (if they can be identified), either associated more globally with the array/event
1671  // itself. The latter are created as needed and go into the fExtraRawDataSignals list.
1672 
1673  if (!fMesytecData) {
1674  // first time we read data, we tweak the parameter names
1675  mesytec::module::set_data_type_alias("qdc_long", "TotLight"); // => CsI
1676  mesytec::module::set_data_type_alias("qdc_short", "R"); // => like old CsI 'R' (rapide) parameter
1677  mesytec::module::set_data_type_alias("tdc", "T"); // => like old 'marqueur de temps' parameters
1678  mesytec::module::set_data_type_alias("adc", "ADC"); // => Si or ChIo signals
1679 
1680  fMesytecData = kTRUE;
1681  }
1682  fReconParameters.SetValue64bit("INDRA.TS", f.GetTimeStamp());
1683  auto mfmfilereader = dynamic_cast<KVMFMDataFileReader*>(fRawDataReader);
1684  mfmfilereader->GetMesytecBufferReader().read_event_in_buffer(
1685  (const uint8_t*)f.GetPointUserData(), f.GetBlobSize(),
1686 #ifdef MESYTEC_DATA_NO_MDPP_NAMESPACE
1687 #ifdef MESYTEC_DATA_BUFFER_READER_CALLBACK_WITH_EVENT_AND_SETUP
1688  [ = ](const mesytec::event & evt, const mesytec::experimental_setup & setup) {
1689 #else
1690  [ = ](const mesytec::event & evt) {
1691 #endif
1692 #else
1693  [ = ](const mesytec::mdpp::event & evt) {
1694 #endif
1695 #ifndef MESYTEC_DATA_BUFFER_READER_CALLBACK_WITH_EVENT_AND_SETUP
1696  auto& setup = mfmfilereader->GetMesytecBufferReader().get_setup();
1697 #endif
1698  // loop over module data in event, set data in detectors when possible
1699 #ifdef MESYTEC_DATA_NO_PUBLIC_MEMBERS
1700  for (auto& mdat : evt.get_module_data()) {
1701  auto mod_id = mdat.get_module_id();
1702 #else
1703  for (auto& mdat : evt.modules) {
1704  auto mod_id = mdat.module_id;
1705 #endif
1706  auto& current_module = setup.get_module(mod_id);
1707  if (current_module.is_mdpp_module()) {
1708  // data for detectors from MDPP module
1709 #ifdef MESYTEC_DATA_NO_PUBLIC_MEMBERS
1710  for (auto& voie : mdat.get_channel_data()) {
1711  KVString detname(setup.get_detector(mod_id, voie.get_channel_number()));
1712  KVString sig_type(current_module.get_data_type_name(voie.get_data_type()));
1713  Double_t sig_data = voie.get_data();
1714 #else
1715  for (auto& voie : mdat.data) {
1716  KVString detname(setup.get_detector(mod_id, voie.channel));
1717  KVString sig_type(voie.data_type);
1718  Double_t sig_data = voie.data;
1719 
1720 #endif
1721  add_and_set_detector_signal(GetDetector(detname), detname, sig_data, sig_type);
1722  }
1723  }
1724  else if (current_module.is_mvlc_scaler()) {
1725  // data from 64 bit scalers in MVLC
1726  //
1727  // 4 data words of 16 bits (least significant is first word) => 64 bit scaler
1728 #ifdef MESYTEC_DATA_NO_PUBLIC_MEMBERS
1729  if (mdat.get_channel_data().size() == 4) {
1730 #else
1731  if (mdat.data.size() == 4) {
1732 #endif
1733  ULong64_t x = 0;
1734  int i = 0;
1735 #ifdef MESYTEC_DATA_NO_PUBLIC_MEMBERS
1736  for (auto& d : mdat.get_channel_data()) x += ((uint64_t)d.get_data_word()) << (16 * (i++));
1737 #else
1738  for (auto& d : mdat.data) x += ((uint64_t)d.data_word) << (16 * (i++));
1739 #endif
1740  fReconParameters.SetValue64bit(current_module.name.c_str(), x);
1741  }
1742 // else {
1743 // Warning("handle_raw_data_event_mfmframe_mesytec_mdpp",
1744 // "Scaler data %s is corrupt : %d words instead of 4",
1745 // current_module.name.c_str(), mdat.data.size());
1746 // }
1747  }
1748  }
1749  },
1750  f.GetRevision()
1751  );
1752  return kTRUE;
1753 }
1754 #endif
1755 #endif
1756 
int Int_t
unsigned int UInt_t
ROOT::R::TRInterface & r
#define d(i)
#define f(i)
#define e(i)
bool Bool_t
unsigned char UChar_t
char Char_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
constexpr Ssiz_t kNPOS
constexpr Bool_t kTRUE
kEnvUser
kEnvChange
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 np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
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
char name[80]
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
Build INDRA geometry from Huguet CAO infos.
void Build(Bool_t withTarget=kTRUE, Bool_t closeGeometry=kTRUE)
virtual const Char_t * GetType() const
Definition: KVBase.h:177
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:216
virtual void SetType(const Char_t *str)
Definition: KVBase.h:173
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *defval)
Definition: KVBase.cpp:1619
virtual Bool_t IsCalled(const Char_t *name) const
Definition: KVBase.h:190
Ionisation chamber detectors of the INDRA multidetector array.
Definition: KVChIo.h:30
virtual Double_t GetPressure() const
Definition: KVChIo.h:49
virtual void SetPressure(Double_t P)
Definition: KVChIo.h:44
CsI(Tl) scintillation detectors of the INDRA multidetector array.
Definition: KVCsI.h:16
void SetPinLaser(Int_t n)
Definition: KVCsI.h:33
CHIO pressure parameters.
virtual void SetPressure(UInt_t n, Float_t pressure)
virtual Float_t GetPressure(UInt_t chio_number)
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Definition: KVDBRecord.cpp:206
Description of an experimental run in database ,,.
Definition: KVDBRun.h:36
virtual Bool_t AddTable(KVDBTable *table)
Definition: KVDataBase.cpp:84
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Definition: KVDataSet.cpp:767
TString GetFullPathToDataSetFile(const Char_t *filename)
Definition: KVDataSet.cpp:1898
Bool_t OpenDataSetFile(const Char_t *filename, std::ifstream &file)
List of hit groups in a multidetector array.
Base class for detector geometry description.
Definition: KVDetector.h:160
void SetNameOfArray(const TString &n)
Definition: KVDetector.h:776
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
KVList * GetAlignedIDTelescopes()
Definition: KVDetector.cpp:737
Double_t GetTheta() const
Definition: KVDetector.h:744
void SetDetecting(Bool_t yes=kTRUE)
Definition: KVDetector.h:677
Double_t GetPhi() const
Definition: KVDetector.h:762
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:326
GANIL VXI/VME 16 bit (maximum) EBYEDAT acquisition parameter.
UShort_t GetData() const
Base class to describe database of an experiment ,,.
Definition: KVExpDB.h:20
const KVNumberList & GetRunList() const
Definition: KVExpDB.h:80
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
Definition: KVExpDB.cpp:87
Bool_t FindCalibFile(const Char_t *type, TString &fullpath, const TString &array_name="") const
Definition: KVExpDB.cpp:487
Reads GANIL acquisition files (EBYEDAT)
const KVSeqCollection & GetFiredDataParameters() const
Path taken by particles through multidetector geometry.
Bool_t ContainsAll(const TCollection *l) const
KVSeqCollection * AccessIDTelescopeList()
KVGeoDetectorNode * GetNodeInFront(const KVGeoDetectorNode *n) const
KVGeoDetectorNode * GetNodeAt(Int_t i) const
KVDetector * GetDetector() const
Int_t GetNDetsInFront() const
Returns number of detectors directly in front of this one.
Import detector array described by ROOT geometry and set up corresponding KVMultiDetArray object.
Definition: KVGeoImport.h:68
void SetLastDetector(KVDetector *)
void PropagateEvent(KVEvent *, TVector3 *TheOrigin=0)
void SetNameCorrespondanceList(const Char_t *)
virtual void Add(KVBase *)
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.
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:84
KVDetector * GetDetector(UInt_t n) const
virtual void SetIDCode(UShort_t c)
const KVList * GetDetectors() const
UInt_t GetSize() const
Base class for detectors of INDRA array.
UInt_t GetRingNumber() const
KVINDRADetector * GetChIo() const
Base class for telescopes in INDRA array.
INDRA multidetector array geometry.
Definition: KVINDRA.h:71
virtual void Build(Int_t run=-1)
Definition: KVINDRA.cpp:385
void InitialiseRawDataReading(KVRawDataReader *)
Definition: KVINDRA.cpp:1610
KVINDRA()
Definition: KVINDRA.cpp:88
virtual KVChIo * GetChIoOf(const Char_t *detname)
Definition: KVINDRA.cpp:570
void handle_ebyedat_raw_data_parameter(const char *param_name, uint16_t val)
Definition: KVINDRA.cpp:801
KVINDRATelescope * BuildTelescope(const Char_t *prefix, Int_t mod)
Definition: KVINDRA.cpp:298
virtual Bool_t handle_raw_data_event_ebyedat(KVGANILDataReader &)
Definition: KVINDRA.cpp:1021
void CreateROOTGeometry()
Definition: KVINDRA.cpp:1370
void SetRawDataFromReconEvent(KVNameValueList &)
Definition: KVINDRA.cpp:1541
void SetPinLasersForCsI()
Definition: KVINDRA.cpp:1162
void copy_fired_parameters_to_recon_param_list()
Definition: KVINDRA.cpp:830
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
Definition: KVINDRA.cpp:1495
virtual void SetGroupsAndIDTelescopes()
Definition: KVINDRA.cpp:552
Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *)
Definition: KVINDRA.cpp:713
KVLayer * GetChIoLayer()
Definition: KVINDRA.cpp:588
virtual void SetROOTGeometry(Bool_t on=kTRUE)
Definition: KVINDRA.cpp:1471
void SetChIoPressures(KVDBRun *)
Definition: KVINDRA.cpp:939
static Char_t SignalTypes[16][3]
Use this static array to translate EBaseIndra_type signal type to a string giving the signal type.
Definition: KVINDRA.h:74
void FillListsOfDetectorsByType()
Fill lists of ChIo, Si, CsI and phoswich.
Definition: KVINDRA.cpp:516
virtual void MakeListOfDetectors()
Overrides KVASMultiDetArray method to add FillListsOfDetectorsByType()
Definition: KVINDRA.cpp:503
void FillTrajectoryIDTelescopeLists()
Definition: KVINDRA.cpp:345
void SetIDCodeForIDTelescope(KVIDTelescope *) const
Set the INDRA-specific general identification code for the given telescope.
Definition: KVINDRA.cpp:1116
void PerformClosedROOTGeometryOperations()
Definition: KVINDRA.cpp:790
void SetReconParametersInEvent(KVReconstructedEvent *) const
If "INDRA.EN" parameter has been set, we use it to set the event number.
Definition: KVINDRA.cpp:1525
void MakeCalibrationTables(KVExpDB *)
Override base method in order to read ChIo pressures for each run.
Definition: KVINDRA.cpp:1595
void SetTrigger(UChar_t trig)
Definition: KVINDRA.cpp:603
Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
Definition: KVINDRA.cpp:1057
KVRing * BuildRing(Int_t number, const Char_t *prefix)
Build ring with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env".
Definition: KVINDRA.cpp:249
virtual KVINDRADetector * GetDetectorByType(UInt_t cou, UInt_t mod, UInt_t type) const
Definition: KVINDRA.cpp:639
void SetNamesOfIDTelescopes() const
Definition: KVINDRA.cpp:736
void ReadChIoPressures(KVExpDB *)
Definition: KVINDRA.cpp:870
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_dets=0)
Definition: KVINDRA.cpp:1290
void SetDetectorParametersForRun(KVDBRun *, const TString &="")
Override base method in order to set ChIo pressures (if defined)
Definition: KVINDRA.cpp:1007
void BuildLayer(const Char_t *name)
Build layer 'name' with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset]....
Definition: KVINDRA.cpp:224
virtual void BuildGeometry()
Definition: KVINDRA.cpp:163
Set of detectors at a similar distance from target (obsolete)
Definition: KVLayer.h:33
Read MFM format acquisition data.
static KVIonRangeTable * GetRangeTable()
Definition: KVMaterial.cpp:166
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
virtual void InitialiseRawDataReading(KVRawDataReader *)
virtual void SetDetectorParametersForRun(KVDBRun *, const TString &="")
virtual void copy_fired_parameters_to_recon_param_list()
virtual Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *list)
virtual void MakeCalibrationTables(KVExpDB *)
virtual void SetRawDataFromReconEvent(KVNameValueList &)
virtual void SetROOTGeometry(Bool_t on=kTRUE)
virtual void SetReconParametersInEvent(KVReconstructedEvent *) const
Copy any parameters in fReconParameters in to the reconstructed event parameter list.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
A generic named parameter storing values of different types.
An event container for KVNucleus objects.
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:126
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
Definition: KVNucleus.cpp:736
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
Bool_t End(void) const
Definition: KVNumberList.h:199
void Begin(void) const
Bool_t IsEmpty() const
Definition: KVNumberList.h:175
Int_t Next(void) const
void SetTheta(Double_t theta)
Definition: KVParticle.h:693
void SetPhi(Double_t phi)
Definition: KVParticle.h:697
virtual void SetAzimuthalMinMax(Double_t min, Double_t max)
Set min and max azimuthal angles and calculate (mean) phi.
Definition: KVPosition.cpp:216
Bool_t ROOTGeo() const
Returns kTRUE if ROOT geometry is used, kFALSE if not.
Definition: KVPosition.cpp:598
void SetDistance(Double_t d)
Definition: KVPosition.h:186
Double_t GetAzimuthalWidth(Double_t phmin=-1., Double_t phimax=-1.) const
Definition: KVPosition.cpp:612
void SetPhi(Double_t p)
Definition: KVPosition.h:182
virtual void SetPolarMinMax(Double_t min, Double_t max)
Set min and max polar angles and calculate (mean) theta.
Definition: KVPosition.cpp:171
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37
Propagate particles through array geometry calculating energy losses.
Abstract base class for reading raw (DAQ) data.
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Ring in INDRA array (obsolete)
Definition: KVRing.h:20
void Add(KVBase *)
Only KVTelescope-derived structures can be placed in a KVRing.
Definition: KVRing.cpp:59
KaliVeda extensions to ROOT collection classes.
virtual void Add(TObject *obj)
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
void SetDepth(UInt_t ndet, Float_t depth)
set the depth of detector number ndet(=1,2,...) in mm.
void Add(KVBase *element)
Definition: KVTelescope.cpp:65
virtual void SetPolarMinMax(Double_t min, Double_t max)
Definition: KVTelescope.h:100
virtual void SetAzimuthalWidth(Double_t aw)
Definition: KVTelescope.h:105
virtual Int_t GetEntries() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
void Reset()
const char * GetName() const override
static TClass * Class()
virtual void SetName(const char *name)
TClass * IsA() const override
virtual TObject * FindObject(const char *name) const
virtual Bool_t InheritsFrom(const char *classname) const
Double_t Atof() const
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(char c, Ssiz_t rep=1)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
unsigned long long ULong64_t
TLine * line
Double_t x[n]
gr SetName("gr")
const Int_t n
TGraphErrors * gr
const long double torr
pressures
Definition: KVUnits.h:78
const long double mbar
Definition: KVUnits.h:81
double dist(AxisAngle const &r1, AxisAngle const &r2)
void Error(const char *location, const char *fmt,...)
void Info(const char *location, const char *fmt,...)
void Fatal(const char *location, const char *fmt,...)
void Warning(const char *location, const char *fmt,...)
Add
TLine l
ClassImp(TPyArg)