#include "AliPHOSPreprocessor.h"
#include "AliLog.h"
#include "AliCDBMetaData.h"
+#include "AliCDBEntry.h"
#include "AliPHOSEmcCalibData.h"
#include "TFile.h"
#include "TH1.h"
#include "TKey.h"
#include "TList.h"
#include "TObjString.h"
+#include "TObjArray.h"
#include "TObject.h"
#include "TString.h"
#include "TMath.h"
+#include "TAxis.h"
#include "AliPHOSEmcBadChannelsMap.h"
ClassImp(AliPHOSPreprocessor)
AliPreprocessor("PHS",shuttle)
{
// Constructor
+
+ AddRunType("PHYSICS");
+ AddRunType("STANDALONE");
}
//_______________________________________________________________________________________
gaus1->SetLineColor(kBlue);
h1->Fit(gaus1,"LERQ+");
- Log(Form("\t%s: %d entries, mean=%.3f, peak=%.3f, rms= %.3f. HG/LG = %.3f\n",
+ 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 kFALSE;
}
+ // Retrieve Bad Channels Map (BCM)
+
+ const AliPHOSEmcBadChannelsMap* badMap=0;
+ AliCDBEntry* entryBCM = GetFromOCDB("Calib", "EmcBadChannels");
+
+ if(!entryBCM)
+ Log(Form("WARNING!! Cannot find any AliCDBEntry for [Calib, EmcBadChannels]!"));
+ else
+ badMap = (AliPHOSEmcBadChannelsMap*)entryBCM->GetObject();
+
+ if(!badMap)
+ Log(Form("WARNING!! No Bad Channels Map in AliCDBEntry. All cells considered _GOOD_!"));
+
TIter iter(list);
TObjString *source;
TString htitl = h2->GetTitle();
if(htitl.Contains("and gain 1")) {
hRef = h2->ProjectionX();
- hRef->SetBins(1000,0.,1000.); // to cut off saturation peak at 1023
+ hRef->GetXaxis()->SetRange(10,1000); // to cut off saturation peak and noise
// Check if the reference histogram has too little statistics
- if(hRef->GetEntries()>2) ok=kTRUE;
+ if(hRef->GetMean() && hRef->GetEntries()>2) ok=kTRUE;
+
+ const TString delim = "_";
+ TString str = hRef->GetName();
+ TObjArray* tks = str.Tokenize(delim);
+ const Int_t md = ((TObjString*)tks->At(0))->GetString().Atoi();
+ const Int_t X = ((TObjString*)tks->At(1))->GetString().Atoi();
+ const Int_t Z = ((TObjString*)tks->At(2))->GetString().Atoi();
+
+ if(badMap) {
+ if(badMap->IsBadChannel(md+1,Z+1,X+1)) {
+ AliInfo(Form("Cell mod=%d col=%d row=%d is bad. Histogram %s rejected.",
+ md+1,Z+1,X+1,hRef->GetName()));
+ ok=kFALSE;
+ }
+ }
+
}
}
//TODO: dead channels exclusion!
if(h2) {
h1 = h2->ProjectionX();
- h1->SetBins(1000,0.,1000.); // to cut off saturation peak at 1023
+ 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);