ROOT logo
#ifndef HShowerHistCell_H
#define HShowerHistCell_H
#pragma interface

#include "hparset.h"
#include "hlocation.h"

class TH3S;
class TH2F;
class HShowerCalPar;
class HShowerCalParCell;
class HShowerGeometry;

enum enum_HSHC_Methods
{
    HSHC_CAL_TEST = 0,
    HSHC_CAL_ELECT,
    HSHC_RUN_SIGMA,
    HSHC_RUN_THRESHOLD,
    HSHC_CAL_SIGMA,
    HSHC_CAL_THRESHOLD,

    HSHC_RUN_INTEGRATE,
    HSHC_CAL_INTEGRATE,

    HSHC_MAX
};

extern const Char_t* g_cpstr_HSHC_Methods[];

//------------------------------------------------------------------------------

#define MAX_OFFSET          (-255.0f)
#define DEF_CHANNEL_10pC    (500.0f)

//------------------------------------------------------------------------------

class HShowerHistCell : public TObject
{
public:
    HShowerHistCell();
    HShowerHistCell(Int_t nSect, Int_t nMod, Int_t nRow, Int_t nCol);
   ~HShowerHistCell();

    Bool_t  reset();
    Bool_t  fill(Int_t nRow, Int_t nCol, Int_t nVal);
    Bool_t  draw(Int_t nRow, Int_t nCol, Option_t* opt="");
    Bool_t  book();
    Bool_t  book(Int_t nRows, Int_t nCols);
    void    deleteHist();

    void    calculate(Int_t iEvents, HShowerCalPar* pCalPar, Int_t iMethod,
                                Float_t fParam1, Float_t fParam2);

    TH3S*   getHistogram()     { return m_pHist;   }
    void    writeHistogram();

    Char_t  getSector(void)   { return m_nSector; }
    Char_t  getModule(void)   { return m_nModule; }
    Char_t  getRows(void)     { return m_nRows;   }
    Char_t  getCols(void)     { return m_nCols;   }

    void    setSector(Char_t s) { m_nSector = s;    }
    void    setModule(Char_t m) { m_nModule = m;    }
    void    setRows(Char_t r)   { m_nRows   = r;    }
    void    setCols(Char_t c)   { m_nCols   = c;    }


    void    setChannel10pC(Float_t f)   { m_fChannel10pC = f;       }
    Float_t getChannel10pC(void)        { return m_fChannel10pC;    }

    void    setGeometry(HShowerGeometry* pGeom) { m_pGeom = pGeom;}
    HShowerGeometry* getGeometry()              { return m_pGeom;}

private:
    void    getName(Char_t* name, Int_t nInt);
    void    getTitle(Char_t* title, Int_t nInt);

    void    fillData(Int_t nRow, Int_t nCol, Int_t nBins, Int_t * pData);
    Int_t   getMax(void);
    Float_t getMean(Int_t nMin, Int_t nMax, Int_t nThreshold);
    Float_t getSigma(Float_t fMean, Int_t nMin, Int_t nMax, Int_t nThreshold);

    void  makeRunFromCal(HShowerCalParCell* pCell);

    // -------------------------------------------------------------------------

    TH3S   *m_pHist;  //!
    TH2F   *m_pSlopeHist;  //!
    TH2F   *m_pOffsetHist;  //!

    Char_t  m_nSector;
    Char_t  m_nModule;

    Char_t  m_nRows;
    Char_t  m_nCols;

    Int_t   m_nDataSize; //!
    Int_t*  m_pData; //!

    Int_t   m_iEvents; //!

    Float_t m_fChannel10pC;
    HShowerGeometry *m_pGeom; //!Pointer to geometry parameters container

    // -------------------------------------------------------------------------

    ClassDef(HShowerHistCell, 2) //ROOT extension

    void calTest(HLocation &loc, HShowerCalParCell *pCell,
                                 Float_t fParam1, Float_t fParam2);
    void calElect(HLocation &loc,HShowerCalParCell* pCell,
                                 Float_t fParam1, Float_t fParam2);
    void runSigma(HLocation &loc,HShowerCalParCell* pCell,
                                 Float_t fParam1, Float_t fParam2);
    void runThreshold(HLocation &loc,HShowerCalParCell* pCell,
                                 Float_t fParam1, Float_t fParam2);
    void runIntegrate(HLocation &loc,HShowerCalParCell* pCell,
                                 Float_t fParam1, Float_t fParam2);
};

