3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * See cxx source for full Copyright notice
8 // This class computes background corrections for the FMD. The
9 // correction is computed in eta,phi cells and the objects stored can
10 // be put into alien to use with analysis.
12 // Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
16 #ifndef ALIFMDBACKGROUNDCORRECTION_H
17 #define ALIFMDBACKGROUNDCORRECTION_H
19 #include "AliFMDInput.h"
20 #include <TObjArray.h>
21 #include <AliRunLoader.h>
22 #include <AliFMDFloatMap.h>
24 class AliTrackReference;
27 * Background correction map.
30 class AliFMDBackgroundCorrection : public TNamed
36 AliFMDBackgroundCorrection() ;
40 virtual ~AliFMDBackgroundCorrection() {};
42 * Generate the background correction
44 * @param from_hits Whether we run over hits
45 * @param nvtxbins Number of vertex bins
46 * @param zvtxcut Outer cut on interaction point Z coordinate
47 * @param nBinsEta Number of psuedo-rapidity bins
48 * @param storeInAlien Whether to store the result in AliEn
49 * @param runNo Run number
50 * @param endRunNo End validity
51 * @param filename The output file name
52 * @param simulate Whether to run the simulation or not
53 * @param nEvents Number of events to analyse
54 * @param inFile Whether an input file is specified
55 * @param infilename Input file name
57 void GenerateBackgroundCorrection(Bool_t from_hits = kFALSE,
61 Bool_t storeInAlien = kFALSE,
63 Int_t endRunNo = 999999999,
64 const Char_t* filename ="background.root",
65 Bool_t simulate = kFALSE,
67 Bool_t inFile = kFALSE,
68 const Char_t* infilename="");
70 * Nested class that derives from AliFMDInput to do the actual
73 class AliFMDInputBG : public AliFMDInput
81 * @param hits_not_trackrefs Use hits rather than track references
83 AliFMDInputBG(Bool_t hits_not_trackrefs);
85 * Initialize the object
88 * @return @c true on success.
93 * Get number of primaries seen
96 * @return Number of primaries seen
98 Int_t GetNprim() {return fPrim;}
100 * Get number of hits (total number of particles seen)
103 * @return Total number of particles seen
105 Int_t GetNhits() {return fHits;}
107 * Set the interaction point Z coordinate cut
109 * @param vtxCut The Z coordinate cut
111 void SetVtxCutZ(Double_t vtxCut) { fZvtxCut = vtxCut;}
113 * Set the number of vertex bins
115 * @param nBins Number of vertex bins
117 void SetNvtxBins(Int_t nBins) { fNvtxBins = nBins;}
119 * Set the number of eta bins
121 * @param nBins Number of eta bins
123 void SetNbinsEta(Int_t nBins) { fNbinsEta = nBins;}
125 * Get a list of hits i.e., the particles that hit the FMD
127 * @return List of particles
129 TObjArray* GetHits() {return &fHitArray;}
131 * Get a list of primaries i.e., the primary particles that hit the FMD
133 * @return List of particles
135 TObjArray* GetPrimaries() {return &fPrimaryArray;}
137 * Get the run loader used
139 * @return Run loader used
141 AliRunLoader* GetRunLoader() {return fLoader; }
144 * Process a single hit
147 * @param p Particle that made the hit
149 * @return @c false on failure
151 Bool_t ProcessHit(AliFMDHit* h, TParticle* p );
153 * Process a track reference
155 * @param tr Track reference
156 * @param p Particle that made the track reference
158 * @return @c false on failure
160 Bool_t ProcessTrackRef(AliTrackReference* tr, TParticle* p );
162 * Process a single event
164 * @param det Detector
166 * @param sector Sector
168 * @param nTrack Track number
169 * @param charge Charge
171 * @return @c false on failure
173 Bool_t ProcessEvent(UShort_t det,
180 * Called at start of event
182 * @param event Event number
184 * @return @c false on failure
186 Bool_t Begin(Int_t event );
188 * Called at end of event
190 * @return @c false on failure
193 TObjArray fPrimaryArray; // List of primaries
194 TObjArray fHitArray; // List of all particles
195 TH2F fPrimaryMapInner; // Histogram for inners
196 TH2F fPrimaryMapOuter; // Histogram for outers
197 // FIXME: Consider using AliFMDUShortMap, or maybe new class AliFMDIntMap
198 AliFMDFloatMap fHitMap; // A map of hits
199 AliFMDFloatMap fLastTrackByStrip; // A map of last track
200 Int_t fPrim; // Number of primaries
201 Int_t fHits; // Number of hits
202 Double_t fZvtxCut; // Vertex cut
203 Int_t fNvtxBins; // Number of vertex bins
204 Int_t fPrevTrack; // Previous track number
205 Int_t fPrevDetector; // Previous detector number
206 Char_t fPrevRing; // Previous ring number
207 Int_t fPrevSec; // Previous sector number
208 Int_t fNbinsEta; // Number of eta bins
215 * @param e_t Not used
217 void Simulate(Int_t e);
219 * Process all primaries from the run loader
221 * @param rl Run loader
223 void ProcessPrimaries(AliRunLoader* rl);
224 TObjArray fCorrectionArray; // Array of corrections
225 TList fPrimaryList; // List of primaries
226 ClassDef(AliFMDBackgroundCorrection,0)