]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationSDD.h
Updated macro
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSDD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSSIMULATIONSDD_H
2#define ALIITSSIMULATIONSDD_H
8a33ae9e 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
88cb7938 5
fcf95fc7 6
8a33ae9e 7/* $Id$ */
1ca7869b 8
8ba39da9 9////////////////////////////////////////////////////////////
10// Simulation class for SDD //
11////////////////////////////////////////////////////////////
12
b0f5e3fc 13#include <TNtuple.h>
b0f5e3fc 14#include "AliITSsimulation.h"
b0f5e3fc 15
1ca7869b 16class TH1F;
17class TFile;
1ca7869b 18class TArrayI;
19class TArrayF;
e8189707 20class AliITS;
c7a4dac0 21class AliITSpList;
e8189707 22class AliITSMap;
23class AliITSMapA1;
24class AliITSMapA2;
b0f5e3fc 25class AliITSetfSDD;
c7a4dac0 26class AliITSsegmentationSDD;
fcf95fc7 27class AliITSCalibration;
28class AliITSCalibrationSDD;
b0f5e3fc 29
b0f5e3fc 30class AliITSsimulationSDD : public AliITSsimulation {
aacedc3e 31 public:
8a33ae9e 32 AliITSsimulationSDD(); // default constructor
33 //Standard Constructor
8ba39da9 34 AliITSsimulationSDD(AliITSDetTypeSim* dettyp);
f45f6658 35 // Copy operator
7537d03c 36 AliITSsimulationSDD(const AliITSsimulationSDD &source);
8a33ae9e 37 virtual ~AliITSsimulationSDD(); // Destructor
f45f6658 38 // = operator
d2f55a22 39 AliITSsimulationSDD& operator=(const AliITSsimulationSDD &source);
85f5e9c2 40 // virtual AliITSsimulation& operator=(const AliITSsimulation &source);
c7a4dac0 41 // Initilize variables for this simulation
aacedc3e 42 void Init();
8a33ae9e 43
8ba39da9 44 // Get a pointer to the segmentation object
45 virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(1);}
46 // set pointer to segmentation object
47 virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(1,seg);}
8a33ae9e 48
49 // set the scale size factor for the smples in FFT
50 virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
51 Int_t ScaleFourier() const {return fScaleSize;} // returns the scale factor
52 // set perpendicular tracks flag
53 virtual void SetPerpendTracksFlag(Bool_t flag=kFALSE) {fFlag=flag;}
54 // returns perpendicular track flag.
55 Bool_t PerpendTracksFlag() const {return fFlag;}
50d05d7b 56 // set crosstalk flag
57 virtual void SetCrosstalkFlag(Bool_t flag=kFALSE) {fCrosstalkFlag=flag;}
58 // return crosstalk flag
59 Bool_t CrosstalkFlag() const {return fCrosstalkFlag;}
20f3f947 60 void FastFourierTransform(Double_t *real, Double_t *imag, Int_t direction);
aacedc3e 61 virtual Int_t Convert10to8(Int_t signal) const;//10 to 8 bit SDD compresion
83ec5e27 62 virtual Int_t Convert8to10(Int_t signal) const;//8 to 10 bit decompresion
8a33ae9e 63 virtual void Compress2D(); // Applies 2D compresion algorithm
8a33ae9e 64 virtual void StoreAllDigits(); // if No compresion run this.
8a33ae9e 65 // returns baseline and noise for a given anode i.
f45f6658 66 //virtual void GetAnodeBaseline(Int_t i,Double_t &baseline,Double_t &noise) const;
8a33ae9e 67 // local implementation of ITS->AddDigit. Specific for SDD
83ec5e27 68 virtual void AddDigit(Int_t i, Int_t j, Int_t signalc, Int_t signale);
8a33ae9e 69
5683bd96 70 // add baseline, noise, gain, electronics and ADC saturation effects
71 void ChargeToSignal(Int_t mod,Bool_t bAddNoise=kFALSE, Bool_t bAddGain=kTRUE);
50d05d7b 72 // add crosstalk effect
8ba39da9 73 void ApplyCrosstalk(Int_t mod);
50d05d7b 74
75 // create maps to build the lists of tracks for each summable digit
76 void InitSimulationModule( Int_t module, Int_t event );
77 // clear maps
78 void ClearMaps();
c7a4dac0 79 // Summable Digitses a SDD module
80 void SDigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
48058160 81 // Add Summable digits to module maps.
82 Bool_t AddSDigitsToModule( TClonesArray *pItemArray, Int_t mask );
50d05d7b 83 // digitize module from the sum of summable digits.
84 void FinishSDigitiseModule();
c7a4dac0 85 // Writes summable digits
50d05d7b 86 void WriteSDigits();
c7a4dac0 87 // Introduces electronics effects and does zero-suppresion if required
50d05d7b 88 void FinishDigits();
8a33ae9e 89 // Digitses a SDD module
90 void DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
c7a4dac0 91 // Spread charge in a SDD module
50d05d7b 92 void HitsToAnalogDigits(AliITSmodule *mod);
8a33ae9e 93 // Sorts tracks for the 3 most highly contributed one to be added to digit.
aacedc3e 94 //void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits
95 // Int_t ntracks);
8a33ae9e 96 // collects and returns the fired SDD cells (uses AliITSMapA2...).
50d05d7b 97 //void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
aacedc3e 98 // TClonesArray *padr);
8a33ae9e 99
100 // Creates histograms of maps for debugging
101 void CreateHistograms(Int_t scale);
102 // Fills histograms of maps for debugging
103 void FillHistograms();
104 // Resets histograms of maps for debugging
105 void ResetHistograms();
106 // Get the pointer to the array of histograms
107 TObjArray* GetHistArray() {return fHis;}
8a33ae9e 108 void WriteToFile(TFile *fp);// Writes the histograms to a file
109 // Get's histogram of a particular anode.
110 TH1F *GetAnode(Int_t wing, Int_t anode);
111
8a33ae9e 112 // sets DoFFT value.
113 void SetDoFFT(Int_t doFFT=1) {fDoFFT=doFFT;}
114
115 // Print SSD simulation Parameters
d2f55a22 116 virtual void PrintStatus() const;
8a33ae9e 117
aacedc3e 118 private:
f45f6658 119 // virtual void GetBaseline(Int_t mod); // read baseline values from a file
8a33ae9e 120 // Variables and pointers for local use only. Not Streamed out.
121 AliITS *fITS; //! local pointer to ITS
8a33ae9e 122 AliITSMapA2 *fHitMap2; //! local pointer to map of signals
48058160 123 AliITSMapA2 *fHitSigMap2; //! local pointer to map of signals
124 AliITSMapA2 *fHitNoiMap2; //! local pointer to map of signals
8a33ae9e 125 AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
126 Double_t *fInZR; //! [fScaleSize*fMaxNofSamples] input of the
127 // real part of FFT
128 Double_t *fInZI; //! [fScaleSize*fMaxNofSamples]
129 // input of the imaginary part of FFT
130 Double_t *fOutZR; //! [fScaleSize*fMaxNofSamples]
131 // output of the real part of FFT
132 Double_t *fOutZI; //! [fScaleSize*fMaxNofSamples]
133 // output of the imaginary part of FFT
43217ad9 134 Bool_t *fAnodeFire; //! [#of anodes] Flag if there is a signal
8a33ae9e 135
136 TObjArray *fHis; // just in case for histogramming
8a33ae9e 137 Bool_t fFlag; // Flag used to simulate perpendicular tracks
50d05d7b 138 Bool_t fCrosstalkFlag; // Flag used to apply the crosstalk effect
8a33ae9e 139 Int_t fDoFFT; // Flag used to switch off electronics when 0
140 Int_t fNofMaps; // Number of anodes used ( 1-2*nanodes per wing )
141 Int_t fMaxNofSamples;// Number of time samples
142 Int_t fScaleSize; // scale size factor for the samples in FFT
95d1e92f 143
20f3f947 144 ClassDef(AliITSsimulationSDD,3) // Simulation of SDD clusters
8a33ae9e 145
b0f5e3fc 146};
147#endif