28 fChoozDataSet =
kTRUE;
56 fChoozDataSet =
kTRUE;
85 fChoozDataSet =
kTRUE;
113 else if (IsChooseTask())
114 ChooseAnalysisTask();
131 Error(
"CheckTaskVariables",
"By the pricking of my thumb, something wicked this way comes...");
132 Error(
"CheckTaskVariables",
" *** ABORTING THE ANALYSIS ***");
137 if (!GetAnalysisTask()) {
138 ChooseAnalysisTask();
141 if (fRunList.IsEmpty()) {
166 _set_dataset_pointer(
nullptr);
167 if (GetAnalysisTask()) SetAnalysisTask(
nullptr);
169 cout <<
"Available datasets :" << endl << endl;
171 Int_t n_dataset = -1;
186 while (!IsQuit() && (n_dataset < 1 || n_dataset > n_avail)) {
188 GetNavailable() <<
")";
189 if (IsMenus()) cout <<
" [q - quit]";
197 n_dataset = tmp.
Atoi();
226 SetAnalysisTask(
nullptr);
228 fDataSet->Print(
"data");
229 cout << endl <<
"Choose data type [d - change dataset | q - quit] : ";
231 while (!IsQuit() && !IsChooseDataSet() && !IsChooseSystem()) {
234 if (tmp ==
"raw" || tmp ==
"recon" || tmp ==
"ident" || tmp ==
"root") {
235 fChoozSystem =
kTRUE;
267 SetAnalysisTask(
nullptr);
272 cout << endl <<
"Available data analysis tasks :" << endl << endl;
273 fDataSet->Print(
"tasks");
274 Int_t n_tasks = fDataSet->GetNtasks();
276 SetAnalysisTask(fDataSet->GetAnalysisTask(1));
277 fChoozSystem =
kTRUE;
284 while (!IsQuit() && (n_task < 1 || n_task > n_tasks)) {
285 cout << endl <<
"Your choice (1-" << n_tasks <<
287 if (IsMenus()) cout <<
" [d - change dataset | q - quit]";
295 fChoozDataSet =
kTRUE;
302 SetAnalysisTask(fDataSet->GetAnalysisTask(n_task));
304 fChoozSystem =
kTRUE;
338 if (!fDataSet->GetDataBase()->GetSystems()->GetSize()) {
349 unique_ptr<TList> sys_list(fDataSet->GetListOfAvailableSystems(d_t.
Data()));
350 if (!sys_list.get() || sys_list->GetSize() < 1) {
351 cout <<
"No systems found for dataset: " << fDataSet->
352 GetName() <<
", datatype: " << d_t.
Data() << endl;
357 TIter next_sys(sys_list.get());
360 cout << endl <<
"Available systems : " << endl << endl;
363 cout <<
" " <<
Form(
"%3d.", nsys);
365 cout <<
" (" <<
Form(
"%-3d",
369 if (sys_list->GetSize() == 1) {
382 while (!IsQuit() && !IsChooseTask() && !fChoozRuns && !fChoozDataSet) {
383 cout << endl <<
"Your choice (1-" << nsys <<
")";
385 cout <<
" [r - choose runs | ";
386 if (GetAnalysisTask())
387 cout <<
"t - change task";
389 cout <<
"t - change type";
390 cout <<
" | d - change dataset | q - quit]";
401 fChoozDataSet =
kTRUE;
408 nsys_pick = tmp.
Atoi();
409 if (nsys_pick >= 1 && nsys_pick <= nsys)
414 fSystem = (
KVDBSystem*) sys_list->At(nsys_pick - 1);
456 cout << endl <<
" Chosen system : " << endl;
459 cout << endl << endl <<
" Available runs: " << endl << endl;
465 fChoozSystem =
kTRUE;
469 cout << endl <<
"Enter list of runs [a - all";
472 if (fSystem) cout <<
"s - change system | ";
473 if (GetAnalysisTask())
474 cout <<
"t - change task";
476 cout <<
"t - change type";
477 cout <<
" | d - change dataset | q - quit";
486 fChoozSystem =
kTRUE;
492 fChoozDataSet =
kTRUE;
505 while (!user_list.
End()) {
507 if (all_runs.
Contains(user_run)) fRunList.Add(user_run);
510 if (fRunList.IsEmpty()) {
512 "None of the runs you chose appear in the list");
520 cout << endl <<
"Chosen runs : " << fRunList.GetList() << endl;
550 "Dataset %s is not available for analysis", ds->
GetName());
556 "%ld is address of dataset in repository \"%s\", not of the dataset in the current repository, \"%s\"",
582 Error(
"SetDataSet",
"Unknown dataset %s", name);
585 set_dataset_pointer(ds);
601 fDataSet->GetRunList(datatype.
Data(), fSystem);
604 while (!all_runs.
End()) {
605 dbrun = fDataSet->GetDataBase()->GetDBRun(all_runs.
Next());
646 Warning(
"SetRuns",
"Data Set not defined... Nothing done");
652 KVDBRun* run = fDataSet->GetDataBase()->GetDBRun(nl.
First());
659 Info(
"SetRuns",
"Checking runs %s for Data type %s",
666 if (!(fDataSet->CheckRunfileAvailable(
GetDataType(), run_no))) {
668 "The run %d is not present for the data type \"%s\" of data set \"%s\".",
669 run_no,
GetDataType().Data(), fDataSet->GetName());
672 fRunList.Add(run_no);
674 KVDBRun* run = fDataSet->GetDataBase()->GetDBRun(run_no);
683 "The system \"%s\" of run %d differs from the system \"%s\" of the previous runs.",
688 Info(
"SetRuns",
"Accepted runs : %s", fRunList.AsString());
710 GetBatchInfoFile()->SetValue(
"DataSet", fDataSet->GetName());
711 GetBatchInfoFile()->SetValue(
"Runs", fRunList.GetList());
712 GetBatchInfoFile()->SetValue(
"FullRunList", fFullRunList.GetList());
713 if (save) GetBatchInfoFile()->SaveLevel(
kEnvUser);
734 TString val = GetBatchInfoFile()->GetValue(
"DataRepository",
"");
739 Error(
"ReadBatchEnvFile",
"Name of data repository not given");
742 val = GetBatchInfoFile()->GetValue(
"DataSet",
"");
748 Error(
"ReadBatchEnvFile",
"Name of dataset not given");
751 val = GetBatchInfoFile()->GetValue(
"AnalysisTask",
"");
752 SetAnalysisTask(
nullptr);
757 Error(
"ReadBatchEnvFile",
"Name of analysis task not given");
760 if (!GetAnalysisTask()) {
761 Error(
"ReadBatchEnvFile",
"Analysis task \"%s\"not found for dataset %s",
765 val = GetBatchInfoFile()->GetValue(
"Runs",
"");
770 Error(
"ReadBatchEnvFile",
"List of runs not given");
773 val = GetBatchInfoFile()->GetValue(
"FullRunList",
"");
775 SetFullRunList(val.
Data());
811 if (!fSystem)
return tmp;
812 return fSystem->GetBatchName();
852 if (fSystem)
return fSystem->GetKinematics();
853 Error(
"GetKinematics",
"No system defined for kinematic calculations");
867 arf = GetDataSet()->GetAvailableRunsFile(
GetDataType().Data());
892 jdl->
SetValue(
"DataSet", fDataSet->GetName());
KVDataRepositoryManager * gDataRepositoryManager
KVDataRepository * gDataRepository
KVDataSetManager * gDataSetManager
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
Relativistic binary kinematics calculator.
Handles lists of available runs for different datasets and types of data.
Int_t IsRunFileName(const Char_t *filename)
virtual Int_t GetNumber() const
Description of an experimental run in database ,.
ULong64_t GetEvents() const
KVDBSystem * GetSystem() const
const TDatime & GetDatime() const
const Char_t * GetComments() const
Database class used to store information on different colliding systems studied during an experiment.
Manager class which sets up and runs data analysis tasks.
virtual TString ExpandAutoBatchName(const Char_t *format) const
virtual void PostRunReset()
virtual void AddJobDescriptionList(TList *)
virtual const Char_t * GetRecognisedAutoBatchNameKeywords() const
virtual void set_up_analyser_for_task(KVDataAnalyser *the_analyser)
virtual void WriteBatchEnvFile(const Char_t *, Bool_t sav=kTRUE)
virtual Bool_t ReadBatchEnvFile(const Char_t *)
KVDataRepository * GetRepository(const Char_t *name) const
virtual Bool_t IsRemote() const
Returns kTRUE for remote repositories, kFALSE for local repositories.
virtual Bool_t IsConnected()
Always returns kTRUE for local repositories.
virtual const Char_t * GetRootDirectory() const
returns root directory of data repository (fLocalrootdir)
Pilots user analysis of experimental data.
void WriteBatchEnvFile(const Char_t *jobname, Bool_t save=kTRUE)
virtual Bool_t PreSubmitCheck()
void SetDataSet(KVDataSet *ds)
virtual void ChooseAnalysisTask()
virtual KVNumberList PrintAvailableRuns(KVString &datatype)
virtual void set_up_analyser_for_task(KVDataAnalyser *the_analyser)
void ChooseRuns(KVDBSystem *system=nullptr, const Char_t *data_type="")
void SetRuns(const KVNumberList &nl, Bool_t check=kTRUE)
void ChooseSystem(const Char_t *data_type="")
KVString GetRootDirectoryOfDataToAnalyse() const
Returns path to data to be analysed.
virtual ~KVDataSetAnalyser()
Destructor.
const KV2Body * GetKinematics() const
Return pointer to kinematics of analysed system if defined.
Int_t GetRunNumberFromFileName(const Char_t *)
Get the run number from the filename.
void SetSystem(KVDBSystem *syst)
Set the System used in the analysis.
const Char_t * GetRecognisedAutoBatchNameKeywords() const
virtual void AddJobDescriptionList(TList *)
virtual void set_dataset_name(const Char_t *name)
virtual void set_dataset_pointer(KVDataSet *ds)
virtual void PostRunReset()
Called at end of Run() after execution of analysis task.
void ChooseWhatToAnalyse()
TO IMPLEMENT ?
Bool_t CheckWhatToAnalyseAndHow()
Bool_t ReadBatchEnvFile(const Char_t *filename)
TString ExpandAutoBatchName(const Char_t *format) const
TString SystemBatchName() const
void ChooseWhatToDo()
TO IMPLEMENT ?
virtual void Print(Option_t *opt="") const
virtual Int_t GetNavailable() const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
virtual KVDataSet * GetAvailableDataSet(Int_t) const
Manage an experimental dataset corresponding to a given experiment or campaign.
KVDataRepository * GetRepository() const
Get pointer to data repository in which dataset is stored.
virtual KVDataAnalysisTask * GetAnalysisTask(Int_t) const
virtual Bool_t IsAvailable() const
Returns kTRUE if this dataset is available for analysis, i.e. if any associated data files are stored...
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
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
Int_t First() const
Returns smallest number included in list.
const Char_t * AsString(Int_t maxchars=0) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
const char * AsString() const
virtual const char * GetName() const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
RooCmdArg BatchMode(bool flag=true)
BinData::ErrorType GetDataType(const TGraph *gr, DataOptions &fitOpt)