4 #include "KVSimDirAnalyser.h"
5 #include "KVDataAnalysisTask.h"
8 #include <KVClassFactory.h>
9 #include <TStopwatch.h>
19 :
KVDataAnalyser(), fListOfSimFiles(
nullptr), fListOfAuxFiles(
nullptr), fAnalysisChain(
nullptr), fSimDir(
nullptr), fCopyFilesToWorkDir(false)
60 Long64_t update_interval = (nevents > 10 ? nevents / 10 : 1);
61 TString results_file_name;
63 results_file_name.Form(
"%s_%s",
GetUserClass(), first_file->GetName());
65 options.Form(
"SimFileName=%s,SimTitle=%s,OutputDir=%s,EventsReadInterval=%lld,BranchName=%s,CombinedOutputFile=%s,SimulationInfos=%s",
68 results_file_name.Data(), first_file->GetTitle());
70 options += Form(
",DataSet=%s", first_file->
GetDataSet());
72 options += Form(
",Run=%d", first_file->
GetRun());
74 options += Form(
",System=%s", first_file->
GetSystem());
82 if (auxfiles !=
"") auxfiles +=
"|";
83 auxfiles += auxf->GetName();
85 options +=
",AuxFiles=";
87 options +=
",AuxDir=";
90 options +=
",AuxTreeName=";
92 options +=
",AuxBranchName=";
103 Info(
"SubmitTask",
"Beginning TChain::Process...");
109 TString analysis_class;
112 if (read_all_events) {
195 if (simdir ==
"")
return ok;
201 if (filetype ==
"")
return ok;
204 if (simfiles ==
"")
return ok;
211 while (!simfiles.
End()) {
220 if (auxfiles ==
"")
return (ok = kTRUE);
227 while (!auxfiles.
End()) {
256 AssignAndDelete(fullpath, gSystem->ConcatFileName(file->
GetSimDir()->
GetDirectory(), file->GetName()));
258 Info(
"BuildChain",
"Copying file to analyse from %s to %s", fullpath.Data(), Form(
"./%s", gSystem->BaseName(fullpath)));
260 TFile::Cp(fullpath, Form(
"./%s", gSystem->BaseName(fullpath)), kFALSE, 1e+08);
261 Info(
"BuildChain",
"Copied file in %g seconds", timer.RealTime());
304 kTRUE,
"SimulatedEventAnalysisTemplate");
307 kTRUE,
"ROOT6SimulatedEventAnalysisTemplate");
325 tmp.ReplaceAll(
"KVEventFiltering",
327 tmp.ReplaceAll(
" ",
"");
328 tmp.ReplaceAll(
"@",
"_");
329 tmp.ReplaceAll(
"+",
"_");
330 tmp.ReplaceAll(
"/",
"_");
Factory class for generating skeleton files for new classes.
void GenerateCode()
Generate header and implementation file for currently-defined class.
void AddImplIncludeFile(const Char_t *filename)
Manager class which sets up and runs data analysis tasks.
const Char_t * GetACliCMode()
virtual TString ExpandAutoBatchName(const Char_t *format) const
const KVString & GetUserClassImp() const
virtual void WriteBatchEnvFile(const TString &, Bool_t sav=kTRUE)
virtual Bool_t CheckIfUserClassIsValid(const KVString &alternative_base_class="")
TList * fWorkDirInit
list of files in working directory before task runs
const KVString & GetUserClassOptions() const
const Char_t * GetUserClass()
EProofMode GetProofMode() const
void ScanWorkingDirectory(TList **)
Long64_t GetNbEventToRead(void) const
virtual Bool_t ReadBatchEnvFile(const TString &)
KVDataAnalysisTask * GetAnalysisTask() const
TEnv * GetBatchInfoFile() const
virtual TObject * FindObject(const char *name) const
Class piloting analyses of simulated data.
void DeleteSimFilesListIfOurs()
TList * fListOfAuxFiles
[optional] list of original simulated data to be used during filtered data analysis
TString ExpandAutoBatchName(const Char_t *format) const override
Replace any special symbols in auto-format jobname with current values.
Bool_t NeedToChooseWhatToAnalyse() const override
KVSimDir * fSimDir
used for batch analysis
Bool_t IsCopyFilesToWorkDir() const
TList * fListOfSimFiles
list of files/trees to analyse
TChain * fAnalysisChain
TChain for analysis.
Bool_t ReadBatchEnvFile(const TString &) override
void GetInfosForJobNameFromFiles()
KVString GetRootDirectoryOfDataToAnalyse() const override
Returns path to data to be analysed.
void SetCopyFilesToWorkDir(Bool_t on=kTRUE)
void DeleteAuxFilesListIfOurs()
TString fFilterDataSet
name of dataset to be used for filtering the simulation
TString fFilterSystem
name of system to be used for filtering the simulation
TString fModel
name of model used for simulation
void SubmitTask() override
Set up and run the analysis.
static void Make(const Char_t *kvsname="MySimulatedAnalysis")
Generate a new simulated analysis selector class.
void WriteBatchEnvFile(const TString &, Bool_t sav=kTRUE) override
Handle directory containing simulated and/or filtered simulated data ,.
virtual const KVList * GetFiltDataList() const
virtual void AnalyseDirectory()
virtual const KVList * GetSimDataList() const
virtual const Char_t * GetDirectory() const
Handle file containing simulated and/or filtered simulated data ,.
const Char_t * GetSystem() const
const Char_t * GetBranchName() const
const Char_t * GetDataSet() const
KVSimDir * GetSimDir() const
Bool_t IsFiltered() const
const Char_t * GetTreeName() const
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