]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulationSPDdubna.h
Removing extra semicolon
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPDdubna.h
1 #ifndef ALIITSSIMULATIONSPDDUBNA_H
2 #define ALIITSSIMULATIONSPDDUBNA_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 #include "TH1F.h"
8 #include "TObjArray.h"
9 #include "AliITSsimulation.h"
10 #include "AliITSCalibrationSPD.h"
11 #include "AliITSsegmentationSPD.h"
12 #include "AliITSresponseSPD.h"
13
14 class AliITSmodule;
15
16 //-------------------------------------------------------------------
17
18 class AliITSsimulationSPDdubna : public AliITSsimulation {
19  public:
20     AliITSsimulationSPDdubna();
21     //    AliITSsimulationSPDdubna(AliITSsegmentation *seg,AliITSCalibration *res,
22     //                         Int_t cup=1);
23     AliITSsimulationSPDdubna(AliITSDetTypeSim *dettyp,Int_t cup=1);
24     virtual ~AliITSsimulationSPDdubna();
25     // copy constructor
26     AliITSsimulationSPDdubna(const AliITSsimulationSPDdubna &source); 
27      // ass. operator
28     AliITSsimulationSPDdubna& operator=(const AliITSsimulationSPDdubna &s);
29     virtual AliITSsimulation& operator=(const AliITSsimulation &source);
30     // Initilizes the variables
31     void Init();
32
33     // General User calling routines
34     // Initilize simulation for a specific event and module
35     void InitSimulationModule(Int_t module, Int_t event);
36     // Finish and write S Digitization
37     void FinishSDigitiseModule();
38     // From hits to Digits, without creating SDigits
39     void DigitiseModule(AliITSmodule *mod,Int_t,Int_t);
40
41     // More or less Internal Routines
42     // Create S Digits from specific module
43     void SDigitiseModule(AliITSmodule *mod, Int_t mask, Int_t event);
44     // Write S Digits to the tree of SDigits.
45     void WriteSDigits();
46     // fill pList from hits, charge sharing, diffusion, coupling
47     void HitToSDigit(AliITSmodule *mod);
48     // Take pList of signals and apply noise... create Digis
49     void pListToDigits();
50     //
51     void CreateHistograms();
52     void FillHistograms(Int_t ix,Int_t iz,Double_t v=1.0);
53     void ResetHistograms();
54     TH1F* GetHistogram(Int_t i){return (TH1F*)(fHis->At(i));}// get histogram
55     TObjArray*  GetHistArray() {return fHis;}// get hist array
56     TString& GetHistName(){return fSPDname;}
57     void SetHistName(TString &n){fSPDname = n;}
58     //
59     // For backwards compatibility
60     void SDigitsToDigits(){ FinishSDigitiseModule();};
61     void HitToDigit(AliITSmodule *mod){
62         // Standard interface to DigitiseModule
63         // Inputs:
64         //    AliITSmodule *mod  Pointer to this module
65         // Outputs:
66         //    none.
67         // Return:
68         //    none.
69         DigitiseModule(mod,GetModuleNumber(),0);};
70
71  private:
72     void SpreadCharge(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0,
73                       Double_t el,Double_t sig,Int_t t,Int_t hi);
74     void UpdateMapSignal(Int_t ix,Int_t iz,Int_t trk,Int_t ht,Double_t signal){
75         //  This function adds a signal to the pList from the pList class
76         //  Inputs:
77         //    Int_t       iz     // row number
78         //    Int_t       ix     // column number
79         //    Int_t       trk    // track number
80         //    Int_t       ht     // hit number
81         //    Double_t    signal // signal strength
82         //  Outputs:
83         //    none.
84         //  Return:
85         //    none
86         GetMap()->AddSignal(iz,ix,trk,ht,GetModuleNumber(),signal);};
87     void UpdateMapNoise(Int_t ix,Int_t iz,Float_t noise){
88         //  This function adds noise to data in the MapA2 as well as the pList
89         //  Inputs:
90         //    Int_t       iz       // row number
91         //    Int_t       ix       // column number
92         //    Double_t    ns    // electronic noise generated by pListToDigits
93         //  Outputs:
94         //    none.
95         //  Return:
96         //    none
97         GetMap()->AddNoise(iz,ix,GetModuleNumber(),noise);}
98     // Get a pointer to the segmentation object
99     virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(0);}
100     // set pointer to segmentation objec
101     virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(0,seg);}
102     // Bari-Salerno Coupling parameters
103     // "New" coupling routine  Tiziano Virgili
104     void SetCoupling(Int_t row,Int_t col,Int_t ntrack,Int_t idhit);
105     // "Old" coupling routine  Rocco Caliandro
106     void SetCouplingOld(Int_t row, Int_t col,Int_t ntrack,Int_t idhit);
107     // Getters for data kept in fSegmentation and fResponse.
108     // Returns the Threshold in electrons
109     Double_t GetThreshold(){
110       Double_t th,sig;AliITSCalibrationSPD* res=(AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber()); 
111         res->Thresholds(th,sig);return th;};
112     // Returns the couplings Columb and Row.
113     void GetCouplings(Double_t &cc,Double_t &cr){
114       AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber());
115       res->GetCouplingParam(cc,cr);};
116     // Returns the number of pixels in x
117     Int_t GetNPixelsX(){return GetSegmentationModel(0)->Npx();};
118     // Returns the number of pixels in z
119     Int_t GetNPixelsZ(){return GetSegmentationModel(0)->Npz();};
120
121     TObjArray    *fHis;          //! just in case for histogramming
122     TString       fSPDname;      //! Histogram name
123     Int_t         fCoupling;     // Sets the coupling to be used.
124                                  // ==1 use SetCoupling, ==2 use SetCouplingOld
125                                  // with diffusion turned off (by constructor)
126                                  // ==3 use SetCoupling, ==4 use SetCouplingOld
127                                  // with diffusion, else no coupling.
128     ClassDef(AliITSsimulationSPDdubna,3)  // Simulation of SPD clusters
129 };
130 #endif