- AliITSCalibrationSPD *cal =
- (AliITSCalibrationSPD*) fDetTypeRec->GetCalibrationModel(iModule);
- // Loop on bad pixels and reset them
- for(Int_t ipix = 0; ipix<cal->GetNrBad(); ipix++){
- Int_t row, col;
- cal->GetBadPixel(ipix,row,col);
- Int_t index = (row+1) * nzbins + (col+1);
- bins[index].SetQ(0);
- bins[index].SetMask(0xFFFFFFFE);
+ // Lorentz angle correction
+ Double_t tanLorentzAngle=0;
+ AliITSsegmentationSPD *seg = (AliITSsegmentationSPD*)(GetDetTypeRec()->GetSegmentationModel(0));
+ Double_t thick = 0.5*kmictocm*seg->Dy(); // Half Thickness in cm
+ if(repa->GetCorrectLorentzAngleSPD()) { // only if CorrectLorentzAngleSPD required
+ // here retrieve the value of the field
+ AliMagF* field = dynamic_cast<AliMagF*>(TGeoGlobalMagField::Instance()->GetField());
+ if (field == 0) {
+ AliError("Cannot get magnetic field from TGeoGlobalMagField");
+ }
+ else {
+ Float_t magField = field->SolenoidField();
+ tanLorentzAngle=repa->GetTanLorentzAngleHolesSPD() * magField / defaultField ;
+ }
+ }
+ //
+
+ if (repa->GetSPDRemoveNoisyFlag()) {
+ // Loop on noisy pixels and reset them
+ AliITSCalibrationSPD *cal =
+ (AliITSCalibrationSPD*) fDetTypeRec->GetCalibrationModel(iModule);
+ for(Int_t ipix = 0; ipix<cal->GetNrBad(); ipix++){
+ Int_t row, col;
+ cal->GetBadPixel(ipix,row,col);
+ //PH printf(" module %d row %d col %d \n",iModule,row,col);
+ Int_t index = (row+1) * nzbins + (col+1);
+
+ bins[index].SetQ(0);
+ bins[index].SetMask(0xFFFFFFFE);
+ }
+ }
+
+ if (repa->GetSPDRemoveDeadFlag()) {
+ // Loop on dead pixels and reset them
+ AliITSCalibrationSPD *cal =
+ (AliITSCalibrationSPD*) fDetTypeRec->GetSPDDeadModel(iModule);
+ if (cal->IsBad()) return 0; // if all ladder is dead, return to save time
+ for(Int_t ipix = 0; ipix<cal->GetNrBad(); ipix++){
+ Int_t row, col;
+ cal->GetBadPixel(ipix,row,col);
+ Int_t index = (row+1) * nzbins + (col+1);
+ bins[index].SetQ(0);
+ bins[index].SetMask(0xFFFFFFFE);
+ }
+ AliITSCalibrationSPD *calSparse = (AliITSCalibrationSPD*) fDetTypeRec->GetSPDSparseDeadModel(iModule);
+ for(Int_t ipix = 0; ipix<calSparse->GetNrBad(); ipix++){
+ Int_t row, col;
+ calSparse->GetBadPixel(ipix,row,col);
+ Int_t index = (row+1) * nzbins + (col+1);
+ bins[index].SetQ(0);
+ bins[index].SetMask(0xFFFFFFFE);
+ }
+