Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ProofStdVect.h
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_ProofStdVec
3///
4/// Selector for generic processing with stdlib collections
5///
6/// \macro_code
7///
8/// \author Gerardo Ganis (gerardo.ganis@cern.ch)
9
10#ifndef ProofStdVect_h
11#define ProofStdVect_h
12
13#include <TSelector.h>
14#include <TChain.h>
15
16#include <vector>
17#ifdef __MAKECINT__
18#pragma link C++ class std::vector<std::vector<bool> >+;
19#pragma link C++ class std::vector<std::vector<float> >+;
20#endif
21
22class TFile;
24class TTree;
25class TRandom3;
26class TH1F;
27
28class ProofStdVect : public TSelector {
29public :
30
31 // Specific members
32 Bool_t fCreate; //! True if in create files mode
33
34 // Create mode
35 TTree *fTree; //! The tree filled in create mode
36 TFile *fFile; //! Output file in create mode
37 TProofOutputFile *fProofFile; //! For dataset creation in create mode
38 TRandom3 *fRandom; //! Random generator in create mode
39 TH1F *fHgood; //! Histogram with good hits
40 TH1F *fHbad; //! Histogram with bad hits
41 // Std vector members
42 std::vector<std::vector<bool> > fVb; //! Booleans
43 std::vector<std::vector<float> > fVfx; //! Floats x
44 std::vector<std::vector<float> > fVfy; //! Floats y
45
46 // Read mode
47 TTree *fChain; //!pointer to the analyzed TTree or TChain
48 // Declaration of leaf types
49 std::vector<std::vector<bool> > *fVbr; //!
50 std::vector<std::vector<float> > *fVfxr; //!
51 std::vector<std::vector<float> > *fVfyr; //!
52 // List of branches
53 TBranch *b_Vb; //!
54 TBranch *b_Vfx; //!
55 TBranch *b_Vfy; //!
56
57 ProofStdVect();
58 ~ProofStdVect() override;
59 Int_t Version() const override { return 2; }
60 void Begin(TTree *tree) override;
61 void SlaveBegin(TTree *tree) override;
62 void Init(TTree *tree) override;
63 Bool_t Notify() override;
64 Bool_t Process(Long64_t entry) override;
65 Int_t GetEntry(Long64_t entry, Int_t getall = 0) override { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
66 void SetOption(const char *option) override { fOption = option; }
67 void SetObject(TObject *obj) override { fObject = obj; }
68 void SetInputList(TList *input) override { fInput = input; }
69 TList *GetOutputList() const override { return fOutput; }
70 void SlaveTerminate() override;
71 void Terminate() override;
72
73 ClassDefOverride(ProofStdVect,0);
74};
75
76#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long long Long64_t
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
A TTree is a list of TBranches.
Definition TBranch.h:93
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:621
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
Class to steer the merging of files produced on the workers.
Random number generator class based on M.
Definition TRandom3.h:27
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
virtual void SetObject(TObject *obj)
Definition TSelector.h:65
virtual void Init(TTree *)
Definition TSelector.h:53
virtual int Version() const
Definition TSelector.h:52
virtual bool Process(Long64_t)
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
TSelectorList * fOutput
! List of objects created during processing
Definition TSelector.h:42
virtual void SlaveBegin(TTree *)
Definition TSelector.h:55
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition TSelector.h:59
bool Notify() override
This method must be overridden to handle object notification (the base implementation is no-op).
Definition TSelector.h:56
virtual void SetOption(const char *option)
Definition TSelector.h:64
virtual void SetInputList(TList *input)
Definition TSelector.h:66
virtual TList * GetOutputList() const
Definition TSelector.h:69
virtual void SlaveTerminate()
Definition TSelector.h:70
virtual void Begin(TTree *)
Definition TSelector.h:54
virtual void Terminate()
Definition TSelector.h:71
A TTree represents a columnar dataset.
Definition TTree.h:79
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition TTree.cxx:5638
virtual TTree * GetTree() const
Definition TTree.h:517