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