if(runType=="STANDALONE") {
Bool_t ledOK = ProcessLEDRun();
+ Bool_t badmap_OK = FindBadChannelsEmc();
+ if(!badmap_OK) Log(Form("WARNING! FindBadChannels() completed with BAD status!"));
if(ledOK) return 0;
else
return 1;
if(runType=="PHYSICS") {
- Bool_t badmap_OK = FindBadChannelsEmc();
- if(!badmap_OK) Log(Form("WARNING!! FindBadChannels() completed with BAD status!"));
-
Bool_t calibEmc_OK = CalibrateEmc();
- if(calibEmc_OK && badmap_OK) return 0;
+ if(calibEmc_OK) return 0;
else
return 1;
}
TIter iter(list);
TObjString *source;
+ Bool_t firedOK = kFALSE;
while ((source = dynamic_cast<TObjString *> (iter.Next()))) {
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 {
+ 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;
+ }
+
+ }
+
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 col=0; col<nCol; col++) {
for(Int_t row=0; row<nRow; row++) {
- //High Gain to Low Gain 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));
-
+ //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));
+ }
+
if(clb) {
Double_t coeff = clb->GetADCchannelEmc(mod+1,col+1,row+1);
calibData.SetADCchannelEmc(mod+1,col+1,row+1,coeff);
} // end of loop over files
- //Store bad channels map
+ //Store the updated High Gain/Low Gain ratios
AliCDBMetaData emcMetaData;
//Data valid from current run fRun until updated (validityInfinite=kTRUE)
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()));
+ continue;
+ }
+
+ const Double_t nFiredCells = fFiredCells->GetMean();
+
+ 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("Begin check for bad channels."));
+ 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++) {
if(nkeys< 2){
Log(Form("Not enough histograms (%d) for calibration.",nkeys));
- return 0;
+ return 1; // it's not fatal! May be short run..
}
while(!ok){
if(!ok && counter > nkeys){
Log("No histogram with enough statistics for reference. Exit.");
- return 0;
+ return 1; // Not fatal, just wait..
}
}
for(Int_t mod=0; mod<nMod; mod++) {
for(Int_t col=0; col<nCol; col++) {
for(Int_t row=0; row<nRow; row++) {
-
- //High Gain to Low Gain ratio
- Float_t ratio = HG2LG(mod,row,col,&f);
- calibData.SetHighLowRatioEmc(mod+1,col+1,row+1,ratio);
sprintf(hnam,"%d_%d_%d_1",mod,row,col); // high gain!
h2 = (TH2F*)f.Get(hnam);
-
+
//TODO: dead channels exclusion!
if(h2) {
h1 = h2->ProjectionX();