#define ALIITSSIMULATIONSDD_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+
+
/* $Id$ */
-#include <TNtuple.h>
-#include <TArrayF.h>
+////////////////////////////////////////////////////////////
+// Simulation class for SDD //
+////////////////////////////////////////////////////////////
+#include <TNtuple.h>
#include "AliITSsimulation.h"
-
+#include "AliITSsegmentationSDD.h"
class TH1F;
class TFile;
-class TVector;
class TArrayI;
class TArrayF;
class AliITS;
class AliITSMapA1;
class AliITSMapA2;
class AliITSetfSDD;
-class AliITSsegmentationSDD;
-class AliITSInStream;
-class AliITSresponse;
-class AliITSresponseSDD;
+class AliITSCalibration;
+class AliITSCalibrationSDD;
class AliITSsimulationSDD : public AliITSsimulation {
-
- public:
+ public:
AliITSsimulationSDD(); // default constructor
//Standard Constructor
- AliITSsimulationSDD(AliITSsegmentation *seg, AliITSresponse *res);
- // Copy opporator
- AliITSsimulationSDD(AliITSsimulationSDD &source);
+ AliITSsimulationSDD(AliITSDetTypeSim* dettyp);
+ // Copy operator
+ AliITSsimulationSDD(const AliITSsimulationSDD &source);
virtual ~AliITSsimulationSDD(); // Destructor
- // = opporator
- AliITSsimulationSDD& operator=(AliITSsimulationSDD &source);
+ // = operator
+ AliITSsimulationSDD& operator=(const AliITSsimulationSDD &source);
+ // virtual AliITSsimulation& operator=(const AliITSsimulation &source);
// Initilize variables for this simulation
- void Init(AliITSsegmentationSDD *seg,AliITSresponseSDD *resp);
+ void Init();
- // get the address of the array mapping the signal or pointers to arrays
-// virtual AliITSMap* HitMap(Int_t i);
+ // Get a pointer to the segmentation object
+ virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(1);}
+ // set pointer to segmentation object
+ virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(1,seg);}
- // set the scale size factor for the smples in FFT
- virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
- Int_t ScaleFourier() const {return fScaleSize;} // returns the scale factor
+ static Int_t ScaleFourier(const AliITSsegmentationSDD* seg)
+ {if(seg->Npx()==128) {return 8;} else {return 4;}} // returns the scale factor
// set perpendicular tracks flag
virtual void SetPerpendTracksFlag(Bool_t flag=kFALSE) {fFlag=flag;}
// returns perpendicular track flag.
virtual void SetCrosstalkFlag(Bool_t flag=kFALSE) {fCrosstalkFlag=flag;}
// return crosstalk flag
Bool_t CrosstalkFlag() const {return fCrosstalkFlag;}
- // set compression parameters for 2D or 1D via response functions
- void SetCompressParam();
- // retrieve compression parameters for 2D or 1D
- void CompressionParam(Int_t i, Int_t &db, Int_t &tl, Int_t &th);
- // retrieve compression parameters for 2D or 1D
- void CompressionParam(Int_t i, Int_t &db, Int_t &tl);
-
- virtual Int_t Convert10to8(Int_t signal) const;// 10 to 8 bit SDD compresion
- virtual Int_t Convert8to10(Int_t signal) const;//undo 10 to 8 bit SDD compresion
- virtual void ZeroSuppression(const char *opt); // Apply zero suppresion
- virtual void Init2D(); // initiilzes 2D compresion algorithm
+ void FastFourierTransform(Double_t *real, Double_t *imag, Int_t direction);
+ virtual Int_t Convert10to8(Int_t signal) const;//10 to 8 bit SDD compresion
+ virtual Int_t Convert8to10(Int_t signal) const;//8 to 10 bit decompresion
virtual void Compress2D(); // Applies 2D compresion algorithm
- virtual void Init1D(); // initilizes 1D compresion algorithm
- virtual void Compress1D(); // Applies 1D compresion algorithm
virtual void StoreAllDigits(); // if No compresion run this.
- virtual void ReadBaseline(); // read baseline values from a file
// returns baseline and noise for a given anode i.
- virtual void GetAnodeBaseline(Int_t i, Float_t &baseline, Float_t &noise);
+ //virtual void GetAnodeBaseline(Int_t i,Double_t &baseline,Double_t &noise) const;
// local implementation of ITS->AddDigit. Specific for SDD
- virtual void AddDigit(Int_t i, Int_t j, Int_t signal);
- // Finds clulsters of signals. Use with regards to Compresion algorithms
- virtual void FindCluster(Int_t i, Int_t j,Int_t signal,
- Int_t minval,Bool_t &cond);
-
- // get parameters for 1D - this could be changed when we get more
- // input from Torino after they have a look at the code
- virtual Int_t Tolerance(Int_t i) {return fTol[i];}//returns tolerance
- virtual Int_t Disable(Int_t i) {return fT2[i];}//high threshold 2D
- // Set the output file name - for 1D encoding
- virtual void SetFileName(const char *filnam) {fFileName=filnam;}
+ virtual void AddDigit(Int_t i, Int_t j, Int_t signalc, Int_t signale);
- // add baseline, noise, electronics and ADC saturation effects
- void ChargeToSignal(Bool_t bAddNoise=kFALSE);
- // add dead channels
- void ApplyDeadChannels();
+ // add baseline, noise, gain, electronics and ADC saturation effects
+ void ChargeToSignal(Int_t mod,Bool_t bAddNoise=kFALSE, Bool_t bAddGain=kTRUE);
// add crosstalk effect
- void ApplyCrosstalk();
+ void ApplyCrosstalk(Int_t mod);
// create maps to build the lists of tracks for each summable digit
void InitSimulationModule( Int_t module, Int_t event );
// Spread charge in a SDD module
void HitsToAnalogDigits(AliITSmodule *mod);
// Sorts tracks for the 3 most highly contributed one to be added to digit.
- //void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits,Int_t ntracks);
+ //void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits
+ // Int_t ntracks);
// collects and returns the fired SDD cells (uses AliITSMapA2...).
//void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
- // TClonesArray *padr);
+ // TClonesArray *padr);
// Creates histograms of maps for debugging
void CreateHistograms(Int_t scale);
void ResetHistograms();
// Get the pointer to the array of histograms
TObjArray* GetHistArray() {return fHis;}
- // create a separate tree for background monitoring (2D)
- virtual void MakeTreeB(Option_t *option="B")
- { fTreeB = new TNtuple("ntuple","2D backgr","nz:nl:nh:low:anode");}
- // presently a dummy routine use TreeB() instead
- void GetTreeB(Int_t) { }
- // Return pointer to TreeB
- TNtuple *TreeB() {return fTreeB;}
void WriteToFile(TFile *fp);// Writes the histograms to a file
// Get's histogram of a particular anode.
TH1F *GetAnode(Int_t wing, Int_t anode);
- // Sets the check noise flag.
- void SetCheckNoise(Bool_t check=kFALSE) {fCheckNoise=check;}
- // Returns the noise value
- Float_t GetNoise();
// sets DoFFT value.
void SetDoFFT(Int_t doFFT=1) {fDoFFT=doFFT;}
// Print SSD simulation Parameters
- virtual void Print();
+ virtual void PrintStatus() const;
- private:
+ private:
+ // virtual void GetBaseline(Int_t mod); // read baseline values from a file
// Variables and pointers for local use only. Not Streamed out.
AliITS *fITS; //! local pointer to ITS
-// AliITSMapA1 *fHitMap1; //! local pointer to map of digits
AliITSMapA2 *fHitMap2; //! local pointer to map of signals
AliITSMapA2 *fHitSigMap2; //! local pointer to map of signals
AliITSMapA2 *fHitNoiMap2; //! local pointer to map of signals
-// AliITSpList *fpList; //!
-// TObjArray *falist; //
-// TClonesArray *fpadr; //
- AliITSInStream *fStream; //! input file stream
AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
Double_t *fInZR; //! [fScaleSize*fMaxNofSamples] input of the
// real part of FFT
Bool_t *fAnodeFire; //! [#of anodes] Flag if there is a signal
TObjArray *fHis; // just in case for histogramming
- TArrayI fD; // decrease values for baseline eq.
- TArrayI fT1; // low thresholds
- TArrayI fT2; // high thresholds(2D) or disable (1D)
- TArrayI fTol; // tolerance
- TArrayF fBaseline; // Baseline
- TArrayF fNoise; // Noise value
- TNtuple *fTreeB; // Background info tree for 2D
- TString fParam; // Compresion algorithm options
- TString fFileName; // File name for possible options above
Bool_t fFlag; // Flag used to simulate perpendicular tracks
- Bool_t fCheckNoise; // Flag used to check the simulated noise
Bool_t fCrosstalkFlag; // Flag used to apply the crosstalk effect
Int_t fDoFFT; // Flag used to switch off electronics when 0
Int_t fNofMaps; // Number of anodes used ( 1-2*nanodes per wing )
Int_t fMaxNofSamples;// Number of time samples
Int_t fScaleSize; // scale size factor for the samples in FFT
-// Int_t fModule; //! in case bgr,noise,param,change module-by-mod.
-// Int_t fEvent; //! solely for output from bgr monitoring of 2D
- ClassDef(AliITSsimulationSDD,1) // Simulation of SDD clusters
+ ClassDef(AliITSsimulationSDD,3) // Simulation of SDD clusters
};
#endif