AliPMDCalibrator::~AliPMDCalibrator()
{
// destructor
- if(fHdetIso) delete fHdetIso ;
+ if(fHdetIso) delete fHdetIso ;
if(fHsmIso) delete fHsmIso ;
if(fHadcIso) delete fHadcIso ;
delete fCalibGain;
char htitle1[120];
for(Int_t d = 0; d < kDet; d++) {
- sprintf(hname2,"Isolated cell adc for Det Plane %d",d);//sid
+ sprintf(hname2,"Isolated cell adc for Det Plane %d",d);
fHdetIso[d]= new TH1F(hname2,htitle2,100,0,1000);
for(Int_t i1 = 0; i1 < kMaxSMN; i1++) {
sprintf(hname,"det_%d_iso_sm_%2d",d,i1);
// Calculates the ADC of isolated cell
TObjArray pmdddlcont;
- const Int_t kDDL = AliDAQ::NumberOfDdls("PMD");
+
const Int_t kCellNeighbour = 6;
Int_t neibx[6] = {1,0,-1,-1,0,1};
while(reader.NextEvent())
{
// New PMD Reader is plugged in
- for (Int_t iddl = 0; iddl < kDDL; iddl++)
- {
- reader.Select("PMD", iddl, iddl);
- stream.DdlData(iddl,&pmdddlcont);
+ Int_t iddl = -1;
+ while ((iddl = stream.DdlData(&pmdddlcont)) >=0) {
+
+ //reader.Select("PMD", iddl, iddl);
+ //stream.DdlData(iddl,&pmdddlcont);
Int_t ientries = pmdddlcont.GetEntries();
for (Int_t ient = 0; ient < ientries; ient++)
{
// Pedestal Subtraction
Int_t pedmeanrms =
fCalibPed->GetPedMeanRms(idet,ismn,irow,icol);
- Int_t pedrms1 = (Int_t) pedmeanrms%1000;
+ Int_t pedrms1 = (Int_t) pedmeanrms%100;
Float_t pedrms = (Float_t)pedrms1/10.;
Float_t pedmean = (Float_t) (pedmeanrms - pedrms1)/1000.0;
Float_t isig = isig1 - (pedmean + 3.0*pedrms);
if (isig>0)
{
d1[idet][ismn][irow][icol] = (Int_t)isig;
- nhitcell[idet][ismn][irow][icol] += 1; //sid
+ nhitcell[idet][ismn][irow][icol] += 1;
}
}//ient loop
pmdddlcont.Clear();
Double_t isoMean[kDet][kMaxSMN][kMaxRow][kMaxCol];
Double_t smNormFactor[kDet][kMaxSMN];
- for(Int_t d1 = 0; d1 < kDet; d1++)
+ for(Int_t det1 = 0; det1 < kDet; det1++)
{
- histdetMean[d1]= fHdetIso[d1]->GetMean();
+ histdetMean[det1]= fHdetIso[det1]->GetMean();
for(Int_t i1 = 0; i1 < kMaxSMN; i1++)
{
- histMean[d1][i1]= fHsmIso[d1][i1]->GetMean();
- if(histMean[d1][i1]>0.0 && histdetMean[d1]>0.0)
+ histMean[det1][i1]= fHsmIso[det1][i1]->GetMean();
+ if(histMean[det1][i1]>0.0 && histdetMean[det1]>0.0)
{
- smNormFactor[d1][i1]= histdetMean[d1]/histMean[d1][i1];
+ smNormFactor[det1][i1]= histdetMean[det1]/histMean[det1][i1];
}
for(Int_t j1 = 0; j1 < kMaxRow; j1++)
{
for(Int_t k1 = 0; k1 < kMaxCol; k1++)
{
- if(nhitcell[d1][i1][j1][k1]< nhitcut[d1][i1])//sid
- {
- isoMean[d1][i1][j1][k1]=fHadcIso[d1][i1][j1][k1]->
+ if(nhitcell[det1][i1][j1][k1]> nhitcut[det1][i1]) fGainFact[det1][i1][j1][k1]=-99.0;
+ if(nhitcell[det1][i1][j1][k1]< nhitcut[det1][i1])
+ {
+ isoMean[det1][i1][j1][k1]=fHadcIso[det1][i1][j1][k1]->
GetMean();
- if(isoMean[d1][i1][j1][k1]>0.0 && histMean[d1][i1]>0.0)
+ if(isoMean[det1][i1][j1][k1]>0.0 && histMean[det1][i1]>0.0)
{
- fGainFact[d1][i1][j1][k1]=
- isoMean[d1][i1][j1][k1]/(histMean[d1][i1]*
- smNormFactor[d1][i1]);
+ fGainFact[det1][i1][j1][k1]=
+ isoMean[det1][i1][j1][k1]/(histMean[det1][i1]*
+ smNormFactor[det1][i1]);
+
}
- }
+ }
+ Float_t gain = fGainFact[det1][i1][j1][k1];
+ fCalibGain->SetGainFact(det1,i1,j1,k1,gain);
}
+
+
}
}
}
Bool_t AliPMDCalibrator::Store()
{
AliCDBManager *man = AliCDBManager::Instance();
- //man->SetDefaultStorage("local://$ALICE_ROOT");
+ //man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
if(!man->IsDefaultStorageSet()) return kFALSE;
- AliCDBId id("PMD/Calib/Gain",0,0);
+ AliCDBId id("PMD/Calib/Gain",0,999999999);
AliCDBMetaData md;
md.SetBeamPeriod(0);
md.SetComment("Test");