KaliVeda
Toolkit for HIC analysis
KVINDRADSTReader.cpp
1 #include "KVINDRADSTReader.h"
2 #include "KVDataRepository.h"
3 
5 
6 
7 
9 void KVINDRADSTReader::InitRun()
10 {
11  Info("InitRun", "ds InitRun");
12 
13  KVString dst_file = gDataSet->GetFullPathToRunfile("dst", fRunNumber);
14  Info("InitRun", "dst file %s", dst_file.Data());
15 
16  Info("InitRun", "%s %s", gDataSet->GetDataPathSubdir(), (const char*)gDataSet->GetRunfileName("dst", fRunNumber));
17  gDataRepository->CopyFileFromRepository(gDataSet, "dst", gDataSet->GetRunfileName("dst", fRunNumber), ".");
18 
19  Info("InitRun", "Starting analysis of run %s", fRunNumber.as_string().Data());
20 
21  TDatime now1;
22  Info("InitRun", "Debut lecture DST %s", now1.AsString());
23 
24  DefineSHELLVariables();
25 
26 }
27 
28 
29 
31 
33 {
34  gSystem->Exec(Form("faire_arbre_c%d", fCampNumber));
35 }
36 
37 
38 
40 
42 {
43  TDatime now2;
44  Info("EndRun", "Fin lecture DST %s", now2.AsString());
45 
46  KVString inst;
47  inst.Form("rm -f %s", (const char*)gDataSet->GetRunfileName("dst", fRunNumber));
48  gSystem->Exec(inst);
49 }
50 
51 
52 
54 
56 {
57 
58  if (gDataSet != GetDataSet()) GetDataSet()->cd();
60 
61  if (fCampNumber == -1) return;
62 
63  //InitAnalysis();
64  Info("SubmitTask", "Liste de runs : %s", GetRunList().AsString().Data());
65  //loop over runs
66  Info("SubmitTask", "RunningInLaunchDirectory : %d", Int_t(RunningInLaunchDirectory()));
67 
68  for (auto& r : GetRunList()) {
69  Info("SubmitTask", "%s", GetBatchName());
70  fRunNumber = r;
71  Info("SubmitTask", "Traitement du Run %s", fRunNumber.as_string().Data());
72  InitRun();
73  ProcessRun();
74  EndRun();
75  }
76 }
77 
78 
79 
81 
83 {
84  KVString shell_var;
85 
86  shell_var.Form("run%d", fRunNumber.run());
87  gSystem->Setenv("RUN_PREFIX", shell_var.Data());
88 
89  camp1 = camp2 = camp4 = kFALSE;
90 
91  if (fCampNumber == 1) {
92 
93  shell_var.Form("%s/veda%d/files/", gSystem->ExpandPathName("$THRONG_DIR"), fCampNumber);
94  gSystem->Setenv("VEDA_DATA", shell_var.Data());
95 
96  camp1 = kTRUE;
97 
98  }
99  else if (fCampNumber == 2) {
100 
101  shell_var.Form("%s/veda%d/data/", gSystem->ExpandPathName("$THRONG_DIR"), fCampNumber);
102  gSystem->Setenv("VEDA_DATA", shell_var.Data());
103 
104  camp2 = kTRUE;
105 
106  }
107  else if (fCampNumber == 4) {
108 
109  shell_var.Form("%s/veda%d/data/", gSystem->ExpandPathName("$THRONG_DIR"), fCampNumber);
110  gSystem->Setenv("VEDA_DATA", shell_var.Data());
111 
112  camp4 = kTRUE;
113 
114  }
115 
116 }
117 
118 
int Int_t
ROOT::R::TRInterface & r
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Bool_t RunningInLaunchDirectory()
const Char_t * GetBatchName()
virtual void CopyFileFromRepository(const KVDataSet *dataset, const Char_t *datatype, const Char_t *filename, const Char_t *destination)
const run_index_list & GetRunList() const
const KVDataSet * GetDataSet() const
TString GetFullPathToRunfile(const KVString &type, const run_index_t &run) const
Definition: KVDataSet.cpp:931
virtual const Char_t * GetDataPathSubdir() const
Returns name of top-level directory in data repository used to store data files for this dataset.
Definition: KVDataSet.h:91
KVString GetRunfileName(const KVString &type, const run_index_t &run) const
Definition: KVDataSet.cpp:957
void cd() const
Definition: KVDataSet.cpp:762
Read INDRA DST file and fill a TTree.
void SubmitTask() override
virtual void InitRun()
run_index_t fRunNumber
run number of current file
virtual void EndRun()
Bool_t camp4
set to kTRUE when reading 4th campaign: => ring1 is Si-CsI
virtual void ProcessRun()
Bool_t camp2
set to kTRUE when reading 2nd campaign: => phoswich code is 4, not 2
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
const char * AsString() const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
void Form(const char *fmt,...)
virtual Int_t Exec(const char *shellcmd)
virtual char * ExpandPathName(const char *path)
virtual void Setenv(const char *name, const char *value)
int run() const
Definition: run_index.h:52
TString as_string() const
Definition: run_index.h:94
void Info(const char *location, const char *fmt,...)
ClassImp(TPyArg)