]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDBackgroundCorrection.h
less log
[u/mrichter/AliRoot.git] / FMD / AliFMDBackgroundCorrection.h
CommitLineData
df0d5480 1// -*- mode: C++ -*-
2
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4 * reserved.
5 *
6 * See cxx source for full Copyright notice
7 */
021f1396 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.
df0d5480 11//
12// Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
13//
14//
15
16#ifndef ALIFMDBACKGROUNDCORRECTION_H
17#define ALIFMDBACKGROUNDCORRECTION_H
18
19#include "AliFMDInput.h"
021f1396 20#include <TObjArray.h>
21#include <AliRunLoader.h>
22#include <AliFMDFloatMap.h>
23#include <TH2F.h>
08d168d9 24class AliTrackReference;
25
021f1396 26/**
27 * Background correction map.
28 *
29 */
30class AliFMDBackgroundCorrection : public TNamed
31{
df0d5480 32public:
021f1396 33 /**
34 * Constructor
35 */
df0d5480 36 AliFMDBackgroundCorrection() ;
021f1396 37 /**
38 * Destructor
39 */
40 virtual ~AliFMDBackgroundCorrection() {};
41 /**
42 * Generate the background correction
43 *
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
56 */
408bf2b4 57 void GenerateBackgroundCorrection(Bool_t from_hits = kFALSE,
58 Int_t nvtxbins = 10,
59 Float_t zvtxcut = 10,
60 Int_t nBinsEta = 100,
61 Bool_t storeInAlien = kFALSE,
62 Int_t runNo = 0,
63 Int_t endRunNo = 999999999,
64 const Char_t* filename ="background.root",
65 Bool_t simulate = kFALSE,
66 Int_t nEvents = 10,
67 Bool_t inFile = kFALSE,
109e97cd 68 const Char_t* infilename="");
021f1396 69 /**
70 * Nested class that derives from AliFMDInput to do the actual
71 * processing
72 */
73 class AliFMDInputBG : public AliFMDInput
74 {
408bf2b4 75
df0d5480 76 public :
08d168d9 77 //AliFMDInputBG() ;
021f1396 78 /**
79 * Constructo
80 *
81 * @param hits_not_trackrefs Use hits rather than track references
82 */
08d168d9 83 AliFMDInputBG(Bool_t hits_not_trackrefs);
021f1396 84 /**
85 * Initialize the object
86 *
87 *
88 * @return @c true on success.
89 */
df0d5480 90 Bool_t Init();
408bf2b4 91
021f1396 92 /**
93 * Get number of primaries seen
94 *
95 *
96 * @return Number of primaries seen
97 */
df0d5480 98 Int_t GetNprim() {return fPrim;}
021f1396 99 /**
100 * Get number of hits (total number of particles seen)
101 *
102 *
103 * @return Total number of particles seen
104 */
df0d5480 105 Int_t GetNhits() {return fHits;}
021f1396 106 /**
107 * Set the interaction point Z coordinate cut
108 *
109 * @param vtxCut The Z coordinate cut
110 */
df0d5480 111 void SetVtxCutZ(Double_t vtxCut) { fZvtxCut = vtxCut;}
021f1396 112 /**
113 * Set the number of vertex bins
114 *
115 * @param nBins Number of vertex bins
116 */
df0d5480 117 void SetNvtxBins(Int_t nBins) { fNvtxBins = nBins;}
021f1396 118 /**
119 * Set the number of eta bins
120 *
121 * @param nBins Number of eta bins
122 */
df0d5480 123 void SetNbinsEta(Int_t nBins) { fNbinsEta = nBins;}
021f1396 124 /**
125 * Get a list of hits i.e., the particles that hit the FMD
126 *
127 * @return List of particles
128 */
df0d5480 129 TObjArray* GetHits() {return &fHitArray;}
021f1396 130 /**
131 * Get a list of primaries i.e., the primary particles that hit the FMD
132 *
133 * @return List of particles
134 */
df0d5480 135 TObjArray* GetPrimaries() {return &fPrimaryArray;}
021f1396 136 /**
137 * Get the run loader used
138 *
139 * @return Run loader used
140 */
ca3af5d9 141 AliRunLoader* GetRunLoader() {return fLoader; }
df0d5480 142 private:
021f1396 143 /**
144 * Process a single hit
145 *
146 * @param h Hit data
147 * @param p Particle that made the hit
148 *
149 * @return @c false on failure
150 */
ca3af5d9 151 Bool_t ProcessHit(AliFMDHit* h, TParticle* p );
021f1396 152 /**
153 * Process a track reference
154 *
155 * @param tr Track reference
156 * @param p Particle that made the track reference
157 *
158 * @return @c false on failure
159 */
08d168d9 160 Bool_t ProcessTrackRef(AliTrackReference* tr, TParticle* p );
021f1396 161 /**
162 * Process a single event
163 *
164 * @param det Detector
165 * @param ring Ring
166 * @param sector Sector
167 * @param strip Strip
168 * @param nTrack Track number
169 * @param charge Charge
170 *
171 * @return @c false on failure
172 */
08d168d9 173 Bool_t ProcessEvent(UShort_t det,
174 Char_t ring,
175 UShort_t sector,
176 UShort_t strip,
177 Int_t nTrack,
178 Float_t charge);
021f1396 179 /**
180 * Called at start of event
181 *
182 * @param event Event number
183 *
184 * @return @c false on failure
185 */
ca3af5d9 186 Bool_t Begin(Int_t event );
021f1396 187 /**
188 * Called at end of event
189 *
190 * @return @c false on failure
191 */
627ba74b 192 Bool_t End();
021f1396 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
df0d5480 209 };
210
211private:
021f1396 212 /**
213 * Run a simulation
214 *
215 * @param e_t Not used
216 */
217 void Simulate(Int_t e);
218 /**
219 * Process all primaries from the run loader
220 *
221 * @param rl Run loader
222 */
223 void ProcessPrimaries(AliRunLoader* rl);
224 TObjArray fCorrectionArray; // Array of corrections
225 TList fPrimaryList; // List of primaries
df0d5480 226 ClassDef(AliFMDBackgroundCorrection,0)
227
228};
229#endif
230// EOF