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 //_____________________________________________________________________________
21 class AliEventPoolSparse : public AliVEventPool {
25 AliEventPoolSparse(const char* name, const char* title, TChain * tagchain, Int_t dim,
26 const char ** vars, const Int_t* nbins, const Double_t* xmin = 0,
27 const Double_t* xmax = 0, Int_t chunksize = 1024 * 16);
29 virtual ~AliEventPoolSparse();
31 // Interface from AiVEventPool, to be overloaded
32 virtual TChain* GetNextChain();
33 virtual void GetCurrentBin(Float_t* xbin);
34 virtual Int_t GetDimension(){return fN;}
37 TEntryList * GetNextPool(Int_t i) {
38 // Returns the array associated with bin "i"
39 return fPool>0 ? fPool[i] : 0x0;
42 TEntryList * GetEvents(const Double_t * x) {
43 // Returns the array associated with the bin
44 // that corresponds to vector "x"
45 Int_t bin = fHnSparseI.GetBin(x,kFALSE);
46 return fPool>0 ? fPool[bin] : 0x0;
49 void SetTagChain(TChain * chain){
54 TChain * GetTagChain() const {
55 // Return the input tag chain
60 void SetRunCut(const char * cut);
61 void SetLHCCut(const char * cut);
62 void SetDetCut(const char * cut);
63 void SetEventCut(const char * cut);
65 TTreeFormula ** GetPoolVars() const {return fVars;}
66 TTreeFormula * GetRunCut() const {return fRunCut;}
67 TTreeFormula * GetLHCCut() const {return fLHCCut;}
68 TTreeFormula * GetDetCut() const {return fDetCut;}
69 TTreeFormula * GetEventCut() const {return fEvCut;}
70 Int_t BinNumber() const {return fBinNumber;}
79 AliEventPoolSparse(const AliEventPoolSparse& source); // Not implemented
80 AliEventPoolSparse& operator = (const AliEventPoolSparse& source); // Not implemented
82 THnSparseI fHnSparseI; // Sparse histogram to
83 Int_t fChunkSize; //! Cached chunk size since the getter is protected
84 Int_t fN; // Size of the array fPool
85 TEntryList ** fPool; // Arrays of pointers to the TEntryList containing the event IDs
86 Int_t fCurrentBin; //! Current bin
87 TChain * fTagChain; //! Input chain of tags
89 TTreeFormula ** fVars; // Array of variables used to create the pools
90 TTreeFormula * fRunCut;// Run selection
91 TTreeFormula * fLHCCut;// LNC-based selection
92 TTreeFormula * fDetCut;// Detector-based selection
93 TTreeFormula * fEvCut; // Event-based selection
94 Int_t fBinNumber; // Current bin
96 ClassDef(AliEventPoolSparse,1) //