#include "hpidhistogramscont.h"

HPidHistogramsCont


class description - source file - inheritance tree (.pdf)

class HPidHistogramsCont : public HPidParCont

Inheritance Chart:
TObject
<-
TNamed
<-
HParSet
<-
HParCond
<-
HPidParCont
<-
HPidHistogramsCont
<-
HPidAlgMdcElossPar
HPidAlgMomVsBetaPar
HPidAlgRingPropertiesPar
HPidAlgShowerPar
HPidAlgStandCutsPar
HPidReconstructorPar
HPidTrackFillerPar
    private:
Int_t getIndex(Int_t iPart, Int_t iOffset, Int_t iSector) const Bool_t resize(Int_t iNPSet) void setDefault() public:
HPidHistogramsCont() HPidHistogramsCont(const char* name, const char* title, const char* context, Int_t iHistsPerPart = 1) virtual ~HPidHistogramsCont() Bool_t addHistogram(Int_t iPartId, Int_t iOffset, Int_t iSector, const TH1* pHist) Bool_t addHistogram(Int_t iPartId, const TH1* pHist) virtual Bool_t checkContext(Int_t nMomAlgInd) static TClass* Class() virtual void clear() virtual void detachHistograms() virtual void Draw(Option_t* option) Int_t findParticleIndex(Int_t iPartId) const TObjArray& getArray() TH1* getHistogram(Int_t iPartId, Int_t iOffset, Int_t iSector) const Int_t getHistsPerPart() const Int_t getNHistograms() const Int_t getNParticles() const virtual Bool_t getParams(HParamList* pl) Stat_t getValue(Int_t iPartId, Int_t iOffset, Int_t iSector, Float_t fX, Float_t fY = 0.0f, Float_t fZ = 0.0f) const Stat_t getValue(Int_t iPartId, Float_t fX, Float_t fY = 0.0f, Float_t fZ = 0.0f) const Bool_t getWarnings() const virtual TClass* IsA() const virtual void Print(Option_t* p) virtual void print() virtual void putParams(HParamList* pl) void removeHistogram(Int_t iPartId, Int_t iOffset = 0, Int_t iSector = 0) virtual void setContext(Int_t nMomAlgInd) void setWarnings(Bool_t b = kTRUE) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
Int_t iNParticles Int_t iHistsPerPart TArrayI aParticles TObjArray aHistograms Bool_t bWarnings ! Bool_t bOk !

Class Description


 HPidHistogramsCont

 Container for define set of histograms with interface for easy access
 of values from them.
 The histograms are organized in an array with access:
 (pid, index)
 The user (class) defines maximum number of histograms for one id (max index).
 The container is stored using normal Pid containers scheme.

 Technical warning: copy functions not implemented !!!



HPidHistogramsCont(void) : HPidParCont("HPidHistogramsCont", "HPidHistogramsCont", "HPidHistogramsCont")
 empty constructor for reading from Stream

HPidHistogramsCont(const char *name, const char *title, const char *context, Int_t iHistSet) : HPidParCont(name, title, context)
 Constructor.
 Makes the array for particle ids and historgams
 The iNParticles and iHistsPerPart must be > 0
 If the parameters are wrong, or there is no memory an error is printed
 and the bOk flag is set off.

void setDefault(void)
 function called in constructors for clearnig memory befor it is used

~HPidHistogramsCont(void)
 Remove all histograms and delete arrays

Bool_t resize(Int_t iNPSet)
 Change the size of the arrays and copy old contains if exists
 The histograms, which will not be included into new array are NOT DELETED !!!

void clear(void)
 Delete the histograms and set all particle ids to default values (-1)
 The arrays of particle ids and histograms are not removed

void detachHistograms(void)
 Deteach histograms from the file by calling hist->SetDirectory(NULL)

void putParams(HParamList* l)
 Put params into HParamList

Bool_t getParams(HParamList* l)
 Get params from HParamList

Int_t findParticleIndex(Int_t iPart) const
 Return the index of particle id iPart in the array.
 If the partcle id is not set -1 is returned

Bool_t addHistogram(Int_t iPartId, Int_t iOffset, Int_t iSector, const TH1 *pHist)
 A !!! COPY !!! of histogram pHist is stored in the position for proper
 iPartId and iOffset (both >= 0). If the position of iOffset is out of bounds
 or iPartId is not on the array yet and there is no space in the array for the
 new entry the error is reported and kFALSE returned.
 If on the position there is already a histogram it is deleted and warning
 is printed
 check the configuration

void removeHistogram(Int_t iPartId, Int_t iOffset, Int_t iSector )
 Removes histogram for the given particle id and offset

TH1* getHistogram(Int_t iPartId, Int_t iOffset, Int_t iSector) const
 Return a pointer to the histogram for given iPartId and iOffset
 In case of out of bounds parameters the error is reported and NULL returned

Stat_t getValue(Int_t iPartId, Int_t iOffset, Int_t iSector, Float_t fX, Float_t fY, Float_t fZ) const
 Returns value from the histogram corresponding to given parameters.
 If the address of the histogram is out of bounds or histogram
 is not set in the array a warning is reported and -1.0f returned.
 Otherwise the returned value is calculated in a way:
 pHist->GetBinContent(pHist->FindBin((fX, fY, fZ))
 If (fX, fY, fZ) is out of range of the histogram, then the value from
 the "closest" bin is returned

void print(void)
 Print information about the histograms in the container

void Draw(const Option_t *pO)

Bool_t checkContext(Int_t nMomAlgInd)
Check the context name and compare with current momentum alg. index
return kTRUE if context corresponds to right momentum algorithm
Possible substrings in contex name are:
 KICK123
 KICK
 SPLINE
 REFT
 RUNGEKUTTA
momentum alg. indices are defined in piddef.h

void setContext(Int_t nMomAlgInd)

void Streamer(TBuffer &R__b)
 Stream an object of class HPidHistogramsCont.
 Default Streamer created by Cint + detachHistograms() after reading



Inline Functions


              Int_t getIndex(Int_t iPart, Int_t iOffset, Int_t iSector) const
         TObjArray& getArray()
              Int_t getNParticles() const
              Int_t getHistsPerPart() const
              Int_t getNHistograms() const
             Bool_t addHistogram(Int_t iPartId, const TH1* pHist)
             Stat_t getValue(Int_t iPartId, Float_t fX, Float_t fY = 0.0f, Float_t fZ = 0.0f) const
               void setWarnings(Bool_t b = kTRUE)
             Bool_t getWarnings() const
               void Print(Option_t* p)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void StreamerNVirtual(TBuffer& b)


Author: Marcin Jaskula 10/10/2002
Last update: Fri Jan 26 12:22:23 2007


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.