From 8be4e1b1828b1b484de7fb8c61a0bbf9b4085b03 Mon Sep 17 00:00:00 2001 From: masera Date: Fri, 29 Aug 2008 15:03:11 +0000 Subject: [PATCH] SSD: updated segmentation class and cleanup of ClusterFinder (M. Van Leeuwen). Elimination of AliITSresponseSSD class. Use of AliITSSimuParam class (E. Fragiacomo) --- ITS/AliITSCalibrationSSD.cxx | 13 ++- ITS/AliITSCalibrationSSD.h | 33 +++--- ITS/AliITSClusterFinderSSD.h | 1 - ITS/AliITSClusterFinderV2SSD.cxx | 178 +++++++++++++++---------------- ITS/AliITSClusterFinderV2SSD.h | 8 +- ITS/AliITSDetTypeRec.cxx | 11 +- ITS/AliITSDetTypeSim.cxx | 11 +- ITS/AliITSSimuParam.cxx | 4 - ITS/AliITSSimuParam.h | 11 +- ITS/AliITSresponseSSD.cxx | 74 ------------- ITS/AliITSresponseSSD.h | 69 ------------ ITS/AliITSsegmentationSSD.cxx | 157 ++++++--------------------- ITS/AliITSsegmentationSSD.h | 9 +- ITS/AliITSsimulationSSD.cxx | 33 +++--- ITS/ITSbaseLinkDef.h | 1 - ITS/libITSbase.pkg | 1 - 16 files changed, 171 insertions(+), 443 deletions(-) delete mode 100644 ITS/AliITSresponseSSD.cxx delete mode 100644 ITS/AliITSresponseSSD.h diff --git a/ITS/AliITSCalibrationSSD.cxx b/ITS/AliITSCalibrationSSD.cxx index 1e2a0d02110..592c0804530 100644 --- a/ITS/AliITSCalibrationSSD.cxx +++ b/ITS/AliITSCalibrationSSD.cxx @@ -36,12 +36,17 @@ fNoise(0), fPedestal(), fGain(0), fBadChannels(0), -fIsBad(kFALSE){ + fIsBad(kFALSE), +fSSDADCpereV(0.), + fKeVperADC(0) +{ // Default Constructor for(Int_t i=0;iSetADCpereV(a);} - virtual Double_t GetDEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->DEvToADC(eV);} - virtual Int_t IEvToADC(Double_t eV) const {return ((AliITSresponseSSD*)fResponse)->IEvToADC(eV);} - - virtual void SetKeVperADC(Double_t a=86.4/120.0) {((AliITSresponseSSD*)fResponse)->SetKeVperADC(a);} - virtual Double_t ADCToKeV(Double_t adc) const {return ((AliITSresponseSSD*)fResponse)->ADCToKeV(adc);} + void SetModule(Int_t mod){fModule = mod;} - virtual Double_t GetCouplingPR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPR();} - virtual Double_t GetCouplingPL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingPL();} - virtual Double_t GetCouplingNR() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNR();} - virtual Double_t GetCouplingNL() const {return ((AliITSresponseSSD*)fResponse)->GetCouplingNL();} - virtual void SetCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) - { ((AliITSresponseSSD*)fResponse)->SetCouplings(pr,pl,nr,nl);} + void SetKeVperADC(Double_t a=86.4/120.){fKeVperADC = a;} + Double_t ADCToKeV(Double_t adc) const {return adc*fKeVperADC;} - virtual Int_t GetZSThreshold() const {return ((AliITSresponseSSD*)fResponse)->GetZSThreshold();} - virtual void SetZSThreshold(Int_t zsth) - { ((AliITSresponseSSD*)fResponse)->SetZSThreshold(zsth);} + void SetSSDADCpereV(Double_t a=120./24888.9){fSSDADCpereV = a;} + Double_t GetSSDDEvToADC(Double_t eV) const {return eV*fSSDADCpereV;} + Int_t GetSSDIEvToADC(Double_t eV) const { + return ((Int_t) GetSSDDEvToADC(eV)); } - void SetModule(Int_t mod){fModule = mod;} -protected: + protected: static const Int_t fgkChipsPerModule = 12; // Number of chips/module static const Int_t fgkChannelsPerChip = 128; // Number of channels/chip @@ -135,10 +125,13 @@ protected: Bool_t fIsBad; // module is dead or alive ? Bool_t fIsChipBad[fgkChipsPerModule]; // chip is dead or alive ? + Double_t fSSDADCpereV; // Constant to convert eV to ADC for SSD. + Double_t fKeVperADC; // Constant to convert ADC to keV + private: AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op. - ClassDef(AliITSCalibrationSSD,4) //Response class for SSD + ClassDef(AliITSCalibrationSSD,5) //Response class for SSD }; #endif diff --git a/ITS/AliITSClusterFinderSSD.h b/ITS/AliITSClusterFinderSSD.h index f45b35e433d..6f39f58d11c 100644 --- a/ITS/AliITSClusterFinderSSD.h +++ b/ITS/AliITSClusterFinderSSD.h @@ -14,7 +14,6 @@ class AliITSpackageSSD; class AliITSsegmentation; class AliITSsegmentationSSD; class AliITSresponse; -class AliITSresponseSSD; class AliITSCalibration; class AliITSCalibrationSSD; diff --git a/ITS/AliITSClusterFinderV2SSD.cxx b/ITS/AliITSClusterFinderV2SSD.cxx index d0f3bd2d442..13f97a8baa5 100644 --- a/ITS/AliITSClusterFinderV2SSD.cxx +++ b/ITS/AliITSClusterFinderV2SSD.cxx @@ -37,6 +37,7 @@ #include "AliITSdigitSSD.h" #include "AliITSReconstructor.h" #include "AliITSCalibrationSSD.h" +#include "AliITSsegmentationSSD.h" Short_t *AliITSClusterFinderV2SSD::fgPairs = 0x0; Int_t AliITSClusterFinderV2SSD::fgPairsSize = 0; @@ -45,25 +46,14 @@ ClassImp(AliITSClusterFinderV2SSD) AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp), -fLastSSD1(AliITSgeomTGeo::GetModuleIndex(6,1,1)-1), -fYpitchSSD(0.0095), -fHwSSD(3.65), -fHlSSD(2.00), -fTanP(0.0275), -fTanN(0.0075) +fLastSSD1(AliITSgeomTGeo::GetModuleIndex(6,1,1)-1) { - - //Default constructor +//Default constructor } //______________________________________________________________________ -AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(const AliITSClusterFinderV2SSD &cf) : AliITSClusterFinderV2(cf), fLastSSD1(cf.fLastSSD1), -fYpitchSSD(cf.fYpitchSSD), -fHwSSD(cf.fHwSSD), -fHlSSD(cf.fHlSSD), -fTanP(cf.fTanP), -fTanN(cf.fTanN) +AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(const AliITSClusterFinderV2SSD &cf) : AliITSClusterFinderV2(cf), fLastSSD1(cf.fLastSSD1) { // Copy constructor } @@ -117,7 +107,6 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(TClonesArray *alldigits) { Float_t q=gain*d->GetSignal(); // calibration brings mip peaks around 120 (in ADC units) q=cal->ADCToKeV(q); // converts the charge in KeV from ADC units - //Float_t q=d->GetSignal()/4.29;// temp. fix (for PID purposed - normalis. to be checked) d->SetSignal(Int_t(q)); if (d->GetSignal()<3) continue; @@ -614,28 +603,30 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(fModule); TClonesArray &cl=*clusters; - // - // Float_t tanp=fTanP, tann=fTanN; - const Float_t kStartXzero=3.64325; - const Float_t kDeltaXzero5or6=0.02239; - const Float_t kDeltaZ5to6=7.6/7.0; - Int_t is6=-1; - - if (fModule>fLastSSD1) is6=1; + AliITSsegmentationSSD *seg = dynamic_cast(fDetTypeRec->GetSegmentationModel(2)); + if (fModule>fLastSSD1) + seg->SetLayer(6); + else + seg->SetLayer(5); + + Float_t hwSSD = seg->Dx()*1e-4/2; + Float_t hlSSD = seg->Dz()*1e-4/2; + Int_t idet=fNdet[fModule]; Int_t ncl=0; // - Int_t negativepair[30000]; - Int_t cnegative[3000]; - Int_t cused1[3000]; - Int_t positivepair[30000]; - Int_t cpositive[3000]; - Int_t cused2[3000]; - for (Int_t i=0;i<3000;i++) {cnegative[i]=0; cused1[i]=0;} - for (Int_t i=0;i<3000;i++) {cpositive[i]=0; cused2[i]=0;} - for (Int_t i=0;i<30000;i++) {negativepair[i]=0; positivepair[i]=0;} + Int_t *cnegative = new Int_t[np]; + Int_t *cused1 = new Int_t[np]; + Int_t *negativepair = new Int_t[10*np]; + Int_t *cpositive = new Int_t[nn]; + Int_t *cused2 = new Int_t[nn]; + Int_t *positivepair = new Int_t[10*nn]; + for (Int_t i=0;i fgPairsSize) { @@ -655,11 +646,11 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, if ( (neg[j].GetQ()>0) && (neg[j].GetQ()<3) ) continue; Float_t yn=neg[j].GetY(); - Float_t zt=1.9*(yp-yn)/7.0-is6*kDeltaZ5to6; - Float_t yt=is6*(kStartXzero-(285*yp + 1045*yn)/140000.0) + kDeltaXzero5or6; + Float_t xt, zt; + seg->GetPadCxz(yn, yp, xt, zt); - if (TMath::Abs(yt)0) && (neg[j].GetQ()<3) ) continue; // if both 1Dclusters have an other cross continue if (cpositive[j]&&cnegative[i]) continue; - Float_t yn=neg[j].GetY(); + Float_t yn=neg[j].GetY(); - Float_t zt=1.9*(yp-yn)/7.0-is6*kDeltaZ5to6; - Float_t yt=is6*(kStartXzero-(285*yp + 1045*yn)/140000.0) + kDeltaXzero5or6; + Float_t xt, zt; + seg->GetPadCxz(yn, yp, xt, zt); - if (TMath::Abs(yt)0.2) continue; // note: 0.2=3xsigma_ratio calculated in cosmics tests // - Float_t yn=neg[j].GetY(); - - Float_t zt=1.9*(yp-yn)/7.0-is6*kDeltaZ5to6; - Float_t yt=is6*(kStartXzero-(285*yp + 1045*yn)/140000.0) + kDeltaXzero5or6; - - ybest=yt; zbest=zt; + Float_t yn=neg[j].GetY(); + + Float_t xt, zt; + seg->GetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; qbest=0.5*(pos[ip].GetQ()+neg[j].GetQ()); if( (pos[ip].GetQ()==0)||(neg[ip].GetQ()==0)) qbest*=2; // in case of bad strips on one side keep all charge from the other one { - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -820,7 +811,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, } for (Int_t ip=0;ipGetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; qbest =pos[ip].GetQ(); - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -900,15 +891,16 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, if ( (fgPairs[ip2*nn+in]==100) && (pos[ip2].GetQ()) ) { Float_t yp=pos[ip2].GetY(); - Float_t yn=neg[in].GetY(); - - Float_t zt=1.9*(yp-yn)/7.0-is6*kDeltaZ5to6; - Float_t yt=is6*(kStartXzero-(285*yp + 1045*yn)/140000.0) + kDeltaXzero5or6; - ybest =yt; zbest=zt; + Float_t yn=neg[in].GetY(); + + Float_t xt, zt; + seg->GetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; qbest =pos[ip2].GetQ(); - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -969,7 +961,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, // for (Int_t jn=0;jnGetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; qbest =neg[jn].GetQ(); { - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -1052,16 +1043,16 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, Float_t yn=neg[jn2].GetY(); Double_t yp=pos[ip].GetY(); - Double_t zt=1.9*(yp-yn)/7.0-is6*kDeltaZ5to6; - Double_t yt=is6*(kStartXzero-(285*yp + 1045*yn)/140000.0) + kDeltaXzero5or6; - - ybest =yt; zbest=zt; + Float_t xt, zt; + seg->GetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; qbest =neg[jn2].GetQ(); { - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -1121,7 +1112,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, for (Int_t ip=0;ipGetPadCxz(yn, yp, xt, zt); + + xbest=xt; zbest=zt; + qbest=0.5*(pos[ip].GetQ()+neg[j].GetQ()); { - Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.}; + Double_t loc[3]={xbest,0.,zbest},trk[3]={0.,0.,0.}; mT2L->MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -1237,7 +1230,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, // recover all the other crosses // for (Int_t i=0; i0)&&(pos[i].GetQ()<3)) continue; for (Int_t j=0; jGetPadCxz(yn, yp, xt, zt); - if (TMath::Abs(yt)MasterToLocal(loc,trk); lp[0]=trk[1]; lp[1]=trk[2]; @@ -1304,5 +1298,11 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn, } } } + delete [] cnegative; + delete [] cused1; + delete [] negativepair; + delete [] cpositive; + delete [] cused2; + delete [] positivepair; } diff --git a/ITS/AliITSClusterFinderV2SSD.h b/ITS/AliITSClusterFinderV2SSD.h index 3a1d9d930db..d3b4e4add4b 100644 --- a/ITS/AliITSClusterFinderV2SSD.h +++ b/ITS/AliITSClusterFinderV2SSD.h @@ -37,16 +37,10 @@ public: return (AliITSCalibrationSSD*) fDetTypeRec->GetCalibrationModel(mod);} Int_t fLastSSD1; //index of the last SSD1 detector - Float_t fYpitchSSD; //strip pitch (cm) - Float_t fHwSSD; //half-width of an SSD detector (cm) - Float_t fHlSSD; //half-length of an SSD detector (cm) - Float_t fTanP; //tangent of the stereo angle on the P side - Float_t fTanN; //tangent of the stereo angle on the N side - static Short_t* fgPairs; //array used to build positive-negative pairs static Int_t fgPairsSize; //actual size of pairs array - ClassDef(AliITSClusterFinderV2SSD,1) // ITS cluster finder V2 for SDD + ClassDef(AliITSClusterFinderV2SSD,2) // ITS cluster finder V2 for SDD }; #endif diff --git a/ITS/AliITSDetTypeRec.cxx b/ITS/AliITSDetTypeRec.cxx index 2b7fc6e68e1..0898ce50ccf 100644 --- a/ITS/AliITSDetTypeRec.cxx +++ b/ITS/AliITSDetTypeRec.cxx @@ -461,7 +461,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() { AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD"); AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD"); - AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD"); AliCDBEntry *drSpSDD = AliCDBManager::Instance()->Get("ITS/Calib/DriftSpeedSDD"); AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); // AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD"); @@ -469,7 +468,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() { if(!entrySPD || !deadSPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD || - !entry2SPD || !entry2SDD || !entry2SSD || !drSpSDD || !ddlMapSDD || !mapTSDD ){ + !entry2SPD || !entry2SDD || !drSpSDD || !ddlMapSDD || !mapTSDD ){ AliFatal("Calibration object retrieval failed! "); return kFALSE; } @@ -547,10 +546,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() { if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL); entryBadChannelsSSD->SetOwner(kTRUE); - AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject(); - if(!cacheStatus)entry2SSD->SetObject(NULL); - entry2SSD->SetOwner(kTRUE); - // DB entries are deleted. In this way metadeta objects are deleted as well if(!cacheStatus){ delete entrySPD; @@ -561,14 +556,13 @@ Bool_t AliITSDetTypeRec::GetCalibration() { delete entryBadChannelsSSD; delete entry2SPD; delete entry2SDD; - delete entry2SSD; //delete mapASDD; delete mapTSDD; delete drSpSDD; delete ddlMapSDD; } - if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!caldeadSPD) ||(!calSDD) || (!drSp) || (!ddlsdd) + if ((!pSPD)||(!pSDD)|| (!calSPD) || (!caldeadSPD) ||(!calSDD) || (!drSp) || (!ddlsdd) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) { AliWarning("Can not get calibration from calibration database !"); return kFALSE; @@ -614,7 +608,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() { } } - fSSDCalibration->SetResponse((AliITSresponse*)pSSD); fSSDCalibration->SetNoise(noiseSSD); fSSDCalibration->SetGain(gainSSD); fSSDCalibration->SetBadChannels(badChannelsSSD); diff --git a/ITS/AliITSDetTypeSim.cxx b/ITS/AliITSDetTypeSim.cxx index e97b5b13b4e..27813a27471 100644 --- a/ITS/AliITSDetTypeSim.cxx +++ b/ITS/AliITSDetTypeSim.cxx @@ -447,10 +447,9 @@ Bool_t AliITSDetTypeSim::GetCalibration() { AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", run); - AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", run); if(!entrySPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD || - !entry2SPD || !entry2SSD || !drSpSDD || !ddlMapSDD || !mapTSDD){ + !entry2SPD || !drSpSDD || !ddlMapSDD || !mapTSDD){ AliFatal("Calibration object retrieval failed! "); return kFALSE; } @@ -545,10 +544,6 @@ Bool_t AliITSDetTypeSim::GetCalibration() { if(!isCacheActive)entryBadChannelsSSD->SetObject(NULL); entryBadChannelsSSD->SetOwner(kTRUE);*/ - AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject(); - if(!isCacheActive)entry2SSD->SetObject(NULL); - entry2SSD->SetOwner(kTRUE); - // DB entries are deleted. In this way metadeta objects are deleted as well if(!isCacheActive){ delete entrySPD; @@ -557,7 +552,6 @@ Bool_t AliITSDetTypeSim::GetCalibration() { delete entryGainSSD; delete entryBadChannelsSSD; delete entry2SPD; - delete entry2SSD; // delete mapASDD; delete mapTSDD; delete drSpSDD; @@ -566,7 +560,7 @@ Bool_t AliITSDetTypeSim::GetCalibration() { AliCDBManager::Instance()->SetCacheFlag(origCacheStatus); - if ((!pSPD)||(!pSSD) || (!calSPD) || (!calSDD) || (!drSp) || (!ddlsdd) + if ((!pSPD)|| (!calSPD) || (!calSDD) || (!drSp) || (!ddlsdd) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) { AliWarning("Can not get calibration from calibration database !"); return kFALSE; @@ -620,7 +614,6 @@ Bool_t AliITSDetTypeSim::GetCalibration() { } } - fSSDCalibration->SetResponse((AliITSresponse*)pSSD); fSSDCalibration->SetNoise(noiseSSD); fSSDCalibration->SetGain(gainSSD); fSSDCalibration->SetBadChannels(badChannelsSSD); diff --git a/ITS/AliITSSimuParam.cxx b/ITS/AliITSSimuParam.cxx index 97964bf0315..ac63cdfaca4 100644 --- a/ITS/AliITSSimuParam.cxx +++ b/ITS/AliITSSimuParam.cxx @@ -69,7 +69,6 @@ fSDDJitterError(fgkSDDJitterErrorDefault), fSDDDynamicRange(fgkSDDDynamicRangeDefault), fSDDMaxAdc(0.), fSDDChargeLoss(fgkSDDChargeLossDefault), -fSSDADCpereV(0.), fSSDCouplingPR(0), fSSDCouplingPL(0), fSSDCouplingNR(0), @@ -92,7 +91,6 @@ fT(300.) SetSDDElectronics(); SetSDDDiffCoeff(fgkSDDDiffCoeffDefault,fgkSDDDiffCoeff1Default); SetSDDMaxAdc((Double_t)fgkSDDMaxAdcDefault); - SetSSDADCpereV(); SetSSDCouplings(fgkSSDCouplingPRDefault,fgkSSDCouplingPLDefault,fgkSSDCouplingNRDefault,fgkSSDCouplingNLDefault); } //______________________________________________________________________ @@ -114,7 +112,6 @@ fSDDJitterError(simpar.fSDDJitterError), fSDDDynamicRange(simpar.fSDDDynamicRange), fSDDMaxAdc(simpar.fSDDMaxAdc), fSDDChargeLoss(simpar.fSDDChargeLoss), -fSSDADCpereV(simpar.fSSDADCpereV), fSSDCouplingPR(simpar.fSSDCouplingPR), fSSDCouplingPL(simpar.fSSDCouplingPL), fSSDCouplingNR(simpar.fSSDCouplingNR), @@ -183,7 +180,6 @@ void AliITSSimuParam::PrintParameters() const{ printf("Charge Loss = %f\n",fSDDChargeLoss); printf("\n"); printf("===== SSD parameters =====\n"); - printf("ADC per eV = %f\n",fSSDADCpereV); printf("Coupling PR = %f\n",fSSDCouplingPR); printf("Coupling PL = %f\n",fSSDCouplingPL); printf("Coupling NR = %f\n",fSSDCouplingNR); diff --git a/ITS/AliITSSimuParam.h b/ITS/AliITSSimuParam.h index 159aa48ebea..4d28d30b196 100644 --- a/ITS/AliITSSimuParam.h +++ b/ITS/AliITSSimuParam.h @@ -87,12 +87,10 @@ class AliITSSimuParam : public TObject { void SetSDDChargeLoss(Double_t p1) {fSDDChargeLoss=p1;} Float_t GetSDDChargeLoss() const {return fSDDChargeLoss;} - - void SetSSDADCpereV(Double_t a=120./24888.9){fSSDADCpereV = a;} - Double_t GetSSDDEvToADC(Double_t eV) const {return eV*fSSDADCpereV;} - Int_t GetSSDIEvToADC(Double_t eV) const { - return ((Int_t) GetSSDDEvToADC(eV)); } - + Int_t GetSSDZSThreshold() const { // ZS threshold + return fSSDZSThreshold; } + virtual void SetSSDZSThreshold(Int_t zsth) { fSSDZSThreshold = zsth; } + void SetSSDCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) { fSSDCouplingPR=pr; fSSDCouplingPL=pl; fSSDCouplingNR=nr; fSSDCouplingNL=nl; } Double_t GetSSDCouplingPR() const {return fSSDCouplingPR;} @@ -217,7 +215,6 @@ class AliITSSimuParam : public TObject { Float_t fSDDMaxAdc; // SDD ADC saturation value Float_t fSDDChargeLoss; // Set Linear Coefficient for Charge Loss - Double_t fSSDADCpereV; // Constant to convert eV to ADC for SSD. Double_t fSSDCouplingPR; // SSD couplings Double_t fSSDCouplingPL; // SSD couplings Double_t fSSDCouplingNR; // SSD couplings diff --git a/ITS/AliITSresponseSSD.cxx b/ITS/AliITSresponseSSD.cxx deleted file mode 100644 index 00431ff6267..00000000000 --- a/ITS/AliITSresponseSSD.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - - -#include "AliITSresponseSSD.h" -////////////////////////////////////////////////// -// Base response class for ITS // -// It is used to set static data members // -// connected to parameters equal for all // -// the SSD modules // -////////////////////////////////////////////////// - - -const Float_t AliITSresponseSSD::fgkDiffCoeffDefault = 0.; -const Double_t AliITSresponseSSD::fgkfCouplingPR = 0.01; -const Double_t AliITSresponseSSD::fgkfCouplingPL = 0.01; -const Double_t AliITSresponseSSD::fgkfCouplingNR = 0.01; -const Double_t AliITSresponseSSD::fgkfCouplingNL = 0.01; -const Int_t AliITSresponseSSD::fgkZSThreshold = 3; - - -ClassImp(AliITSresponseSSD) - -//______________________________________________________________________ -AliITSresponseSSD::AliITSresponseSSD():AliITSresponse(), -fADCpereV(0), -fKeVperADC(0), -fCouplingPR(0), -fCouplingPL(0), -fCouplingNR(0), -fCouplingNL(9), -fZSThreshold(0){ - // Default Constructor - - SetDiffCoeff(fgkDiffCoeffDefault,0.); - SetADCpereV(); - SetKeVperADC(); - SetCouplings(fgkfCouplingPR,fgkfCouplingPL,fgkfCouplingNR,fgkfCouplingNL); - SetZSThreshold(fgkZSThreshold); -} - -//______________________________________________________________________ -AliITSresponseSSD::AliITSresponseSSD(const AliITSresponseSSD &ob) : AliITSresponse(ob), -fADCpereV(ob.fADCpereV), -fKeVperADC(ob.fKeVperADC), -fCouplingPR(ob.fCouplingPR), -fCouplingPL(ob.fCouplingPL), -fCouplingNR(ob.fCouplingNR), -fCouplingNL(ob.fCouplingNL), -fZSThreshold(ob.fZSThreshold){ - // Copy constructor - -} - -//______________________________________________________________________ -AliITSresponseSSD& AliITSresponseSSD::operator=(const AliITSresponseSSD& ob){ - // Assignment operator - this->~AliITSresponseSSD(); - new(this) AliITSresponseSSD(ob); - return *this; -} - diff --git a/ITS/AliITSresponseSSD.h b/ITS/AliITSresponseSSD.h deleted file mode 100644 index 7a1d650037e..00000000000 --- a/ITS/AliITSresponseSSD.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef ALIITSRESPONSESSD_H -#define ALIITSRESPONSESSD_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -#include "AliITSresponse.h" -#include - -/////////////////////////////////////////////////// -// Response class for SSD // -// // -/////////////////////////////////////////////////// - -class AliITSresponseSSD : public AliITSresponse { - - public: - AliITSresponseSSD(); - virtual ~AliITSresponseSSD() {;} - - void SetADCpereV(Double_t a=120./24888.9){fADCpereV = a;} - Double_t DEvToADC(Double_t eV) const {return eV*fADCpereV;} - Int_t IEvToADC(Double_t eV) const { // Converts electron-hole pairs to - return ((Int_t) DEvToADC(eV)); } - - void SetKeVperADC(Double_t a=86.4/120.){fKeVperADC = a;} - Double_t ADCToKeV(Double_t adc) const {return adc*fKeVperADC;} - - Double_t GetCouplingPR() const {// couplings - return fCouplingPR;} - Double_t GetCouplingPL() const {// couplings - return fCouplingPL;} - Double_t GetCouplingNR() const {// couplings - return fCouplingNR;} - Double_t GetCouplingNL() const {// couplings - return fCouplingNL;} - virtual void SetCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) { - fCouplingPR=pr; fCouplingPL=pl; fCouplingNR=nr; fCouplingNL=nl; } - - Int_t GetZSThreshold() const { // ZS threshold - return fZSThreshold; } - virtual void SetZSThreshold(Int_t zsth) { fZSThreshold = zsth; } - -protected: - static const Float_t fgkDiffCoeffDefault; //default for fDiffCoeff - - static const Double_t fgkfCouplingPR; // default value for couplings - static const Double_t fgkfCouplingPL; // default value for couplings - static const Double_t fgkfCouplingNR; // default value for couplings - static const Double_t fgkfCouplingNL; // default value for couplings - - Double_t fADCpereV; // Constant to convert eV to ADC. - Double_t fKeVperADC; // Constant to convert ADC to keV - - Double_t fCouplingPR; // couplings - Double_t fCouplingPL; // couplings - Double_t fCouplingNR; // couplings - Double_t fCouplingNL; // couplings - - static const Int_t fgkZSThreshold; // threshold for the zero suppresion - Int_t fZSThreshold; - - - private: - AliITSresponseSSD(const AliITSresponseSSD &source); // copy constructor - AliITSresponseSSD& operator=(const AliITSresponseSSD &source); // ass. op. - - ClassDef(AliITSresponseSSD,5) //Response class for SSD -}; -#endif diff --git a/ITS/AliITSsegmentationSSD.cxx b/ITS/AliITSsegmentationSSD.cxx index 8ee73e2b2a4..3183732111e 100644 --- a/ITS/AliITSsegmentationSSD.cxx +++ b/ITS/AliITSsegmentationSSD.cxx @@ -143,7 +143,7 @@ void AliITSsegmentationSSD::GetPadTxz(Float_t &x,Float_t &z) const{ Dead region: |000/ |00/ |0/ - // expects x, z in microns + // expects x, z in cm */ /* @@ -162,12 +162,12 @@ void AliITSsegmentationSSD::GetPadTxz(Float_t &x,Float_t &z) const{ Float_t P=0; Float_t N=0; if(fLayer==5) { - P = 105.26*x - 0.79*z + 381.89; - N = P + 3.68*z - 4; + P = 105.26*x - 0.7895*z + 382.000; //- 0.79*z + 381.89; + N = P + 3.684*z - 4; } else if(fLayer==6) { - P = -105.26*x - 0.79*z + 384.66; - N = P + 3.68*z + 4; + P = -105.26*x - 0.7895*z + 385.000; //- 0.79*z + 384.66; + N = P + 3.684*z + 4; } else AliError("Layer can be 5 or 6"); @@ -178,71 +178,36 @@ void AliITSsegmentationSSD::GetPadTxz(Float_t &x,Float_t &z) const{ //---------------------------------------------------------------------- void AliITSsegmentationSSD::GetPadIxz(Float_t x,Float_t z,Int_t &iP,Int_t &iN) const { // returns P and N sided strip numbers for a given location. - /* _- Z - + angle / ^ - fNstrips v | N-Side ...0 - \-------/------------|-----------\--------\ - |\\\\\\/////////////.|\\\\\\\\\\\\\\\\\\\\| - |0\\\\/////////////..|.\\\\\\\\\\\\\\\\\\\| - |00\\/////////////...|..\\\\\\\\\\\\\\\\\\| - X <--|000/////////////... |...\\\\\\\\\\\\\\\\\| - |00/////////////... | ...\\\\\\\\\\\\\\\\| - |0/////////////... | ...\\\\\\\\\\\\\\\| - |//////////////... | ...\\\\\\\\\\\\\\\| - /-----\--------------|--------------------/ - fNstrips-1 P-Side ...0 - |0\ - |00\ - Dead region: |000/ - |00/ - |0/ - - // expects x, z in microns - */ - - Float_t stereoP, stereoN; - Angles(stereoP,stereoN); - Float_t tanP=TMath::Tan(stereoP); - Float_t tanN=TMath::Tan(stereoN); - Float_t x1=x,z1=z; - x1 += fDx/2; - z1 += fDz/2; - Float_t ldX = x1 - z1*tanP; // distance from left-down edge - iP = (Int_t)(ldX/fPitch); - iP = (iP<0)? -1: iP; - iP = (iP>fNstrips)? -1: iP; - - ldX = x1 - tanN*(fDz - z1); - iN = (Int_t)(ldX/fPitch); - iN = (iN<0)? -1: iN; - iN = (iN>fNstrips)? -1: iN; + // expects x, z in cm + GetPadTxz(x,z); + iP = Int_t(x+0.5); + iN = Int_t(z+0.5); } //------------------------------------------------------- -void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z) const { +void AliITSsegmentationSSD::GetPadCxz(Float_t iP,Float_t iN,Float_t &x,Float_t &z) const { // actually this is the GetCrossing(Float_t &,Float_t &) - // returns local x, z in microns ! + // returns local x, z in cm + const Float_t kStartXzero=3.64325; + const Float_t kDeltaXzero5or6=0.02239; + const Float_t kDeltaZ5to6=7.6/7.0; - Float_t lDx = fDx; // detector size in x direction, microns - Float_t lDz = fDz; // detector size in z direction, microns - Float_t xP; // x coordinate in the P side from the first P strip - Float_t xN; // x coordinate in the N side from the first N strip - Float_t stereoP, stereoN; - Angles(stereoP,stereoN); - Float_t kP=TMath::Tan(stereoP); - Float_t kN=TMath::Tan(stereoN); - - xP=iP*fPitch; - xN=iN*fPitch; - x = xP + kP*(lDz*kN-xP+xN)/(kP+kN); - z = (lDz*kN-xP+xN)/(kP+kN); - x -= lDx/2; - z -= lDz/2; - //if(TMath::Abs(z) > Dz/2) cout<<"Warning, wrong z local ="<dx || z<-dz || z>dz) return kFALSE; // crossing is outside - // of the detector so - // these strips don't - // cross. - return kTRUE; -} - //---------------------------------------------------------------------- Int_t AliITSsegmentationSSD::GetChipFromChannel(Int_t ix, Int_t iz) const { // returns chip number (in range 0-11) starting from channel number diff --git a/ITS/AliITSsegmentationSSD.h b/ITS/AliITSsegmentationSSD.h index 52ff9a21ca4..ac615562a77 100644 --- a/ITS/AliITSsegmentationSSD.h +++ b/ITS/AliITSsegmentationSSD.h @@ -35,7 +35,8 @@ public AliITSsegmentation { // Transform from real coordinates to strips virtual void GetPadIxz(Float_t x ,Float_t z ,Int_t &iP,Int_t &iN) const; // Transform from strips to real coordinates - virtual void GetPadCxz(Int_t iP, Int_t iN, Float_t &x , Float_t &z) const; + void GetPadCxz(Float_t iP, Float_t iN, Float_t &x , Float_t &z) const; + virtual void GetPadCxz(Int_t iP, Int_t iN, Float_t &x , Float_t &z) const { GetPadCxz((Float_t) iP, (Float_t) iN, x, z); } virtual void GetPadTxz(Float_t &x , Float_t &z) const; // Transformation from Geant cm detector center local coordinates // to detector P and N side strip numbers.. @@ -44,12 +45,6 @@ public AliITSsegmentation { // from 0. iPN=0 for P side and 1 for N side strip. Returned is z=0.0 // and the corresponding x value.. virtual void DetToLocal(Int_t ix,Int_t iPN,Float_t &x,Float_t &z) const; - // Given one P side strip and one N side strip, Returns kTRUE if they - // cross each other and the location of the two crossing strips and - // their correxlation matrix c[2][2]. - virtual Bool_t GetCrossing(Int_t iP,Int_t iN,Float_t &x,Float_t &z, - Float_t c[2][2]); - virtual Int_t GetNumberOfChips() const { return fgkNchipsPerSide; diff --git a/ITS/AliITSsimulationSSD.cxx b/ITS/AliITSsimulationSSD.cxx index 4a06149bc05..48de1a28e2b 100644 --- a/ITS/AliITSsimulationSSD.cxx +++ b/ITS/AliITSsimulationSSD.cxx @@ -34,7 +34,6 @@ #include "AliITSgeom.h" #include "AliITSsimulationSSD.h" #include "AliITSTableSSD.h" -//#include "AliITSresponseSSD.h" ClassImp(AliITSsimulationSSD) //////////////////////////////////////////////////////////////////////// @@ -397,7 +396,7 @@ void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){ Int_t ix; Double_t signal,noise; AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module); - + // Pside for(ix=0;ixGetDEvToADC(1.); + noise /= res->GetSSDDEvToADC(1.); // Finally, noise is added to the signal signal = noise + fMapA2->GetSignal(0,ix);//get signal from map @@ -424,7 +423,7 @@ void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){ for(ix=0;ixGaus(0,res->GetNoiseN(ix));// give noise to signal noise *= (Double_t) res->GetGainN(ix); - noise /= res->GetDEvToADC(1.); + noise /= res->GetSSDDEvToADC(1.); signal = noise + fMapA2->GetSignal(1,ix);//get signal from map fMapA2->SetHit(1,ix,signal); // give back signal to map if(signal>0.0) pList->AddNoise(1,ix,module,noise); @@ -436,37 +435,38 @@ void AliITSsimulationSSD::ApplyCoupling(AliITSpList *pList,Int_t module) { // Apply the effect of electronic coupling between channels Int_t ix; Double_t signal=0; - AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module); - + //AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module); + AliITSSimuParam* res = fDetType->GetSimuParam(); + Double_t *contrLeft = new Double_t[GetNStrips()]; Double_t *contrRight = new Double_t[GetNStrips()]; // P side coupling for(ix=0;ix0) contrLeft[ix] = fMapA2->GetSignal(0,ix-1)*res->GetCouplingPL(); + if(ix>0) contrLeft[ix] = fMapA2->GetSignal(0,ix-1)*res->GetSSDCouplingPL(); else contrLeft[ix] = 0.0; - if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(0,ix+1)*res->GetCouplingPR(); + if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(0,ix+1)*res->GetSSDCouplingPR(); else contrRight[ix] = 0.0; } // loop over strips for(ix=0;ixGetCouplingPL() * fMapA2->GetSignal(0,ix) - - res->GetCouplingPR() * fMapA2->GetSignal(0,ix); + signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingPL() * fMapA2->GetSignal(0,ix) + - res->GetSSDCouplingPR() * fMapA2->GetSignal(0,ix); fMapA2->AddSignal(0,ix,signal); if(signal>0.0) pList->AddNoise(0,ix,module,signal); } // loop over strips // N side coupling for(ix=0;ix0) contrLeft[ix] = fMapA2->GetSignal(1,ix-1)*res->GetCouplingNL(); + if(ix>0) contrLeft[ix] = fMapA2->GetSignal(1,ix-1)*res->GetSSDCouplingNL(); else contrLeft[ix] = 0.0; - if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(1,ix+1)*res->GetCouplingNR(); + if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(1,ix+1)*res->GetSSDCouplingNR(); else contrRight[ix] = 0.0; } // loop over strips for(ix=0;ixGetCouplingNL() * fMapA2->GetSignal(0,ix) - - res->GetCouplingNR() * fMapA2->GetSignal(0,ix); + signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingNL() * fMapA2->GetSignal(0,ix) + - res->GetSSDCouplingNR() * fMapA2->GetSignal(0,ix); fMapA2->AddSignal(1,ix,signal); if(signal>0.0) pList->AddNoise(1,ix,module,signal); } // loop over strips @@ -640,6 +640,7 @@ void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) { Float_t charges[3] = {0.0,0.0,0.0}; Float_t signal; AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module); + AliITSSimuParam* simpar = fDetType->GetSimuParam(); for(Int_t k=0;k<2;k++){ // both sides (0=Pside, 1=Nside) for(Int_t ix=0;ixGetGainN(ix); // signal is converted in unit of ADC - signal = res->GetDEvToADC(signal); + signal = res->GetSSDDEvToADC(signal); if(signal>4096.) signal = 4096.;//if exceeding, accumulate last one // threshold for zero suppression is set on the basis of the noise @@ -664,7 +665,7 @@ void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) { if(k==0) threshold = res->GetNoiseP(ix); else threshold = res->GetNoiseN(ix); - threshold *= res->GetZSThreshold(); // threshold at 3 sigma noise + threshold *= simpar->GetSSDZSThreshold(); // threshold at 3 sigma noise if(signal < threshold) continue; //cout<