KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVEventSelector.cpp
Go to the documentation of this file.
1 #define KVEventSelector_cxx
2 #include "KVEventSelector.h"
3 #include <KVClassMonitor.h>
4 #include <TStyle.h>
5 #include "TPluginManager.h"
6 #include "TSystem.h"
8 #include "KVDataRepository.h"
9 #include "KVDataSetManager.h"
10 #include "TProof.h"
11 #include "KVDataSetAnalyser.h"
12 
13 using namespace std;
14 
16 
17 
18 
19 
20 
25 void KVEventSelector::Begin(TTree* /*tree*/)
26 {
27  // Need to parse options here for use in Terminate
28  // Also, on PROOF, any KVDataAnalyser instance has to be passed to the workers
29  // via the TSelector input list.
30 
31  ParseOptions();
32 
33  if (IsOptGiven("CombinedOutputFile")) {
34  fCombinedOutputFile = GetOpt("CombinedOutputFile");
35  }
36  else if (gProof) {
37  // when running with PROOF, if the user calls SetCombinedOutputFile()
38  // in InitAnalysis(), it will only be executed on the workers (in SlaveBegin()).
39  // therefore we call InitAnalysis() here, but deactivate CreateTreeFile(),
40  // AddTree() and AddHisto() in order to avoid interference with workers
41  fDisableCreateTreeFile = kTRUE;
42  if (gDataAnalyser) {
45  }
46  InitAnalysis(); //user initialisations for analysis
48  fDisableCreateTreeFile = kFALSE;
49  }
50 
51  if (gDataAnalyser) {
52  if (GetInputList()) {
53  gDataAnalyser->AddJobDescriptionList(GetInputList());
54  //GetInputList()->ls();
55  }
56  }
57  if (IsOptGiven("AuxFiles")) {
58  SetUpAuxEventChain();
59  if (GetInputList()) GetInputList()->Add(fAuxChain);
60  }
61 }
62 
63 
64 
78 
80 {
81  // The SlaveBegin() function is called after the Begin() function.
82  // When running with PROOF SlaveBegin() is called on each slave server.
83  // The tree argument is deprecated (on PROOF 0 is passed).
84  //
85  // ParseOptions : Manage options passed as arguments
86  //
87  // Called user method InitAnalysis where users can create trees or histos
88  // using the appropiate methods :
89  // CreateTrees and CreateMethods
90  //
91  // Test the presence or not of such histo or tree
92  // to manage it properly
93 
94  if (GetInputList() && GetInputList()->FindObject("JobDescriptionList")) {
95  KVNameValueList* jdl = dynamic_cast<KVNameValueList*>(GetInputList()->FindObject("JobDescriptionList"));
96  if (jdl) {
97  KVDataAnalysisTask* task = nullptr;
98  if (jdl->HasParameter("DataRepository")) {
102  }
103  gDataRepositoryManager->GetRepository(jdl->GetStringValue("DataRepository"))->cd();
104  gDataSetManager->GetDataSet(jdl->GetStringValue("DataSet"))->cd();
105  task = gDataSet->GetAnalysisTask(jdl->GetStringValue("AnalysisTask"));
106  }
107  else {
108  if (!gDataSetManager) {
111  }
112  task = gDataSetManager->GetAnalysisTaskAny(jdl->GetStringValue("AnalysisTask"));
113  }
115  if (gDataSet && gDataAnalyser->InheritsFrom("KVDataSetAnalyser"))
116  dynamic_cast<KVDataSetAnalyser*>(gDataAnalyser)->SetDataSet(gDataSet);
120  }
121  }
122 
123  ParseOptions();
124 
125  if (IsOptGiven("CombinedOutputFile")) {
126  fCombinedOutputFile = GetOpt("CombinedOutputFile");
127  Info("SlaveBegin", "Output file name = %s", fCombinedOutputFile.Data());
128  }
129 
130  // tell the data analyser who we are
131  if (gDataAnalyser) {
134  }
135  // make sure histo/tree creation are enabled
136  fDisableCreateTreeFile = kFALSE;
137  InitAnalysis(); //user initialisations for analysis
139 
140  if (IsOptGiven("AuxFiles")) {
141  // auxiliary files with PROOF
142  if (GetInputList()) {
143  fAuxChain = (TTree*)GetInputList()->FindObject(GetOpt("AuxTreeName"));
144  InitFriendTree(fAuxChain, GetOpt("AuxBranchName"));
145  }
146  }
147  Info("SlaveBegin", "fOutput->ls()");
148  GetOutputList()->ls();
149 }
150 
151 
152 
172 
174 {
175  // The Process() function is called for each entry in the tree (or possibly
176  // keyed object in the case of PROOF) to be processed. The entry argument
177  // specifies which entry in the currently loaded tree is to be processed.
178  // It can be passed to either KVEventSelector::GetEntry() or TBranch::GetEntry()
179  // to read either all or the required parts of the data. When processing
180  // keyed objects with PROOF, the object is already loaded and is available
181  // via the fObject pointer.
182  //
183  // This function should contain the "body" of the analysis. It can contain
184  // simple or elaborate selection criteria, run algorithms on the data
185  // of the event and typically fill histograms.
186  //
187  // Processing will abort cleanly if static flag fCleanAbort has been set
188  // by some external controlling process.
189  //
190  // Use fStatus to set the return value of TTree::Process().
191  //
192  // The return value is currently not used.
193 
195  // abort requested by external process
196  Abort(Form("Job received KILL signal from batch system after %lld events - batch job probably needs more CPU time (see end of job statistics)", fEventsRead), kAbortFile);
197  return kFALSE;
198  }
199 
200  fTreeEntry = entry;
201 
203  gDataAnalyser->DoStatusUpdate(fEventsRead);
204 
205  GetEntry(entry);
207  fEventsRead++;
208  if (GetEvent()) {
209  SetAnalysisFrame();//let user define any necessary reference frames for particles
210  //apply particle selection criteria
211  if (fPartCond.IsSet()) {
212  for (auto& part : EventOKIterator(GetEvent())) {
213  part.SetIsOK(fPartCond.Test(part));
214  }
215  }
216 
217  // initialise global variables at first event
218  if (fFirstEvent) {
219  for (auto p : fGlobalVariables) dynamic_cast<KVGVList*>(p)->Init();
220  fFirstEvent = kFALSE;
221  }
222  RecalculateGlobalVariables();
223  }
224 
225  Bool_t ok_anal = kTRUE;
226  if (!fGlobalVariableAbortEventAnalysis) {
227  // if global variables are defined, events are only analysed if no global variables
228  // in the list have failed an event selection condition
229  ok_anal = Analysis(); //user analysis
231  }
232  CheckEndOfRun();
233 
234  return ok_anal;
235 }
236 
237 
238 
241 
243 {
244  // Testing whether EndRun() should be called
245  if (AtEndOfRun()) {
246  Info("Process", "End of file reached after %lld events", fEventsRead);
248  EndRun();
250  fNotifyCalled = kFALSE;//Notify will be called when next file is opened (in TChain)
251  }
252 
253 }
254 
255 
256 
261 
263 {
264  // The SlaveTerminate() function is called after all entries or objects
265  // have been processed. When running with PROOF SlaveTerminate() is called
266  // on each slave server.
267 
268  if (writeFile) {
269  auto sav_dir = gDirectory;//save current working directory
270 
271  writeFile->cd();
272  // loop over all histos and trees, writing them in the output file
273  if (lhisto.GetEntries()) {
274  lhisto.R__FOR_EACH(TH1, Write)();
275  }
276  if (ltree.GetEntries()) {
277  ltree.R__FOR_EACH(TTree, Write)(0, TObject::kOverwrite);
278  }
279  writeFile->Close();
280  if (gDataAnalyser->GetProofMode() != KVDataAnalyser::EProofMode::None) {
281  fOutput->Add(mergeFile);
282  }
283 
284  sav_dir->cd();
285  }
286 }
287 
288 
289 
298 
300 {
301  // The Terminate() function is the last function to be called during
302  // a query. It always runs on the client, it can be used to present
303  // the results graphically or save the results to file.
304  //
305  // This method call the user defined EndAnalysis
306  // where user can do what she wants
307  //
308 
309  TDatime now;
310  Info("Terminate", "Analysis ends at %s", now.AsString());
311 
313  EndAnalysis(); //user end of analysis routine
315 
316  if (GetInputList() && fAuxChain) GetInputList()->Remove(fAuxChain);
317  SafeDelete(fAuxChain);
318 }
319 
320 
321 
352 
354  const Char_t* name)
355 {
356  //Add a global variable to the list of variables for the analysis.
357  //
358  //`"class_name"` must be the name of a valid class inheriting from KVVarGlob, e.g. any of the default global
359  //variable classes defined as part of the standard KaliVeda package (see the [global variables module](group__Globvars.html)),
360  //or the name of a user-defined class (see below).
361  //
362  //`"name"` is a unique name for the new global variable object which will be created and added to the internal
363  //list of global variables. This name can be used to retrieve the object (see GetGV()) in the user's analysis.
364  //
365  //Returns pointer to new global variable object in case more than the usual default initialisation is necessary.
366  //
367  //### User-defined global variables
368  //The user may use her own global variables in an analysis class, without having to add them to the main libraries.
369  //If the given class name is not known, it is assumed to be a user-defined class and we attempt to compile and load
370  //the class from the user's source code. For this to work, the user must:
371  //
372  // 1. add to the ROOT macro path the directory where her class's source code is kept, e.g. in `$HOME/.rootrc` add the following line:
373  //
374  //~~~~~~~~~~~~~~~
375  // +Unix.*.Root.MacroPath: $(HOME)/myVarGlobs
376  //~~~~~~~~~~~~~~~
377  //
378  // 2. for each user-defined class, add a line to $HOME/.kvrootrc to define a "plugin". E.g. for a class called MyNewVarGlob,
379  //
380  //~~~~~~~~~~~~~~~
381  // +Plugin.KVVarGlob: MyNewVarGlob MyNewVarGlob MyNewVarGlob.cpp+ "MyNewVarGlob()"
382  //~~~~~~~~~~~~~~~
383  //
384  // It is assumed that `MyNewVarGlob.h` and `MyNewVarGlob.cpp` will be found in `$HOME/myVarGlobs` (in this example).
385 
386  KVVarGlob* vg = GetGVList()->AddGV(class_name, name);
387  return vg;
388 }
389 
390 
391 
392 
402 
404 {
405  //Use this method if you change e.g. the particle selection criteria in your
406  //Analysis() method and want to recalculate the values of all global variables
407  //for your new selection.
408  //
409  //WARNING: the global variables are calculated automatically for you for each event
410  //before method Analysis() is called. In order for the correct particles to be included in
411  //this calculation, make sure that at the END of Analysis() you reset the selection
412  //criteria.
413 
414  fGlobalVariableAbortEventAnalysis = false;
415  for (auto p : fGlobalVariables) {
416  auto gvl = dynamic_cast<KVGVList*>(p);
417  gvl->CalculateGlobalVariables(GetEvent());
418  // check if a variable event selection failed
419  if (gvl->AbortEventAnalysis()) {
420  fGlobalVariableAbortEventAnalysis = true;
421  return;
422  }
423  }
424 }
425 
426 
427 
428 
442 
444 {
445  //Use this method to set criteria for selecting particles to include in analysis.
446  //The criteria defined in the KVParticleCondition object will be applied to every
447  //particle and if they are not satisfied the particle's
448  //"OK" flag will be set to false, i.e. the particle's IsOK() method will return kFALSE,
449  //and the particle will not be included in iterations such as GetEvent()->GetNextParticle("OK").
450  //Neither will the particle be included in the evaluation of any global variables.
451  //
452  //This method must be called in the user's InitAnalysis() or InitRun() method.
453  //
454  //If the methods used in the condition are not defined for KVNucleus, you can give the
455  //name of the class to which the methods refer (upcast_class), or you can set it before
456  //hand (SetParticleConditionsParticleClassName)
457 
458  fPartCond = cond;
459  if (upcast_class != "") fPartCond.SetParticleClassName(upcast_class);
460  else if (fPartName != "") fPartCond.SetParticleClassName(fPartName);
461 }
462 
463 
464 
465 
468 
470 {
471 
472  //return the list of created trees
473  return &lhisto;
474 
475 }
476 
477 
478 
479 
481 
482 TH1* KVEventSelector::GetHisto(const Char_t* histo_name) const
483 {
484 
485  return lhisto.get_object<TH1>(histo_name);
486 
487 }
488 
489 
490 
491 
495 
497 {
498  // Declare a histogram to be used in analysis.
499  // This method must be called when using PROOF.
500 
501  if (fDisableCreateTreeFile) return;
502 
503  lhisto.Add(histo);
504 
505  if (writeFile) histo->SetDirectory(writeFile); // if output file is initialized, associate histo with it
506  else create_output_file();// try to initialize output file
507 }
508 
509 
510 
514 
516 {
517  // Declare a TTree to be used in analysis.
518  // This method must be called when using PROOF.
519 
520  if (fDisableCreateTreeFile) return;
521 
522  tree->SetAutoSave();
523  ltree.Add(tree);
524 
525  if (writeFile) tree->SetDirectory(writeFile); // if output file is initialized, associate tree with it
526  else create_output_file();// try to initialize output file
527 }
528 
529 
530 
535 
537 {
538  // Create the file for saving histos and/or trees created during analysis.
539  //
540  // The name of the file must first be set using SetJobOutputFileName()
541 
542  if (fCombinedOutputFile == "") return;
543 
544  auto sav_dir = gDirectory;//save current working directory
545  if (gDataAnalyser->GetProofMode() == KVDataAnalyser::EProofMode::None) {
546  // Analysis running in 'normal' (non-PROOF) mode
547  writeFile = TFile::Open(fCombinedOutputFile, "RECREATE");
548  }
549  else {
550  // Analysis running with PROOF(Lite)
551  mergeFile = new TProofOutputFile(fCombinedOutputFile, "M");
552  mergeFile->SetOutputFileName(fCombinedOutputFile);
553  writeFile = mergeFile->OpenFile("RECREATE");
554  if (writeFile && writeFile->IsZombie()) SafeDelete(writeFile);
555  }
556  sav_dir->cd();//return to previous working directory
557 
558  if (!writeFile) {
559  TString amsg = TString::Format("%s::create_output_file: could not create output ROOT file '%s'!",
560  ClassName(), fCombinedOutputFile.Data());
561  Abort(amsg, kAbortProcess);
562  }
563 
564  // any previously declared histograms or trees must now be associated with the output file
565  if (lhisto.GetEntries()) {
566  lhisto.R__FOR_EACH(TH1, SetDirectory)(writeFile);
567  }
568  if (ltree.GetEntries()) {
569  ltree.R__FOR_EACH(TTree, SetDirectory)(writeFile);
570  }
571 }
572 
573 
574 
576 
578 {
579  Deprecate("Calling this method is no longer required, and any filename given will be ignored."
580  " Call SetJobOutputFileName() to define the output filename.");
581  return kTRUE;
582 }
583 
584 
585 
588 
589 TTree* KVEventSelector::AddTree(const TString& name, const TString& title)
590 {
591  // Add TTree with given name and title to list of TTree to be filled by user's analysis
592 
593  auto t = new TTree(name, title);
594  add_tree(t);
595  return t;
596 }
597 
598 
599 
600 
606 
607 void KVEventSelector::FillHisto(const Char_t* histo_name, Double_t one, Double_t two, Double_t three, Double_t four)
608 {
609 
610  //Find in the list, if there is an histogram named "sname"
611  //If not print an error message
612  //If yes redirect to the right method according to its closest mother class
613  //to fill it
614  TH1* h1 = 0;
615  if ((h1 = GetHisto(histo_name))) {
616  if (h1->InheritsFrom("TH3"))
617  FillTH3((TH3*)h1, one, two, three, four);
618  else if (h1->InheritsFrom("TProfile2D"))
619  FillTProfile2D((TProfile2D*)h1, one, two, three, four);
620  else if (h1->InheritsFrom("TH2"))
621  FillTH2((TH2*)h1, one, two, three);
622  else if (h1->InheritsFrom("TProfile"))
623  FillTProfile((TProfile*)h1, one, two, three);
624  else if (h1->InheritsFrom("TH1"))
625  FillTH1(h1, one, two);
626  else
627  Warning("FillHisto", "%s -> Classe non prevue ...", lhisto.FindObject(histo_name)->ClassName());
628  }
629  else {
630  Warning("FillHisto", "%s introuvable", histo_name);
631  }
632 
633 }
634 
635 
636 
639 
640 void KVEventSelector::FillHisto(const Char_t* histo_name, const Char_t* label, Double_t weight)
641 {
642  // Fill 1D histogram with named bins
643  TH1* h1 = 0;
644  if ((h1 = GetHisto(histo_name))) {
645  h1->Fill(label, weight);
646  }
647  else {
648  Warning("FillHisto", "%s introuvable", histo_name);
649  }
650 
651 }
652 
653 
654 
655 
657 
659 {
660 
661  h1->Fill(one, two);
662 
663 }
664 
665 
666 
667 
669 
671 {
672 
673  h1->Fill(one, two, three);
674 
675 }
676 
677 
678 
679 
681 
683 {
684 
685  h2->Fill(one, two, three);
686 
687 }
688 
689 
690 
691 
693 
695 {
696 
697  h2->Fill(one, two, three, four);
698 }
699 
700 
701 
702 
704 
706 {
707 
708  h3->Fill(one, two, three, four);
709 }
710 
711 
712 
722 
724 {
725  // Called by SlaveBegin() when user gives the following options:
726  //
727  //~~~~~~~~~~~~~~~~
728  // AuxFiles: list of files containing "friend" TTrees to be made available during analysis
729  // AuxDir: directory in which to find AuxFiles
730  // AuxTreeName: name of tree in AuxFiles containing KVEvent objects
731  // AuxBranchName: name of branch in AuxFiles containing KVEvent objects
732  //~~~~~~~~~~~~~~~~
733 
734  if (!IsOptGiven("AuxDir") || !IsOptGiven("AuxTreeName") || !IsOptGiven("AuxBranchName")) {
735  Error("SetUpAuxEventChain", "if AuxFiles option given, you must define AuxDir, AuxTreeName and AuxBranchName");
736  return;
737  }
738  KVString filelist = GetOpt("AuxFiles");
739  KVString filedir = GetOpt("AuxDir");
740  if (!filedir.EndsWith("/")) filedir += "/";
741  TChain* auxchain = new TChain(GetOpt("AuxTreeName"));
742  filelist.Begin("|");
743  while (!filelist.End()) {
744  KVString path = filedir + filelist.Next();
745  auxchain->Add(path);
746  }
747  InitFriendTree(auxchain, GetOpt("AuxBranchName"));
748 }
749 
750 
751 
752 
755 
757 {
758  //return the list of created trees
759  return &ltree;
760 
761 }
762 
763 
764 
765 
768 
769 TTree* KVEventSelector::GetTree(const Char_t* tree_name) const
770 {
771  //return the tree named tree_name
772  TTree* t = ltree.get_object<TTree>(tree_name);
773  if (!t) Fatal("GetTree", "Tree %s not found: is this the right name?", tree_name);
774  return t;
775 }
776 
777 
778 
779 
786 
787 void KVEventSelector::FillTree(const Char_t* tree_name)
788 {
789  //Filltree method, the tree named tree_name
790  //has to be declared with AddTTree(TTree*) method
791  //
792  //if no sname="", all trees in the list is filled
793  //
794  if (!strcmp(tree_name, "")) {
795  ltree.R__FOR_EACH(TTree, Fill)();
796  }
797  else {
798  TTree* tt = 0;
799  if ((tt = GetTree(tree_name))) {
800  tt->Fill();
801  }
802  else {
803  Warning("FillTree", "%s introuvable", tree_name);
804  }
805  }
806 
807 }
808 
809 
810 
814 
816 {
817  // Call this method in your InitRun() method with the current run number in order to
818  // automatically reject events which are not consistent with the acquisition trigger.
820 }
821 
822 
823 
836 
838 {
839  // Analyse comma-separated list of options given to TTree::Process
840  // and store all `"option=value"` pairs in fOptionList.
841  // Options can then be accessed using IsOptGiven(), GetOptString(), etc.
842  //
843  //~~~~~~~~~~~~~~~
844  // BranchName=xxxx : change name of branch in TTree containing data
845  // EventsReadInterval=N: print "+++ 12345 events processed +++" every N events
846  //~~~~~~~~~~~~~~~
847  //
848  // This method is called by SlaveBegin
849  //
850 
851  fOptionList.ParseOptions(GetOption());
852 
853  // check for branch name
854  if (IsOptGiven("BranchName")) SetBranchName(GetOpt("BranchName"));
855  // check for events read interval
856  if (IsOptGiven("EventsReadInterval")) SetEventsReadInterval(GetOpt("EventsReadInterval").Atoi());
857 }
858 
859 
860 
870 
872 {
873  // The Init() function is called when the selector needs to initialize
874  // a new tree or chain. Typically here the branch addresses and branch
875  // pointers of the tree will be set.
876  // It is normally not necessary to make changes to the generated
877  // code, but the routine can be extended by the user if needed.
878  // Init() will be called many times when running on PROOF
879  // (once per file to be processed).
880 
881  // Set object pointer
882  Event = nullptr;
883  // Set branch addresses and branch pointers
884  if (!tree) return;
885  fChain = tree;
886  fChain->SetMakeClass(1);
887  // When using PROOF, need to set tree pointer in KVDataAnalyser
888  if (gDataAnalyser->GetProofMode() != KVDataAnalyser::EProofMode::None) {
890  }
891 
892  if (strcmp(GetBranchName(), "") && fChain->GetBranch(GetBranchName())) {
893  Info("Init", "Analysing data in branch : %s", GetBranchName());
894  fChain->SetBranchAddress(GetBranchName(), &Event, &b_Event);
895  }
896  else {
897  Error("Init", "Failed to link KVEvent object with a branch. Expected branch name=%s",
898  GetBranchName());
899  }
900  //user additional branches addressing
901  SetAdditionalBranchAddress();
902  fEventsRead = 0;
903 
904 }
905 
906 
907 
920 
922 {
923  // Set up a "friend" TTree/TChain containing KVEvent-derived objects in branch 'branchname'
924  // N.B. this is not a "friend" in the sense of TTree::AddFriend, the main TTree and the
925  // "friend" TTree can have different numbers of entries
926  //
927  // After calling this method at the beginning of the analysis, you can
928  // access any of the events stored in the "friend" by doing:
929  //
930  //~~~~~~~~~~~~
931  // GetFriendTreeEntry(entry_number);
932  // KVEvent* friend_event = GetFriendEvent();
933  //~~~~~~~~~~~~
934 
935  AuxEvent = 0;
936  fAuxChain = tree;
937  fAuxChain->SetBranchAddress(branchname, &AuxEvent);
938  fAuxChain->Print();
939  fAuxChain->GetEntry(0);
940  fAuxChain->GetTree()->GetEntry(0);
941 }
942 
943 
944 
951 
953 {
954  // The Notify() function is called when a new file is opened. This
955  // can be either for a new TTree in a TChain or when when a new TTree
956  // is started when using PROOF. It is normally not necessary to make changes
957  // to the generated code, but the routine can be extended by the
958  // user if needed. The return value is currently not used.
959 
960  if (fNotifyCalled) return kTRUE; // avoid multiple calls at beginning of analysis
961  fNotifyCalled = kTRUE;
962 
963  Info("Notify", "Beginning analysis of file %s (%lld events)", fChain->GetCurrentFile()->GetName(), fChain->GetTree()->GetEntries());
964 
966  InitRun(); //user initialisations for run
968 
970 
971  return kTRUE;
972 }
973 
974 
KVDataAnalyser * gDataAnalyser
KVDataRepositoryManager * gDataRepositoryManager
KVDataSetManager * gDataSetManager
KVDataSet * gDataSet
Definition: KVDataSet.cpp:29
KVTemplateEvent< KVNucleus >::EventOKIterator EventOKIterator
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define SafeDelete(p)
char Char_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
#define gDirectory
R__EXTERN TProof * gProof
char * Form(const char *fmt,...)
static KVClassMonitor * GetInstance()
Return pointer to unique instance of class monitor class.
void SetInitStatistics()
virtual void SetTriggerConditionsForRun(int)
virtual void SetAnalysedTree(TTree *)
virtual void postEndRun()
void DoStatusUpdate(Long64_t nevents) const
Print infos on events treated, disk usage, memory usage.
virtual void AddJobDescriptionList(TList *)
virtual void preInitAnalysis()
virtual void postAnalysis()
void SetAnalysisTask(KVDataAnalysisTask *at)
void SetProofMode(EProofMode e)
virtual Bool_t CheckStatusUpdateInterval(Long64_t nevents) const
virtual void preAnalysis()
static KVDataAnalyser * GetAnalyser(const Char_t *plugin)
EProofMode GetProofMode() const
virtual void preEndRun()
virtual void postInitRun()
static Bool_t AbortProcessingLoop()
virtual void postEndAnalysis()
virtual void preEndAnalysis()
virtual void preInitRun()
virtual void RegisterUserClass(TObject *)
virtual void postInitAnalysis()
Define and manage data analysis tasks.
virtual const Char_t * GetDataAnalyser() const
Manages access to one or more data repositories.
KVDataRepository * GetRepository(const Char_t *name) const
Pilots user analysis of experimental data.
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
KVDataAnalysisTask * GetAnalysisTaskAny(const Char_t *keywords) const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:589
General purpose analysis class for TTree containing KVEvent objects.
void FillTProfile2D(TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
void AddGV(KVVarGlob *vg)
const KVHashList * GetTreeList() const
return the list of created trees
TH1 * GetHisto(const Char_t *name) const
void SetParticleConditions(const KVParticleCondition &, const KVString &="")
void FillTree(const Char_t *sname="")
void InitFriendTree(TTree *tree, const TString &branchname)
const KVHashList * GetHistoList() const
return the list of created trees
TTree * GetTree(const Char_t *name) const
return the tree named tree_name
virtual void CheckEndOfRun()
Testing whether EndRun() should be called.
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
Bool_t CreateTreeFile(const Char_t *filename="")
void AddTree(TTree *tree)
virtual void SlaveBegin(TTree *tree)
virtual void SlaveTerminate()
virtual void Terminate()
virtual Bool_t Notify()
void add_histo(TH1 *histo)
for merging with PROOF
void FillHisto(const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
void FillTProfile(TProfile *h1, Double_t one, Double_t two, Double_t three)
void SetTriggerConditionsForRun(int)
void FillTH1(TH1 *h1, Double_t one, Double_t two)
virtual void Init(TTree *tree)
void add_tree(TTree *tree)
virtual void RecalculateGlobalVariables()
virtual Bool_t Process(Long64_t entry)
virtual void ParseOptions()
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
Manage a list of global variables.
Definition: KVGVList.h:122
void CalculateGlobalVariables(KVEvent *e)
Definition: KVGVList.cpp:211
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Int_t GetIntValue(const Char_t *name) const
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
void SetParticleClassName(const Char_t *cl)
Base class for all global variable implementations.
Definition: KVVarGlob.h:231
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
const char * AsString() const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
virtual void SetDirectory(TDirectory *dir)
virtual Int_t Fill(const char *name, Double_t w)
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w)
virtual Bool_t InheritsFrom(const char *classname) const
virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w=1.)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
long long Long64_t
RooCmdArg ClassName(const char *name)
TH1F * h1
void Init()
void Info(const char *location, const char *va_(fmt),...)
void Error(const char *location, const char *va_(fmt),...)
void Fatal(const char *location, const char *va_(fmt),...)
void Warning(const char *location, const char *va_(fmt),...)
TH1 * GetHisto(const std::string file, const std::string path, const std::string obj)
auto * tt