]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationSDD.h
Improved cluster finder algorithm for SDD
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSDD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSSIMULATIONSDD_H
2#define ALIITSSIMULATIONSDD_H
3
4
1ca7869b 5
b0f5e3fc 6#include <TNtuple.h>
1ca7869b 7#include <TArrayF.h>
8
b0f5e3fc 9
b0f5e3fc 10#include "AliITSsimulation.h"
b0f5e3fc 11
12//___________________________________________________
13
14
1ca7869b 15class TH1F;
16class TFile;
17class TVector;
18class TArrayI;
19class TArrayF;
e8189707 20class AliITS;
21class AliITSMap;
22class AliITSMapA1;
23class AliITSMapA2;
b0f5e3fc 24class AliITSetfSDD;
e8189707 25class AliITSInStream;
1ca7869b 26class AliITSresponse;
b0f5e3fc 27
28//___________________________________________________
29
30class AliITSsimulationSDD : public AliITSsimulation {
31
32public:
33
34 AliITSsimulationSDD();
35 AliITSsimulationSDD(AliITSsegmentation *seg, AliITSresponse *res);
36 AliITSsimulationSDD(AliITSsimulationSDD &source);
37 virtual ~AliITSsimulationSDD();
38 AliITSsimulationSDD& operator=(AliITSsimulationSDD &source);
39
40 // get the address of the array mapping the signal or pointers to arrays
41 virtual AliITSMap* HitMap(Int_t i);
42
e8189707 43 // set the scale size factor for the smples in FFT
44 virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
45 Int_t ScaleFourier() {return fScaleSize;}
46 // set perpendicular tracks flag
eb6e7f29 47 virtual void SetPerpendTracksFlag(Bool_t flag=1) {fFlag=flag;}
e8189707 48 Bool_t PerpendTracksFlag() {return fFlag;}
b0f5e3fc 49 // set compression parameters for 2D or 1D via response functions
50 void SetCompressParam();
51 // retrieve compression parameters for 2D or 1D
52 void CompressionParam(Int_t i, Int_t &db, Int_t &tl, Int_t &th);
53 void CompressionParam(Int_t i, Int_t &db, Int_t &tl);
54
55 virtual Int_t Convert10to8(Int_t signal);
56 virtual Int_t Convert8to10(Int_t signal);
e8189707 57 virtual void ZeroSuppression(const char *opt);
b0f5e3fc 58 virtual void Init2D();
59 virtual void Compress2D();
60 virtual void Init1D();
61 virtual void Compress1D();
62 virtual void StoreAllDigits();
63 virtual void ReadBaseline();
64 virtual void GetAnodeBaseline(Int_t i, Float_t &baseline, Float_t &noise);
65 virtual void AddDigit(Int_t i, Int_t j, Int_t signal);
66 virtual void FindCluster
ece86d9a 67 (Int_t i, Int_t j,Int_t signal,Int_t minval,Bool_t &cond);
b0f5e3fc 68
69
70 // get parameters for 1D - this could be changed when we get more
71 // input from Torino after they have a look at the code
72 virtual Int_t Tolerance(Int_t i) {return fTol[i];}
73 virtual Int_t Disable(Int_t i) {return fT2[i];}
e8189707 74 // Set the output file name - for 1D encoding
b0f5e3fc 75 virtual void SetFileName(const char *filnam) {fFileName=filnam;}
76
77 void ChargeToSignal();
78 void DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
e8189707 79 void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits,Int_t ntracks);
b0f5e3fc 80 void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
81 TClonesArray *padr);
b0f5e3fc 82
ece86d9a 83 void CreateHistograms(Int_t scale);
84 void FillHistograms();
b0f5e3fc 85 void ResetHistograms();
e8189707 86 // Get the pointer to the array of histograms
b0f5e3fc 87 TObjArray* GetHistArray() {return fHis;}
88
e8189707 89 // create a separate tree for background monitoring (2D)
b0f5e3fc 90 virtual void MakeTreeB(Option_t *option="B")
ece86d9a 91 { fTreeB = new TNtuple("ntuple","2D backgr","nz:nl:nh:low:anode");}
b0f5e3fc 92 void GetTreeB(Int_t) { }
93
94 // Return pointer to TreeB
95 TNtuple *TreeB() {return fTreeB;}
96
97 void WriteToFile(TFile *fp);
98 TH1F *GetAnode(Int_t wing, Int_t anode);
ece86d9a 99 void SetCheckNoise(Bool_t check=kFALSE) {fCheckNoise=check;}
100 Float_t GetNoise();
101 void SetDoFFT(Int_t doFFT=1) {fDoFFT=doFFT;}
102
b0f5e3fc 103
104private:
ece86d9a 105 AliITS *fITS; //! local pointer to ITS
b0f5e3fc 106
ece86d9a 107 AliITSMapA1 *fHitMap1; //! local pointer to map of digits
108 AliITSMapA2 *fHitMap2; //! local pointer to map of signals
109 AliITSInStream *fStream; //! input file stream
110 AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
b0f5e3fc 111
112 TArrayI fD; // decrease values for baseline eq.
113 TArrayI fT1; // low thresholds
114 TArrayI fT2; // high thresholds(2D) or disable (1D)
115 TArrayI fTol; // tolerance
116 TArrayF fBaseline; // Baseline
117 TArrayF fNoise; // Noise value
e8189707 118 TNtuple *fTreeB; // Background info tree for 2D
119 TString fParam; // Compresion algorithm options
120 TString fFileName; // File name for possible options above
b0f5e3fc 121
ece86d9a 122 Bool_t fFlag; // Flag used to simulate perpendicular tracks
123 Bool_t fCheckNoise; // Flag used to check the simulated noise
124 Int_t fDoFFT; // Flag used to switch off electronics when 0
b0f5e3fc 125 Int_t fNofMaps; // Number of anodes used ( 1 - 2*nanodes per wing )
126 Int_t fMaxNofSamples; // Number of time samples
e8189707 127 Int_t fScaleSize; // scale size factor for the samples in FFT
b0f5e3fc 128 Int_t fModule; // in case bgr, noise, param change module-by-module
129 Int_t fEvent; // solely for output from bgr monitoring of 2D
ece86d9a 130
b0f5e3fc 131 TObjArray *fHis; // just in case for histogramming
132
e8189707 133 Double_t *fInZR; // ! [fScaleSize*fMaxNofSamples]
134 // input of the real part of FFT
135 Double_t *fInZI; // ! [fScaleSize*fMaxNofSamples]
136 // input of the imaginary part of FFT
137 Double_t *fOutZR; // ! [fScaleSize*fMaxNofSamples]
138 // output of the real part of FFT
139 Double_t *fOutZI; // ! [fScaleSize*fMaxNofSamples]
140 // output of the imaginary part of FFT
95d1e92f 141
b0f5e3fc 142 ClassDef(AliITSsimulationSDD,1) // Simulation of SDD clusters
143
144};
145#endif