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