+ fCalibration = (TObjArray *)calibSDD->GetObject();
+
+ if(!cacheStatus)calibSDD->SetObject(NULL);
+ calibSDD->SetOwner(kTRUE);
+ if(!cacheStatus){delete calibSDD;}
+
+ AliITSCalibrationSDD * cal=NULL;
+ for(Int_t imod=0;imod<fgknSDDmodules;imod++)
+ {
+ //cal=NULL;
+ Int_t fillmodhisto1=fgkTotalNumberSDDAnodes;
+ Int_t fillmodhisto2side0=fgkNumberOfSDDAnodesperSide;
+ Int_t fillmodhisto2side1=fgkNumberOfSDDAnodesperSide;
+ Int_t fillmodhisto3side0=fgkNumberOfSDDAnodesperSide;
+ Int_t fillmodhisto3side1=fgkNumberOfSDDAnodesperSide;
+
+ Int_t badmodhisto1=0;
+ Int_t badmodhisto2side0=0;
+ Int_t badmodhisto2side1=0;
+ Int_t badmodhisto3side0=0;
+ Int_t badmodhisto3side1=0;
+ //printf("imod %i\t ==== \t",imod);
+ Int_t module=imod + 240;
+ //printf("module %i\t ==== \t",module);
+ cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
+ Int_t lay,lad,det;
+ AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
+ Int_t index=1+(det-1)*2;
+ if(cal==0){continue;}
+ if (cal->IsBad()){continue;}//bad module check
+ else{
+ for(Int_t i=0;i<8;i++) //check on bad chips in good modules
+ {
+ if(lay==3){
+ if(cal->IsChipBad(i)){
+ if(i<4){badmodhisto2side0+=64;}
+ if(i>=4){badmodhisto2side1+=64;}
+ }//end if chip
+ }//end if layer3
+ else if(lay==4){
+ if(cal->IsChipBad(i)){
+ if(i<4){badmodhisto3side0+=64;}
+ if(i>=4){badmodhisto3side1+=64;}
+ }//end if chip
+ }//ens if layer4
+ }//end for chip
+ for(Int_t iAn=0; iAn<512; iAn++){//anodes loop
+ Int_t ic=cal->GetChip(iAn);//chip with this anode number
+ if(!cal->IsChipBad(ic) && !cal->IsBad() && cal->IsBadChannel(iAn)){// good chip good module bad channel
+ if(lay==3){
+ if(ic<4) badmodhisto2side0++;
+ else if(ic>=4)badmodhisto2side1++;
+ }//end if layer 3
+ else if(lay==4){
+ if(ic<4) badmodhisto3side0++;
+ else if(ic>=4)badmodhisto3side1++;
+ }//end if layer 4
+ }//end if chip module channel
+ }//end for anodes
+ if(lay==3){
+ badmodhisto1=badmodhisto2side0+badmodhisto2side1;
+ fillmodhisto1-=badmodhisto1;
+ fillmodhisto2side0-=badmodhisto2side0;
+ fillmodhisto2side1-=badmodhisto2side1;
+ ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
+ ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index,lad,fillmodhisto2side0);
+ ((TH2D*)(fHistoCalibration->At(1)))->SetBinContent(index+1,lad,fillmodhisto2side1);
+ }//end layer 3
+ else if(lay==4){
+ badmodhisto1=badmodhisto3side0+badmodhisto3side1;
+ fillmodhisto1-=badmodhisto1;
+ fillmodhisto3side0-=badmodhisto3side0;
+ fillmodhisto3side1-=badmodhisto3side1;
+ ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
+ ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index,lad,fillmodhisto3side0);
+ ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto2side1);
+ }//end layer 4
+ }//end else bad module
+ }//end module for
+
+}
+
+//____________________________________________________________________
+
+void AliITSQASDDDataMakerRec::InitCalibrationArray()
+{
+
+ TH1D *pattern1 = new TH1D("CALSDDModPattern","Calibration HW Modules pattern",fgknSDDmodules,239.5,499.5);
+ TH2D *patternl3 = new TH2D("CALSDDphizL3","Calibration SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);
+ TH2D *patternl4 = new TH2D("CALSDDphizL4"," Calibration SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5);
+
+ fHistoCalibration = new TObjArray(3);
+ fHistoCalibration->AddAtAndExpand(pattern1,0);
+ fHistoCalibration->AddAtAndExpand(patternl3,1);
+ fHistoCalibration->AddAtAndExpand(patternl4,2);
+
+ // printf("Calibration Histograms created!\n");
+}
+
+//____________________________________________________________________
+
+void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
+{
+
+ AliInfo(Form("Reset detector in SDD called for task index %i", task));
+ if(task== AliQAv1::kRAWS ){
+ fDDLModuleMap=NULL;
+ }
+ fCalibration=NULL;
+
+ ((TH1D*)(fHistoCalibration->At(0)))->Reset();
+ ((TH2D*)(fHistoCalibration->At(1)))->Reset();
+ ((TH2D*)(fHistoCalibration->At(2)))->Reset();
+