4 #include "AliITSdcsSSD.h"
5 #include "AliITSCalibrationSSD.h"
6 #include "AliITSresponseSSD.h"
7 #include "AliITSsegmentationSSD.h"
8 ///////////////////////////////////////////////////////////////////////////
10 // Class AliITSdcsSSD //
11 // describes Detector Control System parameters for one SSD module. //
13 // This class stores parametrers such as gain, threshold //
14 // capacitive coupling. //
16 // Class takes care of invalid strip menagement during //
17 // simulation and runtime //
20 // created at: Warsaw University of Technology //
21 // ver. 1.0 WARSAW, 23.12.1999 //
23 ///////////////////////////////////////////////////////////////////////////
25 ClassImp(AliITSdcsSSD)
27 // Constructor and Destructor
28 //______________________________________________________________________
29 AliITSdcsSSD::AliITSdcsSSD():
39 // Default Constructor
42 //______________________________________________________________________
43 AliITSdcsSSD::AliITSdcsSSD(AliITSsegmentation *seg, AliITSCalibration *resp):
53 // Standard constructor
55 fNstrips =(Float_t) (((AliITSsegmentationSSD*)seg)->Npx());
57 fInvalidP = new TArrayS();
58 fInvalidN = new TArrayS();
60 Int_t npar=((AliITSCalibrationSSD*)resp)->NDetParam();
62 Warning("AliITSdcsSSD","I need 6 parameters ");
66 Double_t *detpar= new Double_t[npar];
67 resp->GetDetParam(detpar);
69 fNInvalid = detpar[0];
72 fCouplingPR = detpar[2];
73 fCouplingPL = detpar[3];
74 fCouplingNR = detpar[4];
75 fCouplingNL = detpar[5];
77 char opt[30],dummy[20];
78 ((AliITSCalibrationSSD*)resp)->GetParamOptions(opt,dummy);
79 if (strstr(opt,"SetInvalid")) SetInvalidMC(fNInvalid,fISigma);
83 //______________________________________________________________________
84 AliITSdcsSSD::~AliITSdcsSSD() {
90 //______________________________________________________________________
91 AliITSdcsSSD::AliITSdcsSSD(const AliITSdcsSSD &source) : TObject(source),
92 fCouplingPR(source.fCouplingPR),
93 fCouplingPL(source.fCouplingPL),
94 fCouplingNR(source.fCouplingNR),
95 fCouplingNL(source.fCouplingNL),
96 fNstrips(source.fNstrips),
97 fNInvalid(source.fNInvalid),
98 fISigma(source.fISigma),
99 fInvalidP(source.fInvalidP),
100 fInvalidN(source.fInvalidN){
104 //_________________________________________________________________________
105 AliITSdcsSSD& AliITSdcsSSD::operator=(const AliITSdcsSSD &source) {
106 // Assignment operator
108 if(&source == this) return *this;
110 this->fCouplingPR = source.fCouplingPR;
111 this->fCouplingPL = source.fCouplingPL;
112 this->fCouplingNR = source.fCouplingNR;
113 this->fCouplingNL = source.fCouplingNL;
114 this->fNstrips = source.fNstrips;
115 this->fNInvalid = source.fNInvalid;
116 this->fISigma = source.fISigma;
117 this->fInvalidP = source.fInvalidP;
118 this->fInvalidN = source.fInvalidN;
122 //_____________________________________________________________________
124 // Methods for creating invalid strips
125 //_____________________________________________________________________
126 void AliITSdcsSSD::SetInvalidMC(Float_t mean, Float_t sigma) {
129 SetInvalidParam(mean, sigma);
132 //______________________________________________________________________
133 void AliITSdcsSSD::SetInvalidMC() {
140 pside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
141 nside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
143 fInvalidP->Set(pside);
144 fInvalidN->Set(nside);
146 for(i=0 ;i<pside; i++) {
147 strip = (Int_t)(gRandom->Rndm() * fNstrips);
148 fInvalidP->AddAt(strip, i);
151 for(i=0 ;i<nside; i++) {
152 strip = (Int_t)(gRandom->Rndm() * fNstrips);
153 fInvalidN->AddAt(strip, i);
156 //______________________________________________________________________
157 void AliITSdcsSSD::SetInvalidParam(Float_t mean, Float_t sigma) {
163 fNInvalid = (fNInvalid<0)? 0 : fNInvalid;
164 fNInvalid = (fNInvalid>fNstrips)? fNstrips: fNInvalid;
166 fISigma = (fISigma < 0)? 0 : fISigma;
167 fISigma = (fISigma > fNstrips/10) ? fNstrips/10 : fISigma;
169 //______________________________________________________________________
170 void AliITSdcsSSD::GetInvalidParam(Float_t &mean, Float_t &sigma) const {
176 //_____________________________________________________________________
178 // Methods for accessing to invalid strips
179 //_____________________________________________________________________
180 Bool_t AliITSdcsSSD::IsValidP(Int_t strip) {
182 Int_t nElem = fInvalidP->GetSize();
184 for(Int_t i = 0; i<nElem; i++) if(fInvalidP->At(i) == strip) return kFALSE;
187 //______________________________________________________________________
188 Bool_t AliITSdcsSSD::IsValidN(Int_t strip) {
190 Int_t nElem = fInvalidN->GetSize();
192 for(Int_t i = 0; i<nElem; i++) if(fInvalidN->At(i) == strip) return kFALSE;
195 //______________________________________________________________________
196 TArrayS* AliITSdcsSSD::GetInvalidP() {
201 //______________________________________________________________________
202 TArrayS* AliITSdcsSSD::GetInvalidN() {
207 //______________________________________________________________________
208 Int_t AliITSdcsSSD::GetNInvalidP(){
209 // get numeber of invalid P
211 return fInvalidP->GetSize();
213 //______________________________________________________________________
214 Int_t AliITSdcsSSD::GetNInvalidN() {
215 // get number of invalid N
217 return fInvalidN->GetSize();
219 //_____________________________________________________________________