X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliCaloCalibPedestal.cxx;h=fc1609c999d57e38472cbbc7cf2bc3b911f092f4;hb=281613740638839619c51125a647bd06a2a6281a;hp=f527aafec2d300b3078d3038b2183fd976dd6a8c;hpb=65bec413f88781dcfc968082568d35c70258687f;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliCaloCalibPedestal.cxx b/EMCAL/AliCaloCalibPedestal.cxx index f527aafec2d..fc1609c999d 100644 --- a/EMCAL/AliCaloCalibPedestal.cxx +++ b/EMCAL/AliCaloCalibPedestal.cxx @@ -255,35 +255,30 @@ void AliCaloCalibPedestal::CompressAndSetOwner() AliCaloCalibPedestal::~AliCaloCalibPedestal() { //dtor - printf("Dtor\n"); - - if (fReference){ printf("Ref\n"); delete fReference;}//Delete the reference object, if it has been loaded + if (fReference) delete fReference;//Delete the reference object, if it has been loaded - - printf("Delete\n"); - // delete also TObjArray's - fPedestalLowGain.Delete(); printf("D 1\n"); - fPedestalHighGain.Delete();printf("D 2\n"); - fPedestalLEDRefLowGain.Delete();printf("D 3\n"); - fPedestalLEDRefHighGain.Delete();printf("D 4\n"); - fPeakMinusPedLowGain.Delete();printf("D 5\n"); - fPeakMinusPedHighGain.Delete();printf("D 6\n"); - fPeakMinusPedHighGainHisto.Delete();printf("D 7\n"); - fPedestalLowGainDiff.Delete();printf("D 8\n"); - fPedestalHighGainDiff.Delete();printf("D 9\n"); - fPedestalLEDRefLowGainDiff.Delete();printf("D 10\n"); - fPedestalLEDRefHighGainDiff.Delete();printf("D 11\n"); - fPeakMinusPedLowGainDiff.Delete();printf("D 12\n"); - fPeakMinusPedHighGainDiff.Delete();printf("D 13\n"); - fPedestalLowGainRatio.Delete();printf("D 14\n"); - fPedestalHighGainRatio.Delete();printf("D 15\n"); - fPedestalLEDRefLowGainRatio.Delete();printf("D 16\n"); - fPedestalLEDRefHighGainRatio.Delete();printf("D 17\n"); - fPeakMinusPedLowGainRatio.Delete();printf("D 18\n"); - fPeakMinusPedHighGainRatio.Delete();printf("D 19\n"); - fDeadMap.Delete();printf("D 20\n"); + fPedestalLowGain.Delete(); + fPedestalHighGain.Delete(); + fPedestalLEDRefLowGain.Delete(); + fPedestalLEDRefHighGain.Delete(); + fPeakMinusPedLowGain.Delete(); + fPeakMinusPedHighGain.Delete(); + fPeakMinusPedHighGainHisto.Delete(); + fPedestalLowGainDiff.Delete(); + fPedestalHighGainDiff.Delete(); + fPedestalLEDRefLowGainDiff.Delete(); + fPedestalLEDRefHighGainDiff.Delete(); + fPeakMinusPedLowGainDiff.Delete(); + fPeakMinusPedHighGainDiff.Delete(); + fPedestalLowGainRatio.Delete(); + fPedestalHighGainRatio.Delete(); + fPedestalLEDRefLowGainRatio.Delete(); + fPedestalLEDRefHighGainRatio.Delete(); + fPeakMinusPedLowGainRatio.Delete(); + fPeakMinusPedHighGainRatio.Delete(); + fDeadMap.Delete(); } @@ -366,9 +361,8 @@ AliCaloCalibPedestal& AliCaloCalibPedestal::operator = (AliCaloCalibPedestal &so //_____________________________________________________________________ void AliCaloCalibPedestal::Reset() -{ +{ // Reset all arrays/histograms ValidateProfiles(); // make sure histos/profiles exist - // Reset all arrays/histograms for (int i = 0; i < fModules; i++) { GetPedProfileLowGain(i)->Reset(); GetPedProfileHighGain(i)->Reset(); @@ -521,9 +515,10 @@ void AliCaloCalibPedestal::WriteParametersToFile(const char *parameterFile) //_____________________________________________________________________ Bool_t AliCaloCalibPedestal::AddInfo(AliCaloCalibPedestal *ped) { - ValidateProfiles(); // make sure histos/profiles exist // 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.. + ValidateProfiles(); // make sure histos/profiles exist + for (int i = 0; i < fModules; i++) { GetPedProfileLowGain(i)->Add( ped->GetPedProfileLowGain(i) ); GetPedProfileHighGain(i)->Add( ped->GetPedProfileHighGain(i) ); @@ -532,9 +527,26 @@ Bool_t AliCaloCalibPedestal::AddInfo(AliCaloCalibPedestal *ped) GetPeakProfileLowGain(i)->Add( ped->GetPeakProfileLowGain(i) ); GetPeakProfileHighGain(i)->Add( ped->GetPeakProfileHighGain(i) ); GetPeakHighGainHisto(i)->Add( ped->GetPeakHighGainHisto(i) ); - }//end for nModules + // We should also copy other pieces of info: counters and parameters + // (not number of columns and rows etc which should be the same) + // note that I just assign them here rather than Add them, but we + // normally just Add (e.g. in Preprocessor) one object so this should be fine. + fNEvents = ped->GetNEvents(); + fNChanFills = ped->GetNChanFills(); + fDeadTowers = ped->GetDeadTowerCount(); + fNewDeadTowers = ped->GetDeadTowerNew(); + fResurrectedTowers = ped->GetDeadTowerResurrected(); + fRunNumber = ped->GetRunNumber(); + fSelectPedestalSamples = ped->GetSelectPedestalSamples(); + fFirstPedestalSample = ped->GetFirstPedestalSample(); + fLastPedestalSample = ped->GetLastPedestalSample(); + fDeadThreshold = ped->GetDeadThreshold(); + fWarningThreshold = ped->GetWarningThreshold(); + fWarningFraction = ped->GetWarningFraction(); + fHotSigma = ped->GetHotSigma(); + // DeadMap; Diff profiles etc would need to be redone after this operation return kTRUE;//We succesfully added info from the supplied object @@ -743,7 +755,7 @@ Bool_t AliCaloCalibPedestal::LoadReferenceCalib(TString fileName, TString object //_____________________________________________________________________ Bool_t AliCaloCalibPedestal::SetReference(AliCaloCalibPedestal *ref) -{ +{ // set reference object if (fReference) delete fReference;//Delete the reference object, if it already exists fReference = 0; @@ -878,8 +890,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles() //_____________________________________________________________________ void AliCaloCalibPedestal::ComputeDiffAndRatio() -{ - // calculate differences and ratios relative to a reference +{ // calculate differences and ratios relative to a reference ValidateProfiles(); // make sure histos/profiles exist ValidateComparisonProfiles();//Make sure the comparison histos exist @@ -1074,7 +1085,7 @@ void AliCaloCalibPedestal::ComputeDeadTowers(const char * deadMapFile) } if (!diff->is_open()) { delete diff; - fout = 0;//Set the pointer to empty if the file was not opened + diff = 0;//Set the pointer to empty if the file was not opened } }