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 */
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
13 #include <THnSparse.h>
14 #include <TEntryList.h>
15 #include "AliVEventPool.h"
20 class AliEventTagCuts;
21 class AliDetectorTagCuts;
24 //_____________________________________________________________________________
25 class AliEventPoolSparse : public AliVEventPool {
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);
33 virtual ~AliEventPoolSparse();
35 // Interface from AiVEventPool, to be overloaded
36 virtual TChain* GetNextChain();
37 virtual void GetCurrentBin(Float_t* xbin);
38 virtual Int_t GetDimension(){return fN;}
41 TEntryList * GetNextPool(Int_t i) {
42 // Returns the array associated with bin "i"
43 return fPool>0 ? fPool[i] : 0x0;
46 TEntryList * GetEvents(const Double_t * x) {
47 // Returns the array associated with the bin
48 // that corresponds to vector "x"
49 Int_t bin = fHnSparseI.GetBin(x,kFALSE);
50 return fPool>0 ? fPool[bin] : 0x0;
53 void SetTagChain(TChain * chain){
58 TChain * GetTagChain() const {
59 // Return the input tag chain
64 void SetRunCut(const char * cut);
65 void SetLHCCut(const char * cut);
66 void SetDetCut(const char * cut);
67 void SetEventCut(const char * cut);
69 void SetRunCut(AliRunTagCuts* cut);
70 void SetEventCut(AliEventTagCuts* cut);
71 void SetDetectorCut(AliDetectorTagCuts* cut);
72 void SetLHCCut(AliLHCTagCuts* cut);
74 TTreeFormula ** GetPoolVars() const {return fVars;}
75 TTreeFormula * GetRunCut() const {return fRunCut;}
76 TTreeFormula * GetLHCCut() const {return fLHCCut;}
77 TTreeFormula * GetDetCut() const {return fDetCut;}
78 TTreeFormula * GetEventCut() const {return fEvCut;}
79 Int_t BinNumber() const {return fBinNumber;}
88 AliEventPoolSparse(const AliEventPoolSparse& source); // Not implemented
89 AliEventPoolSparse& operator = (const AliEventPoolSparse& source); // Not implemented
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
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
104 AliRunTagCuts *fRunTagCut; // RunTag class cut
105 AliEventTagCuts *fEventTagCut; // EventTag class cut
106 AliDetectorTagCuts *fDetectorTagCut; // DetectorTag class cut
107 AliLHCTagCuts *fLHCTagCut; // LHCTag class cut
109 Int_t fBinNumber; // Current bin
111 ClassDef(AliEventPoolSparse,2) //