54 #include "MFMEbyedatFrame.h"
89 fChIo->SetCleanup(
kTRUE);
91 fSi->SetCleanup(
kTRUE);
93 fCsI->SetCleanup(
kTRUE);
95 fPhoswich->SetCleanup(
kTRUE);
116 if (fChIo && fChIo->TestBit(kNotDeleted)) {
121 if (fSi && fSi->TestBit(kNotDeleted)) {
126 if (fCsI && fCsI->TestBit(kNotDeleted)) {
131 if (fPhoswich && fPhoswich->TestBit(kNotDeleted)) {
136 if (fSelecteur)
delete fSelecteur;
173 TString path =
Form(
"indra-struct.%s.env", fDataSet.Data());
174 TString path2 = GetDataSetEnv(fDataSet,
"INDRA.StructureFile",
"");
176 if (!SearchKVFile(path.
Data(), path2,
"data")) {
177 path =
"indra-struct.env";
178 SearchKVFile(path.
Data(), path2,
"data");
181 fStrucInfos.ReadFile(path2,
kEnvAll);
183 KVString lruns = fStrucInfos.GetValue(
"AddOnForRuns",
"");
187 while (!lruns.
End()) {
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");
196 Warning(
"BuildGeometry",
"fichier %s inconnu", path.
Data());
205 SetName(fStrucInfos.GetValue(
"INDRA.Name",
""));
206 SetTitle(fStrucInfos.GetValue(
"INDRA.Title",
""));
208 KVString layers = fStrucInfos.GetValue(
"INDRA.Layers",
"");
210 while (!layers.
End()) BuildLayer(layers.
Next());
223 Int_t number = fStrucInfos.GetValue(
Form(
"INDRA.Layer.%s.Number", name), 0);
227 Info(
"BuildLayer",
"Building layer %d:%s", number, name);
228 KVNumberList rings = fStrucInfos.GetValue(
Form(
"INDRA.Layer.%s.Rings", name),
"");
230 while (!rings.
End()) {
232 TString prefix =
Form(
"INDRA.Layer.%s.Ring.%d", name, ring_num);
233 KVRing* ring = BuildRing(ring_num, prefix);
248 Info(
"BuildRing",
"Building ring %d (%s)", number, prefix);
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);
262 phi_min = (phi_min < 0. ? phi_min + 360. : phi_min);
263 dphi = (dphi < 0. ? 360. / ntel : dphi);
266 phi_max = (phi_max > 360. ? phi_max - 360. : phi_max);
271 UInt_t counter = num_first;
272 for (
int i = 0; i < ntel; i++) {
275 phi = (phi + dphi > 360. ? (phi + dphi - 360.) : (phi + dphi));
280 if (i + 1 < ntel) kvt = BuildTelescope(prefix, counter);
298 KVString telescopes = fStrucInfos.GetValue(
Form(
"%s.Telescope", prefix),
"");
299 telescopes.
Begin(
" ");
301 while (!telescopes.
End()) {
302 name = telescopes.
Next();
303 KVNumberList mods = fStrucInfos.GetValue(
Form(
"%s.Telescope.%s.Modules", prefix, name.
Data()),
"1-100");
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);
311 detectors.
Begin(
" ");
313 while (!detectors.
End()) {
315 detector.
Begin(
"()");
320 Double_t depth = fStrucInfos.GetValue(
Form(
"INDRA.Telescope.%s.Depth.%s", name.
Data(), dettype.
Data()), 0.);
349 TIter it_traj(GetTrajectories());
391 MakeListOfDetectors();
393 SetGroupsAndIDTelescopes();
395 SetNamesOfIDTelescopes();
399 SetDetectorThicknesses();
401 SetIdentifications();
406 SetPinLasersForCsI();
477 AddArrayACQParam(ste);
479 AddArrayACQParam(dec);
481 AddArrayACQParam(conf);
484 fSelecteur->SetR_DEC_PAR(dec);
485 fSelecteur->SetVXCONFIG_PAR(conf);
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"));
520 FillListsOfDetectorsByType();
536 TIter next_det(GetDetectors());
570 CalculateGroupsFromGeometry();
573 CreateIDTelescopesInGroups();
605 return (
KVLayer*)GetStructure(
"LAYER",
"CHIO");
683 sprintf(nom_det,
"PHOS_%02d", mod);
691 sprintf(nom_det,
"CI_%02d%02d", cou, mod);
696 sprintf(nom_det,
"SI_%02d%02d", cou, mod);
701 sprintf(nom_det,
"SILI_%02d", cou);
706 sprintf(nom_det,
"SI75_%02d", cou);
711 sprintf(nom_det,
"CSI_%02d%02d", cou, mod);
732 if (
de->InheritsFrom(
"KVSiLi") &&
e->InheritsFrom(
"KVCsI")) {
754 TIter it(GetListOfIDTelescopes());
756 const TString etalon_numbers[] = {
"1002",
"1102",
"1202",
"1304",
"1403",
"1503",
"1602",
"1702"};
772 if (e_type ==
"SILI" || e_type ==
"SI75") {
780 dynamic_cast<KVHashList*
>(GetListOfIDTelescopes())->Rehash();
793 CreateROOTGeometry();
818 if (ts != 0) fReconParameters.SetValue64bit(
"INDRA.TS", ts);
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);
828 for (std::vector<TString>::iterator it = names.begin(); it != names.end(); ++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);
862 Error(
"SetIDCodeForIDTelescope",
"Request for telescope name=%s of unknown class=%s",
926 Info(
"SetPinLasersForCsI",
"Setting correspondance CsI-PinLaser using file %s.",
930 line.ReadLine(pila_file);
931 while (pila_file.good()) {
932 if (!
line.BeginsWith(
"#")) {
941 line.ReadLine(pila_file);
946 Info(
"SetPinLasersForCsI",
"File %s not found. Correspondance Csi-PinLaser is unknown.",
988 Info(
"LinkToCodeurs()",
"Reading correspondance Codeur-Detecteur ...");
992 while (flist.
IsOK()) {
1003 if (!strcmp(rec->
GetName(),
"type")) {
1004 Info(
"LinkToCodeurs",
"Module type %s", rec->
GetValue());
1050 if (run_number != -1 || run_number !=
Int_t(GetCurrentRunNumber()))
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;
1061 if ((sltype = GetDetectors()->GetSubListWithMethod(det_type,
"GetType"))) {
1063 sring.
Form(
"%d", ring_number);
1098 if (((fired_params && fired_params->
GetEntries()) || fFiredACQParams.GetEntries())
1099 && !GetTriggerInfo()->IsINDRAEvent())
return;
1142 Info(
"SetGGtoPGConversionFactors",
"Cannot open file with parameters for conversion (%s).",
1147 Info(
"SetGGtoPGConversionFactors",
"Reading parameters from file %s",
1154 while (datfile.good()) {
1156 if (aline[0] !=
'#') {
1158 sscanf(aline.
Data(),
"%s %lf %lf", detname, &
a, &
b);
1162 Error(
"SetGGtoPGConversionFactors",
"Unknown detector : %s", detname);
1202 Error(
"CreateROOTGeometry",
"gIndra has to be build first");
1205 if (!GetNavigator()) {
1208 GetNavigator()->SetNameCorrespondanceList(
"INDRA.names");
1212 Info(
"CreateROOTGeometry",
"Scanning geometry shapes and matrices...");
1219 TIter next(GetDetectors());
1227 Info(
"CreateROOTGeometry",
"Volume checking for %s", det->
GetName());
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) {
1242 Info(
"CreateROOTGeometry",
"Volume checking failed for : %s", det->
GetName());
1252 Info(
"CreateROOTGeometry",
"Trajectory checking for %s", det->
GetName());
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) {
1271 Info(
"CreateROOTGeometry",
"ROOT geometry initialised for %d/%d detectors", nrootgeo, GetDetectors()->GetEntries());
1274 TIter it(GetDetectors());
1276 while ((
d = (
KVDetector*)it()))
d->GetNode()->RehashLists();
1277 AssociateTrajectoriesAndNodes();
1278 DeduceGroupsFromTrajectories();
1279 FillTrajectoryIDTelescopeLists();
1280 CalculateReconstructionTrajectories();
1281 GetNavigator()->AbsorbDetectorPaths(&gimp);
1299 if (fCloseGeometryNow) PerformClosedROOTGeometryOperations();
1317 if (GetTrigger() > 0)
e->SetMinimumOKMultiplicity(GetTrigger());
1336 if (GetGroup(
g->GetName())) {
1338 if (
g->GetDetectorByType(
"SILI") ||
g->GetDetectorByType(
"SI75"))
1359 if (GetReconParameters().HasValue64bit(
"INDRA.EN"))
e->SetNumber(GetReconParameters().GetValue64bit(
"INDRA.EN"));
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
void SetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
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)
GANIL VXI/VME acquisition parameter.
void MakeListOfDetectors()
virtual void SetNumber(UInt_t num)
virtual void SetType(const Char_t *str)
virtual Bool_t IsCalled(const Char_t *name) const
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Ionisation chamber detectors of the INDRA multidetector array.
CsI(Tl) scintillation detectors of the INDRA multidetector array.
void SetPinLaser(Int_t n)
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Bool_t OpenDataSetFile(const Char_t *filename, std::ifstream &file)
Base class for detector geometry description, interface to energy-loss calculations.
void SetNameOfArray(const TString &n)
static KVDetector * MakeDetector(const Char_t *name, Float_t thick)
KVList * GetAlignedIDTelescopes()
Double_t GetTheta() const
KVGeoDetectorNode * GetNode()
Base class container for multi-particle events.
KVNucleus * AddParticle()
Handle reading text files.
KVString GetCurrentLine()
Bool_t OpenFileToRead(KVString filename)
void ReadLine(const Char_t *pattern)
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.
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.
Extended version of ROOT THashList.
Base class for all detectors or associations of detectors in array which can identify charged particl...
KVDetector * GetDetector(UInt_t n) const
virtual void SetIDCode(UShort_t c)
const KVList * GetDetectors() 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.
virtual void Build(Int_t run=-1)
void SetGGtoPGConversionFactors()
virtual KVChIo * GetChIoOf(const Char_t *detname)
KVINDRATelescope * BuildTelescope(const Char_t *prefix, Int_t mod)
void CreateROOTGeometry()
void SetPinLasersForCsI()
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
virtual void SetGroupsAndIDTelescopes()
Int_t GetIDTelescopes(KVDetector *, KVDetector *, TCollection *)
virtual void SetROOTGeometry(Bool_t on=kTRUE)
static Char_t SignalTypes[16][3]
Use this static array to translate EBaseIndra_type signal type to a string giving the signal type.
void FillListsOfDetectorsByType()
Fill lists of ChIo, Si, CsI and phoswich.
virtual void MakeListOfDetectors()
Overrides KVASMultiDetArray method to add FillListsOfDetectorsByType()
void FillTrajectoryIDTelescopeLists()
void SetIDCodeForIDTelescope(KVIDTelescope *) const
Set the INDRA-specific general identification code for the given telescope.
void PerformClosedROOTGeometryOperations()
void SetReconParametersInEvent(KVReconstructedEvent *) const
If "INDRA.EN" parameter has been set, we use it to set the event number.
virtual TGraph * GetPedestals(const Char_t *det_signal, const Char_t *det_type, Int_t ring_number, Int_t run_number=-1)
void SetTrigger(UChar_t trig)
Bool_t handle_raw_data_event_mfmframe_ebyedat(const MFMEbyedatFrame &)
KVRing * BuildRing(Int_t number, const Char_t *prefix)
Build ring with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env".
virtual KVINDRADetector * GetDetectorByType(UInt_t cou, UInt_t mod, UInt_t type) const
void SetNamesOfIDTelescopes() const
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
void BuildLayer(const Char_t *name)
Build layer 'name' with infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset]....
virtual void BuildGeometry()
void SetMinimumOKMultiplicity(KVEvent *) const
Set of detectors at a similar distance from target (obsolete)
static KVIonRangeTable * GetRangeTable()
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.
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
void SetTheta(Double_t theta)
void SetPhi(Double_t phi)
virtual void SetAzimuthalMinMax(Double_t min, Double_t max)
Set min and max azimuthal angles and calculate (mean) phi.
Bool_t ROOTGeo() const
Returns kTRUE if ROOT geometry is used, kFALSE if not.
void SetDistance(Double_t d)
Double_t GetAzimuthalWidth(Double_t phmin=-1., Double_t phimax=-1.) const
virtual void SetPolarMinMax(Double_t min, Double_t max)
Set min and max polar angles and calculate (mean) theta.
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)
void Add(KVBase *)
Only KVTelescope-derived structures can be placed in a KVRing.
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....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
void SetDepth(UInt_t ndet, Float_t depth)
set the depth of detector number ndet(=1,2,...) in mm.
void Add(KVBase *element)
virtual void SetPolarMinMax(Double_t min, Double_t max)
Set min and max polar angles and calculate (mean) theta.
virtual void SetAzimuthalWidth(Double_t aw)
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="")
virtual const char * GetName() const
virtual void SetName(const char *name)
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
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
const long double g
masses
void Add(RHist< DIMENSIONS, PRECISION, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION, STAT_FROM... > &from)
double dist(AxisAngle const &r1, AxisAngle const &r2)