KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVINDRA.cpp
Go to the documentation of this file.
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 "Riostream.h"
20 #include "KVINDRA.h"
21 #include "KVMaterial.h"
22 #include "KVDetector.h"
23 #include "KVTelescope.h"
24 #include "KVIDTelescope.h"
25 #include "KVIDSiCsI.h"
26 #include "KVIDINDRACsI.h"
27 #include "KVIDChIoSi.h"
28 #include "KVIDChIoCsI.h"
29 #include "KVIDChIoSi75.h"
30 #include "KVIDSi75SiLi.h"
31 #include "KVIDSiLiCsI.h"
32 #include "KVIDPhoswich.h"
33 #include "KVLayer.h"
34 #include "KVRing.h"
35 #include "KVGroup.h"
36 #include "KVSilicon.h"
37 #include "KVChIo.h"
38 #include "KVCsI.h"
39 #include "KVPhoswich.h"
40 #include "KVNucleus.h"
41 #include "KVDetectorEvent.h"
42 #include "KVINDRAReconEvent.h"
43 #include "TEnv.h"
44 #include "KVFileReader.h"
45 #include "INDRAGeometryBuilder.h"
46 #include <KVASGroup.h>
47 #include "TROOT.h"
48 #include "KVGeoNavigator.h"
49 #include <KVGeoImport.h>
51 #include <KVRawDataReader.h>
52 #ifdef WITH_MFM
53 #include "KVMFMDataFileReader.h"
54 #include "MFMEbyedatFrame.h"
55 #endif
56 
57 using namespace std;
58 
60 
61 //Use this static array to translate EBaseIndra_type
62 //signal type to a string giving the signal type
63 
64 
67  "", //dummy for index=0
68  "GG", "PG", "T",
69  "GG", "PG", "T",
70  "R", "L", "T",
71  "GG", "PG", "T",
72  "GG", "PG", "T"
73 };
74 
75 
76 #define KV_DEBUG 1
77 
79 
83 
85 {
86  //Default constructor
87  //Set up lists of ChIo, Si, CsI, Phoswich
88  fChIo = new KVHashList();
89  fChIo->SetCleanup(kTRUE);
90  fSi = new KVHashList();
91  fSi->SetCleanup(kTRUE);
92  fCsI = new KVHashList();
93  fCsI->SetCleanup(kTRUE);
94  fPhoswich = new KVHashList();
95  fPhoswich->SetCleanup(kTRUE);
96  fTrigger = 0;
97  gIndra = this;
98  fPHDSet = kFALSE;
99  fSelecteur = 0;
100  // unlike a normal multidetector, INDRA does not own its detectors
101  // they are owned by the TELESCOPE structures
102  SetOwnsDetectors(kFALSE);
103 }
104 
105 
106 
110 
111 KVINDRA::~KVINDRA()
112 {
113  //Delets lists of ChIo, Si, etc.
114  //Resets global gIndra pointer.
115 
116  if (fChIo && fChIo->TestBit(kNotDeleted)) {
117  fChIo->Clear();
118  delete fChIo;
119  }
120  fChIo = 0;
121  if (fSi && fSi->TestBit(kNotDeleted)) {
122  fSi->Clear();
123  delete fSi;
124  }
125  fSi = 0;
126  if (fCsI && fCsI->TestBit(kNotDeleted)) {
127  fCsI->Clear();
128  delete fCsI;
129  }
130  fCsI = 0;
131  if (fPhoswich && fPhoswich->TestBit(kNotDeleted)) {
132  fPhoswich->Clear();
133  delete fPhoswich;
134  }
135  fPhoswich = 0;
136  if (fSelecteur) delete fSelecteur;
137  gIndra = 0;
138 }
139 
140 
141 
142 
156 
158 {
159  // Construction of INDRA detector array.
160  //
161  // Uses infos in file
162  // $KVROOT/KVFiles/data/indra_struct.[dataset].env
163  // or
164  // $KVROOT/KVFiles/data/indra_struct.env
165  //
166  // if no dataset-specific file found
167  //
168  // Alternatively, by defining the variable
169  //
170  // [dataset].INDRA.StructureFile: [path to file]
171 
172 
173  TString path = Form("indra-struct.%s.env", fDataSet.Data());
174  TString path2 = GetDataSetEnv(fDataSet, "INDRA.StructureFile", "");
175  if (path2 == "") {
176  if (!SearchKVFile(path.Data(), path2, "data")) {
177  path = "indra-struct.env";
178  SearchKVFile(path.Data(), path2, "data");
179  }
180  }
181  fStrucInfos.ReadFile(path2, kEnvAll);
182 
183  KVString lruns = fStrucInfos.GetValue("AddOnForRuns", "");
184  //test if additional geometrical specification exists
185  if (lruns != "") {
186  lruns.Begin(",");
187  while (!lruns.End()) {
188  KVString sruns = lruns.Next();
189  KVNumberList nlr(sruns.Data());
190  //the current run needs specific geometry
191  if (nlr.Contains(fCurrentRun)) {
192  path = fStrucInfos.GetValue(sruns.Data(), "");
193  Info("BuildGeometry", "Additional geometry for run=%d in file #%s#", fCurrentRun, path.Data());
194  SearchKVFile(path.Data(), path2, "data");
195  if (path2 == "") {
196  Warning("BuildGeometry", "fichier %s inconnu", path.Data());
197  }
198  else {
199  fStrucInfos.ReadFile(path2, kEnvChange);
200  }
201  }
202  }
203  }
204 
205  SetName(fStrucInfos.GetValue("INDRA.Name", ""));
206  SetTitle(fStrucInfos.GetValue("INDRA.Title", ""));
207 
208  KVString layers = fStrucInfos.GetValue("INDRA.Layers", "");
209  layers.Begin(" ");
210  while (!layers.End()) BuildLayer(layers.Next());
211 }
212 
213 
214 
217 
218 void KVINDRA::BuildLayer(const Char_t* name)
219 {
220  // Build layer 'name' with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
221 
222  KVLayer* layer = new KVLayer;
223  Int_t number = fStrucInfos.GetValue(Form("INDRA.Layer.%s.Number", name), 0);
224  layer->SetName(name);
225  layer->SetNumber(number);
226  Add(layer);
227  Info("BuildLayer", "Building layer %d:%s", number, name);
228  KVNumberList rings = fStrucInfos.GetValue(Form("INDRA.Layer.%s.Rings", name), "");
229  rings.Begin();
230  while (!rings.End()) {
231  Int_t ring_num = rings.Next();
232  TString prefix = Form("INDRA.Layer.%s.Ring.%d", name, ring_num);
233  KVRing* ring = BuildRing(ring_num, prefix);
234  layer->Add(ring);
235  }
236 }
237 
238 
239 
242 
243 KVRing* KVINDRA::BuildRing(Int_t number, const Char_t* prefix)
244 {
245  // Build ring with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
246 
247  KVRing* ring = new KVRing;
248  Info("BuildRing", "Building ring %d (%s)", number, prefix);
249 
250  Double_t thmin = fStrucInfos.GetValue(Form("%s.ThMin", prefix), 0.0);
251  Double_t thmax = fStrucInfos.GetValue(Form("%s.ThMax", prefix), 0.0);
252  Double_t phi_0 = fStrucInfos.GetValue(Form("%s.Phi0", prefix), 0.0);
253  Int_t ntel = fStrucInfos.GetValue(Form("%s.Ntel", prefix), 0);
254  Int_t step = fStrucInfos.GetValue(Form("%s.Step", prefix), 1);
255  Int_t num_first = fStrucInfos.GetValue(Form("%s.Nfirst", prefix), 1);
256  Double_t dphi = fStrucInfos.GetValue(Form("%s.Dphi", prefix), -1.0);
257  KVNumberList absent = fStrucInfos.GetValue(Form("%s.Absent", prefix), "");
258 
259  ring->SetPolarMinMax(thmin, thmax);
260  KVINDRATelescope* kvt = BuildTelescope(prefix, num_first);
261  Double_t phi_min = phi_0 - 0.5 * (kvt->GetAzimuthalWidth());
262  phi_min = (phi_min < 0. ? phi_min + 360. : phi_min);
263  dphi = (dphi < 0. ? 360. / ntel : dphi);
264  Double_t phi_max =
265  phi_0 + ((ntel - 1.0) * dphi) + 0.5 * (kvt->GetAzimuthalWidth());
266  phi_max = (phi_max > 360. ? phi_max - 360. : phi_max);
267  ring->SetAzimuthalMinMax(phi_min, phi_max);
268  ring->SetNumber(number);
269 
270  Double_t phi = phi_0;
271  UInt_t counter = num_first;
272  for (int i = 0; i < ntel; i++) {
273  kvt->SetPolarMinMax(thmin, thmax);
274  kvt->SetPhi(phi);
275  phi = (phi + dphi > 360. ? (phi + dphi - 360.) : (phi + dphi));
276  kvt->SetNumber(counter);
277  if (!absent.Contains(counter)) ring->Add(kvt);
278  else delete kvt;
279  counter += step;
280  if (i + 1 < ntel) kvt = BuildTelescope(prefix, counter);
281  }
282  ring->SetName(Form("RING_%d", number));
283  return ring;
284 }
285 
286 
287 
291 
293 {
294  // Build telescope from infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
295 
296  //Info("BuildTelescope", "Building telescope %s",name);
298  KVString telescopes = fStrucInfos.GetValue(Form("%s.Telescope", prefix), "");
299  telescopes.Begin(" ");
300  KVString name;
301  while (!telescopes.End()) {
302  name = telescopes.Next();
303  KVNumberList mods = fStrucInfos.GetValue(Form("%s.Telescope.%s.Modules", prefix, name.Data()), "1-100");
304  if (mods.Contains(module)) break;
305  }
306 
307  KVString detectors = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Detectors", name.Data()), "");
308  Double_t aziwidth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.AziWidth", name.Data()), 1.0);
309  Double_t dist = fStrucInfos.GetValue(Form("%s.Dist", prefix), 0.0);
310  kvt->SetDistance(dist);
311  detectors.Begin(" ");
312  Int_t idet = 1;
313  while (!detectors.End()) {
314  KVString detector = detectors.Next();
315  detector.Begin("()");
316  KVString dettype = detector.Next();
317  Double_t detthick = detector.Next().Atof();
318  KVDetector* det = KVDetector::MakeDetector(Form("%s.%s", fDataSet.Data(), dettype.Data()), detthick);
319  kvt->Add(det);
320  Double_t depth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Depth.%s", name.Data(), dettype.Data()), 0.);
321  kvt->SetDepth(idet, depth);
322  idet++;
323  }
324  kvt->SetAzimuthalWidth(aziwidth);
325  return kvt;
326 }
327 
328 
329 
338 
340 {
341  // Kludge to make INDRA ROOT geometry work like any other
342  // Normally ID telescopes are deduced from successive detectors on the different trajectories
343  // Each trajectory then possesses its list of ID telescopes
344  // These lists are then used when reconstruction trajectories are calculated
345  //
346  // When INDRA ROOT geometry is used, trajectory lists need to be filled
347  // by hand before reconstruction trajectories are calculated
348 
349  TIter it_traj(GetTrajectories());
350  KVGeoDNTrajectory* tr;
351  while ((tr = (KVGeoDNTrajectory*)it_traj())) {
352  // get first detector on trajectory
353  KVDetector* det = tr->GetNodeAt(0)->GetDetector();
354  // list of 'aligned' id telescopes
355  TIter it_idt(det->GetAlignedIDTelescopes());
356  KVIDTelescope* idt;
357  while ((idt = (KVIDTelescope*)it_idt())) {
358  if (tr->ContainsAll(idt->GetDetectors())) { // all detectors on trajectory
359  if (idt->GetDetectors()->GetEntries() > 1) {
360  // make sure dE and E detector are consecutive on trajectory
361  // i.e. dE has to be immediately in front of E on the trajectory
362  if (tr->GetNodeInFront(idt->GetDetector(2)->GetNode()) == idt->GetDetector(1)->GetNode())
363  tr->AccessIDTelescopeList()->Add(idt);
364  }
365  else
366  tr->AccessIDTelescopeList()->Add(idt);//single-detector telescope
367  }
368  }
369  }
370 }
371 
372 
373 
374 
379 
381 {
382  // Overrides KVASMultiDetArray::Build
383  // Correspondance between CsI detectors and pin lasers is set up if known.
384  //Correspondance between Si and ChIo detectors and nunmber of the QDC is made
385 
386  if (run != -1) {
387  fCurrentRun = run;
388  }
389  BuildGeometry();
390 
391  MakeListOfDetectors();
392 
393  SetGroupsAndIDTelescopes();
394 
395  SetNamesOfIDTelescopes();
396 
397  SetACQParams();
398 
399  SetDetectorThicknesses();
400 
401  SetIdentifications();
402 
403  //set flag to say Build() was called
404  SetBit(kIsBuilt);
405 
406  SetPinLasersForCsI();
407 
408  LinkToCodeurs();
409 }
410 
411 
412 
443 
445 {
446  // Overrides KVASMultiDetArray::SetArrayACQParams() in order to
447  // add the following acquisition parameters which are not associated to a detector:
448  //
449  // STAT_EVE
450  // R_DEC
451  // CONFIG
452  // PILA_01_PG
453  // PILA_01_GG
454  // PILA_02_PG
455  // PILA_02_GG
456  // PILA_03_PG
457  // PILA_03_GG
458  // PILA_04_PG
459  // PILA_04_GG
460  // PILA_05_PG
461  // PILA_05_GG
462  // PILA_06_PG
463  // PILA_06_GG
464  // PILA_07_PG
465  // PILA_07_GG
466  // PILA_08_PG
467  // PILA_08_GG
468  // SI_PIN1_PG
469  // SI_PIN1_GG
470  // SI_PIN2_PG
471  // SI_PIN2_GG
472  //
473  // We also create and initialize the KVINDRATriggerInfo object (fSelecteur) used to read
474  // the status of the DAQ trigger event by event (access through GetTriggerInfo()).
475 
476  KVACQParam* ste = new KVACQParam("STAT_EVE");
477  AddArrayACQParam(ste);
478  KVACQParam* dec = new KVACQParam("R_DEC");
479  AddArrayACQParam(dec);
480  KVACQParam* conf = new KVACQParam("CONFIG");
481  AddArrayACQParam(conf);
482  fSelecteur = new KVINDRATriggerInfo;
483  fSelecteur->SetSTAT_EVE_PAR(ste);
484  fSelecteur->SetR_DEC_PAR(dec);
485  fSelecteur->SetVXCONFIG_PAR(conf);
486 
487  AddArrayACQParam(new KVACQParam("PILA_01_PG"));
488  AddArrayACQParam(new KVACQParam("PILA_01_GG"));
489  AddArrayACQParam(new KVACQParam("PILA_02_PG"));
490  AddArrayACQParam(new KVACQParam("PILA_02_GG"));
491  AddArrayACQParam(new KVACQParam("PILA_03_PG"));
492  AddArrayACQParam(new KVACQParam("PILA_03_GG"));
493  AddArrayACQParam(new KVACQParam("PILA_04_PG"));
494  AddArrayACQParam(new KVACQParam("PILA_04_GG"));
495  AddArrayACQParam(new KVACQParam("PILA_05_PG"));
496  AddArrayACQParam(new KVACQParam("PILA_05_GG"));
497  AddArrayACQParam(new KVACQParam("PILA_06_PG"));
498  AddArrayACQParam(new KVACQParam("PILA_06_GG"));
499  AddArrayACQParam(new KVACQParam("PILA_07_PG"));
500  AddArrayACQParam(new KVACQParam("PILA_07_GG"));
501  AddArrayACQParam(new KVACQParam("PILA_08_PG"));
502  AddArrayACQParam(new KVACQParam("PILA_08_GG"));
503  AddArrayACQParam(new KVACQParam("SI_PIN1_PG"));
504  AddArrayACQParam(new KVACQParam("SI_PIN1_GG"));
505  AddArrayACQParam(new KVACQParam("SI_PIN2_PG"));
506  AddArrayACQParam(new KVACQParam("SI_PIN2_GG"));
507 }
508 
509 
510 
511 
514 
516 {
517  //Overrides KVASMultiDetArray method to add FillListsOfDetectorsByType()
518 
520  FillListsOfDetectorsByType();
521 }
522 
523 
524 
527 
529 {
530  //Fill lists of ChIo, Si, CsI and phoswich
531 
532  fChIo->Clear();
533  fSi->Clear();
534  fCsI->Clear();
535  fPhoswich->Clear();
536  TIter next_det(GetDetectors());
537  KVDetector* kvd;
538  while ((kvd = (KVDetector*) next_det())) {
539  kvd->SetNameOfArray("INDRA");
540  if (kvd->InheritsFrom("KVChIo")) {
541  fChIo->Add(kvd);
542  }
543  if (kvd->InheritsFrom("KVSilicon")) {
544  fSi->Add(kvd);
545  }
546  if (kvd->InheritsFrom("KVCsI")) {
547  fCsI->Add(kvd);
548  }
549  if (kvd->InheritsFrom("KVPhoswich")) {
550  fPhoswich->Add(kvd);
551  }
552  }
553 }
554 
555 
556 
557 
563 
565 {
566  //Find groups of telescopes in angular alignment placed on different layers.
567  //List is in fGroups.
568  //Also creates all ID telescopes in array and stores them in fIDTelescopes.
569  //Any previous groups/idtelescopes are deleted beforehand.
570  CalculateGroupsFromGeometry();
571 
572  //now read list of groups and create list of ID telescopes
573  CreateIDTelescopesInGroups();
574 }
575 
576 
577 
581 
583 {
584 
585  //Returns a pointer to the Ionisation Chamber placed directly in front of the
586  //detector "detname". If no ChIo is present, a null pointer is returned.
587 
588  KVINDRADetector* kvd;
589  kvd = dynamic_cast<KVINDRADetector*>(GetDetector(detname));
590  return (kvd ? (KVChIo*)kvd->GetChIo() : NULL);
591 }
592 
593 
594 
595 
599 
601 {
602  //Return pointer to layer in INDRA structure corresponding to ionisation
603  //chambers.
604 
605  return (KVLayer*)GetStructure("LAYER", "CHIO");
606 }
607 
608 
609 
610 
614 
616 {
617  // Define multiplicity trigger used for acquisition and filter.
618  // Events with multipicity >= trig are OK.
619 
620  fTrigger = trig;
621 }
622 
623 
624 
650 
652 {
653  //Find a detector based on the old BaseIndra type definitions:
654  //
655 //enum EBaseIndra_type {
656 // ChIo_GG=1,
657 // ChIo_PG,//=2
658 // ChIo_T,//=3
659 // Si_GG,//=4
660 // Si_PG,//=5
661 // Si_T,//=6
662 // CsI_R,//=7
663 // CsI_L,//=8
664 // CsI_T,//=9
665 // Si75_GG,//=10
666 // Si75_PG,//=11
667 // Si75_T,//=12
668 // SiLi_GG,//=13
669 // SiLi_PG,//=14
670 // SiLi_T//=15
671 //};
672 //enum EBaseIndra_typePhos {
673 // Phos_R=1,
674 // Phos_L,//=2
675 // Phos_T,//=3
676 //};
677 
678  KVINDRADetector* det = 0;
679 
680  char nom_det[20];
681  if (cou == 1) {
682  if (type >= Phos_R && type <= Phos_T) {
683  sprintf(nom_det, "PHOS_%02d", mod);
684  det =
685  (KVINDRADetector*) GetListOfPhoswich()->FindObjectByName(nom_det);
686  }
687  }
688  if (det)
689  return det;
690  else if (type >= ChIo_GG && type <= ChIo_T) {
691  sprintf(nom_det, "CI_%02d%02d", cou, mod);
692  det = (KVINDRADetector*) GetListOfChIo()->FindObject(nom_det);
693  return det;
694  }
695  else if (type >= Si_GG && type <= Si_T) {
696  sprintf(nom_det, "SI_%02d%02d", cou, mod);
697  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
698  return det;
699  }
700  else if (type >= SiLi_GG && type <= SiLi_T) {
701  sprintf(nom_det, "SILI_%02d", cou);
702  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
703  return det;
704  }
705  else if (type >= Si75_GG && type <= Si75_T) {
706  sprintf(nom_det, "SI75_%02d", cou);
707  det = (KVINDRADetector*) GetListOfSi()->FindObject(nom_det);
708  return det;
709  }
710  else if (type >= CsI_R && type <= CsI_T) {
711  sprintf(nom_det, "CSI_%02d%02d", cou, mod);
712  det = (KVINDRADetector*) GetListOfCsI()->FindObject(nom_det);
713  return det;
714  }
715  return 0;
716 }
717 
718 
719 
720 
724 
726 {
727  //Override KVASMultiDetArray method for special case of "etalon" modules:
728  //we need to add ChIo-CsI identification telescope by hand
729 
731 
732  if (de->InheritsFrom("KVSiLi") && e->InheritsFrom("KVCsI")) {
733  KVChIo* chio = (KVChIo*)((KVINDRADetector*)e)->GetChIo();
734  if (chio) {
735  n += KVASMultiDetArray::GetIDTelescopes(chio, e, idtels);
736  }
737  }
738  return n;
739 }
740 
741 
742 
747 
749 {
750  // Change default names of ID telescopes to INDRA standard
751  //
752  // This method also sets the types of the ID telescopes
753 
754  TIter it(GetListOfIDTelescopes());
755  KVIDTelescope* idt;
756  const TString etalon_numbers[] = {"1002", "1102", "1202", "1304", "1403", "1503", "1602", "1702"};
757  while ((idt = (KVIDTelescope*)it())) {
758  KVString N = idt->GetDetector(1)->GetName();
759  N.Begin("_");
760  KVString de_type = N.Next();
761  KVString de_number = N.Next();
762  if (idt->GetSize() == 1) {
763  // PHOS_R_L_MM or CSI_R_L_RRMM
764  idt->SetName(Form("%s_R_L_%s", de_type.Data(), de_number.Data()));
765  idt->SetType(Form("%s_R_L", de_type.Data()));
766  }
767  else {
768  N = idt->GetDetector(2)->GetName();
769  N.Begin("_");
770  KVString e_type = N.Next();
771  KVString e_number = N.Next();
772  if (e_type == "SILI" || e_type == "SI75") {
773  e_number = etalon_numbers[dynamic_cast<KVINDRADetector*>(idt->GetDetector(2))->GetRingNumber() - 10];
774  }
775  idt->SetName(Form("%s_%s_%s", de_type.Data(), e_type.Data(), e_number.Data()));
776  idt->SetType(Form("%s_%s", de_type.Data(), e_type.Data()));
777  }
778  }
779  // changed names of all id telescope objects in hashlist: must rehash
780  dynamic_cast<KVHashList*>(GetListOfIDTelescopes())->Rehash();
781 }
782 
783 
784 
788 
790 {
791  // Finalise the ROOT geometry description by performing operations which can
792  // only be done once the geometry is closed
793  CreateROOTGeometry();
794 }
795 
796 
797 #ifdef WITH_MFM
798 
806 
808 {
809  // Override base method to retrieve CENTRUM timestamp from data if present.
810  // It will be added to fReconParameters as a 64-bit value "INDRA.TS" (if != 0)
811  // Event number is retrieved and stored as "INDRA.EN" (if != 0)
812  // Any parameter which appears as [name] and [name]_UP is an unsigned 32-bit value
813  // split into two 16-bit words. We replace the two parameters with a 64-bit
814  // value (to hold correctly all unsigned 32-bit values) with [name].
815 
817  ULong64_t ts = f.GetCENTRUMTimestamp();
818  if (ts != 0) fReconParameters.SetValue64bit("INDRA.TS", ts);
819  ULong64_t en = f.GetEventNumber();
820  if (en != 0) fReconParameters.SetValue64bit("INDRA.EN", en);
821  int npars = fReconParameters.GetNpar();
822  std::vector<TString> names;
823  for (int i = 0; i < npars; ++i) {
824  TString name = fReconParameters.GetParameter(i)->GetName();
825  if (name.EndsWith("_UP")) names.push_back(name);
826  }
827  if (names.size()) {
828  for (std::vector<TString>::iterator it = names.begin(); it != names.end(); ++it) {
829  TString name = (*it);
830  name.Remove(name.Index("_UP"), 3);
831  TString name_up = (*it);
832  ULong64_t par_up = fReconParameters.GetIntValue(name_up);
833  ULong64_t par = fReconParameters.GetIntValue(name);
834  UInt_t par32 = (par_up << 16) + par;
835  fReconParameters.RemoveParameter(name_up);
836  fReconParameters.RemoveParameter(name);
837  fReconParameters.SetValue64bit(name, par32);
838  }
839  }
840  return kTRUE;
841 }
842 
843 #endif
844 
845 
848 
850 {
851  // Set the INDRA-specific general identification code for the given telescope
852 
853  if (idt->InheritsFrom(KVIDPhoswich::Class())) idt->SetIDCode(IDCodes::ID_PHOSWICH);
854  else if (idt->InheritsFrom(KVIDINDRACsI::Class())) idt->SetIDCode(IDCodes::ID_CSI_PSA);
855  else if (idt->InheritsFrom(KVIDSiCsI::Class())) idt->SetIDCode(IDCodes::ID_SI_CSI);
856  else if (idt->InheritsFrom(KVIDChIoSi::Class())) idt->SetIDCode(IDCodes::ID_CI_SI);
857  else if (idt->InheritsFrom(KVIDChIoCsI::Class())) idt->SetIDCode(IDCodes::ID_CI_CSI);
858  else if (idt->InheritsFrom(KVIDChIoSi75::Class())) idt->SetIDCode(IDCodes::ID_CI_SI75);
859  else if (idt->InheritsFrom(KVIDSi75SiLi::Class())) idt->SetIDCode(IDCodes::ID_SI75_SILI);
860  else if (idt->InheritsFrom(KVIDChIoSi75::Class())) idt->SetIDCode(IDCodes::ID_CI_SI75);
861  else {
862  Error("SetIDCodeForIDTelescope", "Request for telescope name=%s of unknown class=%s",
863  idt->GetName(), idt->IsA()->GetName());
864  }
865 }
866 
867 
868 
869 
895 
897 {
898  // Sets the KVCsI::fPinLaser member of each CsI detector with the number of the
899  // pin laser associated for the stability control of these detectors.
900  //
901  // We look for a file with the following format:
902  //
903  // CSI_0101 1
904  // CSI_0102 1
905  // CSI_0103 1
906  // CSI_0104 1
907  // etc.
908  //
909  // i.e. 'name of CsI detector' 'number of pin laser (1-8)'
910  // Comment lines must begin with '#'
911  //
912  // The default name of this file is defined in .kvrootrc by
913  //
914  // INDRADB.CsIPinCorr: CsI_PILA.dat
915  //
916  // Dataset-specific version can be specified:
917  //
918  // INDRA_e999.INDRADB.CsIPinCorr: CorrCsIPin_2054.dat
919  //
920  // This file should be in the directory corresponding to the current dataset,
921  // i.e. in $KVROOT/KVFiles/name_of_dataset
922 
923  ifstream pila_file;
924  if (gDataSet->OpenDataSetFile(gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""), pila_file)) {
925 
926  Info("SetPinLasersForCsI", "Setting correspondance CsI-PinLaser using file %s.",
927  gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""));
928  // read file, set correspondance
929  KVString line;
930  line.ReadLine(pila_file);
931  while (pila_file.good()) {
932  if (!line.BeginsWith("#")) {
933  line.Begin(" ");
934  KVString detname = line.Next(kTRUE);
935  KVCsI* det = (KVCsI*)GetDetector(detname.Data());
936  Int_t pila = line.Next(kTRUE).Atoi();
937  if (det) {
938  det->SetPinLaser(pila);
939  }
940  }
941  line.ReadLine(pila_file);
942  }
943  pila_file.close();
944  }
945  else {
946  Info("SetPinLasersForCsI", "File %s not found. Correspondance Csi-PinLaser is unknown.",
947  gDataSet->GetDataSetEnv("CsIPinCorr", ""));
948  }
949 }
950 
951 
952 
953 
963 
965 {
966 
967  // Link detectors with electronic modules
968  // for the moment only QDC for Si and ChIo are implemented
969  // This information is accessible via KVINDRADetector::GetNumeroCodeur()
970  // To be active one has to put in the dataset directory
971  // a file name Codeurs.dat containing the name of the file for the concerned type
972  // of electronic module
973  // for example see INDRA_e613 dataset
974  // [dataset name].INDRADB.Codeurs: ...
975 
976 
977  KVFileReader flist;
978  TString fp;
979  if (!KVBase::SearchKVFile(gDataSet->GetDataSetEnv("INDRADB.Codeurs", ""), fp, gDataSet->GetName())) {
980  Warning("LinkToCodeurs", "Fichier %s, inconnu au bataillon", gDataSet->GetDataSetEnv("INDRADB.Codeurs", ""));
981  return;
982  }
983 
984  if (!flist.OpenFileToRead(fp.Data())) {
985  //Error("ReadGainList","Error opening file named %s",fp.Data());
986  return;
987  }
988  Info("LinkToCodeurs()", "Reading correspondance Codeur-Detecteur ...");
989 
990  TEnv* env = 0;
991  KVINDRADetector* idet = 0;
992  while (flist.IsOK()) {
993  flist.ReadLine(NULL);
994  KVString file = flist.GetCurrentLine();
995  if (file != "") {
996  if (KVBase::SearchKVFile(file.Data(), fp, gDataSet->GetName())) {
997  env = new TEnv();
998  env->ReadFile(fp.Data(), kEnvAll);
999  TEnvRec* rec = 0;
1000  TObjArray* toks = 0;
1001  TIter it(env->GetTable());
1002  while ((rec = (TEnvRec*)it.Next())) {
1003  if (!strcmp(rec->GetName(), "type")) {
1004  Info("LinkToCodeurs", "Module type %s", rec->GetValue());
1005  }
1006  else {
1007  toks = TString(rec->GetValue()).Tokenize(",");
1008  for (Int_t ii = 0; ii < toks->GetEntries(); ii += 1) {
1009  idet = (KVINDRADetector*)gIndra->GetDetector(((TObjString*)toks->At(ii))->GetString().Data());
1010  if (idet)
1011  idet->SetNumeroCodeur(TString(rec->GetName()).Atoi());
1012  }
1013  delete toks;
1014  }
1015  }
1016  delete env;
1017  }
1018  }
1019  }
1020 
1021  flist.CloseFile();
1022 
1023 
1024 }
1025 
1026 
1027 
1028 
1037 
1038 TGraph* KVINDRA::GetPedestals(const Char_t* det_signal, const Char_t* det_type, Int_t ring_number, Int_t
1039  run_number)
1040 {
1041 
1042  //Renvoie sous forme de TGraph (en fonction du numero de module)
1043  //les piedestaux du signal (det_signal) asssocies aux detecteurs de type (det_type)
1044  //qui sont presents dans la couronne ring_number pour un numero de run donne (si run_number==-1)
1045  //on suppose que gIndra->SetParameters(xxx) a ete fait en amont
1046  //L'utilisateur doit effacer ce TGraph tout seul comme un grand apres usage
1047  //Une recherche sur l existence ou non du graph permet d eviter des boucles inutiles
1048  //Si l appel est reitere
1049 
1050  if (run_number != -1 || run_number != Int_t(GetCurrentRunNumber()))
1051  SetParameters(run_number);
1052 
1053  KVSeqCollection* sltype = 0;
1054  KVSeqCollection* slring = 0;
1055  TGraph* gr_ped = 0;
1056 
1057  KVString sgraph;
1058  sgraph.Form("KVPed_%s_%s_%d_%d", det_signal, det_type, ring_number, GetCurrentRunNumber());
1059  if ((gr_ped = (TGraph*)gROOT->FindObject(sgraph.Data()))) return gr_ped;
1060 
1061  if ((sltype = GetDetectors()->GetSubListWithMethod(det_type, "GetType"))) {
1062  KVString sring;
1063  sring.Form("%d", ring_number);
1064  if ((slring = sltype->GetSubListWithMethod(sring, "GetRingNumber"))) {
1065  gr_ped = new TGraph();
1066  gr_ped->SetName(sgraph.Data());
1067  for (Int_t mm = 0; mm < slring->GetEntries(); mm += 1) {
1068  gr_ped->SetPoint(gr_ped->GetN(),
1069  ((KVINDRADetector*)slring->At(mm))->GetModuleNumber(),
1070  ((KVDetector*)slring->At(mm))->GetPedestal(det_signal));
1071 
1072  }
1073  delete slring;
1074  return gr_ped;
1075  }
1076  delete sltype;
1077  }
1078  return 0;
1079 
1080 }
1081 
1082 
1083 
1084 
1090 
1091 void KVINDRA::GetDetectorEvent(KVDetectorEvent* detev, const TSeqCollection* fired_params)
1092 {
1093  // Overrides KVASMultiDetArray::GetDetectorEvent.
1094  // If the list of fired acquisition parameters is given (meaning we are reading raw data)
1095  // then we check that what we have read is in fact an INDRA event
1096  // (see KVINDRATriggerInfo::IsINDRAEvent()) : if not, we do not try to find the hit groups.
1097 
1098  if (((fired_params && fired_params->GetEntries()) || fFiredACQParams.GetEntries())
1099  && !GetTriggerInfo()->IsINDRAEvent()) return;
1100  KVASMultiDetArray::GetDetectorEvent(detev, fired_params);
1101 }
1102 
1103 
1104 
1105 
1121 
1123 {
1124  // Sets the parameters for linear conversion of silicon & ChIo coder values
1125  // between GG and PG, using the following formula:
1126  //
1127  // PG = alpha + beta*(GG - GG_0) + PG_0
1128  //
1129  // where GG_0 and PG_0 are respectively GG and PG pedestals
1130  //
1131  // We look for the file whose name is given by the .kvrootrc variable
1132  // [dataset].INDRADB.GGtoPGFactors:
1133  // or by default
1134  // INDRADB.GGtoPGFactors:
1135  // and expect to find in it a line for each detector of the form:
1136  // Det_Name alpha beta
1137  // Comments in the file can be written on lines beginning with the character '#'
1138 
1139  ifstream datfile;
1140  if (!gDataSet->OpenDataSetFile(gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""), datfile)) {
1141 
1142  Info("SetGGtoPGConversionFactors", "Cannot open file with parameters for conversion (%s).",
1143  gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""));
1144  return;
1145  }
1146  else {
1147  Info("SetGGtoPGConversionFactors", "Reading parameters from file %s",
1148  gDataSet->GetDataSetEnv("INDRADB.GGtoPGFactors", ""));
1149 
1150  Char_t detname[30];
1151  Double_t a, b;
1152  TString aline;
1153  aline.ReadLine(datfile);
1154  while (datfile.good()) {
1155 
1156  if (aline[0] != '#') { //skip comments
1157 
1158  sscanf(aline.Data(), "%s %lf %lf", detname, &a, &b);
1159  KVINDRADetector* det = (KVINDRADetector*)GetDetector(detname);
1160  if (!det) {
1161  //no detector found with cou, mod and type
1162  Error("SetGGtoPGConversionFactors", "Unknown detector : %s", detname);
1163  }
1164  else {
1166  //Info("SetGGtoPGConversionFactors", "%s : PG = %f + %f * GG", detname, a, b);
1167  }
1168  }
1169  aline.ReadLine(datfile);
1170  } //while( datfile.good()
1171  datfile.close();
1172  }
1173 }
1174 
1175 
1176 
1177 
1188 
1190 {
1191  // Overrides KVASMultiDetArray::CreateGeoManager in order to use INDRAGeometryBuilder
1192  // which builds the TGeo representation of INDRA using the Y. Huguet CAO data.
1193  //
1194  // The optional arguments (dx,dy,dz) are the half-lengths in centimetres of the "world"/"top" volume
1195  // into which all the detectors of the array are placed. This should be big enough so that all detectors
1196  // fit in. The default values of 500 give a "world" which is a cube 1000cmx1000cmx1000cm (with sides
1197  // going from -500cm to +500cm on each axis).
1198  //
1199  // If closegeo=kFALSE we leave the geometry open for other structures to be added.
1200 
1201  if (!IsBuilt()) {
1202  Error("CreateROOTGeometry", "gIndra has to be build first");
1203  return;
1204  }
1205  if (!GetNavigator()) {
1206  //Error("CreateROOTGeometry","No existing navigator"); return;
1208  GetNavigator()->SetNameCorrespondanceList("INDRA.names");
1209  }
1210 
1211  // set up shape & matrix pointers in detectors
1212  Info("CreateROOTGeometry", "Scanning geometry shapes and matrices...");
1214  gimp.SetNameCorrespondanceList("INDRA.names");
1215  KVEvent evt;
1216  KVNucleus* nuc = evt.AddParticle();
1217  nuc->SetZAandE(1, 1, 1);
1218  KVINDRADetector* det;
1219  TIter next(GetDetectors());
1220  Int_t nrootgeo = 0;
1221  while ((det = (KVINDRADetector*)next())) {
1222  nuc->SetTheta(det->GetTheta());
1223  nuc->SetPhi(det->GetPhi());
1224  gimp.SetLastDetector(0);
1225  gimp.PropagateEvent(&evt);
1226  if (!(det->ROOTGeo())) {
1227  Info("CreateROOTGeometry", "Volume checking for %s", det->GetName());
1228  Double_t theta0 = det->GetTheta();
1229  Double_t phi0 = det->GetPhi();
1230  for (Double_t TH = theta0 - 0.5; TH <= theta0 + 0.5; TH += 0.1) {
1231  for (Double_t PH = phi0 - 10; PH <= phi0 + 10; PH += 1) {
1232  nuc->SetTheta(TH);
1233  nuc->SetPhi(PH);
1234  gimp.SetLastDetector(0);
1235  gimp.PropagateEvent(&evt);
1236  if (det->ROOTGeo()) break;
1237  }
1238  if (det->ROOTGeo()) break;
1239  }
1240  }
1241  if (!(det->ROOTGeo())) {
1242  Info("CreateROOTGeometry", "Volume checking failed for : %s", det->GetName());
1243  }
1244  // check etalon trajectories (if etalons are present)
1245  if (det->ROOTGeo() && det->GetRingNumber() > 9) {
1246  if (GetDetector(Form("SI75_%d", det->GetRingNumber())) || GetDetector(Form("SILI_%d", det->GetRingNumber()))) {
1247  if ((det->IsCalled("CSI_1002") || det->IsCalled("CSI_1102")
1248  || det->IsCalled("CSI_1202") || det->IsCalled("CSI_1304")
1249  || det->IsCalled("CSI_1403") || det->IsCalled("CSI_1503")
1250  || det->IsCalled("CSI_1602") || det->IsCalled("CSI_1702"))
1251  && det->GetNode()->GetNDetsInFront() < 2) {
1252  Info("CreateROOTGeometry", "Trajectory checking for %s", det->GetName());
1253  Double_t theta0 = det->GetTheta();
1254  Double_t phi0 = det->GetPhi();
1255  for (Double_t TH = theta0 - 0.5; TH <= theta0 + 0.5; TH += 0.1) {
1256  for (Double_t PH = phi0 - 10; PH <= phi0 + 10; PH += 1) {
1257  nuc->SetTheta(TH);
1258  nuc->SetPhi(PH);
1259  gimp.SetLastDetector(0);
1260  gimp.PropagateEvent(&evt);
1261  if (det->GetNode()->GetNDetsInFront() == 2) break;
1262  }
1263  if (det->GetNode()->GetNDetsInFront() == 2) break;
1264  }
1265  }
1266  }
1267  }
1268  nrootgeo += (det->ROOTGeo());
1269  }
1270 
1271  Info("CreateROOTGeometry", "ROOT geometry initialised for %d/%d detectors", nrootgeo, GetDetectors()->GetEntries());
1272 
1273  // Set up trajectories
1274  TIter it(GetDetectors());
1275  KVDetector* d;
1276  while ((d = (KVDetector*)it())) d->GetNode()->RehashLists();// make sure detector nodes are correct
1277  AssociateTrajectoriesAndNodes();
1278  DeduceGroupsFromTrajectories();
1279  FillTrajectoryIDTelescopeLists();
1280  CalculateReconstructionTrajectories();
1281  GetNavigator()->AbsorbDetectorPaths(&gimp);
1282 }
1283 
1284 
1285 
1289 
1291 {
1292  // Override base class method
1293  // If ROOT geometry is requested but has not been built, we create it
1294 
1295  if (on) {
1296  CreateGeoManager();
1298  igb.Build(kFALSE, fCloseGeometryNow);
1299  if (fCloseGeometryNow) PerformClosedROOTGeometryOperations();
1300  }
1301  else {
1303  }
1304 }
1305 
1306 
1307 
1311 
1313 {
1314  // Set minimum OK multiplicity for (reconstructed) event
1315  // This is the multiplicity trigger used for the current run (if known)
1316 
1317  if (GetTrigger() > 0) e->SetMinimumOKMultiplicity(GetTrigger());
1318 }
1319 
1320 
1321 
1327 
1329 {
1330  // Special INDRA group reconstructors:
1331  // KVINDRAForwardGroupReconstructor rings 1-9
1332  // KVINDRABackwardGroupReconstructor rings 10-17
1333  // KVINDRAEtalonGroupReconstructor for groups with etalon telescopes
1334 
1335  KVGroupReconstructor* gr(nullptr);
1336  if (GetGroup(g->GetName())) { // make sure group belongs to us
1337  // etalons ?
1338  if (g->GetDetectorByType("SILI") || g->GetDetectorByType("SI75"))
1339  gr = KVGroupReconstructor::Factory("INDRA.etalon");
1340  else {
1341  KVINDRADetector* id = (KVINDRADetector*)g->GetDetectors()->First();
1342  if (id->GetRingNumber() < 10) gr = KVGroupReconstructor::Factory("INDRA.forward");
1343  else gr = KVGroupReconstructor::Factory("INDRA.backward");
1344  }
1345  }
1346  return gr;
1347 }
1348 
1349 
1350 
1353 
1355 {
1356  // If "INDRA.EN" parameter has been set, we use it to set the event number
1357 
1359  if (GetReconParameters().HasValue64bit("INDRA.EN")) e->SetNumber(GetReconParameters().GetValue64bit("INDRA.EN"));
1360 }
1361 
1362 
1363 
1364 
int Int_t
unsigned int UInt_t
KVDataSet * gDataSet
Definition: KVDataSet.cpp:30
KVINDRA * gIndra
Definition: KVINDRA.cpp:78
@ SiLi_GG
Definition: KVINDRA.h:55
@ Si75_GG
Definition: KVINDRA.h:52
@ ChIo_T
Definition: KVINDRA.h:45
@ SiLi_T
Definition: KVINDRA.h:57
@ CsI_T
Definition: KVINDRA.h:51
@ ChIo_GG
Definition: KVINDRA.h:43
@ CsI_R
Definition: KVINDRA.h:49
@ Si75_T
Definition: KVINDRA.h:54
@ Si_GG
Definition: KVINDRA.h:46
@ Si_T
Definition: KVINDRA.h:48
@ Phos_T
Definition: KVINDRA.h:62
@ Phos_R
Definition: KVINDRA.h:60
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define d(i)
#define b(i)
#define f(i)
#define e(i)
unsigned char UChar_t
char Char_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
kEnvChange
kEnvAll
void SetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
#define N
int type
R__EXTERN TGeoManager * gGeoManager
#define gROOT
char * Form(const char *fmt,...)
Build INDRA geometry from Huguet CAO infos.
void Build(Bool_t withTarget=kTRUE, Bool_t closeGeometry=kTRUE)
GANIL VXI/VME acquisition parameter.
Definition: KVACQParam.h:15
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:209
virtual void SetType(const Char_t *str)
Definition: KVBase.h:166
virtual Bool_t IsCalled(const Char_t *name) const
Definition: KVBase.h:183
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:541
Ionisation chamber detectors of the INDRA multidetector array.
Definition: KVChIo.h:29
CsI(Tl) scintillation detectors of the INDRA multidetector array.
Definition: KVCsI.h:15
void SetPinLaser(Int_t n)
Definition: KVCsI.h:35
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Definition: KVDataSet.cpp:757
Bool_t OpenDataSetFile(const Char_t *filename, std::ifstream &file)
Definition: KVDataSet.cpp:1849
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
void SetNameOfArray(const TString &n)
Definition: KVDetector.h:722
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
KVList * GetAlignedIDTelescopes()
Definition: KVDetector.cpp:875
Double_t GetTheta() const
Definition: KVDetector.h:690
Double_t GetPhi() const
Definition: KVDetector.h:708
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:285
Base class container for multi-particle events.
Definition: KVEvent.h:176
KVNucleus * AddParticle()
Definition: KVEvent.cpp:166
Handle reading text files.
Definition: KVFileReader.h:19
KVString GetCurrentLine()
Definition: KVFileReader.h:131
void CloseFile()
Definition: KVFileReader.h:79
Bool_t OpenFileToRead(KVString filename)
Definition: KVFileReader.h:59
void ReadLine(const Char_t *pattern)
Definition: KVFileReader.h:84
Bool_t IsOK()
Definition: KVFileReader.h:74
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:67
void SetLastDetector(KVDetector *)
void PropagateEvent(KVEvent *, TVector3 *TheOrigin=0)
void SetNameCorrespondanceList(const Char_t *)
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
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:19
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:88
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.
void SetNumeroCodeur(Int_t numero)
Set the number of the electronic module of type QDC.
UInt_t GetRingNumber() const
void SetGGtoPGConversionFactors(Double_t alpha, Double_t beta)
KVINDRADetector * GetChIo() const
Base class for telescopes in INDRA array.
Information on INDRA event from DAQ trigger.
void SetSTAT_EVE_PAR(KVACQParam *p)
INDRA multidetector array geometry.
Definition: KVINDRA.h:71
virtual void Build(Int_t run=-1)
Definition: KVINDRA.cpp:380
void SetGGtoPGConversionFactors()
Definition: KVINDRA.cpp:1122
KVINDRA()
Definition: KVINDRA.cpp:84
virtual KVChIo * GetChIoOf(const Char_t *detname)
Definition: KVINDRA.cpp:582
KVINDRATelescope * BuildTelescope(const Char_t *prefix, Int_t mod)
Definition: KVINDRA.cpp:292
void CreateROOTGeometry()
Definition: KVINDRA.cpp:1189
void SetPinLasersForCsI()
Definition: KVINDRA.cpp:896
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
Definition: KVINDRA.cpp:1328
virtual void SetGroupsAndIDTelescopes()
Definition: KVINDRA.cpp:564
void LinkToCodeurs()
Definition: KVINDRA.cpp:964
Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *)
Definition: KVINDRA.cpp:725
KVLayer * GetChIoLayer()
Definition: KVINDRA.cpp:600
virtual void SetROOTGeometry(Bool_t on=kTRUE)
Definition: KVINDRA.cpp:1290
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:528
virtual void MakeListOfDetectors()
Overrides KVASMultiDetArray method to add FillListsOfDetectorsByType()
Definition: KVINDRA.cpp:515
void FillTrajectoryIDTelescopeLists()
Definition: KVINDRA.cpp:339
void SetIDCodeForIDTelescope(KVIDTelescope *) const
Set the INDRA-specific general identification code for the given telescope.
Definition: KVINDRA.cpp:849
void PerformClosedROOTGeometryOperations()
Definition: KVINDRA.cpp:789
void SetReconParametersInEvent(KVReconstructedEvent *) const
If "INDRA.EN" parameter has been set, we use it to set the event number.
Definition: KVINDRA.cpp:1354
virtual TGraph * GetPedestals(const Char_t *det_signal, const Char_t *det_type, Int_t ring_number, Int_t run_number=-1)
Definition: KVINDRA.cpp:1038
void SetTrigger(UChar_t trig)
Definition: KVINDRA.cpp:615
Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
Definition: KVINDRA.cpp:807
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:243
virtual KVINDRADetector * GetDetectorByType(UInt_t cou, UInt_t mod, UInt_t type) const
Definition: KVINDRA.cpp:651
void SetNamesOfIDTelescopes() const
Definition: KVINDRA.cpp:748
void SetArrayACQParams()
Definition: KVINDRA.cpp:444
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
Definition: KVINDRA.cpp:1091
void BuildLayer(const Char_t *name)
Build layer 'name' with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset]....
Definition: KVINDRA.cpp:218
virtual void BuildGeometry()
Definition: KVINDRA.cpp:157
void SetMinimumOKMultiplicity(KVEvent *) const
Definition: KVINDRA.cpp:1312
Set of detectors at a similar distance from target (obsolete)
Definition: KVLayer.h:32
static KVIonRangeTable * GetRangeTable()
Definition: KVMaterial.cpp:153
virtual Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
virtual Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *list)
virtual void SetROOTGeometry(Bool_t on=kTRUE)
virtual void SetReconParametersInEvent(KVReconstructedEvent *) const
Copy any parameters in fReconParameters in to the reconstructed event parameter list.
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
Definition: KVNucleus.cpp:733
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
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:196
void Begin(void) const
Int_t Next(void) const
void SetTheta(Double_t theta)
Definition: KVParticle.h:654
void SetPhi(Double_t phi)
Definition: KVParticle.h:658
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:185
Double_t GetAzimuthalWidth(Double_t phmin=-1., Double_t phimax=-1.) const
Definition: KVPosition.cpp:612
void SetPhi(Double_t p)
Definition: KVPosition.h:181
virtual void SetPolarMinMax(Double_t min, Double_t max)
Set min and max polar angles and calculate (mean) theta.
Definition: KVPosition.cpp:171
Propagate particles through array geometry calculating energy losses.
Physical event reconstructed from data measured with a detector array using implemented identificatio...
Ring in INDRA array (obsolete)
Definition: KVRing.h:19
void Add(KVBase *)
Only KVTelescope-derived structures can be placed in a KVRing.
Definition: KVRing.cpp:59
KaliVeda extensions to ROOT collection classes.
KVSeqCollection * GetSubListWithMethod(const Char_t *retvalue, const Char_t *method) const
virtual TObject * At(Int_t idx) const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
void Begin(TString delim) const
Definition: KVString.cpp:562
Bool_t End() const
Definition: KVString.cpp:625
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:675
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)
Set min and max polar angles and calculate (mean) theta.
Definition: KVTelescope.h:99
virtual void SetAzimuthalWidth(Double_t aw)
Definition: KVTelescope.h:104
virtual Int_t GetEntries() const
const char * GetName() const
const char * GetValue() const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
THashList * GetTable() const
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual void SetName(const char *name="")
Int_t GetN() const
TObject * Next()
virtual const char * GetName() const
virtual void SetName(const char *name)
Int_t GetEntries() const
TObject * At(Int_t idx) const
virtual TObject * FindObject(const char *name) const
virtual Bool_t InheritsFrom(const char *classname) const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Double_t Atof() const
const char * Data() const
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
unsigned long long ULong64_t
TLine * line
const Int_t n
gr SetName("gr")
TGraphErrors * gr
const long double mm
Definition: KVUnits.h:69
const long double g
masses
Definition: KVUnits.h:72
void Add(RHist< DIMENSIONS, PRECISION, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION, STAT_FROM... > &from)
double dist(AxisAngle const &r1, AxisAngle const &r2)
void Info(const char *location, const char *va_(fmt),...)
void Error(const char *location, const char *va_(fmt),...)
void Warning(const char *location, const char *va_(fmt),...)
auto * a