]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSresponseSDD.cxx
Mods to add the number of pixels in SPD rec. points (A. Mastroserio, D. Elia)
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 //////////////////////////////////////////////////////
19 //  Base response class forITS                      //
20 //  It is used to set static data members           //
21 //  connected to parameters equal for all           //
22 //  the modules                                     //
23 //                                                  //
24 //                                                  //
25 //////////////////////////////////////////////////////
26
27 #include <TMath.h>
28
29 #include "AliITSresponseSDD.h"
30 #include <AliITSgeomTGeo.h>
31
32 const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.30;
33 const Float_t AliITSresponseSDD::fgkADC2keVDefault = 3.34;
34 const Float_t AliITSresponseSDD::fgkChargevsTimeDefault = 0.00355;
35 const Float_t AliITSresponseSDD::fgkCarlosRXClockPeriod = 25.;
36 ClassImp(AliITSresponseSDD)
37
38 //_________________________________________________________________________
39 AliITSresponseSDD::AliITSresponseSDD():
40 TObject(),
41 fTimeOffset(fgkTimeOffsetDefault),
42 fADC2keV(fgkADC2keVDefault),
43 fChargevsTime(fgkChargevsTimeDefault){
44   // default constructor
45   for(Int_t i=0; i<kNSDDmods;i++){
46     fTimeZero[i]=fgkTimeOffsetDefault;
47     fDeltaVDrift[i]=0.;
48   }  
49 }
50 //_________________________________________________________________________
51 void AliITSresponseSDD::SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero){
52   // Sets time Zero for all modules of a ladder on side A (Z>0)
53   Int_t minMod,maxMod;
54   if(lay==3){
55     minMod=1; 
56     maxMod=3;
57     if(lad>kNLaddersLay3){
58       AliError(Form("Ladder number %d out of range",lad));
59       return;
60     }
61   }else if(lay==4){
62     minMod=1; 
63     maxMod=4;
64     if(lad>kNLaddersLay4){
65       AliError(Form("Ladder number %d out of range",lad));
66       return;
67     }
68   }else{
69     AliError(Form("Layer number %d out of range",lay));
70     return;
71   }
72   for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
73     Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
74     SetModuleTimeZero(modIndex,tzero);
75   }
76 }
77 //_________________________________________________________________________
78 void AliITSresponseSDD::SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero){
79   // Sets time Zero for all modules of a ladder on side C (Z<0)
80   Int_t minMod,maxMod;
81   if(lay==3){
82     minMod=4; 
83     maxMod=6;
84     if(lad>kNLaddersLay3){
85       AliError(Form("Ladder number %d out of range",lad));
86       return;
87     }
88   }else if(lay==4){
89     minMod=5; 
90     maxMod=8;
91     if(lad>kNLaddersLay4){
92       AliError(Form("Ladder number %d out of range",lad));
93       return;
94     }
95   }else{
96     AliError(Form("Layer number %d out of range",lay));
97     return;
98   }
99   for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
100     Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
101     SetModuleTimeZero(modIndex,tzero);
102   }
103 }