+ AliInfo("Calib SDD Created\n ");
+
+ TIter next(list);
+
+ switch(index) {
+ case AliQAv1::kRAW:{
+ AliInfo(Form("Check on %s\n",AliQAv1::GetAliTaskName(index)));
+// if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
+// if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
+// if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
+ if (list->GetEntries() == 0){SDDQACheckerValue += fHighSDDValue[AliQAv1::kFATAL]; break;}
+ TH1 *hmodule=NULL;
+ TH2 *hlayer[2];
+ Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2];
+ for(Int_t i=0;i<2;i++){emptymodules[i]=0; filledmodules[i]=0; emptyladders[i]=0; filledladders[i]=0; }
+ for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
+ while( (hdata = dynamic_cast<TH1* >(next())) ){
+ if (hdata){TString hname=hdata->GetName();
+ if(hname.Contains("SDDchargeMap"))continue;
+ if(hname.Contains("SDDModPattern")){
+ if(hname.Contains("NORM")) continue;
+ hmodule=(TH1*)hdata->Clone();
+ entries= hdata->GetEntries();
+ if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));SDDQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
+ else{int modmax=hdata->GetNbinsX();
+ Int_t empty=0;
+ Int_t filled=0;
+ Double_t content=0;
+ for(Int_t i=1;i<=modmax;i++){content=hdata->GetBinContent(i);if(AliITSQADataMakerRec::AreEqual(content,0.)) empty++; else filled++; }//end for
+ AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));}//end else pattern entries !=0
+ }
+ if(hname.Contains("_RelativeOccupancy")) {
+ //fRawModulePattern = (TH1F *) hdata;
+ Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
+ if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: L3 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
+ if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: L4 mean: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
+ Int_t aboveThreshold = 0;
+ for(Int_t k=0; k<= hdata->GetNbinsX(); k++) {if(hdata->GetBinLowEdge(k) > threshold) aboveThreshold += (int)(hdata->GetBinContent(k));}
+ Float_t fractionAboveThreshold = ((Float_t) aboveThreshold)/hdata->GetEntries();
+ if(hname.Contains("L3")) AliInfo(Form("SDD check number 1, L3: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
+ if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
+ if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+ if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
+ if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }
+ if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
+ //if(hname.Contains("L3")) {fRawL3Pattern = (TH2F *) hdata;}
+ //if(hname.Contains("L4")) {fRawL4Pattern = (TH2F *) hdata;}
+ Int_t layer=0;
+ if(hname.Contains("3"))layer=0;
+ else if(hname.Contains("4"))layer=1;
+ entries2[layer]=hdata->GetEntries();
+ if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in %s \n",hname.Data()));
+ SDDQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
+ else{
+ Int_t layer1=0;
+ if(hname.Contains("3"))layer1=0;
+ else if(hname.Contains("4"))layer1=1;
+ TH2* htemp=dynamic_cast<TH2*>(hdata);
+ hlayer[layer1]=(TH2*)htemp->Clone();
+ char newname[50];
+ sprintf(newname,"%s_copy",hname.Data());
+ hlayer[layer1]->SetName(newname);
+ hlayer[layer1]->RebinX(2);
+ int modmay=hlayer[layer1]->GetNbinsY();
+ TH1D* hproj= hlayer[layer1]->ProjectionY();
+ Double_t ladcontent=0;
+ for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
+ ladcontent=hproj->GetBinContent(i);
+ if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
+ else filledladders[layer1]++;}//end for
+ AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer], filledladders[layer]));//end else layer 3
+ delete hproj;
+ hproj=NULL;}//end else entries !=0
+ }//end check on phiz
+ }//end if hdata
+ }//end while
+ if(AliITSQADataMakerRec::AreEqual(entries,0.)&&AliITSQADataMakerRec::AreEqual(entries2[0],0.)&&AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
+ //else{
+ if(hmodule || (hlayer[0] && hlayer[1])){
+ Int_t excluded=0;
+ Int_t active=0;
+ Int_t exactive=0;//excluded but taking data
+ for(Int_t imod=0;imod<fgknSDDmodules;imod++){
+ Int_t lay=0;
+ Int_t lad=0;
+ Int_t det=0;
+ Int_t module=0;
+ module=imod+fgkmodoffset;
+ AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
+ if(cal==0) { delete cal; continue;}
+ AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
+ if (cal->IsBad()){
+ excluded++;
+ Double_t content=0.;
+ Double_t contentlayer[2];
+ for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
+ if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram has been created
+ if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
+ if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE || AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.)==kFALSE) {
+ filledmodules[lay-3]++;
+ AliWarning(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
+ exactive++;
+ } else if(AliITSQADataMakerRec::AreEqual(content,0.) && AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.))
+ emptymodules[lay-3]++;
+ } else {
+ Double_t contentgood=0.;
+ active++;
+ if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(det,lad);
+ if(AliITSQADataMakerRec::AreEqual(contentgood,0.))
+ emptymodules[lay-3]++;
+ else
+ filledmodules[lay-3]++;
+ }
+ }//end for
+ for(Int_t i=0;i<2;i++){AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));}//end else layers
+ if(exactive==0){
+ AliInfo(Form("All the active modules (%i) are in acquisition. The number of excluded modules are %i \n",active,excluded));
+ SDDQACheckerValue=fHighSDDValue[AliQAv1::kINFO];