StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtQaCorrelationPlotMaker.h
1 
6 /***************************************************************************
7  *
8  * $Id: StFgtQaCorrelationPlotMaker.h,v 1.1 2012/01/31 09:26:17 sgliske Exp $
9  * Author: S. Gliske, Sept 2011
10  *
11  ***************************************************************************
12  *
13  * Description: Plots either the covariance or correlation
14  * coefficients between channels or groups of channels.
15  *
16  ***************************************************************************
17  *
18  * $Log: StFgtQaCorrelationPlotMaker.h,v $
19  * Revision 1.1 2012/01/31 09:26:17 sgliske
20  * StFgtQaMakers moved to StFgtPool
21  *
22  * Revision 1.2 2011/11/01 19:07:24 sgliske
23  * Updated to correspond with StEvent containers, take 2.
24  *
25  * Revision 1.1 2011/09/28 17:48:50 sgliske
26  * minor updates
27  *
28  *
29  **************************************************************************/
30 
31 #ifndef _ST_FGT_QA_CORRELATION_PLOT_MAKER_H_
32 #define _ST_FGT_QA_CORRELATION_PLOT_MAKER_H_
33 
34 #include <string>
35 #include <Rtypes.h>
36 #include <TH2F.h>
37 
38 #include "StFgtQaMaker.h"
39 
41  public:
42  // constructors
43  StFgtQaCorrelationPlotMaker( const Char_t* name = "FGT_QA_Adc_vs_Channel",
44  Short_t discId = 0,
45  Short_t quadId = 0,
46  const Char_t* quadName = "000" );
47 
48  // copy constr.
50 
51  // equals operator
53 
54  // deconstructor
55  virtual ~StFgtQaCorrelationPlotMaker();
56 
57  Int_t Init();
58  Int_t Make();
59  Int_t Finish();
60 
61  // accessor
62  const TH2F* getCovarianceHist() const;
63  const TH2F* getCorrelationHist() const;
64 
65  // modifiers
66  void setComputeCorrelations( Bool_t doCor = 1 );
67 
68  protected:
69  // what to plot
70  Bool_t mComputeCor;
71 
72  // the histograms
73  TH2F *mCovHist;
74  TH2F *mCorHist;
75 
76  // need a struct for after ped subtraction
77  struct data_t {
78  Int_t count;
79  Float_t val;
80 
81  data_t( Int_t i, Float_t v );
82  };
83 
84  // to set title
85  void getTitle( Bool_t isCor, std::string& title );
86 
87  // to hold sums
88  Int_t mNbins;
89  Float_t **mMatrix;
90  Float_t *mSum;
91  Int_t *mN;
92 
93  private:
94  // forbid this from being changed
95  void setToSubtrPeds( Bool_t doIt );
96 
97  ClassDef(StFgtQaCorrelationPlotMaker,1);
98 
99 };
100 
101 // inline functions
102 
103 // accessor
104 inline const TH2F* StFgtQaCorrelationPlotMaker::getCovarianceHist() const { return mCovHist; };
105 inline const TH2F* StFgtQaCorrelationPlotMaker::getCorrelationHist() const { return mCorHist; };
106 
107 // modifiers
108 inline void StFgtQaCorrelationPlotMaker::setComputeCorrelations( Bool_t doCor ){ mComputeCor = doCor; };
109 
110 // for the struct
111 inline StFgtQaCorrelationPlotMaker::data_t::data_t( Int_t i, Float_t v ) : count(i), val(v) {
112  //cout << "y " << count << ' ' << val << endl;
113 };
114 
115 #endif