65 Info(
"InitRun",
"ds InitRun");
68 Info(
"InitRun",
"dst file %s", dst_file.
Data());
72 gROOT->ProcessLine(
".! ls -lhrt *");
74 Info(
"InitRun",
"Starting analysis of run %d", fRunNumber);
77 Info(
"InitRun",
"Debut lecture DST %s", now1.
AsString());
78 DefineSHELLVariables();
83 Info(
"InitRun",
"Bilan ressource apres ReadDST");
90 cout <<
" ------------- Process infos -------------" << endl;
91 printf(
" CpuUser = %f s. VirtMem = %f MB DiskUsed = %s\n",
95 Warning(
"InitRun",
"pas d info disponible sur le bilan ressource");
106 inst.
Form(
".! rm xrun%d", fRunNumber);
152 ifstream f_in(
"list_of_files");
155 Int_t nfiles, necrit, rn_verif;
156 nfiles = necrit = rn_verif = 0;
158 while (f_in.good()) {
161 toks =
line.Tokenize(
"=");
164 if (
line.BeginsWith(
"file_number=")) nfiles = val;
165 else if (
line.BeginsWith(
"write_evts=")) necrit = val;
166 else if (
line.BeginsWith(
"run_number=")) rn_verif = val;
174 if (rn_verif != fRunNumber) {
175 Error(
"ProcessRun",
"Le numero de run inscrit dans le fichier list_of_files (%d) est different du run courant (%d)", rn_verif, fRunNumber);
176 Error(
"ProcessRun",
"\t->analysis is going to stop");
179 inst.
Form(
".! rm list_of_files");
182 inst.
Form(
".! rm arbre_root_*.txt");
187 Info(
"ProcessRun",
"Lecture de list_of_files :\n - nbre de fichiers a lire %d\n - nbre d evts a lire %d\n", nfiles, necrit);
190 Info(
"ProcessRun",
"Debut Conversion au format du run %d ROOT %s", fRunNumber, now1.
AsString());
207 stit.
Form(
"%s : %s : root events converted from DST",
210 data_tree =
new TTree(
"ReconstructedEvents", stit.
Data());
211 #if ROOT_VERSION_CODE > ROOT_VERSION(5,25,4)
212 #if ROOT_VERSION_CODE < ROOT_VERSION(5,26,1)
215 data_tree->SetAutoFlush(0);
222 rawtree =
new TTree(
"RawData",
Form(
"%s : %s : raw data",
224 rawtree->Branch(
"RunNumber", &fRunNumber,
"RunNumber/I");
225 rawtree->Branch(
"EventNumber", &fEventNumber,
"EventNumber/I");
235 Error(
"ProcessRun",
"No RAW data file available for this run. ABORT!!");
239 Info(
"InitRun",
"Created raw data tree (%s : %s). Format: %s",
240 rawtree->GetName(), rawtree->GetTitle(), raw_opt.
Data());
249 TIter nextparam(params);
253 rawtree->SetBranchAddress(
"NbParFired", &NbParFired);
254 rawtree->SetBranchAddress(
"ParVal", ParVal);
255 rawtree->SetBranchAddress(
"ParNum", ParNum);
257 events_good = events_read = 0;
260 Info(
"ProcessRun",
"Special treatment INDRA 2nd campaign data:");
261 Info(
"ProcessRun",
"Particles detected in phoswich ring 1 have general ID code=4");
262 Info(
"ProcessRun",
"After translation, they will have Veda ID code=2 (like 1st campaign)");
265 Info(
"ProcessRun",
"Bilan ressource avant lecture des %d fichiers ascii", nfiles);
272 cout <<
" ------------- Process infos -------------" << endl;
273 printf(
" CpuUser = %f s. VirtMem = %f MB DiskUsed = %s\n",
280 for (
Int_t nf = 1; nf <= nfiles; nf += 1) {
282 stit.
Form(
"arbre_root_%d.txt", nf);
283 ifstream f_data(stit.
Data());
285 while (f_data.good()) {
286 lire_evt(f_data, evt);
289 if (events_read % 10000 == 0 && events_read > 0) {
290 cout <<
" +++ " << events_read <<
" events processed +++ " << endl;
297 cout <<
" ------------- Process infos -------------" << endl;
298 printf(
" CpuUser = %f s. VirtMem = %f MB DiskUsed = %s\n",
305 inst.
Form(
".! rm arbre_root_%d.txt", nf);
307 Info(
"ProcessRun",
"Bilan ressource apres lecture du fichier numero %d/%d", nf, nfiles);
314 cout <<
" ------------- Process infos -------------" << endl;
315 printf(
" CpuUser = %f s. VirtMem = %f MB DiskUsed = %s\n",
325 cout <<
"Nb. evts read from files: " << events_read << endl;
326 cout <<
"Nb. evts written to TTree: " << events_good << endl;
327 cout <<
"Nb. evts in FORTRAN file: " << necrit << endl;
328 if (check_events < 0.99) cout <<
"ERROR: number of events read <99% number in FORTRAN file" << endl;
345 Info(
"ProcessRun",
"Fin Conversion format ROOT %s", now2.
AsString());
348 inst.
Form(
".! rm list_of_files");
360 Info(
"EndRun",
"ds EndRun");
372 if (
gDataSet != GetDataSet()) GetDataSet()->cd();
375 if (fCampNumber == -1)
return;
378 Info(
"SubmitTask",
"Liste de runs : %s", GetRunList().AsString());
380 Info(
"SubmitTask",
"RunningInLaunchDirectory : %d",
Int_t(RunningInLaunchDirectory()));
382 GetRunList().Begin();
383 while (!GetRunList().
End()) {
384 Info(
"SubmitTask",
"%s", GetBatchName());
385 fRunNumber = GetRunList().Next();
386 Info(
"SubmitTask",
"Traitement du Run %d", fRunNumber);
404 Info(
"DefineSHELLVariables",
"campagne %d", fCampNumber);
408 shell_var.
Form(
"%d", fCampNumber);
420 shell_var.
Form(
"run%d", fRunNumber);
425 camp1 = camp2 = camp4 =
kFALSE;
427 if (fCampNumber == 1) {
438 else if (fCampNumber == 2) {
449 else if (fCampNumber == 4) {
501 phos->GetACQParam(
"T")->SetData((
UShort_t)mt);
518 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
523 else if (ring >= 2 && ring <= 9) {
543 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
580 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
607 if (ring == 1 && camp4) {
619 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
623 else if (ring >= 2 && ring <= 9) {
642 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
646 else if (ring >= 10) {
667 if (canal[
CsI_R] > 0.) {
671 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
705 if (ring == 1 && !camp4) {
710 phos->GetACQParam(
"T")->SetData((
UShort_t)mt);
716 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
733 if (ring < 2 || ring > 9)
return 0;
740 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
793 if (ring == 1 && camp2) {
801 phos->GetACQParam(
"T")->SetData((
UShort_t)mt);
805 else if (ring >= 2 && ring <= 9) {
826 else if (ring >= 10) {
838 if (canal[
CsI_R] > 0.) {
842 csi->GetACQParam(
"T")->SetData((
UShort_t)mt);
846 else if (de4 > 0.0) {
917 num_ev = buff.
Atoi();
932 for (
Int_t i = 0; i < mul; i++) {
934 Int_t z,
a, code, icou, imod, ecode, ncans;
936 for (
Int_t gj = 0; gj < 16; gj++) canal[gj] = 0.0;
949 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for ener. Set E=0" << endl;
950 cout <<
"(read: " << buff.
Data() <<
")" << endl;
962 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de_mylar. Set de_mylar=0" << endl;
963 cout <<
"(read: " << buff.
Data() <<
")" << endl;
972 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de1. Set de1=0" << endl;
973 cout <<
"(read: " << buff.
Data() <<
")" << endl;
981 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de2. Set de2=0" << endl;
982 cout <<
"(read: " << buff.
Data() <<
")" << endl;
990 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de3. Set de3=0" << endl;
991 cout <<
"(read: " << buff.
Data() <<
")" << endl;
999 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de4. Set de4=0" << endl;
1000 cout <<
"(read: " << buff.
Data() <<
")" << endl;
1008 cout <<
"BAD: event#" << num_ev <<
" z=" << z <<
" a=" <<
a <<
" / Non-numeric value read for de5. Set de5=0" << endl;
1009 cout <<
"(read: " << buff.
Data() <<
")" << endl;
1015 cout <<
"BAD: event#" << num_ev <<
" particle#" << i <<
" Z=" << z <<
" code=" << code << endl;
1019 for (
Int_t mk = 1; mk <= 4; mk++) {
1028 for (
Int_t mk = 1; mk <= ncans; mk++) {
1034 if ((code < 11 || (camp2 && code == 14)) && icou > 0 && imod > 0 && icou < 18 && imod < 25) {
1046 identifying_telescope = 0;
1047 if (code == 14) det_stop = (this->*CodeFunc[4])(icou, imod);
1048 else det_stop = (this->*CodeFunc[code])(icou, imod);
1051 cout <<
"det_stop=0: event#" << num_ev <<
" particle#" << i <<
" icou=" << icou <<
" imod=" << imod <<
1052 " z=" << z <<
" a=" <<
a <<
" code=" << code <<
" ecode=" << ecode << endl;
1057 Fatal(
"lire_evt",
"KVINDRAReconEvent::AddParticle() returns NULL pointer.");
1060 det_stop->GetACQParam(
"T")->SetData((
UShort_t)mt);
1062 if (identifying_telescope) {
1077 if (
a > 0 && (code == 2 || code == 3)) {
1131 GetDataSet()->GetRunList(datatype.
Data(), GetSystem());
1135 vector<int> triggers;
1137 while (!all_runs.
End()) {
1138 dbrun = (
KVINDRADBRun*)GetDataSet()->GetDataBase()->GetDBRun(all_runs.
Next());
1139 if (triggers.size() == 0
1140 || std::find(triggers.begin(), triggers.end(), dbrun->
GetTrigger()) != triggers.end()) {
1145 std::sort(triggers.begin(), triggers.end());
1147 for (std::vector<int>::iterator it = triggers.begin(); it != triggers.end(); ++it) {
1148 cout <<
" ---> Trigger M>" << *it << endl;
1150 while (!all_runs.
End()) {
1151 dbrun = (
KVINDRADBRun*)GetDataSet()->GetDataBase()->GetDBRun(all_runs.
Next());
1155 cout <<
"\t[File written: " << dbrun->
GetDatime().
1183 ParVal[NbParFired] = par->GetCoderData();
1184 ParNum[NbParFired++] = par->
GetNumber();
KVDataAnalyser * gDataAnalyser
KVDataRepositoryManager * gDataRepositoryManager
KVDataRepository * gDataRepository
KVDetector *(KVINDRADstToRootTransfert::* FNMETHOD)(int, int)
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
static const Char_t * GetBINDIRFilePath(const Char_t *namefile="")
virtual void SetNumber(UInt_t num)
Ionisation chamber detectors of the INDRA multidetector array.
CsI(Tl) scintillation detectors of the INDRA multidetector array.
virtual Int_t GetNumber() const
ULong64_t GetEvents() const
KVDBSystem * GetSystem() const
const TDatime & GetDatime() const
const Char_t * GetComments() const
void WriteBatchInfo(TTree *)
KVDataSet * GetDataSet(const Char_t *repository, const Char_t *dataset) const
Return pointer to named dataset in the given repository.
virtual void CopyFileFromRepository(const KVDataSet *dataset, const Char_t *datatype, const Char_t *filename, const Char_t *destination)
Manage an experimental dataset corresponding to a given experiment or campaign.
TString GetOutputRepository(const Char_t *taskname) const
FileType * OpenRunfile(const Char_t *type, Int_t run)
const Char_t * GetRunfileName(const Char_t *type, Int_t run) const
virtual const Char_t * GetDataPathSubdir() const
Returns name of top-level directory in data repository used to store data files for this dataset.
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
void CommitRunfile(const Char_t *type, Int_t run, TFile *file)
TFile * NewRunfile(const Char_t *type, Int_t run)
Base class for detector geometry description.
virtual void SetEnergy(Double_t e) const
GANIL VXI/VME 16 bit (maximum) EBYEDAT acquisition parameter.
void UseInternalDataMember()
void Clear(Option_t *opt="")
Clear object properties : name, type/title, number, label.
static void MakeEventBranch(TTree *tree, const TString &branchname, T &event, Int_t bufsize=10000000)
Reads GANIL acquisition files (EBYEDAT)
virtual void SetUserTree(TTree *, Option_t *="arrays")
static UChar_t VedaECodeToBitmask(UChar_t veda_e_code)
static UShort_t VedaIDCodeToBitmask(UChar_t veda_id_code)
Database entry for each run of an INDRA experiment.
KVINDRADBRun * GetRun(Int_t run) const
KVINDRADetector * GetChIo() const
Conversion of INDRA DST file to KaliVeda ROOT format.
KVDetector * Code1(int ring, int mod)
KVDetector * Code2and9and10(int ring, int mod)
virtual ~KVINDRADstToRootTransfert()
Destructor.
KVDetector * Code0(int ring, int mod)
void lire_evt(std::ifstream &f_in, KVINDRAReconEvent *evt)
virtual KVNumberList PrintAvailableRuns(KVString &datatype)
KVDetector * Code4and5and6and8(int ring, int mod)
void DefineSHELLVariables()
virtual void SubmitTask()
KVDetector * Code3(int ring, int mod)
virtual void ProcessRun()
KVDetector * Code7(int ring, int mod)
Event reconstructed from energy losses in INDRA multidetector.
Nuclei reconstructed from data measured in the INDRA array.
void SetEnergyCsI(Float_t val)
void SetEnergySi(Float_t val)
void SetEnergyChIo(Float_t val)
void SetEnergySi75(Float_t val)
void SetEnergySiLi(Float_t val)
virtual KVINDRADetector * GetDetectorByType(UInt_t cou, UInt_t mod, UInt_t type) const
UInt_t GetCurrentRunNumber() const
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
void SetZ(Int_t z, Char_t mt=-1)
Strings used to represent a set of ranges of values.
void SetEnergy(Double_t e)
Phoswich detector in the INDRA array (first 3 campaigns)
void SetEnergy(Double_t e) const
Set energy lost in both layers.
virtual void Reconstruct(KVDetector *kvd)
virtual void SetAMeasured(Bool_t yes=kTRUE)
void SetRealZ(Float_t zz)
virtual void SetZMeasured(Bool_t yes=kTRUE)
void SetIDCode(UShort_t s)
void SetIdentifyingTelescope(KVIDTelescope *i)
80um silicon detector for INDRA etalon telescopes
2mm + 40um dead zone Si(Li) detector for INDRA etalon telescopes
Silicon detectors of the INDRA array.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
const char * AsString() const
Bool_t cd(const char *path=nullptr) override
virtual const char * GetName() const
virtual void SetTitle(const char *title="")
virtual const char * GetTitle() const
virtual void SetName(const char *name)
TObject * At(Int_t idx) const
TObjArray * Tokenize(const TString &delim) const
const char * Data() const
void Form(const char *fmt,...)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
virtual int GetProcInfo(ProcInfo_t *info) const
virtual void Exit(int code, Bool_t mode=kTRUE)
virtual TString GetFromPipe(const char *command)
virtual char * ExpandPathName(const char *path)
virtual void Setenv(const char *name, const char *value)