2 /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 @brief Declaration of an Axis in a Flow "histogram" */
21 #ifndef ALIFMDFLOWSPLITTER_H
22 #define ALIFMDFLOWSPLITTER_H
23 #include "flow/AliFMDFlowAxis.h"
31 // Object used by AliFMDFlowBinned1D to split an event into sub-events.
32 // Default is to split randomly.
33 // User defined derived classes can do other stuff.
35 //______________________________________________________
36 /** @class AliFMDFlowSplitter flow/AliFMDFlowSplitter.h <flow/AliFMDFlowSplitter.h>
38 @brief Object used by AliFMDFlowBinned1D to split an event into
39 sub-events. Default is to split randomly. User defined derived
40 classes can do other stuff.
44 class AliFMDFlowSplitter : public TObject
48 @param axis Axis object */
49 AliFMDFlowSplitter() {}
51 @param o Other splitter to copy from */
52 AliFMDFlowSplitter(const AliFMDFlowSplitter& o) : TObject(o) {}
55 virtual ~AliFMDFlowSplitter() {}
56 /** Assignment operator
57 @param o Other splitter to assign from.
58 @return Reference to this object */
59 AliFMDFlowSplitter& operator=(const AliFMDFlowSplitter&);
60 /** Called at the beginning of an event */
61 virtual void Begin() {}
62 /** Prepare for an event
63 @param phis List of phis.
64 @param xs List of bin variable
65 @param n Number of entries in @a phis and @a n
66 @return true on success, false otherwise */
67 virtual void Event(Double_t* phis, Double_t* xs, ULong_t n);
68 /** Decide whether entry should go in A or B sub-event.
69 @param entry The entry number
70 @return true if this should go in sub-event A */
71 virtual Bool_t Select(ULong_t entry) const;
72 /** Called at the end of an event */
75 /** Reference to axis object */
76 ClassDef(AliFMDFlowSplitter,1) // Split events
78 inline AliFMDFlowSplitter&
79 AliFMDFlowSplitter::operator=(const AliFMDFlowSplitter& /*o*/)
84 AliFMDFlowSplitter::Event(Double_t*, Double_t*,ULong_t)
87 //____________________________________________________________________
88 class AliFMDFlowShuffle : public AliFMDFlowSplitter
92 AliFMDFlowShuffle() : fIdx(), fN(0) {}
93 /** Prepare for an event
94 @param phis List of phis.
95 @param xs List of bin variable
96 @param n Number of entries in @a phis and @a n
97 @return true on success, false otherwise */
98 virtual void Event(Double_t* phis, Double_t* xs, ULong_t n);
99 /** Decide whether entry should go in A or B sub-event.
100 @param entry The entry number
101 @return true if this should go in sub-event A */
102 virtual Bool_t Select(ULong_t entry) const;
104 /** Function to shuffle */
106 /** Array of indicies */
108 /** Curren number of entries */
110 ClassDef(AliFMDFlowShuffle,1) // Split events