4 #include "AliITSdcsSSD.h"
5 #include "AliITSresponseSSD.h"
6 #include "AliITSsegmentationSSD.h"
7 ///////////////////////////////////////////////////////////////////////////
9 // Class AliITSdcsSSD //
10 // describes Detector Control System parameters for one SSD module. //
12 // This class stores parametrers such as gain, threshold //
13 // capacitive coupling. //
15 // Class takes care of invalid strip menagement during //
16 // simulation and runtime //
19 // created at: Warsaw University of Technology //
20 // ver. 1.0 WARSAW, 23.12.1999 //
22 ///////////////////////////////////////////////////////////////////////////
24 ClassImp(AliITSdcsSSD)
26 // Constructor and Destructor
27 //______________________________________________________________________
28 AliITSdcsSSD::AliITSdcsSSD(){
29 // Default Constructor
34 //______________________________________________________________________
35 AliITSdcsSSD::AliITSdcsSSD(AliITSsegmentation *seg, AliITSresponse *resp){
36 // Standard constructor
38 fNstrips =(Float_t) (((AliITSsegmentationSSD*)seg)->Npx());
40 fInvalidP = new TArrayS();
41 fInvalidN = new TArrayS();
43 Int_t npar=((AliITSresponseSSD*)resp)->NDetParam();
45 Warning("AliITSdcsSSD","I need 6 parameters ");
49 Double_t *detpar= new Double_t[npar];
50 ((AliITSresponseSSD*)resp)->GetDetParam(detpar);
52 fNInvalid = detpar[0];
55 fCouplingPR = detpar[2];
56 fCouplingPL = detpar[3];
57 fCouplingNR = detpar[4];
58 fCouplingNL = detpar[5];
60 char opt[30],dummy[20];
61 ((AliITSresponseSSD*)resp)->ParamOptions(opt,dummy);
62 if (strstr(opt,"SetInvalid")) SetInvalidMC(fNInvalid,fISigma);
66 //______________________________________________________________________
67 AliITSdcsSSD::~AliITSdcsSSD() {
73 //______________________________________________________________________
74 AliITSdcsSSD::AliITSdcsSSD(const AliITSdcsSSD &source) : TObject(source){
77 if(&source == this) return;
79 this->fCouplingPR = source.fCouplingPR;
80 this->fCouplingPL = source.fCouplingPL;
81 this->fCouplingNR = source.fCouplingNR;
82 this->fCouplingNL = source.fCouplingNL;
83 this->fNstrips = source.fNstrips;
84 this->fNInvalid = source.fNInvalid;
85 this->fISigma = source.fISigma;
86 this->fInvalidP = source.fInvalidP;
87 this->fInvalidN = source.fInvalidN;
91 //_________________________________________________________________________
92 AliITSdcsSSD& AliITSdcsSSD::operator=(const AliITSdcsSSD &source) {
93 // Assignment operator
95 if(&source == this) return *this;
97 this->fCouplingPR = source.fCouplingPR;
98 this->fCouplingPL = source.fCouplingPL;
99 this->fCouplingNR = source.fCouplingNR;
100 this->fCouplingNL = source.fCouplingNL;
101 this->fNstrips = source.fNstrips;
102 this->fNInvalid = source.fNInvalid;
103 this->fISigma = source.fISigma;
104 this->fInvalidP = source.fInvalidP;
105 this->fInvalidN = source.fInvalidN;
109 //_____________________________________________________________________
111 // Methods for creating invalid strips
112 //_____________________________________________________________________
113 void AliITSdcsSSD::SetInvalidMC(Float_t mean, Float_t sigma) {
116 SetInvalidParam(mean, sigma);
119 //______________________________________________________________________
120 void AliITSdcsSSD::SetInvalidMC() {
127 pside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
128 nside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
130 fInvalidP->Set(pside);
131 fInvalidN->Set(nside);
133 for(i=0 ;i<pside; i++) {
134 strip = (Int_t)(gRandom->Rndm() * fNstrips);
135 fInvalidP->AddAt(strip, i);
138 for(i=0 ;i<nside; i++) {
139 strip = (Int_t)(gRandom->Rndm() * fNstrips);
140 fInvalidN->AddAt(strip, i);
143 //______________________________________________________________________
144 void AliITSdcsSSD::SetInvalidParam(Float_t mean, Float_t sigma) {
150 fNInvalid = (fNInvalid<0)? 0 : fNInvalid;
151 fNInvalid = (fNInvalid>fNstrips)? fNstrips: fNInvalid;
153 fISigma = (fISigma < 0)? 0 : fISigma;
154 fISigma = (fISigma > fNstrips/10) ? fNstrips/10 : fISigma;
156 //______________________________________________________________________
157 void AliITSdcsSSD::GetInvalidParam(Float_t &mean, Float_t &sigma) const {
163 //_____________________________________________________________________
165 // Methods for accessing to invalid strips
166 //_____________________________________________________________________
167 Bool_t AliITSdcsSSD::IsValidP(Int_t strip) {
169 Int_t nElem = fInvalidP->GetSize();
171 for(Int_t i = 0; i<nElem; i++) if(fInvalidP->At(i) == strip) return kFALSE;
174 //______________________________________________________________________
175 Bool_t AliITSdcsSSD::IsValidN(Int_t strip) {
177 Int_t nElem = fInvalidN->GetSize();
179 for(Int_t i = 0; i<nElem; i++) if(fInvalidN->At(i) == strip) return kFALSE;
182 //______________________________________________________________________
183 TArrayS* AliITSdcsSSD::GetInvalidP() {
188 //______________________________________________________________________
189 TArrayS* AliITSdcsSSD::GetInvalidN() {
194 //______________________________________________________________________
195 Int_t AliITSdcsSSD::GetNInvalidP(){
196 // get numeber of invalid P
198 return fInvalidP->GetSize();
200 //______________________________________________________________________
201 Int_t AliITSdcsSSD::GetNInvalidN() {
202 // get number of invalid N
204 return fInvalidN->GetSize();
206 //_____________________________________________________________________