TObject(),
fPedestalLowGain(),
fPedestalHighGain(),
+ fSampleLowGain(),
+ fSampleHighGain(),
fPeakMinusPedLowGain(),
fPeakMinusPedHighGain(),
fPedestalLowGainDiff(),
fColumns(0),
fRows(0),
fModules(0),
+ fRowMin(0),
+ fRowMax(0),
+ fRowMultiplier(0),
+ fCaloString(),
+ fMapping(NULL),
fRunNumber(-1)
{
//Default constructor. First we set the detector-type related constants.
fColumns = fgkPhosCols;
fRows = fgkPhosRows;
fModules = fgkPhosModules;
+ fCaloString = "PHOS";
+ fRowMin = -1*fRows;
+ fRowMax = 0;
+ fRowMultiplier = -1;
}
else {
//We'll just trust the enum to keep everything in line, so that if detectorType
fColumns = fgkEmCalCols;
fRows = fgkEmCalRows;
fModules = fgkEmCalModules;
+ fCaloString = "EMCAL";
+ fRowMin = 0;
+ fRowMax = fRows;
+ fRowMultiplier = 1;
}
fDetType = detectorType;
title += i;
fPedestalLowGain.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Pedestals, high gain
name = "hPedhighgain";
title += i;
fPedestalHighGain.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
+ //All Samples, low gain
+ name = "hSamplelowgain";
+ name += i;
+ title = "All Samples, low gain, module ";
+ title += i;
+ fSampleLowGain.Add(new TProfile2D(name, title,
+ fColumns, 0.0, fColumns,
+ fRows, fRowMin, fRowMax,"s"));
+
+ //All Samples, high gain
+ name = "hSamplehighgain";
+ name += i;
+ title = "All Samples, high gain, module ";
+ title += i;
+ fSampleHighGain.Add(new TProfile2D(name, title,
+ fColumns, 0.0, fColumns,
+ fRows, fRowMin, fRowMax,"s"));
//Peak-Pedestals, low gain
name = "hPeakMinusPedlowgain";
title += i;
fPeakMinusPedLowGain.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Peak-Pedestals, high gain
name = "hPeakMinusPedhighgain";
title += i;
fPeakMinusPedHighGain.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
name = "hDeadMap";
name += i;
title = "Dead map, module ";
title += i;
fDeadMap.Add(new TH2D(name, title, fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax));
}//end for nModules create the histograms
//Compress the arrays, in order to remove the empty objects (a 16 slot array is created by default)
fPedestalLowGain.Compress();
fPedestalHighGain.Compress();
+ fSampleLowGain.Compress();
+ fSampleHighGain.Compress();
fPeakMinusPedLowGain.Compress();
fPeakMinusPedHighGain.Compress();
fDeadMap.Compress();
TObject(ped),
fPedestalLowGain(),
fPedestalHighGain(),
+ fSampleLowGain(),
+ fSampleHighGain(),
fPeakMinusPedLowGain(),
fPeakMinusPedHighGain(),
fPedestalLowGainDiff(),
fColumns(ped.GetColumns()),
fRows(ped.GetRows()),
fModules(ped.GetModules()),
+ fRowMin(ped.GetRowMin()),
+ fRowMax(ped.GetRowMax()),
+ fRowMultiplier(ped.GetRowMultiplier()),
+ fCaloString(ped.GetCaloString()),
+ fMapping(NULL), //! note that we are not copying the map info
fRunNumber(ped.GetRunNumber())
{
// Then the ObjArray ones; we add the histograms rather than trying TObjArray = assignment
for (int i = 0; i < fModules; i++) {
fPedestalLowGain.Add( ped.GetPedProfileLowGain(i) );
fPedestalHighGain.Add( ped.GetPedProfileHighGain(i) );
+ fSampleLowGain.Add( ped.GetSampleProfileLowGain(i) );
+ fSampleHighGain.Add( ped.GetSampleProfileHighGain(i) );
fPeakMinusPedLowGain.Add( ped.GetPeakProfileLowGain(i) );
fPeakMinusPedHighGain.Add( ped.GetPeakProfileHighGain(i) );
//Compress the arrays, in order to remove the empty objects (a 16 slot array is created by default)
fPedestalLowGain.Compress();
fPedestalHighGain.Compress();
+ fSampleLowGain.Compress();
+ fSampleHighGain.Compress();
fPeakMinusPedLowGain.Compress();
fPeakMinusPedHighGain.Compress();
fDeadMap.Compress();
return kTRUE;//We succesfully added info from the supplied object
}
+//_____________________________________________________________________
+Bool_t AliCaloCalibPedestal::ProcessEvent(AliRawReader *rawReader)
+{
+ // if fMapping is NULL the rawstream will crate its own mapping
+ AliCaloRawStream rawStream(rawReader, fCaloString, (AliAltroMapping**)fMapping);
+ return ProcessEvent(&rawStream);
+}
+
//_____________________________________________________________________
Bool_t AliCaloCalibPedestal::ProcessEvent(AliCaloRawStream *in)
{
i++;
if ( i >= in->GetTimeLength()) {
//If we're here then we're done with this tower
- gain = 1 - in->IsLowGain();
-
+ gain = -1; // init to not valid value
+ if ( in->IsLowGain() ) {
+ gain = 0;
+ }
+ else if ( in->IsHighGain() ) {
+ gain = 1;
+ }
+
int arrayPos = in->GetModule(); //The modules are numbered starting from 0
if (arrayPos >= fModules) {
//TODO: return an error message, if appopriate (perhaps if debug>0?)
//NOTE: coordinates are (column, row) for the profiles
if (gain == 0) {
//fill the low gain histograms
- ((TProfile2D*)fPedestalLowGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, min);
- ((TProfile2D*)fPeakMinusPedLowGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, max - min);
+ ((TProfile2D*)fPedestalLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), min);
+ ((TProfile2D*)fPeakMinusPedLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), max - min);
+ ((TProfile2D*)fSampleLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), sample);
}
- else {//fill the high gain ones
- ((TProfile2D*)fPedestalHighGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, min);
- ((TProfile2D*)fPeakMinusPedHighGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, max - min);
+ else if (gain == 1) {//fill the high gain ones
+ ((TProfile2D*)fPedestalHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), min);
+ ((TProfile2D*)fPeakMinusPedHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), max - min);
+ ((TProfile2D*)fSampleHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), sample);
}//end if gain
max = fgkSampleMin; min = fgkSampleMax;
if( ((TProfile2D *)fPedestalHighGain[i])->GetEntries() || saveEmptyHistos) {
fPedestalHighGain[i]->Write();
}
+ if( ((TProfile2D *)fSampleLowGain[i])->GetEntries() || saveEmptyHistos) {
+ fSampleLowGain[i]->Write();
+ }
+ if( ((TProfile2D *)fSampleHighGain[i])->GetEntries() || saveEmptyHistos) {
+ fSampleHighGain[i]->Write();
+ }
}
destFile.Close();
title += i;
fPedestalLowGainDiff.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Pedestals, high gain
name = "hPedhighgainDiff";
title += i;
fPedestalHighGainDiff.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
-
- //Peak-Pedestals, low gain
- name = "hPeakMinusPedlowgainDiff";
- name += i;
- title = "Peak-Pedestal difference, low gain, module ";
- title += i;
- fPeakMinusPedLowGainDiff.Add(new TProfile2D(name, title,
- fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
-
+ fRows, fRowMin, fRowMax,"s"));
+
//Peak-Pedestals, high gain
name = "hPeakMinusPedhighgainDiff";
name += i;
title += i;
fPeakMinusPedHighGainDiff.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Pedestals, low gain
name = "hPedlowgainRatio";
title += i;
fPedestalLowGainRatio.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Pedestals, high gain
name = "hPedhighgainRatio";
title += i;
fPedestalHighGainRatio.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Peak-Pedestals, low gain
name = "hPeakMinusPedlowgainRatio";
title += i;
fPeakMinusPedLowGainRatio.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
//Peak-Pedestals, high gain
name = "hPeakMinusPedhighgainRatio";
title += i;
fPeakMinusPedHighGainRatio.Add(new TProfile2D(name, title,
fColumns, 0.0, fColumns,
- fRows, -fRows, 0.0));
+ fRows, fRowMin, fRowMax,"s"));
}//end for nModules create the histograms
}