From: dsilverm Date: Tue, 11 May 2010 12:44:10 +0000 (+0000) Subject: add SetReference method X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=35eabcf495e64ac23ac8d3df3834efcec0b2e66b;p=u%2Fmrichter%2FAliRoot.git add SetReference method --- diff --git a/EMCAL/AliCaloCalibPedestal.cxx b/EMCAL/AliCaloCalibPedestal.cxx index 8311741ce4c..b2f1cfc7b5d 100644 --- a/EMCAL/AliCaloCalibPedestal.cxx +++ b/EMCAL/AliCaloCalibPedestal.cxx @@ -676,6 +676,24 @@ Bool_t AliCaloCalibPedestal::LoadReferenceCalib(TString fileName, TString object return kTRUE;//We succesfully loaded the object } + +//_____________________________________________________________________ +Bool_t AliCaloCalibPedestal::SetReference(AliCaloCalibPedestal *ref) +{ + if (fReference) delete fReference;//Delete the reference object, if it already exists + fReference = 0; + + fReference = ref; + + if (!fReference || (fReference->GetDetectorType() != fDetType)) { + if (fReference) delete fReference;//Delete the object, in case we had an object of the wrong type + fReference = 0; + return kFALSE; + } + + return kTRUE;//We succesfully loaded the object +} + //_____________________________________________________________________ void AliCaloCalibPedestal::ValidateComparisonProfiles() { @@ -758,7 +776,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles() fRows, fRowMin, fRowMax,"s")); //LED Ref/Mon pedestals, low gain - name = "hPedestalLEDReflowgain"; + name = "hPedestalLEDReflowgainRatio"; name += i; title = "Pedestal ratio LEDRef, low gain, module "; title += i; diff --git a/EMCAL/AliCaloCalibPedestal.h b/EMCAL/AliCaloCalibPedestal.h index 14329c36192..74727634dbf 100644 --- a/EMCAL/AliCaloCalibPedestal.h +++ b/EMCAL/AliCaloCalibPedestal.h @@ -153,6 +153,7 @@ class AliCaloCalibPedestal : public TObject { Bool_t LoadReferenceCalib(TString fileName, TString objectName); //Loads another AliCaloCalibPedestal by name "objectName" from the file "fileName", for reference void ComputeDiffAndRatio();//Actually computes the difference and ratio into the histo's in memory AliCaloCalibPedestal * GetReference() const {return fReference;}; //Get the reference object. Needed for debug, will probably be removed later + Bool_t SetReference(AliCaloCalibPedestal *ref); void ComputeDeadTowers(const char * deadMapFile = 0);//Computes the dead tower values void ComputeHotAndWarningTowers(const char * hotMapFile = 0);//Computes the hot tower values