#endif
 hshowerhistcell.h:1
 hshowerhistcell.h:2
 hshowerhistcell.h:3
 hshowerhistcell.h:4
 hshowerhistcell.h:5
 hshowerhistcell.h:6
 hshowerhistcell.h:7
 hshowerhistcell.h:8
 hshowerhistcell.h:9
 hshowerhistcell.h:10
 hshowerhistcell.h:11
 hshowerhistcell.h:12
 hshowerhistcell.h:13
 hshowerhistcell.h:14
 hshowerhistcell.h:15
 hshowerhistcell.h:16
 hshowerhistcell.h:17
 hshowerhistcell.h:18
 hshowerhistcell.h:19
 hshowerhistcell.h:20
 hshowerhistcell.h:21
 hshowerhistcell.h:22
 hshowerhistcell.h:23
 hshowerhistcell.h:24
 hshowerhistcell.h:25
 hshowerhistcell.h:26
 hshowerhistcell.h:27
 hshowerhistcell.h:28
 hshowerhistcell.h:29
 hshowerhistcell.h:30
 hshowerhistcell.h:31
 hshowerhistcell.h:32
 hshowerhistcell.h:33
 hshowerhistcell.h:34
 hshowerhistcell.h:35
 hshowerhistcell.h:36
 hshowerhistcell.h:37
 hshowerhistcell.h:38
 hshowerhistcell.h:39
 hshowerhistcell.h:40
 hshowerhistcell.h:41
 hshowerhistcell.h:42
 hshowerhistcell.h:43
 hshowerhistcell.h:44
 hshowerhistcell.h:45
 hshowerhistcell.h:46
 hshowerhistcell.h:47
 hshowerhistcell.h:48
 hshowerhistcell.h:49
 hshowerhistcell.h:50
 hshowerhistcell.h:51
 hshowerhistcell.h:52
 hshowerhistcell.h:53
 hshowerhistcell.h:54
 hshowerhistcell.h:55
 hshowerhistcell.h:56
 hshowerhistcell.h:57
 hshowerhistcell.h:58
 hshowerhistcell.h:59
 hshowerhistcell.h:60
 hshowerhistcell.h:61
 hshowerhistcell.h:62
 hshowerhistcell.h:63
 hshowerhistcell.h:64
 hshowerhistcell.h:65
 hshowerhistcell.h:66
 hshowerhistcell.h:67
 hshowerhistcell.h:68
 hshowerhistcell.h:69
 hshowerhistcell.h:70
 hshowerhistcell.h:71
 hshowerhistcell.h:72
 hshowerhistcell.h:73
 hshowerhistcell.h:74
 hshowerhistcell.h:75
 hshowerhistcell.h:76
 hshowerhistcell.h:77
 hshowerhistcell.h:78
 hshowerhistcell.h:79
 hshowerhistcell.h:80
 hshowerhistcell.h:81
 hshowerhistcell.h:82
 hshowerhistcell.h:83
 hshowerhistcell.h:84
 hshowerhistcell.h:85
 hshowerhistcell.h:86
 hshowerhistcell.h:87
 hshowerhistcell.h:88
 hshowerhistcell.h:89
 hshowerhistcell.h:90
 hshowerhistcell.h:91
 hshowerhistcell.h:92
 hshowerhistcell.h:93
 hshowerhistcell.h:94
 hshowerhistcell.h:95
 hshowerhistcell.h:96
 hshowerhistcell.h:97
 hshowerhistcell.h:98
 hshowerhistcell.h:99
 hshowerhistcell.h:100
 hshowerhistcell.h:101
 hshowerhistcell.h:102
 hshowerhistcell.h:103
 hshowerhistcell.h:104
 hshowerhistcell.h:105
 hshowerhistcell.h:106
 hshowerhistcell.h:107
 hshowerhistcell.h:108
 hshowerhistcell.h:109
 hshowerhistcell.h:110
 hshowerhistcell.h:111
 hshowerhistcell.h:112
 hshowerhistcell.h:113
 hshowerhistcell.h:114
 hshowerhistcell.h:115
 hshowerhistcell.h:116
 hshowerhistcell.h:117
 hshowerhistcell.h:118
 hshowerhistcell.h:119
 hshowerhistcell.h:120
 hshowerhistcell.h:121
 hshowerhistcell.h:122