27 : fSelector(
nullptr), theChain(
nullptr)
42 TotalEntriesToRead = 0;
50 KVReconDataAnalyser::~KVReconDataAnalyser()
68 cout <<
"============> Analysis summary <=============" << endl;
69 cout <<
"Analysis of runs " << GetRunList().GetList() <<
" with the class ";
70 cout <<
"\"" << GetUserClass() <<
"\"." << endl;
71 if (GetNbEventToRead()) {
72 cout << GetNbEventToRead() <<
" events will be processed." << endl;
75 cout <<
"All events will be processed." << endl;
77 cout <<
"=============================================" << endl;
99 theChain =
new TChain(
"ReconEvents");
100 theChain->SetDirectory(0);
102 GetRunList().Begin();
108 while (!GetRunList().
End()) {
109 run = GetRunList().Next();
111 cout <<
"Opening file " << fullPathToRunfile << endl;
113 cout <<
"Adding file " << fullPathToRunfile;
114 cout <<
" to the TChain." << endl;
115 dynamic_cast<TChain*
>(theChain)->
Add(fullPathToRunfile);
116 if (
f && !
f->IsZombie()) {
120 if (!((
TTree*)
f->Get(
"ReconEvents"))) {
121 Error(
"SubmitTask",
"No tree named ReconEvents is present in the current file");
128 TString username = treeInfos->
GetValue(
"gSystem->GetUserInfo()->fUser",
"");
132 Info(
"SubmitTask",
"No TEnv object associated to the tree");
137 TotalEntriesToRead = theChain->GetEntries();
138 TString option =
Form(
"EventsReadInterval=%lld,", GetAnalysisTask()->GetStatusUpdateInterval());
139 option +=
Form(
"FullRunList=%s", GetFullRunList().GetList());
142 if (GetUserClassOptions() !=
"") {
144 option += GetUserClassOptions();
147 TObject* new_selector = GetInstanceOfUserClass();
149 if (!new_selector || !new_selector->
InheritsFrom(
"TSelector")) {
150 cout <<
"The selector \"" << GetUserClass() <<
"\" is not valid." << endl;
151 cout <<
"Process aborted." << endl;
156 Info(
"SubmitTask",
"Beginning TChain::Process...");
158 if (GetProofMode() != KVDataAnalyser::EProofMode::None)
dynamic_cast<TChain*
>(theChain)->SetProof(
kTRUE);
163 if (GetAnalysisTask()->WithUserClass()) analysis_class.
Form(
"%s%s", GetUserClassImp().Data(), GetACliCMode());
164 else analysis_class = GetUserClass();
166 if (GetNbEventToRead()) {
167 theChain->Process(analysis_class, option.
Data(), GetNbEventToRead());
170 theChain->Process(analysis_class, option.
Data());
194 if (save) GetBatchInfoFile()->SaveLevel(
kEnvUser);
253 if (fSelector->IsOptGiven(
"WithCalibInfos"))
254 physics_parameters_only = (fSelector->GetOpt(
"WithCalibInfos") !=
"yes");
256 Int_t run = GetRunNumberFromFileName(theChain->GetCurrentFile()->GetName());
259 SetCurrentRun(CurrentRun);
260 fSelector->SetCurrentRun(CurrentRun);
262 cout << endl <<
" =================== New Run =================== " <<
271 cout << endl <<
" ================================================= " <<
275 Info(
"preInitRun",
"Data written with series %s, release %d", GetDataSeries().Data(),
276 GetDataReleaseNumber());
277 fRustines.InitializePatchList(GetDataSet()->GetName(),
GetDataType(), run, GetDataSeries(),
278 GetDataReleaseNumber(), theChain->GetCurrentFile()->GetStreamerInfoCache());
294 if (fRustines.HasActivePatches()) fRustines.Apply(fSelector->GetEvent());
303 return (
TEnv*)theChain->GetTree()->GetUserInfo()->
FindObject(
"TEnv");
334 Info(
"SetTriggerConditionsForRun",
335 "No definition of trigger conditions available for dataset %s",
336 GetDataSet()->GetName());
340 trig->SetTriggerConditionsForRun(fSelector, run);
352 TEnv* treeInfos = GetReconDataTreeInfos();
353 if (!treeInfos)
return;
354 cout << endl <<
"----------------------------------------------------------------------------------------------------" << endl;
355 cout <<
"INFORMATIONS ON VERSION OF KALIVEDA USED TO GENERATE FILE:" << endl << endl;
356 fDataVersion = treeInfos->
GetValue(
"KVBase::GetKVVersion()",
"(unknown)");
357 cout <<
"version = " << fDataVersion << endl ;
358 cout <<
"build date = " << treeInfos->
GetValue(
"KVBase::GetKVBuildDate()",
"(unknown)") << endl ;
359 cout <<
"source directory = " << treeInfos->
GetValue(
"KVBase::GetKVSourceDir()",
"(unknown)") << endl ;
360 cout <<
"KVROOT = " << treeInfos->
GetValue(
"KVBase::GetKVRoot()",
"(unknown)") << endl ;
361 if (strcmp(treeInfos->
GetValue(
"KVBase::bzrBranchNick()",
"(unknown)"),
"(unknown)")) {
362 cout <<
"BZR branch name = " << treeInfos->
GetValue(
"KVBase::bzrBranchNick()",
"(unknown)") << endl ;
363 cout <<
"BZR revision #" << treeInfos->
GetValue(
"KVBase::bzrRevisionNumber()",
"(unknown)") << endl ;
364 cout <<
"BZR revision ID = " << treeInfos->
GetValue(
"KVBase::bzrRevisionId()",
"(unknown)") << endl ;
365 cout <<
"BZR revision date = " << treeInfos->
GetValue(
"KVBase::bzrRevisionDate()",
"(unknown)") << endl ;
367 else if (strcmp(treeInfos->
GetValue(
"KVBase::gitBranch()",
"(unknown)"),
"(unknown)")) {
368 cout <<
"git branch = " << treeInfos->
GetValue(
"KVBase::gitBranch()",
"(unknown)") << endl;
369 cout <<
"git commit = " << treeInfos->
GetValue(
"KVBase::gitCommit()",
"(unknown)") << endl;
371 cout << endl <<
"INFORMATIONS ON GENERATION OF FILE:" << endl << endl;
372 cout <<
"Generated by : " << treeInfos->
GetValue(
"gSystem->GetUserInfo()->fUser",
"(unknown)") << endl ;
373 cout <<
"Analysis task : " << treeInfos->
GetValue(
"AnalysisTask",
"(unknown)") << endl ;
374 cout <<
"Job name : " << treeInfos->
GetValue(
"BatchSystem.JobName",
"(unknown)") << endl ;
375 cout <<
"Job submitted from : " << treeInfos->
GetValue(
"LaunchDirectory",
"(unknown)") << endl ;
376 cout <<
"Runs : " << treeInfos->
GetValue(
"Runs",
"(unknown)") << endl ;
377 cout <<
"Number of events requested : " << treeInfos->
GetValue(
"NbToRead",
"(unknown)") << endl ;
378 cout << endl <<
"----------------------------------------------------------------------------------------------------" << endl;
386 if (fDataVersion !=
"(unknown)") {
387 if (fDataVersion.Contains(
"/")) {
388 if (sscanf(fDataVersion.Data(),
"%d.%d/%d", &
a, &
b, &
c) == 3) {
389 fDataSeries.Form(
"%d.%d",
a,
b);
394 if (sscanf(fDataVersion.Data(),
"%d.%d.%d", &
a, &
b, &
c) == 3) {
395 fDataSeries.Form(
"%d.%d",
a,
b);
402 fDataReleaseNum = -1;
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TProof * gProof
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()
virtual Bool_t CheckTaskVariables()
void WriteBatchEnvFile(const Char_t *jobname, Bool_t save=kTRUE)
KVAvailableRunsFile * GetAvailableRunsFile(const Char_t *type) const
FileType * OpenRunfile(const Char_t *type, Int_t run)
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
KVDBRun * GetDBRun(Int_t number) const
virtual void SetMinimumOKMultiplicity(KVEvent *) const
virtual void SetParameters(UInt_t n, Bool_t physics_parameters_only=kFALSE)
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
Manages user analysis of reconstructed experimental data.
virtual void SetTriggerConditionsForRun(int)
TEnv * GetReconDataTreeInfos() const
void PrintTreeInfos()
Print informations on currently analysed TTree.
void preAnalysis()
Set minimum (trigger) multiplicity for array.
virtual void Reset()
Reset task variables.
virtual void SubmitTask()
virtual void WriteBatchEnvFile(const Char_t *, Bool_t sav=kTRUE)
virtual Bool_t CheckTaskVariables(void)
Checks the task variables.
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
virtual TObject * FindObject(const char *name) const
virtual Bool_t InheritsFrom(const char *classname) const
Longptr_t ExecPlugin(int nargs, const T &... params)
const char * Data() const
void Form(const char *fmt,...)
virtual const char * BaseName(const char *pathname)
void Add(RHist< DIMENSIONS, PRECISION, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION, STAT_FROM... > &from)
BinData::ErrorType GetDataType(const TGraph *gr, DataOptions &fitOpt)