Line data Source code
1 : #ifndef ALIEVENTPOOLSPARSE_H
2 : #define ALIEVENTPOOLSPARSE_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 :
8 : // Event pool based on THnSparseI
9 : // This class is needed by the AnalysisManager to steer a mixing analysis.
10 : // Author: Peter Hristov
11 : // Peter.Hristov@cern.ch
12 :
13 : #include <THnSparse.h>
14 : #include <TEntryList.h>
15 : #include "AliVEventPool.h"
16 :
17 : class TChain;
18 : class TTreeFormula;
19 : class AliRunTagCuts;
20 : class AliEventTagCuts;
21 : class AliDetectorTagCuts;
22 : class AliLHCTagCuts;
23 :
24 : //_____________________________________________________________________________
25 : class AliEventPoolSparse : public AliVEventPool {
26 : public:
27 :
28 : AliEventPoolSparse();
29 : AliEventPoolSparse(const char* name, const char* title, TChain * tagchain, Int_t dim,
30 : const char ** vars, const Int_t* nbins, const Double_t* xmin = 0,
31 : const Double_t* xmax = 0, Int_t chunksize = 1024 * 16);
32 :
33 : virtual ~AliEventPoolSparse();
34 :
35 : // Interface from AiVEventPool, to be overloaded
36 : virtual TChain* GetNextChain();
37 : virtual void GetCurrentBin(Float_t* xbin);
38 0 : virtual Int_t GetDimension(){return fN;}
39 : virtual void Init();
40 :
41 : TEntryList * GetNextPool(Int_t i) {
42 : // Returns the array associated with bin "i"
43 0 : return fPool>0 ? fPool[i] : 0x0;
44 : }
45 :
46 : TEntryList * GetEvents(const Double_t * x) {
47 : // Returns the array associated with the bin
48 : // that corresponds to vector "x"
49 0 : Int_t bin = fHnSparseI.GetBin(x,kFALSE);
50 0 : return fPool>0 ? fPool[bin] : 0x0;
51 : }
52 :
53 : void SetTagChain(TChain * chain){
54 : // Input tag chain
55 0 : fTagChain = chain;
56 0 : }
57 :
58 : TChain * GetTagChain() const {
59 : // Return the input tag chain
60 0 : return fTagChain;
61 : }
62 :
63 : // Cuts
64 : void SetRunCut(const char * cut);
65 : void SetLHCCut(const char * cut);
66 : void SetDetCut(const char * cut);
67 : void SetEventCut(const char * cut);
68 :
69 : void SetRunCut(AliRunTagCuts* cut);
70 : void SetEventCut(AliEventTagCuts* cut);
71 : void SetDetectorCut(AliDetectorTagCuts* cut);
72 : void SetLHCCut(AliLHCTagCuts* cut);
73 :
74 0 : TTreeFormula ** GetPoolVars() const {return fVars;}
75 0 : TTreeFormula * GetRunCut() const {return fRunCut;}
76 0 : TTreeFormula * GetLHCCut() const {return fLHCCut;}
77 0 : TTreeFormula * GetDetCut() const {return fDetCut;}
78 0 : TTreeFormula * GetEventCut() const {return fEvCut;}
79 0 : Int_t BinNumber() const {return fBinNumber;}
80 :
81 : protected:
82 :
83 : void Set(Int_t n);
84 :
85 :
86 : private:
87 :
88 : AliEventPoolSparse(const AliEventPoolSparse& source); // Not implemented
89 : AliEventPoolSparse& operator = (const AliEventPoolSparse& source); // Not implemented
90 :
91 : THnSparseI fHnSparseI; // Sparse histogram to
92 : Int_t fChunkSize; //! Cached chunk size since the getter is protected
93 : Int_t fN; // Size of the array fPool
94 : TEntryList ** fPool; // Arrays of pointers to the TEntryList containing the event IDs
95 : Int_t fCurrentBin; //! Current bin
96 : TChain * fTagChain; //! Input chain of tags
97 :
98 : TTreeFormula ** fVars; // Array of variables used to create the pools
99 : TTreeFormula * fRunCut;// Run selection
100 : TTreeFormula * fLHCCut;// LNC-based selection
101 : TTreeFormula * fDetCut;// Detector-based selection
102 : TTreeFormula * fEvCut; // Event-based selection
103 :
104 : AliRunTagCuts *fRunTagCut; // RunTag class cut
105 : AliEventTagCuts *fEventTagCut; // EventTag class cut
106 : AliDetectorTagCuts *fDetectorTagCut; // DetectorTag class cut
107 : AliLHCTagCuts *fLHCTagCut; // LHCTag class cut
108 :
109 : Int_t fBinNumber; // Current bin
110 :
111 170 : ClassDef(AliEventPoolSparse,2) //
112 : };
113 :
114 : #endif
115 :
116 :
|