#include "TFile.h"
+#include "AliRawReader.h"
#include "AliRawEventHeaderBase.h"
#include "AliCaloRawStream.h"
fColumns(0),
fRows(0),
fModules(0),
+ fCaloString(),
+ fMapping(NULL),
fRunNumber(-1),
fStartTime(0),
fAmpCut(50),
fColumns = fgkPhosCols;
fRows = fgkPhosRows;
fModules = fgkPhosModules;
+ fCaloString = "PHOS";
}
else {
//We'll just trust the enum to keep everything in line, so that if detectorType
fColumns = fgkEmCalCols;
fRows = fgkEmCalRows;
fModules = fgkEmCalModules;
+ fCaloString = "EMCAL";
}
fDetType = detectorType;
fColumns(sig.GetColumns()),
fRows(sig.GetRows()),
fModules(sig.GetModules()),
+ fCaloString(sig.GetCaloString()),
+ fMapping(NULL), //! note that we are not copying the map info
fRunNumber(sig.GetRunNumber()),
fStartTime(sig.GetStartTime()),
fAmpCut(sig.GetAmpCut()),
{
// just do this for the basic graphs/profiles that get filled in ProcessEvent
// may not have data for all channels, but let's just Add everything..
+ // Note: this method will run into problems with TProfile adding if the binning of
+ // the local profiles is not the same as those provided by the argument *sig..
+ int numGraphPoints = 0;
+ int id = 0;
+ int ip = 0;
for (int i = 0; i < fModules; i++) {
for (int j = 0; j < fColumns; j++) {
for (int k = 0; k < fRows; k++) {
- int id = GetTowerNum(i,j,k);
- if(fUseAverage){
- GetProfAmpVsTimeHighGain(id)->Add(sig->GetProfAmpVsTimeHighGain(id));
- GetProfAmpVsTimeLowGain(id)->Add(sig->GetProfAmpVsTimeLowGain(id));
+ id = GetTowerNum(i,j,k);
+
+ if(fUseAverage){ // add to Profiles
+ if (sig->GetProfAmpVsTimeHighGain(id)) {
+ GetProfAmpVsTimeHighGain(id)->Add(sig->GetProfAmpVsTimeHighGain(id));
+ }
+ if (sig->GetProfAmpVsTimeLowGain(id)) {
+ GetProfAmpVsTimeLowGain(id)->Add(sig->GetProfAmpVsTimeLowGain(id));
+ }
}
- else{
- //DS
-// sig->GetGraphAmpVsTimeHighGain(i,j,k);
-// sig->GetGraphAmpVsTimeLowGain(i,j,k);
+ else{ // add to Graphs
+ // high gain
+ numGraphPoints= sig->GetGraphAmpVsTimeHighGain(id)->GetN();
+ if (numGraphPoints > 0) {
+ // get the values
+ double *graphX = sig->GetGraphAmpVsTimeHighGain(id)->GetX();
+ double *graphY = sig->GetGraphAmpVsTimeHighGain(id)->GetY();
+ for(ip=0; ip < numGraphPoints; ip++){
+ fGraphAmpVsTimeHighGain[id]->SetPoint(fNHighGain[id]++,graphX[ip],graphY[ip]);
+ }
+ }
+ // low gain
+ numGraphPoints= sig->GetGraphAmpVsTimeLowGain(id)->GetN();
+ if (numGraphPoints > 0) {
+ // get the values
+ double *graphX = sig->GetGraphAmpVsTimeLowGain(id)->GetX();
+ double *graphY = sig->GetGraphAmpVsTimeLowGain(id)->GetY();
+ for(ip=0; ip < numGraphPoints; ip++){
+ fGraphAmpVsTimeLowGain[id]->SetPoint(fNLowGain[id]++,graphX[ip],graphY[ip]);
+ }
+ }
+
}
}//end for nModules
return kTRUE;//We succesfully added info from the supplied object
}
+//_____________________________________________________________________
+Bool_t AliCaloCalibSignal::ProcessEvent(AliRawReader *rawReader)
+{
+ // if fMapping is NULL the rawstream will crate its own mapping
+ AliCaloRawStream rawStream(rawReader, fCaloString, (AliAltroMapping**)fMapping);
+
+ return ProcessEvent( &rawStream, (AliRawEventHeaderBase*)rawReader->GetEventHeader() );
+}
//_____________________________________________________________________
Bool_t AliCaloCalibSignal::ProcessEvent(AliCaloRawStream *in, AliRawEventHeaderBase *aliHeader)
// now check if it was a led event, only use high gain (that should be sufficient)
if (fReqFractionAboveAmp) {
- bool ok = CheckFractionAboveAmp(AmpValHighGain, nHighChan);
+ bool ok = false;
+ if (nHighChan > 0) {
+ ok = CheckFractionAboveAmp(AmpValHighGain, nHighChan);
+ }
if (!ok) return false; // skip event
}