ROOT logo
AliRoot » EMCAL » AliCaloCalibPedestal

class AliCaloCalibPedestal: public TObject


 A help class for monitoring and calibration tools: MOOD, AMORE etc.,
 It can be created and used a la (ctor):

  //Create the object for making the histograms
  fPedestals = new AliCaloCalibPedestal( fDetType );
  // AliCaloCalibPedestal knows how many modules we have for PHOS or EMCAL
  fNumModules = fPedestals->GetModules();

 fed an event:
  fPedestals->ProcessEvent(fCaloRawStream);
 asked to draw histograms:
  fPedestals->GetDeadMap(i)->Draw("col");
 or
  fPedestals->GetPeakProfileHighGainRatio((i < fNumModules) ? i : fVisibleModule)->Draw("colz");
 etc.
 The pseudo-code examples above were from the first implementation in MOOD (summer 2007).

Function Members (Methods)

public:
AliCaloCalibPedestal(AliCaloCalibPedestal::kDetType detectorType = kPhos)
AliCaloCalibPedestal(AliCaloCalibPedestal& ped)
virtual~AliCaloCalibPedestal()
voidTObject::AbstractMethod(const char* method) const
Bool_tAddInfo(AliCaloCalibPedestal* ped)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
voidComputeDeadTowers(const char* deadMapFile = 0)
voidComputeDiffAndRatio()
voidComputeHotAndWarningTowers(const char* hotMapFile = 0)
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
AliCaloAltroMapping**GetAltroMapping() const
TStringGetCaloString() const
Int_tGetChannelStatus(int imod, int icol, int irow) const
intGetColumns() const
TObjArrayGetDeadMap()
TH2D*GetDeadMap(int i)
intGetDeadThreshold() const
intGetDeadTowerCount() const
intGetDeadTowerNew() const
doubleGetDeadTowerRatio() const
intGetDeadTowerResurrected() const
AliCaloCalibPedestal::kDetTypeGetDetectorType() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
intGetFirstPedestalSample() const
doubleGetHotSigma() const
virtual const char*TObject::GetIconName() const
intGetLastPedestalSample() const
intGetLEDRefs() const
intGetModules() const
virtual const char*TObject::GetName() const
intGetNChanFills() const
intGetNEvents() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TH2F*GetPeakHighGainHisto(int i)
TProfile2D*GetPeakProfileHighGain(int i)
TProfile2D*GetPeakProfileHighGainDiff(int i)
TProfile2D*GetPeakProfileHighGainRatio(int i)
TProfile2D*GetPeakProfileLowGain(int i)
TProfile2D*GetPeakProfileLowGainDiff(int i)
TProfile2D*GetPeakProfileLowGainRatio(int i)
TProfile*GetPedLEDRefProfileHighGain(int i)
TProfile*GetPedLEDRefProfileHighGainDiff(int i)
TProfile*GetPedLEDRefProfileHighGainRatio(int i)
TProfile*GetPedLEDRefProfileLowGain(int i)
TProfile*GetPedLEDRefProfileLowGainDiff(int i)
TProfile*GetPedLEDRefProfileLowGainRatio(int i)
TProfile2D*GetPedProfileHighGain(int i)
TProfile2D*GetPedProfileHighGainDiff(int i)
TProfile2D*GetPedProfileHighGainRatio(int i)
TProfile2D*GetPedProfileLowGain(int i)
TProfile2D*GetPedProfileLowGainDiff(int i)
TProfile2D*GetPedProfileLowGainRatio(int i)
AliCaloCalibPedestal*GetReference() const
intGetRefRunNumber() const
intGetRowMax() const
intGetRowMin() const
intGetRowMultiplier() const
intGetRows() const
intGetRunNumber() const
Bool_tGetSelectPedestalSamples() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
doubleGetWarningFraction() const
intGetWarningThreshold() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
voidInit()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsBadChannel(int imod, int icol, int irow) const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
Bool_tLoadReferenceCalib(TString fileName, TString objectName)
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
AliCaloCalibPedestal&operator=(AliCaloCalibPedestal& source)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
Bool_tProcessEvent(AliRawReader* rawReader)
Bool_tProcessEvent(AliCaloRawStreamV3* in)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidReset()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
Bool_tSaveHistograms(TString fileName, Bool_t saveEmptyHistos = kFALSE)
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidSetAltroMapping(AliCaloAltroMapping** mapp)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetChannelStatus(int imod, int icol, int irow, int status)
voidSetDeadMap(TObjArray map)
voidSetDeadThreshold(int i)
voidSetDeadTowerCount(Int_t dead)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetFirstPedestalSample(int i)
voidSetHotSigma(double d)
voidSetLastPedestalSample(int i)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetParametersFromFile(const char* parameterFile)
Bool_tSetReference(AliCaloCalibPedestal* ref)
voidSetRunNumber(int runNo)
voidSetSelectPedestalSamples(Bool_t flag = kFALSE)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetWarningFraction(double d)
voidSetWarningThreshold(int i)
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
voidWriteParametersToFile(const char* parameterFile)
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum kDetType { kPhos
kEmCal
kNone
};
enum kDeadMapEntry { kAlive
kDead
kHot
kWarning
kResurrected
kRecentlyDeceased
kNumDeadMapStates
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
TStringfCaloStringid for which detector type we have
intfColumnsThe number of columns per module
TObjArrayfDeadMapThe deadmap
intfDeadThresholdPeak - ped threshold used for dead towers evaluation
intfDeadTowersNumber of towers found dead.
AliCaloCalibPedestal::kDetTypefDetTypeThe detector type for this object
intfFirstPedestalSamplefirst sample to use
doublefHotSigmaif pedestal rms more than fHotSigma away from normal -> tower is assigned kHot
intfLEDRefsThe number of LED references/monitors per module
intfLastPedestalSamplelast sample to use
AliCaloAltroMapping**fMapping! Altro Mapping object
intfModulesThe number of modules
intfNChanFills# total channel fills (NChan * NEvents if not zero-suppressed)
intfNEvents# total events processed,
intfNewDeadTowers! Towers that have died since the reference run
TObjArrayfPeakMinusPedHighGain(peak-pedestal) info for high gain
TObjArrayfPeakMinusPedHighGainDiff!
TObjArrayfPeakMinusPedHighGainHisto(peak-pedestal TH2F) info for high gain, used for hot towers eveluation
TObjArrayfPeakMinusPedHighGainRatio!
TObjArrayfPeakMinusPedLowGain(peak-pedestal) info for low gain
TObjArrayfPeakMinusPedLowGainDiff!
TObjArrayfPeakMinusPedLowGainRatio!
TObjArrayfPedestalHighGainpedestal info for high gain
TObjArrayfPedestalHighGainDiff!
TObjArrayfPedestalHighGainRatio!
TObjArrayfPedestalLEDRefHighGainpedestal LEDRef info for high gain
TObjArrayfPedestalLEDRefHighGainDiff!
TObjArrayfPedestalLEDRefHighGainRatio!
TObjArrayfPedestalLEDRefLowGainpedestal LEDRef info for low gain
TObjArrayfPedestalLEDRefLowGainDiff!
TObjArrayfPedestalLEDRefLowGainRatio!
TObjArrayfPedestalLowGainpedestal info for low gain
TObjArrayfPedestalLowGainDiff!
TObjArrayfPedestalLowGainRatio!
AliCaloCalibPedestal*fReference! A reference object, for comparing the accumulated results to a previous run
intfResurrectedTowers! Towers that have been resurrected from the dead, compared to the reference
intfRowMaxMaximum now number
intfRowMinMinimum Row number
intfRowMultiplierMultiplication factor to get proper row range between PHOS and EMCAL
intfRowsThe number of rows per module
intfRunNumberThe run number. Needs to be set by the user.
Bool_tfSelectPedestalSamplesselect to to use only some range of samples for pedestal calc.
doublefWarningFractionif(Peak - ped) > threshold in more than this fraction of event -> tower is assigned kWarning
intfWarningThresholdPeak - ped threshold used for warm/warning towers evaluation
static const intfgkPhosColsnumber of columns per module for PHOS
static const intfgkPhosLEDRefsno LED monitor channels for PHOS, set to 1 just to keep code simpler (also create LEDRef histos for PHOS)
static const intfgkPhosModulesnumber of modules for PHOS
static const intfgkPhosRowsnumber of rows per module for PHOS

Class Charts

Inheritance Chart:
TObject
AliCaloCalibPedestal

Function documentation

AliCaloCalibPedestal(kDetType detectorType)
Default constructor. First we set the detector-type related constants.
void ValidateProfiles()
Make sure the basic histos exist
void CompressAndSetOwner()
Compress the arrays, in order to remove the empty objects (a 16 slot array is created by default)
~AliCaloCalibPedestal()
dtor
AliCaloCalibPedestal(AliCaloCalibPedestal& ped)
 Then the ObjArray ones; we add the histograms rather than trying TObjArray = assignment
DS: this has not really been tested yet..
void Reset()
void SetParametersFromFile(const char* parameterFile)
 Note: this method is a bit more complicated than it really has to be
 - allowing for multiple entries per line, arbitrary order of the
 different variables etc. But I wanted to try and do this in as
 correct a C++ way as I could (as an exercise).
void WriteParametersToFile(const char* parameterFile)
Write parameters in file.
Bool_t AddInfo(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..
Bool_t ProcessEvent(AliRawReader* rawReader)
 if fMapping is NULL the rawstream will crate its own mapping
Bool_t ProcessEvent(AliCaloRawStreamV3* in)
 Method to process=analyze one event in the data stream
Bool_t SaveHistograms(TString fileName, Bool_t saveEmptyHistos = kFALSE)
Saves all the histograms (or profiles, to be accurate) to the designated file
Bool_t LoadReferenceCalib(TString fileName, TString objectName)
Bool_t SetReference(AliCaloCalibPedestal* ref)
void ValidateComparisonProfiles()
Make sure the comparison histos exist
void ComputeDiffAndRatio()
void ComputeHotAndWarningTowers(const char* hotMapFile = 0)
void ComputeDeadTowers(const char* deadMapFile = 0)
Bool_t IsBadChannel(int imod, int icol, int irow) const
 Check if status info histo exists
void SetChannelStatus(int imod, int icol, int irow, int status)
AliCaloAltroMapping ** GetAltroMapping() const
 Mapping handling
{ return fMapping; }
void SetAltroMapping(AliCaloAltroMapping** mapp)
{ fMapping = mapp; }
TProfile2D * GetPedProfileLowGain(int i)
Simple getters
 Main profiles:
{ValidateProfiles(); return (TProfile2D*)fPedestalLowGain[i];}
TProfile2D * GetPedProfileHighGain(int i)
{ValidateProfiles(); return (TProfile2D*)fPedestalHighGain[i];}
TProfile * GetPedLEDRefProfileLowGain(int i)
{ValidateProfiles(); return (TProfile*)fPedestalLEDRefLowGain[i];}
TProfile * GetPedLEDRefProfileHighGain(int i)
{ValidateProfiles(); return (TProfile*)fPedestalLEDRefHighGain[i];}
TProfile2D * GetPeakProfileLowGain(int i)
{ValidateProfiles(); return (TProfile2D*)fPeakMinusPedLowGain[i];}
TProfile2D * GetPeakProfileHighGain(int i)
{ValidateProfiles(); return (TProfile2D*)fPeakMinusPedHighGain[i];}
TProfile2D * GetPedProfileLowGainDiff(int i)
 Differences to references:
TProfile2D * GetPedProfileHighGainDiff(int i)
TProfile * GetPedLEDRefProfileLowGainDiff(int i)
TProfile * GetPedLEDRefProfileHighGainDiff(int i)
TProfile2D * GetPeakProfileLowGainDiff(int i)
TProfile2D * GetPeakProfileHighGainDiff(int i)
TProfile2D * GetPedProfileLowGainRatio(int i)
 Ratio to references:
TProfile2D * GetPedProfileHighGainRatio(int i)
TProfile * GetPedLEDRefProfileLowGainRatio(int i)
TProfile * GetPedLEDRefProfileHighGainRatio(int i)
TProfile2D * GetPeakProfileLowGainRatio(int i)
TProfile2D * GetPeakProfileHighGainRatio(int i)
TH2F * GetPeakHighGainHisto(int i)
TH2D * GetDeadMap(int i)
void SetDeadMap(int i, TH2D *h) const {((TH2D*)fDeadMap[i])=h;}
{ValidateProfiles(); return (TH2D*)fDeadMap[i];}
Int_t GetChannelStatus(int imod, int icol, int irow) const
{ return (Int_t)((TH2D*)fDeadMap[imod])->GetBinContent(icol, irow); }
TObjArray GetDeadMap()
void SetDeadMap(TObjArray map)
{fDeadMap = map;}
kDetType GetDetectorType() const
 Basic info: getters
{return fDetType;}
TString GetCaloString() const
{return fCaloString;}
int GetColumns() const
{return fColumns;}
int GetRows() const
{return fRows;}
int GetLEDRefs() const
{return fLEDRefs;}
int GetModules() const
{return fModules;}
int GetRowMin() const
{return fRowMin;}
int GetRowMax() const
{return fRowMax;}
int GetRowMultiplier() const
{return fRowMultiplier;}
void SetRunNumber(int runNo)
 RunNumbers : setters and getters
{fRunNumber = runNo;}
int GetRunNumber() const
{return fRunNumber;}
int GetRefRunNumber() const
{if (fReference) return fReference->GetRunNumber(); else return -1;}
void SetSelectPedestalSamples(Bool_t flag = kFALSE)
 Possibility to select only some samples for the pedestal calculation
Bool_t GetSelectPedestalSamples() const
void SetFirstPedestalSample(int i)
void SetLastPedestalSample(int i)
int GetFirstPedestalSample() const
int GetLastPedestalSample() const
void SetDeadThreshold(int i)
Set threshold/event fraction for tower warnings
void SetWarningThreshold(int i)
void SetWarningFraction(double d)
int GetDeadThreshold() const
{return fDeadThreshold;}
int GetWarningThreshold() const
double GetWarningFraction() const
 hot towers
void SetHotSigma(double d)
{fHotSigma = d;}
double GetHotSigma() const
{return fHotSigma;}
int GetNEvents() const
 Basic counters
{return fNEvents;}
int GetNChanFills() const
{return fNChanFills;}
void SetDeadTowerCount(Int_t dead)
Analysis functions
{fDeadTowers = dead;}
int GetDeadTowerCount() const
{return fDeadTowers;}
double GetDeadTowerRatio() const
{return fDeadTowers/(double)(fRows*fColumns);}
int GetDeadTowerNew() const
{return fNewDeadTowers;}
int GetDeadTowerResurrected() const
AliCaloCalibPedestal * GetReference() const
{return fReference;}
void Init()