4 #include "AliITSdcsSSD.h"
5 #include "AliITSresponseSSD.h"
6 #include "AliITSsegmentationSSD.h"
10 // Constructor and Destructor
11 //______________________________________________________________________
12 AliITSdcsSSD::AliITSdcsSSD(){
13 // Default Constructor
18 //______________________________________________________________________
19 AliITSdcsSSD::AliITSdcsSSD(AliITSsegmentation *seg, AliITSresponse *resp){
20 // Standard constructor
22 fNstrips = seg->Npx();
24 fInvalidP = new TArrayS();
25 fInvalidN = new TArrayS();
27 Int_t npar=resp->NDetParam();
29 Warning("AliITSdcsSSD","I need 6 parameters ");
33 Float_t *detpar= new Float_t[npar];
34 resp->GetDetParam(detpar);
36 fNInvalid = detpar[0];
39 fCouplingPR = detpar[2];
40 fCouplingPL = detpar[3];
41 fCouplingNR = detpar[4];
42 fCouplingNL = detpar[5];
44 char opt[30],dummy[20];
45 resp->ParamOptions(opt,dummy);
46 if (strstr(opt,"SetInvalid")) SetInvalidMC(fNInvalid,fISigma);
50 //______________________________________________________________________
51 AliITSdcsSSD::~AliITSdcsSSD() {
57 //______________________________________________________________________
58 AliITSdcsSSD::AliITSdcsSSD(const AliITSdcsSSD &source){
61 if(&source == this) return;
63 this->fCouplingPR = source.fCouplingPR;
64 this->fCouplingPL = source.fCouplingPL;
65 this->fCouplingNR = source.fCouplingNR;
66 this->fCouplingNL = source.fCouplingNL;
67 this->fNstrips = source.fNstrips;
68 this->fNInvalid = source.fNInvalid;
69 this->fISigma = source.fISigma;
70 this->fInvalidP = source.fInvalidP;
71 this->fInvalidN = source.fInvalidN;
75 //_________________________________________________________________________
76 AliITSdcsSSD& AliITSdcsSSD::operator=(const AliITSdcsSSD &source) {
77 // Assignment operator
79 if(&source == this) return *this;
81 this->fCouplingPR = source.fCouplingPR;
82 this->fCouplingPL = source.fCouplingPL;
83 this->fCouplingNR = source.fCouplingNR;
84 this->fCouplingNL = source.fCouplingNL;
85 this->fNstrips = source.fNstrips;
86 this->fNInvalid = source.fNInvalid;
87 this->fISigma = source.fISigma;
88 this->fInvalidP = source.fInvalidP;
89 this->fInvalidN = source.fInvalidN;
93 //_____________________________________________________________________
95 // Methods for creating invalid strips
96 //_____________________________________________________________________
97 void AliITSdcsSSD::SetInvalidMC(Float_t mean, Float_t sigma) {
100 SetInvalidParam(mean, sigma);
103 //______________________________________________________________________
104 void AliITSdcsSSD::SetInvalidMC() {
111 pside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
112 nside = (Int_t)gRandom->Gaus(fNInvalid, fISigma);
114 fInvalidP->Set(pside);
115 fInvalidN->Set(nside);
117 for(i=0 ;i<pside; i++) {
118 strip = (Int_t)(gRandom->Rndm() * fNstrips);
119 fInvalidP->AddAt(strip, i);
122 for(i=0 ;i<nside; i++) {
123 strip = (Int_t)(gRandom->Rndm() * fNstrips);
124 fInvalidN->AddAt(strip, i);
127 //______________________________________________________________________
128 void AliITSdcsSSD::SetInvalidParam(Float_t mean, Float_t sigma) {
134 fNInvalid = (fNInvalid<0)? 0 : fNInvalid;
135 fNInvalid = (fNInvalid>fNstrips)? fNstrips: fNInvalid;
137 fISigma = (fISigma < 0)? 0 : fISigma;
138 fISigma = (fISigma > fNstrips/10) ? fNstrips/10 : fISigma;
140 //______________________________________________________________________
141 void AliITSdcsSSD::GetInvalidParam(Float_t &mean, Float_t &sigma) {
147 //_____________________________________________________________________
149 // Methods for accessing to invalid strips
150 //_____________________________________________________________________
151 Bool_t AliITSdcsSSD::IsValidP(Int_t strip) {
153 Int_t nElem = fInvalidP->GetSize();
155 for(Int_t i = 0; i<nElem; i++) if(fInvalidP->At(i) == strip) return kFALSE;
158 //______________________________________________________________________
159 Bool_t AliITSdcsSSD::IsValidN(Int_t strip) {
161 Int_t nElem = fInvalidN->GetSize();
163 for(Int_t i = 0; i<nElem; i++) if(fInvalidN->At(i) == strip) return kFALSE;
166 //______________________________________________________________________
167 TArrayS* AliITSdcsSSD::GetInvalidP() {
172 //______________________________________________________________________
173 TArrayS* AliITSdcsSSD::GetInvalidN() {
178 //______________________________________________________________________
179 Int_t AliITSdcsSSD::GetNInvalidP(){
180 // get numeber of invalid P
182 return fInvalidP->GetSize();
184 //______________________________________________________________________
185 Int_t AliITSdcsSSD::GetNInvalidN() {
186 // get number of invalid N
188 return fInvalidN->GetSize();
190 //_____________________________________________________________________