4#include "KVFAZIASelector.h"
5#include "KVReconstructedNucleus.h"
6#include "KVBatchSystem.h"
9#include "KVDataAnalyser.h"
10#include "KVFAZIAReconDataAnalyser.h"
11#include "KVFAZIADetector.h"
13#include "KVClassFactory.h"
15#include "KVDataRepositoryManager.h"
16#include "KVDataSetManager.h"
17#include "KVFAZIADBRun.h"
19#include "KVFileReader.h"
62 SetReadingOfRawData(
kFALSE);
236 Error(
"CreateOutputFile",
"FAZIASELECTOR_OUTPUTS shell variable has to defined first");
244 Info(
"SetAutomaticManagementOfOutputs",
"Error in the %s directory creation",
fOutputPath.
Data());
299 Error(
"SaveAndCloseOutputFile",
"No file open for writing outputs");
356 printf(
"Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
360 printf(
"directory %s does not exist\n",
op.Data());
367 while (!
lruns.End()) {
374 if (
lr.GetNValues() > 0)
375 printf(
"Ended runs for the selector %s and the dataset %s are:\n%s\n",
kvsname,
dsname,
lr.AsString());
435 printf(
"Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
439 printf(
"directory %s does not exist\n",
op.Data());
445 gDataRepositoryManager->
Init();
456 while (!
lruns.End()) {
479 slist.ReplaceAll(
" ",
",");
481 sname.ReplaceAll(
"+ ",
"");
482 sname.ReplaceAll(
" MeV/A",
"");
483 sname.ReplaceAll(
" ",
"");
486 inst.Form(
"hadd -f -k -v 0 %s/%s.root %s/R{%s}.root",
493 else if (
lpersyst->GetNValues() == 1) {
494 inst.Form(
"hadd -f -k -v 0 %s/%s.root %s/R%d.root",
504 std::cout <<
"Creation of output file " <<
sname.Data() <<
".root from run list:" << std::endl;
505 std::cout <<
lpersyst->AsString() <<
" ..." << std::endl;
518 std::cout <<
" ... done" << std::endl;
520 Form(
"%s/listruns_%s.env",
561 printf(
"Error in CheckListOfEndedRuns : FAZIASELECTOR_OUTPUTS shell variable is not defined\n");
565 printf(
"directory %s does not exist\n",
op.Data());
571 gDataRepositoryManager->
Init();
577 while (!
lenv.End()) {
588 if (
ltot.GetNValues() > 0)
589 printf(
"System: %s, Missing Runs %s\n",
dbsys->GetName(),
ltot.AsString());
591 printf(
"System: %s, All runs done\n",
dbsys->GetName());
682 if (
line.BeginsWith(
"Info in <KVFAZIAReconDataAnalyser::SetRuns>: Accepted runs :")) {
683 line.ReplaceAll(
"Info in <KVFAZIAReconDataAnalyser::SetRuns>: Accepted runs :",
"");
687 else if (
line.BeginsWith(
"Info in <KVFAZIAReconDataAnalyser::SubmitTask>: treatment of run#")) {
688 line.ReplaceAll(
"Info in <KVFAZIAReconDataAnalyser::SubmitTask>: treatment of run#",
"");
693 else if (
line.BeginsWith(
Form(
"Info in <%s::Process>: End of file reached after ",
kvsname))) {
697 else if (
line.BeginsWith(
"CpuSys = ")) {
698 sscanf(
line.Data(),
" CpuSys = %lf s. CpuUser = %lf s. ResMem = %lf MB VirtMem = %lf MB",
704 if (
linit.GetNValues()) {
706 if (
lended.GetNValues() > 0)
716 if (
linit.GetNValues() > 0)
717 printf(
"in %s : runs not started : %s\n",
file.Data(),
linit.AsString());
724 printf(
"in %s : initial run list is empty\n",
file.Data());
742 printf(
"Maximum values\n");
743 printf(
"CpuSys=%lf s\nCpuUser=%lf s (%lf s/run)\nResMem=%lf MB\nVirtMem=%lf MB\n",
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
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)
const Char_t * GetSystemName() const
Database class used to store information on different colliding systems studied during an experiment....
virtual void preInitAnalysis()
virtual void preInitRun()
Manages access to one or more data repositories.
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Long64_t fEventsRead
number of events read
TTree * fChain
pointer to the analyzed TTree or TChain
virtual void SlaveBegin(TTree *tree)
void AddHisto(TH1 *histo)
TBranch * b_Event
List of branches.
void SetBranchName(const Char_t *n)
virtual void SetAdditionalBranchAddress()
Bool_t IsOptGiven(const Char_t *option)
Bool_t fNotifyCalled
avoid multiple calls to Notify/InitRun
TString GetOpt(const Char_t *option) const
const Char_t * GetBranchName() const
virtual void ParseOptions()
virtual KVDBSystem * GetSystem(const Char_t *system) const
Database entry for a run in a FAZIA experiment.
KVFAZIADBRun * GetRun(Int_t run) const
Base class for FAZIA detectors.
static const Char_t * GetNewName(KVString oldname)
TClonesArray * GetSignals() const
Pilot analysis of reconstructed FAZIA data.
virtual void ParseOptions()
void SetAutomaticManagementOfOutputs(Bool_t automatic=kTRUE)
TString rawdatabranchname
Bool_t NeedToReadRawData() const
virtual void CheckEndOfRun()
Testing whether EndRun() should be called.
KVFAZIARawEvent * RawEvent
static void MergeListOfEndedRuns(const Char_t *kvsname, const Char_t *dsname)
static void CheckListOfWellEndedRuns(const Char_t *kvsname, const Char_t *dsname)
virtual void Init(TTree *tree)
Bool_t SetReadingOfRawData(Bool_t need=kFALSE)
Bool_t SaveAndCloseOutputFile()
static void GetMissingRunsListing(const Char_t *kvsname, const Char_t *dsname)
Bool_t CreateOutputFile()
Int_t GetCurrentRunNumber() const
void ConnectSignalsToDetectors()
static void CheckBatchOutputFiles(const Char_t *kvsname, Bool_t eraseafter=kFALSE)
static void Make(const Char_t *kvsname="MyOwnFAZIASelector")
Automatic generation of KVSelector-derived class for KaliVeda analysis.
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Bool_t OpenFileToRead(const KVString &filename)
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Strings used to represent a set of ranges of values.
void Remove(Int_t)
Remove value 'n' from the list.
const Char_t * GetDetectorName() const
const Char_t * GetType() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
KVString Next(Bool_t strip_whitespace=kFALSE) const
virtual Int_t WriteFile(const char *fname, EEnvLevel level=kEnvAll)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual Bool_t IsOpen() const
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) const override
void Close(Option_t *option="") override
virtual void Add(TObject *obj)
const char * GetName() const override
virtual const char * GetName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
static const char * Class_Name()
const char * Data() const
void Form(const char *fmt,...)
virtual const char * Getenv(const char *env)
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
virtual Int_t Exec(const char *shellcmd)
virtual const char * BaseName(const char *pathname)
virtual TString GetFromPipe(const char *command)
virtual TBranch * GetBranch(const char *name)
TFile * GetCurrentFile() const
virtual void SetMakeClass(Int_t make)
virtual Long64_t GetEntries() const
virtual TTree * GetTree() const
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)