5#include "KVReconDataAnalyser.h"
7#include "KVMultiDetArray.h"
8#include "KVDataAnalysisTask.h"
13#include "KVAvailableRunsFile.h"
16#include <KVClassFactory.h>
17#include <KVTriggerConditions.h>
27 : fSelector(
nullptr), theChain(
nullptr)
59 cout <<
"============> Analysis summary <=============" << endl;
66 cout <<
"All events will be processed." << endl;
68 cout <<
"=============================================" << endl;
102 cout <<
"Opening file " << fullPathToRunfile << endl;
104 cout <<
"Adding file " << fullPathToRunfile;
105 cout <<
" to the TChain." << endl;
107 if (
f && !
f->IsZombie()) {
111 if (!((
TTree*)
f->Get(
"ReconEvents"))) {
112 Error(
"SubmitTask",
"No tree named ReconEvents is present in the current file");
119 TString username = treeInfos->
GetValue(
"gSystem->GetUserInfo()->fUser",
"");
123 Info(
"SubmitTask",
"No TEnv object associated to the tree");
140 if (!new_selector || !new_selector->
InheritsFrom(
"TSelector")) {
141 cout <<
"The selector \"" <<
GetUserClass() <<
"\" is not valid." << endl;
142 cout <<
"Process aborted." << endl;
147 Info(
"SubmitTask",
"Beginning TChain::Process...");
205 physics_parameters_only = (
fSelector->
GetOpt(
"WithCalibInfos") !=
"yes");
215 cout << endl <<
" =================== New Run =================== " <<
224 cout << endl <<
" ================================================= " <<
228 Info(
"preInitRun",
"Data written with series %s, release %d",
GetDataSeries().Data(),
292 Info(
"SetTriggerConditionsForRun",
293 "No definition of trigger conditions available for dataset %s",
298 trig->SetTriggerConditionsForRun(
fSelector, run);
310 if (!treeInfos)
return;
311 cout << endl <<
"----------------------------------------------------------------------------------------------------" << endl;
312 cout <<
"INFORMATIONS ON VERSION OF KALIVEDA USED TO GENERATE FILE:" << endl << endl;
315 cout <<
"build date = " << treeInfos->
GetValue(
"KVBase::GetKVBuildDate()",
"(unknown)") << endl ;
316 cout <<
"source directory = " << treeInfos->
GetValue(
"KVBase::GetKVSourceDir()",
"(unknown)") << endl ;
317 cout <<
"KVROOT = " << treeInfos->
GetValue(
"KVBase::GetKVRoot()",
"(unknown)") << endl ;
318 if (strcmp(treeInfos->
GetValue(
"KVBase::bzrBranchNick()",
"(unknown)"),
"(unknown)")) {
319 cout <<
"BZR branch name = " << treeInfos->
GetValue(
"KVBase::bzrBranchNick()",
"(unknown)") << endl ;
320 cout <<
"BZR revision #" << treeInfos->
GetValue(
"KVBase::bzrRevisionNumber()",
"(unknown)") << endl ;
321 cout <<
"BZR revision ID = " << treeInfos->
GetValue(
"KVBase::bzrRevisionId()",
"(unknown)") << endl ;
322 cout <<
"BZR revision date = " << treeInfos->
GetValue(
"KVBase::bzrRevisionDate()",
"(unknown)") << endl ;
324 else if (strcmp(treeInfos->
GetValue(
"KVBase::gitBranch()",
"(unknown)"),
"(unknown)")) {
325 cout <<
"git branch = " << treeInfos->
GetValue(
"KVBase::gitBranch()",
"(unknown)") << endl;
326 cout <<
"git commit = " << treeInfos->
GetValue(
"KVBase::gitCommit()",
"(unknown)") << endl;
328 cout << endl <<
"INFORMATIONS ON GENERATION OF FILE:" << endl << endl;
329 cout <<
"Generated by : " << treeInfos->
GetValue(
"gSystem->GetUserInfo()->fUser",
"(unknown)") << endl ;
330 cout <<
"Analysis task : " << treeInfos->
GetValue(
"AnalysisTask",
"(unknown)") << endl ;
331 cout <<
"Job name : " << treeInfos->
GetValue(
"BatchSystem.JobName",
"(unknown)") << endl ;
332 cout <<
"Job submitted from : " << treeInfos->
GetValue(
"LaunchDirectory",
"(unknown)") << endl ;
333 cout <<
"Runs : " << treeInfos->
GetValue(
"Runs",
"(unknown)") << endl ;
334 cout <<
"Number of events requested : " << treeInfos->
GetValue(
"NbToRead",
"(unknown)") << endl ;
335 cout << endl <<
"----------------------------------------------------------------------------------------------------" << endl;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
void Print(Option_t *opt="") const
Handles lists of available runs for different datasets and types of data.
virtual void UpdateInfos(Int_t run, const Char_t *filename, const Char_t *kvversion, const Char_t *username)
virtual Bool_t InfosNeedUpdate(Int_t run, const Char_t *filename)
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Description of an experimental run in database ,,.
KVDBSystem * GetSystem() const
virtual void Print(Option_t *option="") const
KV2Body * GetKinematics()
const KVString & GetUserClassOptions() const
const Char_t * GetACliCMode()
Double_t GetStatusUpdateInterval() const
const Char_t * GetUserClass()
KVDataAnalysisTask * GetAnalysisTask() const
virtual Bool_t CheckTaskVariables()
const KVString & GetUserClassImp() const
const KVString & GetDataType() const
EProofMode GetProofMode() const
Long64_t GetNbEventToRead(void) const
TObject * GetInstanceOfUserClass(const KVString &alternative_base_class="")
virtual Bool_t WithUserClass() const
Bool_t HasActivePatches() const
void Print(Option_t *="") const
Print list of currently active patches.
void InitializePatchList(TString dataset, TString datatype, Int_t runnumber, TString dataseries, Int_t datareleasenumber, const TList *streamerinfolist)
Fill lists of active patches for given data.
void Apply(KVReconstructedEvent *)
Apply all currently active patches to event.
void SetCurrentRun(KVDBRun *r)
const KVNumberList & GetRunList() const
const KVDataSet * GetDataSet() const
Int_t GetRunNumberFromFileName(const Char_t *)
Get the run number from the filename.
const KVNumberList & GetFullRunList() const
FileType * OpenRunfile(const Char_t *type, Int_t run)
KVAvailableRunsFile * GetAvailableRunsFile(const Char_t *type) const
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
Bool_t IsOptGiven(const Char_t *option)
TString GetOpt(const Char_t *option) const
KVDBRun * GetDBRun(Int_t number) const
static void SetMakeMultiDetectorPhysicsParametersOnly(Bool_t on=kTRUE)
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
const Char_t * GetList() const
Manages user analysis of reconstructed experimental data.
KVReconEventSelector * fSelector
the data analysis class
void preAnalysis() override
apply any required patches to data
TEnv * GetReconDataTreeInfos() const
void PrintTreeInfos()
Print informations on currently analysed TTree.
KVString GetDataSeries() const
KVString fDataVersion
KV version used to write analysed data.
Int_t fDataReleaseNum
KV release number used to write analysed data.
void preInitRun() override
Bool_t CheckTaskVariables(void) override
Checks the task variables.
Int_t GetDataReleaseNumber() const
Long64_t TotalEntriesToRead
KVString fDataSeries
KV series used to write analysed data.
virtual void SetTriggerConditionsForRun(int) override
TTree * theChain
chain of TTrees to be analysed
void SubmitTask() override
void Reset() override
Reset task variables.
KVDataPatchList fRustines
patches to be applied to correct data before analysis
void SetCurrentRun(KVDBRun *r)
KVReconstructedEvent * GetEvent() const
Set trigger conditions for analysis of reconstructed data.
virtual void SetProof(Bool_t on=kTRUE, Bool_t refresh=kFALSE, Bool_t gettreeheader=kFALSE)
virtual const char * GetValue(const char *name, const char *dflt) const
const TList * GetStreamerInfoCache()
TObject * FindObject(const char *name) const override
const char * GetName() const override
virtual const char * GetName() const
virtual TObject * FindObject(const char *name) const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs)
const char * Data() const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * BaseName(const char *pathname)
TFile * GetCurrentFile() const
virtual void SetDirectory(TDirectory *dir)
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
virtual Long64_t GetEntries() const
virtual TTree * GetTree() const
virtual TList * GetUserInfo()