TIter iter(list);
TObjString *source;
- Bool_t firedOK = kFALSE;
while ((source = dynamic_cast<TObjString *> (iter.Next()))) {
Log(Form("File %s is not opened, something goes wrong!",fileName.Data()));
return kFALSE;
}
-
+
TH1I* fFiredCells = (TH1I*)f.Get("fFiredCells");
-
- if(!fFiredCells) {
- Log(Form("fFiredCells histogram not found in %s, skip this source.",fileName.Data()));
- firedOK=kFALSE;
- }
- else {
+
+ if(fFiredCells) {
const Double_t nFiredCells = fFiredCells->GetMean();
- if(nFiredCells>100 && nFiredCells<600) {
- firedOK = kTRUE;
- Log(Form("Number of fired cells per event is %d.",nFiredCells));
- }
- else {
- Log(Form("Number of fired cells per event is %d, possibly not a LED run!",nFiredCells));
- firedOK = kFALSE;
- }
-
+ Log(Form("Number of fired cells per event is %.1f",nFiredCells));
}
-
+
const Int_t nMod=5; // 1:5 modules
const Int_t nCol=56; //1:56 columns in each module
const Int_t nRow=64; //1:64 rows in each module
for(Int_t row=0; row<nRow; row++) {
//High Gain to Low Gain ratio
- if(firedOK) {
- Float_t ratio = HG2LG(mod,row,col,&f);
- calibData.SetHighLowRatioEmc(mod+1,col+1,row+1,ratio);
- if(ratio != 16.)
- AliInfo(Form("mod %d iX %d iZ %d ratio %.3f\n",mod,row,col,ratio));
- }
-
+ Float_t ratio = HG2LG(mod,row,col,&f);
+ calibData.SetHighLowRatioEmc(mod+1,col+1,row+1,ratio);
+ if(ratio != 16.)
+ AliInfo(Form("mod %d iX %d iZ %d ratio %.3f\n",mod,row,col,ratio));
+
if(clb) {
Double_t coeff = clb->GetADCchannelEmc(mod+1,col+1,row+1);
calibData.SetADCchannelEmc(mod+1,col+1,row+1,coeff);
}
else
- calibData.SetADCchannelEmc(mod+1,col+1,row+1,1.);
-
+ calibData.SetADCchannelEmc(mod+1,col+1,row+1,0.005);
+
}
}
}
if(!h1->GetEntries()) return 16.;
- h1->Rebin(4);
+ if(h1->GetMaximum()<10.) h1->Rebin(4);
if(h1->GetMaximum()<10.) return 16.;
-
+
Double_t max = h1->GetBinCenter(h1->GetMaximumBin()); // peak
Double_t xmin = max - (h1->GetRMS()/3);
Double_t xmax = max + (h1->GetRMS()/2);
gaus1->SetParameter("Mean",max);
gaus1->SetParameter("Sigma",1.);
gaus1->SetLineColor(kBlue);
- h1->Fit(gaus1,"LERQ+");
-
- AliInfo(Form("%s: %d entries, mean=%.3f, peak=%.3f, rms= %.3f. HG/LG = %.3f\n",
- h1->GetTitle(),h1->GetEntries(),h1->GetMean(),max,h1->GetRMS(),
- gaus1->GetParameter("Mean")));
-
- return gaus1->GetParameter("Mean");
+
+ Double_t mean_min = h1->GetXaxis()->GetXmin();
+ Double_t mean_max = h1->GetXaxis()->GetXmax();
+ gaus1->SetParLimits(1,mean_min,mean_max);
+
+ h1->Fit(gaus1,"RQ+");
+ Double_t hg2lg = gaus1->GetParameter("Mean");
+ if( (hg2lg-mean_min<0.001) || (mean_max-hg2lg<0.001)) hg2lg=max;
+
+ AliInfo(Form("%s: %.1f entries, mean=%.3f, peak=%.3f, rms= %.3f. HG/LG = %.3f\n",
+ h1->GetTitle(),h1->GetEntries(),h1->GetMean(),max,h1->GetRMS(),hg2lg));
+ return hg2lg;
+
}
Bool_t AliPHOSPreprocessor::FindBadChannelsEmc()
return kFALSE;
}
- TH1I* fFiredCells = (TH1I*)f.Get("fFiredCells");
-
- if(!fFiredCells) {
- Log(Form("fFiredCells histogram not found in %s, skip this source.",fileName.Data()));
- continue;
- }
-
- const Double_t nFiredCells = fFiredCells->GetMean();
+ Log(Form("Begin check for bad channels."));
- if(nFiredCells<100. || nFiredCells>600. ) {
- Log(Form("Number of fired cells per event is %d, possibly not a LED run!",nFiredCells));
- continue; // not a LED run!
- }
-
- Log(Form("Number of fired cells per event %d. Begin check for bad channels.",nFiredCells));
-
for(Int_t mod=0; mod<5; mod++) {
for(Int_t iX=0; iX<64; iX++) {
for(Int_t iZ=0; iZ<56; iZ++) {
-
+
sprintf(hnam,"%d_%d_%d_%d",mod,iX,iZ,1); // high gain
h1 = (TH1F*)f.Get(hnam);
h1->GetXaxis()->SetRange(10,1000); //to cut off saturation peak and noise
coeff = h1->GetMean()/refMean;
if(coeff>0)
- calibData.SetADCchannelEmc(mod+1,col+1,row+1,1./coeff);
+ calibData.SetADCchannelEmc(mod+1,col+1,row+1,0.005/coeff);
else
- calibData.SetADCchannelEmc(mod+1,col+1,row+1,1.);
+ calibData.SetADCchannelEmc(mod+1,col+1,row+1,0.005);
AliInfo(Form("mod %d col %d row %d coeff %f\n",mod,col,row,coeff));
}
else
- calibData.SetADCchannelEmc(mod+1,col+1,row+1,1.);
+ calibData.SetADCchannelEmc(mod+1,col+1,row+1,0.005);
}
}
}