TObject(),
fPedestalLowGain(),
fPedestalHighGain(),
+ fSampleLowGain(),
+ fSampleHighGain(),
fPeakMinusPedLowGain(),
fPeakMinusPedHighGain(),
fPedestalLowGainDiff(),
fPeakMinusPedLowGainRatio(),
fPeakMinusPedHighGainRatio(),
fDeadMap(),
+ fNEvents(0),
+ fNChanFills(0),
fDeadTowers(0),
fNewDeadTowers(0),
fResurrectedTowers(0),
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(),
fPeakMinusPedLowGainRatio(),
fPeakMinusPedHighGainRatio(),
fDeadMap(),
+ fNEvents(ped.GetNEvents()),
+ fNChanFills(ped.GetNChanFills()),
fDeadTowers(ped.GetDeadTowerCount()),
fNewDeadTowers(ped.GetDeadTowerNew()),
fResurrectedTowers(ped.GetDeadTowerResurrected()),
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();
GetPeakProfileHighGainRatio(i)->Reset();
}
}
+ fNEvents = 0;
+ fNChanFills = 0;
fDeadTowers = 0;
fNewDeadTowers = 0;
fResurrectedTowers = 0;
//To think about: should fReference be deleted too?... let's not do it this time, at least...
}
+//_____________________________________________________________________
+Bool_t AliCaloCalibPedestal::AddInfo(const AliCaloCalibPedestal *ped)
+{
+ // just do this for the basic histograms/profiles that get filled in ProcessEvent
+ // may not have data for all modules, but let's just Add everything..
+ for (int i = 0; i < fModules; i++) {
+ GetPedProfileLowGain(i)->Add( ped->GetPedProfileLowGain(i) );
+ GetPedProfileHighGain(i)->Add( ped->GetPedProfileHighGain(i) );
+ GetPeakProfileLowGain(i)->Add( ped->GetPeakProfileLowGain(i) );
+ GetPeakProfileHighGain(i)->Add( ped->GetPeakProfileHighGain(i) );
+ }//end for nModules
+
+ // DeadMap; Diff profiles etc would need to be redone after this operation
+
+ 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)
{
// Method to process=analyze one event in the data stream
if (!in) return kFALSE; //Return right away if there's a null pointer
+ fNEvents++; // one more event
int sample, i = 0; //The sample temp, and the sample number in current event.
int max = fgkSampleMin, min = fgkSampleMax;//Use these for picking the pedestal
int gain = 0;
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?)
printf("Oh no: arrayPos = %i.\n", arrayPos);
}
+ fNChanFills++; // one more channel found, and profile to be filled
//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;
i = 0;
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
}