Logo ROOT   6.12/07
Reference Guide
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 
22 class TFile;
23 class TProofOutputFile;
24 class TTree;
25 class TRandom3;
26 class TH1F;
27 
28 class ProofStdVect : public TSelector {
29 public :
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  virtual ~ProofStdVect();
59  virtual Int_t Version() const { return 2; }
60  virtual void Begin(TTree *tree);
61  virtual void SlaveBegin(TTree *tree);
62  void Init(TTree *tree);
63  Bool_t Notify();
64  virtual Bool_t Process(Long64_t entry);
65  virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
66  virtual void SetOption(const char *option) { fOption = option; }
67  virtual void SetObject(TObject *obj) { fObject = obj; }
68  virtual void SetInputList(TList *input) { fInput = input; }
69  virtual TList *GetOutputList() const { return fOutput; }
70  virtual void SlaveTerminate();
71  virtual void Terminate();
72 
73  ClassDef(ProofStdVect,0);
74 };
75 
76 #endif
virtual Int_t GetEntry(Long64_t, Int_t=0)
Definition: TSelector.h:61
Random number generator class based on M.
Definition: TRandom3.h:27
TSelectorList * fOutput
! List of objects created during processing
Definition: TSelector.h:44
long long Long64_t
Definition: RtypesCore.h:69
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Definition: TSelector.h:58
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:46
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition: TTree.cxx:5330
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:567
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetInputList(TList *input)
Definition: TSelector.h:68
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void Begin(TTree *)
Definition: TSelector.h:56
virtual TTree * GetTree() const
Definition: TTree.h:434
A doubly linked list.
Definition: TList.h:44
virtual int Version() const
Definition: TSelector.h:54
virtual void SlaveBegin(TTree *)
Definition: TSelector.h:57
Class to steer the merging of files produced on the workers.
virtual void Terminate()
Definition: TSelector.h:73
virtual void SlaveTerminate()
Definition: TSelector.h:72
virtual Bool_t Process(Long64_t)
Definition: TSelector.cxx:330
virtual void SetObject(TObject *obj)
Definition: TSelector.h:67
virtual void SetOption(const char *option)
Definition: TSelector.h:66
Mother of all ROOT objects.
Definition: TObject.h:37
Definition: tree.py:1
A TTree object has a header with a name and a title.
Definition: TTree.h:70
A TTree is a list of TBranches.
Definition: TBranch.h:59
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
virtual TList * GetOutputList() const
Definition: TSelector.h:71
virtual void Init(TTree *)
Definition: TSelector.h:55