From 23197852b55a2f848f715a9f57e1dc811c9d3f50 Mon Sep 17 00:00:00 2001 From: masera Date: Tue, 20 May 2008 16:18:48 +0000 Subject: [PATCH] Modifications to access and use OCDB information during tracking (A. Dainese, D. Elia, F. Prino, E. Fragiacomo) --- ITS/AliITSCalibrationSSD.cxx | 29 +++- ITS/AliITSCalibrationSSD.h | 1 + ITS/AliITSChannelStatus.cxx | 53 +++++- ITS/AliITSChannelStatus.h | 14 +- ITS/AliITSDetTypeRec.cxx | 60 ++++++- ITS/AliITSDetTypeRec.h | 5 +- ITS/AliITSRecoParam.cxx | 4 +- ITS/AliITSRecoParam.h | 14 +- ITS/AliITSReconstructor.cxx | 3 + ITS/AliITSsegmentation.h | 2 + ITS/AliITSsegmentationSDD.cxx | 41 +++++ ITS/AliITSsegmentationSDD.h | 6 + ITS/AliITSsegmentationSPD.cxx | 36 ++++ ITS/AliITSsegmentationSPD.h | 4 + ITS/AliITSsegmentationSSD.cxx | 82 ++++++++- ITS/AliITSsegmentationSSD.h | 2 +- ITS/AliITStrackerMI.cxx | 302 +++++++++++++++++++++++++++------- ITS/AliITStrackerMI.h | 33 +++- 18 files changed, 606 insertions(+), 85 deletions(-) diff --git a/ITS/AliITSCalibrationSSD.cxx b/ITS/AliITSCalibrationSSD.cxx index bb058ffb034..30c1cc43e17 100644 --- a/ITS/AliITSCalibrationSSD.cxx +++ b/ITS/AliITSCalibrationSSD.cxx @@ -110,7 +110,7 @@ fDeadPChannelsList(0){ //______________________________________________________________________ AliITSCalibrationSSD::~AliITSCalibrationSSD(){ // destructor - + delete [] fDetPar; } //______________________________________________________________________ @@ -132,3 +132,30 @@ void AliITSCalibrationSSD::GetDetParam(Double_t *par) const { par[i]=fDetPar[i]; } // end for i } + +//______________________________________________________________________ +void AliITSCalibrationSSD::FillBadChipMap() { + + Int_t mc=0; + Int_t cc[12]; + + // P-side + for(Int_t i=0; i<6; i++){ + cc[i]=0; + for(Int_t j=0; jSetBitNumber(index,kTRUE); + } + } + Int_t ix,iz; + + // Mask SPD dead pixels + AliITSCalibrationSPD* deadspd=(AliITSCalibrationSPD*)dtrec->GetSPDDeadModel(imod); + for(Int_t ipix=0; ipixGetNrBad();ipix++){ + deadspd->GetBadPixel(ipix,ix,iz); + Int_t index=imod*kSPDNpxPerModule*kSPDNpzPerModule+ix*kSPDNpzPerModule+iz; + fSPDChannelStatus->SetBitNumber(index,kFALSE); + } + // Mask SPD noisy pixels + AliITSCalibrationSPD* noisspd=(AliITSCalibrationSPD*)dtrec->GetCalibrationModel(imod); + for(Int_t ipix=0; ipixGetNrBad();ipix++){ + noisspd->GetBadPixel(ipix,ix,iz); + Int_t index=imod*kSPDNpxPerModule*kSPDNpzPerModule+ix*kSPDNpzPerModule+iz; + fSPDChannelStatus->SetBitNumber(index,kFALSE); + } + } + + // SDD modules + for(Int_t imod=0; imodGetCalibrationModel(imod+kSPDModules); + for(Int_t ian=0; ianIsBadChannel(ian)) cstatus=kFALSE; + Int_t index=imod*kSDDAnodesPerModule+ian; + fSDDChannelStatus->SetBitNumber(index,cstatus); + } + } +} +//______________________________________________________________________ void AliITSChannelStatus::InitDefaults(){ // fill bitmaps setting all channels as good for(Int_t imod=0; imod #include #include "AliCDBManager.h" +#include "AliITSDetTypeRec.h" class AliITSChannelStatus : public TObject { public: AliITSChannelStatus(); AliITSChannelStatus(AliCDBManager *cdb); + AliITSChannelStatus(AliITSDetTypeRec *dtrec); AliITSChannelStatus(const AliITSChannelStatus& cstatus); AliITSChannelStatus& operator=(const AliITSChannelStatus& cstatus); virtual ~AliITSChannelStatus(); @@ -32,9 +34,17 @@ class AliITSChannelStatus : public TObject { void SetChannelStatus(Bool_t cstatus, Int_t imod, Int_t iz, Int_t ix=0); Bool_t GetChannelStatus(Int_t imod, Int_t iz, Int_t ix=0) const; + + Bool_t AnyBadInRoad(Int_t /*imod*/, Float_t /*zlocmin*/, Float_t /*zlocmax*/, Float_t /*xlocmin*/, Float_t /*xlocmax*/) const{ + return kFALSE; + } + Float_t FractionOfBadInRoad(Int_t /*imod*/, Float_t /*zlocmin*/, Float_t /*zlocmax*/, Float_t /*xlocmin*/, Float_t /*xlocmax*/) const{ + return 0.; + } + Int_t GetNSPDChannels()const {return fSPDChannelStatus->GetNbits();} Int_t GetNSDDChannels()const {return fSDDChannelStatus->GetNbits();} - + protected: void InitDefaults(); void InitFromOCDB(TObjArray* deadArrSPD, TObjArray* noisArrSPD, TObjArray* calArrSDD); diff --git a/ITS/AliITSDetTypeRec.cxx b/ITS/AliITSDetTypeRec.cxx index f4bc0d144bd..004a5f0cc85 100644 --- a/ITS/AliITSDetTypeRec.cxx +++ b/ITS/AliITSDetTypeRec.cxx @@ -74,6 +74,7 @@ fITSgeom(0), fReconstruction(0), fSegmentation(0), fCalibration(0), +fSPDDead(0), fPreProcess(0), fPostProcess(0), fDigits(0), @@ -126,6 +127,7 @@ fITSgeom(rec.fITSgeom), fReconstruction(rec.fReconstruction), fSegmentation(rec.fSegmentation), fCalibration(rec.fCalibration), +fSPDDead(rec.fSPDDead), fPreProcess(rec.fPreProcess), fPostProcess(rec.fPostProcess), fDigits(rec.fDigits), @@ -178,6 +180,13 @@ AliITSDetTypeRec::~AliITSDetTypeRec(){ fCalibration = 0; } } + if(fSPDDead){ + if(!(AliCDBManager::Instance()->GetCacheFlag())) { + fSPDDead->Delete(); + delete fSPDDead; + fSPDDead = 0; + } + } if(fPreProcess) delete fPreProcess; if(fPostProcess) delete fPostProcess; if(fDDLMapSDD) delete fDDLMapSDD; @@ -262,6 +271,20 @@ void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){ } //_______________________________________________________________________ +void AliITSDetTypeRec::SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal){ + + //Set dead pixel info for the SPD module iMod + if (fSPDDead==0) { + fSPDDead = new TObjArray(fgkDefaultNModulesSPD); + fSPDDead->SetOwner(kTRUE); + fSPDDead->Clear(); + } + + if (fSPDDead->At(iMod) != 0) + delete (AliITSCalibration*) fSPDDead->At(iMod); + fSPDDead->AddAt(cal,iMod); +} +//_______________________________________________________________________ AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){ //Get calibration model for module type @@ -273,6 +296,18 @@ AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){ return (AliITSCalibration*)fCalibration->At(iMod); } +//_______________________________________________________________________ +AliITSCalibration* AliITSDetTypeRec::GetSPDDeadModel(Int_t iMod){ + + //Get SPD dead for module iMod + + if(fSPDDead==0) { + AliWarning("fSPDDead is 0!"); + return 0; + } + + return (AliITSCalibration*)fSPDDead->At(iMod); +} //______________________________________________________________________ void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){ @@ -392,15 +427,16 @@ Bool_t AliITSDetTypeRec::GetCalibration() { // dead pixel are not used for local reconstruction AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDNoisy"); + AliCDBEntry *deadSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead"); AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD"); // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD"); - AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD"); - AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD"); - AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD"); - AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); - // Entry for the AliITSRecoParam object - AliCDBEntry *entryRP = AliCDBManager::Instance()->Get("ITS/Calib/RecoParam/"); + AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD"); + AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD"); + AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD"); + AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); + // Entry for the AliITSRecoParam object + AliCDBEntry *entryRP = AliCDBManager::Instance()->Get("ITS/Calib/RecoParam/"); AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD"); AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD"); AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD"); @@ -409,7 +445,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() { AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD"); AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD"); - if(!entrySPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || + if(!entrySPD || !deadSPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || !entryPedestalSSD || !entryBadChannelsSSD || !entry2SPD || !entry2SDD || !entry2SSD || !drSpSDD || !ddlMapSDD || !mapASDD || !mapTSDD || !entryRP){ AliFatal("Calibration object retrieval failed! "); @@ -420,6 +456,10 @@ Bool_t AliITSDetTypeRec::GetCalibration() { if(!cacheStatus)entrySPD->SetObject(NULL); entrySPD->SetOwner(kTRUE); + TObjArray *caldeadSPD = (TObjArray *)deadSPD->GetObject(); + if(!cacheStatus)deadSPD->SetObject(NULL); + deadSPD->SetOwner(kTRUE); + AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject(); if(!cacheStatus)entry2SPD->SetObject(NULL); entry2SPD->SetOwner(kTRUE); @@ -481,6 +521,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() { // DB entries are deleted. In this way metadeta objects are deleted as well if(!cacheStatus){ delete entrySPD; + delete deadSPD; delete entrySDD; delete entryNoiseSSD; delete entryPedestalSSD; @@ -495,7 +536,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() { delete ddlMapSDD; } - if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!calSDD) || (!drSp) || (!ddlsdd) + if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!caldeadSPD) ||(!calSDD) || (!drSp) || (!ddlsdd) || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) { AliWarning("Can not get calibration from calibration database !"); return kFALSE; @@ -511,6 +552,8 @@ Bool_t AliITSDetTypeRec::GetCalibration() { cal = (AliITSCalibration*) calSPD->At(i); cal->SetResponse((AliITSresponse*)pSPD); SetCalibrationModel(i, cal); + cal = (AliITSCalibration*) caldeadSPD->At(i); + SetSPDDeadModel(i, cal); } fDDLMapSDD->SetDDLMap(ddlsdd); @@ -551,6 +594,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() { calibSSD->SetGain(gain); AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (badchannelsSSD->At(i)); calibSSD->SetBadChannels(bad); + calibSSD->FillBadChipMap(); Int_t iMod = i + fgkDefaultNModulesSPD + fgkDefaultNModulesSDD; SetCalibrationModel(iMod, calibSSD); diff --git a/ITS/AliITSDetTypeRec.h b/ITS/AliITSDetTypeRec.h index 1e1bb62f5ce..6613392af5d 100644 --- a/ITS/AliITSDetTypeRec.h +++ b/ITS/AliITSDetTypeRec.h @@ -47,10 +47,12 @@ class AliITSDetTypeRec : public TObject { virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg); virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal); + virtual void SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal); virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec); virtual Bool_t GetCalibration(); virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype); virtual AliITSCalibration* GetCalibrationModel(Int_t iMod); + virtual AliITSCalibration* GetSPDDeadModel(Int_t iMod); virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype); virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD() const { return fDDLMapSDD;} @@ -108,6 +110,7 @@ class AliITSDetTypeRec : public TObject { TObjArray *fReconstruction;//! [NDet] TObjArray *fSegmentation; //! [NDet] TObjArray *fCalibration; //! [NMod] + TObjArray *fSPDDead; //! [fgkDefaultNModulesSPD] TObjArray *fPreProcess; //! [] e.g. Find Calibration values TObjArray *fPostProcess; //! [] e.g. find primary vertex TObjArray *fDigits; //! [NMod][NDigits] @@ -126,7 +129,7 @@ class AliITSDetTypeRec : public TObject { TString fSelectedVertexer; // Vertexer selected in CreateVertexer Bool_t fFirstcall; //! flag - ClassDef(AliITSDetTypeRec,8) // ITS Reconstruction structure + ClassDef(AliITSDetTypeRec,9) // ITS Reconstruction structure }; #endif diff --git a/ITS/AliITSRecoParam.cxx b/ITS/AliITSRecoParam.cxx index 186adef0705..a7b56ffa121 100644 --- a/ITS/AliITSRecoParam.cxx +++ b/ITS/AliITSRecoParam.cxx @@ -101,7 +101,9 @@ fComputePlaneEff(kFALSE), fHistoPlaneEff(kFALSE), fReadPlaneEffFromOCDB(kFALSE), fExtendedEtaAcceptance(kFALSE), -fUseDeadZonesFromOCDB(kFALSE), +fUseBadZonesFromOCDB(kFALSE), +fUseSingleBadChannelsFromOCDB(kFALSE), +fMinFractionOfBadInRoad(0), fAllowProlongationWithEmptyRoad(kFALSE), fFactorSAWindowSizes(1.), fNLoopsSA(33), diff --git a/ITS/AliITSRecoParam.h b/ITS/AliITSRecoParam.h index d0fd381fc70..b4601471e62 100644 --- a/ITS/AliITSRecoParam.h +++ b/ITS/AliITSRecoParam.h @@ -139,8 +139,14 @@ class AliITSRecoParam : public AliDetectorRecoParam void SetAllowProlongationWithEmptyRoad(Bool_t allow=kTRUE) { fAllowProlongationWithEmptyRoad=allow; return; } Bool_t GetAllowProlongationWithEmptyRoad() const { return fAllowProlongationWithEmptyRoad; } - void SetUseDeadZonesFromOCDB(Bool_t use=kTRUE) { fUseDeadZonesFromOCDB=use; return; } - Bool_t GetUseDeadZonesFromOCDB() const { return fUseDeadZonesFromOCDB; } + void SetUseBadZonesFromOCDB(Bool_t use=kTRUE) { fUseBadZonesFromOCDB=use; return; } + Bool_t GetUseBadZonesFromOCDB() const { return fUseBadZonesFromOCDB; } + + void SetUseSingleBadChannelsFromOCDB(Bool_t use=kTRUE) { fUseSingleBadChannelsFromOCDB=use; return; } + Bool_t GetUseSingleBadChannelsFromOCDB() const { return fUseSingleBadChannelsFromOCDB; } + + void SetMinFractionOfBadInRoad(Float_t frac=0) { fMinFractionOfBadInRoad=frac; return; } + Float_t GetMinFractionOfBadInRoad() const { return fMinFractionOfBadInRoad; } void SetFactorSAWindowSizes(Double_t fact=1.) { fFactorSAWindowSizes=fact; return; } Double_t GetFactorSAWindowSizes() const { return fFactorSAWindowSizes; } @@ -292,7 +298,9 @@ class AliITSRecoParam : public AliDetectorRecoParam Bool_t fReadPlaneEffFromOCDB; // enable initial reading of Plane Eff statistics from OCDB // The analized events would be used to increase the statistics Bool_t fExtendedEtaAcceptance; // enable jumping from TPC to SPD at large eta (MI) - Bool_t fUseDeadZonesFromOCDB; // enable using OCDB info on dead modules.. (MI) + Bool_t fUseBadZonesFromOCDB; // enable using OCDB info on dead modules and chips (MI) + Bool_t fUseSingleBadChannelsFromOCDB; // enable using OCDB info on bad single SPD pixels and SDD anodes (MI) + Float_t fMinFractionOfBadInRoad; // to decide whether to skip the layer (MI) Bool_t fAllowProlongationWithEmptyRoad; // allow to prolong even if road is empty (MI) Double_t fFactorSAWindowSizes; // larger window sizes in SA Int_t fNLoopsSA; // number of loops in tracker SA diff --git a/ITS/AliITSReconstructor.cxx b/ITS/AliITSReconstructor.cxx index 38a8f2c5d0b..97e24aeedb9 100644 --- a/ITS/AliITSReconstructor.cxx +++ b/ITS/AliITSReconstructor.cxx @@ -139,6 +139,8 @@ AliTracker* AliITSReconstructor::CreateTracker() const AliTracker* tracker; if (selectedTracker.Contains("MI")) { tracker = new AliITStrackerMI(0); + AliITStrackerMI *mit=(AliITStrackerMI*)tracker; + mit->SetDetTypeRec(fDetTypeRec); } else if (selectedTracker.Contains("V2")) { tracker = new AliITStrackerV2(0); @@ -146,6 +148,7 @@ AliTracker* AliITSReconstructor::CreateTracker() const else { tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI AliITStrackerSA *sat=(AliITStrackerSA*)tracker; + sat->SetDetTypeRec(fDetTypeRec); if(selectedTracker.Contains("onlyITS"))sat->SetSAFlag(kTRUE); if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n"); if(selectedTracker.Contains("cosmics")||selectedTracker.Contains("COSMICS")) diff --git a/ITS/AliITSsegmentation.h b/ITS/AliITSsegmentation.h index 1bf370e4355..2f111270499 100644 --- a/ITS/AliITSsegmentation.h +++ b/ITS/AliITSsegmentation.h @@ -35,8 +35,10 @@ public TObject { virtual void SetLayer(Int_t) {MayNotUse("SetLayer");} // Number of Chips virtual Int_t GetNumberOfChips() const {MayNotUse("GetNumberOfChips"); return 0;} + virtual Int_t GetMaximumChipIndex() const {MayNotUse("GetNumberOfChips"); return 0;} // Chip number from local coordinates virtual Int_t GetChipFromLocal(Float_t, Float_t) const {MayNotUse("GetChipFromLocal"); return 0;} + virtual Int_t GetChipsInLocalWindow(Int_t* /*array*/, Float_t /*zmin*/, Float_t /*zmax*/, Float_t /*xmin*/, Float_t /*xmax*/) const {MayNotUse("GetChipsInLocalWindow"); return 0;} // Chip number from channel number virtual Int_t GetChipFromChannel(Int_t, Int_t) const {MayNotUse("GetChipFromChannel"); return 0;} diff --git a/ITS/AliITSsegmentationSDD.cxx b/ITS/AliITSsegmentationSDD.cxx index 43b21c7fd51..0756d45405d 100644 --- a/ITS/AliITSsegmentationSDD.cxx +++ b/ITS/AliITSsegmentationSDD.cxx @@ -212,6 +212,47 @@ Int_t AliITSsegmentationSDD::GetChipFromLocal(Float_t xloc, Float_t zloc) const return iChip; } //---------------------------------------------------------------------- +Int_t AliITSsegmentationSDD::GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t xmin, Float_t xmax) const { + Int_t nChipInW = 0; + Float_t zminDet=-fDz*fgkMicron2Cm/2.; + Float_t zmaxDet=fDz*fgkMicron2Cm/2.; + if(zminzmaxDet) zmax=zmaxDet; + Float_t xminDet=-fDx*fgkMicron2Cm; + Float_t xmaxDet=fDx*fgkMicron2Cm; + if(xminxmaxDet) xmax=xmaxDet; + Int_t n1=GetChipFromLocal(xmin,zmin); + array[nChipInW]=n1; + nChipInW++; + Int_t n2=GetChipFromLocal(xmin,zmax); + if(n2!=n1){ + Int_t imin=TMath::Min(n1,n2); + Int_t imax=TMath::Max(n1,n2); + for(Int_t ichip=imin; ichip<=imax; ichip++){ + if(ichip==n1) continue; + array[nChipInW]=ichip; + nChipInW++; + } + } + Int_t n3=GetChipFromLocal(xmax,zmin); + if(n3!=n1){ + array[nChipInW]=n3; + nChipInW++; + Int_t n4=GetChipFromLocal(xmax,zmax); + if(n4!=n3){ + Int_t imin=TMath::Min(n3,n4); + Int_t imax=TMath::Max(n3,n4); + for(Int_t ichip=imin; ichip<=imax; ichip++){ + if(ichip==n3) continue; + array[nChipInW]=ichip; + nChipInW++; + } + } + } + return nChipInW; +} +//---------------------------------------------------------------------- void AliITSsegmentationSDD::GetPadIxz(Float_t x,Float_t z, Int_t &timebin,Int_t &anode) const { // Returns cell coordinates (time sample,anode) diff --git a/ITS/AliITSsegmentationSDD.h b/ITS/AliITSsegmentationSDD.h index 7e7567e1a71..345835eb2bd 100644 --- a/ITS/AliITSsegmentationSDD.h +++ b/ITS/AliITSsegmentationSDD.h @@ -68,7 +68,13 @@ public AliITSsegmentation { virtual Int_t GetNumberOfChips() const { return fgkNchipsPerHybrid; } + virtual Int_t GetMaximumChipIndex() const{ + return fgkNchipsPerHybrid*2-1; + } virtual Int_t GetChipFromLocal(Float_t xloc, Float_t zloc) const; + virtual Int_t GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t xmin, Float_t xmax) const; + + virtual Int_t GetChipFromChannel(Int_t ix, Int_t iz) const; // Initialisation diff --git a/ITS/AliITSsegmentationSPD.cxx b/ITS/AliITSsegmentationSPD.cxx index b2e41e2c5a9..34ea7368113 100644 --- a/ITS/AliITSsegmentationSPD.cxx +++ b/ITS/AliITSsegmentationSPD.cxx @@ -527,3 +527,39 @@ Int_t AliITSsegmentationSPD::GetChipFromLocal(Float_t, Float_t zloc) const { return GetChipFromChannel(ix0,iz); } //---------------------------------------------------------------------- +Int_t AliITSsegmentationSPD::GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t, Float_t) const { + // returns the number of chips containing a road defined by given local coordinate limits + + const Float_t kconv = 1.0E-04; // converts microns to cm. + + if (zmin>zmax) { + AliWarning("Bad coordinate limits: zmin>zmax!"); + return -1; + } + + Int_t nChipInW = 0; + + Float_t zminDet = -0.5*kconv*Dz(); + Float_t zmaxDet = 0.5*kconv*Dz(); + if(zminzmaxDet) zmax=zmaxDet; + + Int_t n1 = GetChipFromLocal(0,zmin); + array[nChipInW] = n1; + nChipInW++; + + Int_t n2 = GetChipFromLocal(0,zmax); + + if(n2!=n1){ + Int_t imin=TMath::Min(n1,n2); + Int_t imax=TMath::Max(n1,n2); + for(Int_t ichip=imin; ichip<=imax; ichip++){ + if(ichip==n1) continue; + array[nChipInW]=ichip; + nChipInW++; + } + } + + return nChipInW; +} +//---------------------------------------------------------------------- diff --git a/ITS/AliITSsegmentationSPD.h b/ITS/AliITSsegmentationSPD.h index 3b4a6037e46..b72ba5db279 100644 --- a/ITS/AliITSsegmentationSPD.h +++ b/ITS/AliITSsegmentationSPD.h @@ -44,7 +44,11 @@ public AliITSsegmentation { Double_t &zl,Double_t &zu) const; // virtual Int_t GetNumberOfChips() const {return fgkNchipsPerModule;} + virtual Int_t GetMaximumChipIndex() const {return fgkNchipsPerModule-1;} + virtual Int_t GetChipFromLocal(Float_t, Float_t zloc) const; + virtual Int_t GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t, Float_t) const; + virtual Int_t GetChipFromChannel(Int_t, Int_t iz) const; // // Initialisation diff --git a/ITS/AliITSsegmentationSSD.cxx b/ITS/AliITSsegmentationSSD.cxx index 58d8426db4e..e3aa24cbc05 100644 --- a/ITS/AliITSsegmentationSSD.cxx +++ b/ITS/AliITSsegmentationSSD.cxx @@ -126,10 +126,15 @@ void AliITSsegmentationSSD::Angles(Float_t &aP,Float_t &aN) const{ aP = fStereoPl5; aN = fStereoNl5; } // end if - if (fLayer == 6){ + else if (fLayer == 6){ aP = fStereoPl6; aN = fStereoNl6; } // end if + else { + AliWarning("SSD layer not set in segmentation. Setting angles for layer 5"); + aP = fStereoPl5; + aN = fStereoNl5; + } } //---------------------------------------------------------------------- void AliITSsegmentationSSD::SetLayer(Int_t l){ @@ -271,8 +276,16 @@ Bool_t AliITSsegmentationSSD::LocalToDet(Float_t x,Float_t z, const Double_t kconst = 1.0E-04; // convert microns to cm. dx = 0.5*kconst*Dx(); dz = 0.5*kconst*Dz(); - if( (x<-dx) || (x>dx) ) { iP=-1; return kTRUE; } // outside x range. - if( (z<-dz) || (z>dz) ) { iN=-1; return kTRUE; } // outside z range. + if( (x<-dx) || (x>dx) ) { + iP=-1; + AliWarning(Form("Input argument %f out of range (%f, %f)",x,dx,-dx)); + return kFALSE; // outside of defined volume. + } // outside x range. + if( (z<-dz) || (z>dz) ) { + iN=-1; + AliWarning(Form("Input argument %f out of range (%f, %f)",z,dz,-dz)); + return kFALSE; // outside of defined volume. + } x /= kconst; // convert to microns z /= kconst; // convert to microns @@ -445,7 +458,7 @@ Int_t AliITSsegmentationSSD::GetChipFromLocal(Float_t xloc, Float_t zloc) const Int_t iN=0; if (!LocalToDet(xloc,zloc,iP,iN) || (iP<0) || (iP>=fNstrips) || (iN<0) || (iN>=fNstrips) ) { - AliWarning("Bad local coordinate"); + //AliWarning("Bad local coordinate"); return -1; } @@ -457,6 +470,67 @@ Int_t AliITSsegmentationSSD::GetChipFromLocal(Float_t xloc, Float_t zloc) const } // +Int_t AliITSsegmentationSSD::GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, + Float_t xmin, Float_t xmax) const { + + Int_t nChipInW = 0; + + Float_t zminDet=-fDz*1.0E-04/2.; + Float_t zmaxDet=fDz*1.0E-04/2.; + if(zminzmaxDet) zmax=zmaxDet; + + Float_t xminDet=-fDx*1.0E-04/2; + Float_t xmaxDet=fDx*1.0E-04/2; + if(xminxmaxDet) xmax=xmaxDet; + + Int_t n1N=-1; + Int_t n1P=-1; + Int_t n1=GetChipFromLocal(xmin,zmin); + if(n1!=-1) { // Note! Recpoint can be on the sensor but in the dead area not covered by strips! + n1N = (Int_t) (n1/10); // N-side chip coded as 10*chip_index + n1P = n1 - 10 * n1N; // P-side chip coded 0-5 + array[nChipInW]=n1P; + nChipInW++; + array[nChipInW]=n1N; + nChipInW++; + } + + Int_t n2N=-1; + Int_t n2P=-1; + Int_t n2=GetChipFromLocal(xmin,zmax); + if(n2!=-1) { // Note! Recpoint can be on the sensor but in the dead area not covered by strips! + n2N = (Int_t) (n2/10); // N-side chip coded as 10*chip_index + n2P = n2 - 10 * n2N; // P-side chip coded 0-5 + if(n2P!=n1P) { array[nChipInW]=n2P; nChipInW++;} + if(n2N!=n1N) { array[nChipInW]=n2N; nChipInW++;} + } + + Int_t n3N=-1; + Int_t n3P=-1; + Int_t n3=GetChipFromLocal(xmax,zmin); + if(n3!=-1) { + n3N=(Int_t) (n3/10); // N-side chip coded as 10*chip_index + n3P=n3 - 10 * n3N; // P-side chip coded 0-5 + if((n3P!=n1P)&&(n3P!=n2P)) { array[nChipInW]=n3P; nChipInW++;} + if((n3N!=n1N)&&(n3N!=n2N)) { array[nChipInW]=n3N; nChipInW++;} + } + + Int_t n4N=-1; + Int_t n4P=-1; + Int_t n4=GetChipFromLocal(xmax,zmax); + if(n4!=-1) { + n4N=(Int_t) (n4/10); // N-side chip coded as 10*chip_index + n4P=n4 - 10 * n4N; // P-side chip coded 0-5 + if((n4P!=n1P)&&(n4P!=n2P)&&(n4P!=n3P)) { array[nChipInW]=n4P; nChipInW++;} + if((n4N!=n1N)&&(n4N!=n2N)&&(n4N!=n3N)) { array[nChipInW]=n4N; nChipInW++;} + } + + return nChipInW; + +} + //---------------------------------------------------------------------- void AliITSsegmentationSSD::PrintDefaultParameters() const { // Print default values for parameters. diff --git a/ITS/AliITSsegmentationSSD.h b/ITS/AliITSsegmentationSSD.h index 51d5d425f47..91d043e36d5 100644 --- a/ITS/AliITSsegmentationSSD.h +++ b/ITS/AliITSsegmentationSSD.h @@ -63,7 +63,7 @@ public AliITSsegmentation { } virtual Int_t GetChipFromLocal(Float_t xloc, Float_t zloc) const; virtual Int_t GetChipFromChannel(Int_t ix, Int_t iz) const; - + virtual Int_t GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t xmin, Float_t xmax) const; virtual void Init(); diff --git a/ITS/AliITStrackerMI.cxx b/ITS/AliITStrackerMI.cxx index 97cc085c21f..7a4b31197a9 100644 --- a/ITS/AliITStrackerMI.cxx +++ b/ITS/AliITStrackerMI.cxx @@ -19,6 +19,8 @@ // It reads AliITSRecPoint clusters and creates AliITStrackMI tracks // and fills with them the ESD // Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch +// Current support and development: +// Andrea Dainese, andrea.dainese@lnl.infn.it // dE/dx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch // Params moved to AliITSRecoParam by: Andrea Dainese, INFN // Material budget from TGeo by: Ludovic Gaudichet & Andrea Dainese, INFN @@ -31,6 +33,7 @@ #include #include + #include "AliESDEvent.h" #include "AliESDtrack.h" #include "AliESDVertex.h" @@ -44,6 +47,8 @@ #include "AliITSClusterParam.h" #include "AliCDBManager.h" #include "AliCDBEntry.h" +#include "AliITSsegmentation.h" +#include "AliITSCalibration.h" #include "AliITSCalibrationSPD.h" #include "AliITSCalibrationSDD.h" #include "AliITSCalibrationSSD.h" @@ -82,6 +87,8 @@ fxTimesRhoShieldTrks(0), fxOverX0LayerTrks(0), fxTimesRhoLayerTrks(0), fDebugStreamer(0), +fITSChannelStatus(0), +fDetTypeRec(0), fPlaneEff(0) { //Default constructor Int_t i; @@ -115,6 +122,8 @@ fxTimesRhoShieldTrks(0), fxOverX0LayerTrks(0), fxTimesRhoLayerTrks(0), fDebugStreamer(0), +fITSChannelStatus(0), +fDetTypeRec(0), fPlaneEff(0) { //-------------------------------------------------------------------- //This is the AliITStrackerMI constructor @@ -161,10 +170,10 @@ fPlaneEff(0) { AliITSdetector &det=fgLayers[i-1].GetDetector((j-1)*ndet + k-1); new(&det) AliITSdetector(r,phi); - } - } + } // end loop on detectors + } // end loop on ladders + } // end loop on layers - } fI=AliITSgeomTGeo::GetNLayers(); @@ -218,7 +227,8 @@ fPlaneEff(0) { } } if(AliITSReconstructor::GetRecoParam()->GetReadPlaneEffFromOCDB()) - if(!fPlaneEff->ReadFromCDB()) {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;} + if(!fPlaneEff->ReadFromCDB()) + {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;} if(AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) { fPlaneEff->SetCreateHistos(kTRUE); //fPlaneEff->ReadHistosFromFile(); @@ -251,6 +261,8 @@ fxTimesRhoShieldTrks(0), fxOverX0LayerTrks(0), fxTimesRhoLayerTrks(0), fDebugStreamer(tracker.fDebugStreamer), +fITSChannelStatus(tracker.fITSChannelStatus), +fDetTypeRec(tracker.fDetTypeRec), fPlaneEff(tracker.fPlaneEff) { //Copy constructor Int_t i; @@ -285,6 +297,8 @@ AliITStrackerMI::~AliITStrackerMI() //fDebugStreamer->Close(); delete fDebugStreamer; } + if(fITSChannelStatus) delete fITSChannelStatus; + if(fPlaneEff) delete fPlaneEff; } //------------------------------------------------------------------------ void AliITStrackerMI::SetLayersNotToSkip(Int_t *l) { @@ -294,6 +308,37 @@ void AliITStrackerMI::SetLayersNotToSkip(Int_t *l) { for (Int_t i=0; iGetUseBadZonesFromOCDB()) return; + + Info("ReadBadFromDetTypeRec","Reading info about bad ITS detectors and channels\n"); + + if(!fDetTypeRec) Error("ReadBadFromDetTypeRec","AliITSDetTypeRec nof found!\n"); + + // ITS channels map + if(fITSChannelStatus) delete fITSChannelStatus; + fITSChannelStatus = new AliITSChannelStatus(AliCDBManager::Instance()); + + // ITS detectors and chips + Int_t i=0,j=0,k=0,ndet=0; + for (i=1; iSetAddress(&clusters); - Int_t j=0; + Int_t i=0,j=0,ndet=0; Int_t detector=0; - for (Int_t i=0; iGetEvent(j)) continue; @@ -367,6 +412,8 @@ Int_t AliITStrackerMI::LoadClusters(TTree *cTree) { fgLayers[i].SortClusters(); } + dummy.Clear(); + return 0; } //------------------------------------------------------------------------ @@ -377,6 +424,24 @@ void AliITStrackerMI::UnloadClusters() { for (Int_t i=0; iAddLast(cl); + } + } + + return; +} +//------------------------------------------------------------------------ static Int_t CorrectForTPCtoITSDeadZoneMaterial(AliITStrackMI *t) { //-------------------------------------------------------------------- // Correction for the material between the TPC and the ITS @@ -924,6 +989,7 @@ void AliITStrackerMI::FollowProlongationTree(AliITStrackMI * otrack, Int_t esdin const AliITSdetector &det=layer.GetDetector(idet); new(¤ttrack2) AliITStrackMI(currenttrack1); if (!currenttrack1.Propagate(det.GetPhi(),det.GetR())) continue; + LocalModuleCoord(ilayer,idet,¤ttrack1,xloc,zloc); // local module coords currenttrack2.Propagate(det.GetPhi(),det.GetR()); currenttrack1.SetDetectorIndex(idet); @@ -997,10 +1063,12 @@ void AliITStrackerMI::FollowProlongationTree(AliITStrackMI * otrack, Int_t esdin currenttrack = ¤ttrack1; // check if the road contains a dead zone - Int_t dead = CheckDeadZone(ilayer,idet,zmin,zmax); + Bool_t noClusters = kFALSE; + if (!layer.GetNextCluster(clidx,kTRUE)) noClusters=kTRUE; + Int_t dead = CheckDeadZone(¤ttrack1,ilayer,idet,zmin,zmax,ymin,ymax,noClusters); // create a prolongation without clusters (check also if there are no clusters in the road) if (dead || - ((layer.GetNextCluster(clidx,kTRUE))==0 && + (noClusters && AliITSReconstructor::GetRecoParam()->GetAllowProlongationWithEmptyRoad())) { AliITStrackMI * updatetrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(*currenttrack); updatetrack->SetClIndex(ilayer,0); @@ -1008,7 +1076,7 @@ void AliITStrackerMI::FollowProlongationTree(AliITStrackMI * otrack, Int_t esdin modstatus = 5; // no cls in road } else if (dead==1) { modstatus = 7; // holes in z in SPD - } else if (dead==2) { + } else if (dead==2 || dead==3) { modstatus = 2; // dead from OCDB } updatetrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc); @@ -1405,7 +1473,7 @@ AliITStrackerMI::AliITSlayer::~AliITSlayer() { //-------------------------------------------------------------------- // AliITSlayer destructor //-------------------------------------------------------------------- - delete[] fDetectors; + delete [] fDetectors; for (Int_t i=0; i=fNdetectors) return -1; if (nz<0) return -1; + // ad hoc correction for 3rd ladder of SDD inner layer, + // which is reversed (rotated by pi around local y) + // this correction is OK only from AliITSv11Hybrid onwards + if (GetR()>12. && GetR()<20.) { // SDD inner + if(np==2) { // 3rd ladder + nz = (fNdetectors-1) - nz; + } + } + //printf("ndet %d phi %f z %f np %d nz %d\n",fNdetectors,phi,z,np,nz); + + return np*fNdetectors + nz; } //------------------------------------------------------------------------ @@ -1850,6 +1929,73 @@ const { return d; } //------------------------------------------------------------------------ +AliITStrackerMI::AliITSdetector::AliITSdetector(const AliITSdetector& det): +fR(det.fR), +fPhi(det.fPhi), +fSinPhi(det.fSinPhi), +fCosPhi(det.fCosPhi), +fYmin(det.fYmin), +fYmax(det.fYmax), +fZmin(det.fZmin), +fZmax(det.fZmax), +fIsBad(det.fIsBad), +fNChips(det.fNChips), +fChipIsBad(det.fChipIsBad) +{ + //Copy constructor +} +//------------------------------------------------------------------------ +void AliITStrackerMI::AliITSdetector::ReadBadDetectorAndChips(Int_t ilayer,Int_t idet, + AliITSDetTypeRec *detTypeRec) +{ + //-------------------------------------------------------------------- + // Read bad detectors and chips from calibration objects in AliITSDetTypeRec + //-------------------------------------------------------------------- + + // In AliITSDetTypeRec, detector numbers go from 0 to 2197 + // while in the tracker they start from 0 for each layer + for(Int_t il=0; ilGetCalibrationModel(idet); + AliITSCalibration *calibSPDdead = 0; + if(detType==0) calibSPDdead = (AliITSCalibration*)detTypeRec->GetSPDDeadModel(idet); // TEMPORARY + if (calib->IsBad() || + (detType==0 && calibSPDdead->IsBad())) // TEMPORARY + { + SetBad(); + printf("lay %d bad %d\n",ilayer,idet); + } + + // Get segmentation from AliITSDetTypeRec + AliITSsegmentation *segm = (AliITSsegmentation*)detTypeRec->GetSegmentationModel(detType); + + // Read info about bad chips + fNChips = segm->GetMaximumChipIndex()+1; + //printf("ilayer %d detType %d idet %d fNChips %d %d GetNumberOfChips %d\n",ilayer,detType,idet,fNChips,segm->GetMaximumChipIndex(),segm->GetNumberOfChips()); + if(fChipIsBad) { delete [] fChipIsBad; fChipIsBad=NULL; } + fChipIsBad = new Bool_t[fNChips]; + for (Int_t iCh=0;iChIsChipBad(iCh); + if (detType==0 && calibSPDdead->IsChipBad(iCh)) fChipIsBad[iCh] = kTRUE; // TEMPORARY + } + + return; +} +//------------------------------------------------------------------------ Double_t AliITStrackerMI::GetEffectiveThickness() { //-------------------------------------------------------------------- @@ -2028,10 +2174,11 @@ Bool_t AliITStrackerMI::RefitAt(Double_t xx,AliITStrackMI *track, const AliITSdetector &det=layer.GetDetector(idet); phi=det.GetPhi(); if (!track->Propagate(phi,det.GetR())) return kFALSE; + track->SetDetectorIndex(idet); LocalModuleCoord(ilayer,idet,track,xloc,zloc); // local module coords - Double_t dz,zmin,zmax; + Double_t dz,zmin,zmax,dy,ymin,ymax; const AliITSRecPoint *clAcc=0; Double_t maxchi2=1000.*AliITSReconstructor::GetRecoParam()->GetMaxChi2(); @@ -2077,9 +2224,16 @@ Bool_t AliITStrackerMI::RefitAt(Double_t xx,AliITStrackMI *track, AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer)); zmin=track->GetZ() - dz; zmax=track->GetZ() + dz; - Int_t dead = CheckDeadZone(ilayer,idet,zmin,zmax); + dy=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadY()* + TMath::Sqrt(track->GetSigmaY2() + + AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()* + AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()* + AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer)); + ymin=track->GetY() - dy; + ymax=track->GetY() + dy; + Int_t dead = CheckDeadZone(track,ilayer,idet,zmin,zmax,ymin,ymax,kTRUE); if (dead==1) modstatus = 7; // holes in z in SPD - if (dead==2) modstatus = 2; // dead from OCDB + if (dead==2 || dead==3) modstatus = 2; // dead from OCDB } } @@ -4836,15 +4990,18 @@ Int_t AliITStrackerMI::CheckSkipLayer(AliITStrackMI *track, return 0; } //------------------------------------------------------------------------ -Int_t AliITStrackerMI::CheckDeadZone(/*AliITStrackMI *track,*/ +Int_t AliITStrackerMI::CheckDeadZone(AliITStrackMI *track, Int_t ilayer,Int_t idet, - Double_t zmin,Double_t zmax/*,Double_t ymin,Double_t ymax*/) const { + Double_t zmin,Double_t zmax, + Double_t ymin,Double_t ymax, + Bool_t noClusters) const { //----------------------------------------------------------------- // This method is used to decide whether to allow a prolongation // without clusters, because there is a dead zone in the road. // In this case the return value is > 0: // return 1: dead zone at z=0,+-7cm in SPD - // return 2: dead area from the OCDB // NOT YET IMPLEMENTED + // return 2: all road is "bad" (dead or noisy) from the OCDB + // return 3: something "bad" (dead or noisy) from the OCDB //----------------------------------------------------------------- // check dead zones at z=0,+-7cm in the SPD @@ -4859,49 +5016,80 @@ Int_t AliITStrackerMI::CheckDeadZone(/*AliITStrackMI *track,*/ if (zminzmindead[i]) return 1; } - // check dead zones from OCDB - if (!AliITSReconstructor::GetRecoParam()->GetUseDeadZonesFromOCDB()) return 0; + // check bad zones from OCDB + if (!AliITSReconstructor::GetRecoParam()->GetUseBadZonesFromOCDB()) return 0; - if(idet<0) return 0; + if (idet<0) return 0; - // look in OCDB (only entire dead modules for the moment) - if (ilayer==0 || ilayer==1) { // SPD - AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead"); - if (!cdbEntry) { - Error("CheckDeadZone","Cannot get CDB entry for SPD\n"); - return 0; - } - TObjArray* spdEntry = (TObjArray*)cdbEntry->GetObject(); - if (!spdEntry) { - Error("CheckDeadZone","Cannot get CDB entry for SPD\n"); - return 0; - } - if(ilayer==1) idet += AliITSgeomTGeo::GetNLadders(1)*AliITSgeomTGeo::GetNDetectors(1); - //printf("SPD det: %d\n",idet); - AliITSCalibrationSPD *calibSPD = (AliITSCalibrationSPD*)spdEntry->At(idet); - if (calibSPD->IsBad()) return 2; - } else if (ilayer==2 || ilayer==3) { // SDD - AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD"); - if (!cdbEntry) { - Error("CheckDeadZone","Cannot get CDB entry for SDD\n"); - return 0; - } - TObjArray* sddEntry = (TObjArray*)cdbEntry->GetObject(); - if (!sddEntry) { - Error("CheckDeadZone","Cannot get CDB entry for SDD\n"); - return 0; - } - if(ilayer==3) idet += AliITSgeomTGeo::GetNLadders(3)*AliITSgeomTGeo::GetNDetectors(3); - //printf("SDD det: %d\n",idet); - AliITSCalibrationSDD *calibSDD = (AliITSCalibrationSDD*)sddEntry->At(idet); - if (calibSDD->IsBad()) return 2; - } else if (ilayer==4 || ilayer==5) { // SSD - } else { - Error("CheckDeadZone","Wrong layer number\n"); - if(ilayer==5) idet += AliITSgeomTGeo::GetNLadders(5)*AliITSgeomTGeo::GetNDetectors(5); - return 0; + AliITSdetector &det=fgLayers[ilayer].GetDetector(idet); + + // check if this detector is bad + if (det.IsBad()) { + //printf("lay %d bad detector %d\n",ilayer,idet); + return 2; + } + + Int_t detType=-1; + Float_t detSizeFactorX=0.0001,detSizeFactorZ=0.0001; + if (ilayer==0 || ilayer==1) { // ---------- SPD + detType = 0; + } else if (ilayer==2 || ilayer==3) { // ---------- SDD + detType = 1; + detSizeFactorX *= 2.; + } else if (ilayer==4 || ilayer==5) { // ---------- SSD + detType = 2; + } + AliITSsegmentation *segm = (AliITSsegmentation*)fDetTypeRec->GetSegmentationModel(detType); + if (detType==2) segm->SetLayer(ilayer+1); + Float_t detSizeX = detSizeFactorX*segm->Dx(); + Float_t detSizeZ = detSizeFactorZ*segm->Dz(); + + // check if the road overlaps with bad chips + Float_t xloc,zloc; + LocalModuleCoord(ilayer,idet,track,xloc,zloc); + Float_t zlocmin = zloc-0.5*(zmax-zmin); + Float_t zlocmax = zloc+0.5*(zmax-zmin); + Float_t xlocmin = xloc-0.5*(ymax-ymin); + Float_t xlocmax = xloc+0.5*(ymax-ymin); + Int_t chipsInRoad[100]; + + if (TMath::Max(TMath::Abs(xlocmin),TMath::Abs(xlocmax))>0.5*detSizeX || + TMath::Max(TMath::Abs(zlocmin),TMath::Abs(zlocmax))>0.5*detSizeZ) return 0; + //printf("lay %d det %d zmim zmax %f %f xmin xmax %f %f %f %f\n",ilayer,idet,zlocmin,zlocmax,xlocmin,xlocmax,segm->Dx(),segm->Dz()); + Int_t nChipsInRoad = segm->GetChipsInLocalWindow(chipsInRoad,zlocmin,zlocmax,xlocmin,xlocmax); + //printf("lay %d nChipsInRoad %d\n",ilayer,nChipsInRoad); + if (!nChipsInRoad) return 0; + + Bool_t anyBad=kFALSE,anyGood=kFALSE; + for (Int_t iCh=0; iChdet.GetNChips()-1) continue; + //printf(" chip %d bad %d\n",chipsInRoad[iCh],(Int_t)det.IsChipBad(chipsInRoad[iCh])); + if (det.IsChipBad(chipsInRoad[iCh])) { + anyBad=kTRUE; + } else { + anyGood=kTRUE; + } } + if (!anyGood) return 2; // all chips in road are bad + + if (anyBad) return 3; // at least a bad chip in road + + + if (!AliITSReconstructor::GetRecoParam()->GetUseSingleBadChannelsFromOCDB() + || ilayer==4 || ilayer==5 // SSD + || !noClusters) return 0; + + // There are no clusters in road: check if there is at least + // a bad SPD pixel or SDD anode + + if(ilayer==1 || ilayer==3 || ilayer==5) + idet += AliITSgeomTGeo::GetNLadders(ilayer)*AliITSgeomTGeo::GetNDetectors(ilayer); + + //if (fITSChannelStatus->AnyBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax)) return 3; + + if (fITSChannelStatus->FractionOfBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax) > AliITSReconstructor::GetRecoParam()->GetMinFractionOfBadInRoad()) return 3; + return 0; } //------------------------------------------------------------------------ diff --git a/ITS/AliITStrackerMI.h b/ITS/AliITStrackerMI.h index db9e904f4b3..bbd40520f01 100644 --- a/ITS/AliITStrackerMI.h +++ b/ITS/AliITStrackerMI.h @@ -9,6 +9,8 @@ // ITS tracker // reads AliITSclusterMI clusters and creates AliITStrackMI tracks // Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch +// Current support and development: +// Andrea Dainese, andrea.dainese@lnl.infn.it //------------------------------------------------------------------------- class TTree; @@ -19,6 +21,8 @@ class AliESDEvent; #include "AliITSRecPoint.h" #include "AliITStrackMI.h" #include "AliITSPlaneEff.h" +#include "AliITSChannelStatus.h" +#include "AliITSDetTypeRec.h" #include "AliPlaneEff.h" #include "AliTracker.h" @@ -38,6 +42,7 @@ public: {return fgLayers[layn].GetNumberOfClusters();} Int_t LoadClusters(TTree *cf); void UnloadClusters(); + void FillClusterArray(TObjArray* array) const; Int_t Clusters2Tracks(AliESDEvent *event); Int_t PropagateBack(AliESDEvent *event); Int_t RefitInward(AliESDEvent *event); @@ -56,10 +61,13 @@ public: Double_t GetPredictedChi2MI(AliITStrackMI* track, const AliITSRecPoint *cluster,Int_t layer); Int_t UpdateMI(AliITStrackMI* track, const AliITSRecPoint* cl,Double_t chi2,Int_t layer) const; AliPlaneEff *GetPlaneEff() {return (AliPlaneEff*)fPlaneEff;} // return the pointer to AliPlaneEff + void SetDetTypeRec(AliITSDetTypeRec *detTypeRec) {fDetTypeRec = detTypeRec; ReadBadFromDetTypeRec(); } + class AliITSdetector { public: - AliITSdetector():fR(0),fPhi(0),fSinPhi(0),fCosPhi(0),fYmin(0),fYmax(0),fZmin(0),fZmax(0){} - AliITSdetector(Double_t r,Double_t phi):fR(r),fPhi(phi),fSinPhi(TMath::Sin(phi)),fCosPhi(TMath::Cos(phi)),fYmin(10000),fYmax(-1000),fZmin(10000),fZmax(-1000) {} + AliITSdetector():fR(0),fPhi(0),fSinPhi(0),fCosPhi(0),fYmin(0),fYmax(0),fZmin(0),fZmax(0),fIsBad(kFALSE),fNChips(0),fChipIsBad(0) {} + AliITSdetector(Double_t r,Double_t phi):fR(r),fPhi(phi),fSinPhi(TMath::Sin(phi)),fCosPhi(TMath::Cos(phi)),fYmin(10000),fYmax(-1000),fZmin(10000),fZmax(-1000),fIsBad(kFALSE),fNChips(0),fChipIsBad(0) {} + ~AliITSdetector() {if(fChipIsBad) delete [] fChipIsBad;} inline void GetGlobalXYZ( const AliITSRecPoint *cl, Double_t xyz[3]) const; Double_t GetR() const {return fR;} Double_t GetPhi() const {return fPhi;} @@ -67,11 +75,20 @@ public: Double_t GetYmax() const {return fYmax;} Double_t GetZmin() const {return fZmin;} Double_t GetZmax() const {return fZmax;} + Bool_t IsBad() const {return fIsBad;} + Int_t GetNChips() const {return fNChips;} + Bool_t IsChipBad(Int_t iChip) const {return (fChipIsBad ? fChipIsBad[iChip] : kFALSE);} void SetYmin(Double_t min) {fYmin = min;} void SetYmax(Double_t max) {fYmax = max;} void SetZmin(Double_t min) {fZmin = min;} void SetZmax(Double_t max) {fZmax = max;} + void SetBad() {fIsBad = kTRUE;} + void ReadBadDetectorAndChips(Int_t ilayer,Int_t idet,AliITSDetTypeRec *detTypeRec); private: + AliITSdetector(const AliITSdetector& det); + AliITSdetector & operator=(const AliITSdetector& det){ + this->~AliITSdetector();new(this) AliITSdetector(det); + return *this;} Double_t fR; // polar coordinates Double_t fPhi; // of this detector Double_t fSinPhi; // sin of phi; @@ -80,13 +97,16 @@ public: Double_t fYmax; // local max y Double_t fZmin; // local z min Double_t fZmax; // local z max + Bool_t fIsBad; // is detector dead or noisy? + Int_t fNChips; // number of chips + Bool_t *fChipIsBad; //[fNChips] is chip dead or noisy? }; class AliITSlayer { public: AliITSlayer(); AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd); - ~AliITSlayer(); + ~AliITSlayer(); Int_t InsertCluster(AliITSRecPoint *c); void SortClusters(); void ResetClusters(); @@ -223,8 +243,9 @@ protected: Int_t CorrectForShieldMaterial(AliITStrackMI *t, TString shield, TString direction="inward"); Int_t CorrectForLayerMaterial(AliITStrackMI *t, Int_t layerindex, Double_t oldGlobXYZ[3], TString direction="inward"); void UpdateESDtrack(AliITStrackMI* track, ULong_t flags) const; + void ReadBadFromDetTypeRec(); Int_t CheckSkipLayer(AliITStrackMI *track,Int_t ilayer,Int_t idet) const; - Int_t CheckDeadZone(/*AliITStrackMI *track,*/Int_t ilayer,Int_t idet,Double_t zmin,Double_t zmax/*,Double_t ymin,Double_t ymax*/) const; + Int_t CheckDeadZone(AliITStrackMI *track,Int_t ilayer,Int_t idet,Double_t zmin,Double_t zmax,Double_t ymin,Double_t ymax,Bool_t noClusters=kFALSE) const; Bool_t LocalModuleCoord(Int_t ilayer,Int_t idet,AliITStrackMI *track, Float_t &xloc,Float_t &zloc) const; // method to be used for Plane Efficiency evaluation @@ -266,11 +287,13 @@ protected: Float_t *fxOverX0LayerTrks; //! material budget Float_t *fxTimesRhoLayerTrks; //! material budget TTreeSRedirector *fDebugStreamer; //!debug streamer + AliITSChannelStatus *fITSChannelStatus;//! bitmaps with channel status for SPD and SDD + AliITSDetTypeRec *fDetTypeRec; //! ITS det type rec, from AliITSReconstructor AliITSPlaneEff *fPlaneEff; //! Pointer to the ITS plane efficicency private: AliITStrackerMI(const AliITStrackerMI &tracker); AliITStrackerMI & operator=(const AliITStrackerMI &tracker); - ClassDef(AliITStrackerMI,4) //ITS tracker MI + ClassDef(AliITStrackerMI,5) //ITS tracker MI }; -- 2.43.0