QA Tree is now read onlt once at initialisation
[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
44a312c3 47 virtual void SetPerpendTracksFlag(Bool_t flag=kFALSE) {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
44a312c3 103 // Print Parameters
104 virtual void Print();
b0f5e3fc 105
106private:
ece86d9a 107 AliITS *fITS; //! local pointer to ITS
b0f5e3fc 108
ece86d9a 109 AliITSMapA1 *fHitMap1; //! local pointer to map of digits
110 AliITSMapA2 *fHitMap2; //! local pointer to map of signals
111 AliITSInStream *fStream; //! input file stream
112 AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
b0f5e3fc 113
114 TArrayI fD; // decrease values for baseline eq.
115 TArrayI fT1; // low thresholds
116 TArrayI fT2; // high thresholds(2D) or disable (1D)
117 TArrayI fTol; // tolerance
118 TArrayF fBaseline; // Baseline
119 TArrayF fNoise; // Noise value
e8189707 120 TNtuple *fTreeB; // Background info tree for 2D
121 TString fParam; // Compresion algorithm options
122 TString fFileName; // File name for possible options above
b0f5e3fc 123
ece86d9a 124 Bool_t fFlag; // Flag used to simulate perpendicular tracks
125 Bool_t fCheckNoise; // Flag used to check the simulated noise
126 Int_t fDoFFT; // Flag used to switch off electronics when 0
b0f5e3fc 127 Int_t fNofMaps; // Number of anodes used ( 1 - 2*nanodes per wing )
128 Int_t fMaxNofSamples; // Number of time samples
e8189707 129 Int_t fScaleSize; // scale size factor for the samples in FFT
b0f5e3fc 130 Int_t fModule; // in case bgr, noise, param change module-by-module
131 Int_t fEvent; // solely for output from bgr monitoring of 2D
ece86d9a 132
b0f5e3fc 133 TObjArray *fHis; // just in case for histogramming
134
e8189707 135 Double_t *fInZR; // ! [fScaleSize*fMaxNofSamples]
136 // input of the real part of FFT
137 Double_t *fInZI; // ! [fScaleSize*fMaxNofSamples]
138 // input of the imaginary part of FFT
139 Double_t *fOutZR; // ! [fScaleSize*fMaxNofSamples]
140 // output of the real part of FFT
141 Double_t *fOutZI; // ! [fScaleSize*fMaxNofSamples]
142 // output of the imaginary part of FFT
95d1e92f 143
b0f5e3fc 144 ClassDef(AliITSsimulationSDD,1) // Simulation of SDD clusters
145
146};
147#endif