StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtCosmicTrackPlots.h
1 /***************************************************************************
2  *
3  * $Id: StFgtCosmicTrackPlots.h,v 1.2 2012/01/31 23:37:17 avossen Exp $
4  * Author: C. K. Riley (ckriley@bnl.gov), Oct. 18 2011
5  *
6  ***************************************************************************
7  *
8  * Description: Plotting class for different histograms concerning
9  * cosmicstand tracks
10  *
11  ***************************************************************************
12  *
13  * $Log: StFgtCosmicTrackPlots.h,v $
14  * Revision 1.2 2012/01/31 23:37:17 avossen
15  * fixed StFgtCosmicTrackMaker paths
16  *
17  * Revision 1.1 2012/01/31 23:25:35 avossen
18  * moved StFgtCosmicTrackMaker to StFgtPool
19  *
20  * Revision 1.1 2012/01/17 20:03:06 sgliske
21  * moved from StFgtQaMakers
22  *
23  * Revision 1.10 2011/12/07 17:19:59 ckriley
24  * minor update
25  *
26  * Revision 1.9 2011/11/25 20:20:04 ckriley
27  * added statusmaker functionality
28  *
29  * Revision 1.8 2011/11/09 21:03:20 ckriley
30  * working version with current containers
31  *
32  * Revision 1.7 2011/11/01 19:07:24 sgliske
33  * Updated to correspond with StEvent containers, take 2.
34  *
35  * Revision 1.5 2011/10/25 20:43:32 ckriley
36  * added more plots
37  *
38  * Revision 1.4 2011/10/25 15:40:39 ckriley
39  * more plots
40  *
41  * Revision 1.3 2011/10/20 17:13:44 ckriley
42  * major update -> headers, tracks stored in StFgtEvent instead of StFgtDisc, changes to trackmaker and algorithms
43  *
44  *
45  **************************************************************************/
46 
47 #ifndef _ST_FGT_COSMIC_TRACK_PLOTS_
48 #define _ST_FGT_COSMIC_TRACK_PLOTS_
49 
50 #include <string>
51 #include <TH1F.h>
52 #include <TH2F.h>
53 #include <TProfile.h>
54 #include <TProfile2D.h>
55 #include "StMaker.h"
56 #include "StRoot/StFgtPool/StFgtCosmicTrackMaker/StFgtCosmicTrack.h"
57 
59  public:
60  // constructors
61  StFgtCosmicTrackPlots( const Char_t* name = "FGT_TrackQA_Residual",
62  const Char_t* cosmicTrackerName = "fgtCosmicTrackMaker",
63  Short_t discId = 0,
64  Short_t quadId = 0,
65  const Char_t* quadName = "000" );
67 
68  // deconstructor
70 
71  // equals operator
73 
74  Int_t Init();
75  Int_t Make();
76  Int_t Finish();
77  void Clear( Option_t *opt = "" );
78 
79  // modifiers
80  void setDisc( Short_t discId );
81  void setQuad( Short_t quadId );
82  void setQuadName( const Char_t* quadName );
83  void setXbins( Int_t nbins );
84  void setXrange( Float_t low, Float_t high );
85  void setBinFactors( Int_t factorX );
86  void setFilenameBase( const Char_t* filenameBase );
87  void setFilenameKey( const Char_t* filenameKey );
88  void setPath( const Char_t* path );
89  void setRand( Float_t rndm=1 );
90 
91  // accessor
92  TH1F* getHistX(int,int);
93  TH1F* getHistY(int,int);
94  TH1F* getHist1Dcluster(int);
95  TH1F* getHist1Dclusters();
96  TH2F* getHistTracks();
97  TH2F* getHistRealTracks();
98  TProfile2D* getProfileEfficiency();
99  TH2F* getHist2Dcluster();
100  TProfile2D* getProfileChi2();
101  TProfile* getProfileX();
102  TProfile* getProfileY();
103 
104  protected:
105  // for accessing the data
106  std::string mFgtTrackMakerName;
107  StFgtCosmicTrackVec* mTrackVecPtr;
108 
109  // for knowing what & how to plot
110  Short_t mDiscId, mQuadId;
111  Int_t mXbins;
112  Float_t mXmin, mXmax;
113  Int_t mBinFactorX;
114 
115  // for labeling the plot
116  std::string mQuadName;
117 
118  // for saving the plot
119  std::string mPath, mFileNameBase, mFileNameKey;
120 
121  // the plots
122  TH1F *mHistX[4][4]; // 1D deltaX histograms
123  TH1F *mHistY[4][4]; // 1D deltaY histograms
124  TH1F *mHist1Dcluster[2]; // 1D cluster energy histograms for r & phi
125  TH1F *mHist1Dclusters; // 1D cluster energy histograms
126  TH2F *mHistTracks; // reconstructed tracks on middle quad
127  TH2F *mHistRealTracks; // reconstructed registered tracks on mid quad
128  TH2F *mHist2Dpoint; // for calculating efficiency
129  TProfile2D *mProfileEfficiency; // efficiency plots
130  TH2F *mHist2Dcluster; // cluster points hist of isTrack=True tracks
131  TProfile2D *mProfileChi2; // chi2 profile on middle quad
132  TProfile *mProfileX;
133  TProfile *mProfileY;
134 
135  private:
136 
137  ClassDef(StFgtCosmicTrackPlots,1);
138 };
139 
140 // inline functions
141 
142 // modifiers
143 inline void StFgtCosmicTrackPlots::setDisc( Short_t discId ){ mDiscId = discId; };
144 inline void StFgtCosmicTrackPlots::setQuad( Short_t quadId ){ mQuadId = quadId; };
145 inline void StFgtCosmicTrackPlots::setQuadName( const Char_t* quadName ){ mQuadName = quadName; };
146 inline void StFgtCosmicTrackPlots::setXbins( Int_t nbins ){ mXbins = nbins; };
147 inline void StFgtCosmicTrackPlots::setXrange( Float_t low, Float_t high ){ mXmin = low; mXmax = high; };
148 inline void StFgtCosmicTrackPlots::setBinFactors( Int_t factorX ){
149  mBinFactorX = factorX;
150 };
151 inline void StFgtCosmicTrackPlots::setFilenameBase( const Char_t* filenameBase ){ mFileNameBase = filenameBase; };
152 inline void StFgtCosmicTrackPlots::setFilenameKey( const Char_t* filenameKey ){ mFileNameKey = filenameKey; };
153 inline void StFgtCosmicTrackPlots::setPath( const Char_t* path ){ mPath = path; };
154 
155 // accessor
156 inline TH1F* StFgtCosmicTrackPlots::getHistX(int i, int j){
157  return mHistX[i][j];
158 };
159 inline TH1F* StFgtCosmicTrackPlots::getHistY(int i, int j){
160  return mHistY[i][j];
161 };
162 inline TH1F* StFgtCosmicTrackPlots::getHist1Dcluster( int i ){
163  return mHist1Dcluster[i];
164 };
165 inline TH1F* StFgtCosmicTrackPlots::getHist1Dclusters(){
166  return mHist1Dclusters;
167 };
168 inline TH2F* StFgtCosmicTrackPlots::getHistTracks(){
169  return mHistTracks;
170 };
171 inline TH2F* StFgtCosmicTrackPlots::getHistRealTracks(){
172  return mHistRealTracks;
173 };
174 inline TProfile2D* StFgtCosmicTrackPlots::getProfileEfficiency(){
175  return mProfileEfficiency;
176 };
177 inline TH2F* StFgtCosmicTrackPlots::getHist2Dcluster(){
178  return mHist2Dcluster;
179 };
180 inline TProfile2D* StFgtCosmicTrackPlots::getProfileChi2(){
181  return mProfileChi2;
182 };
183 inline TProfile* StFgtCosmicTrackPlots::getProfileX(){
184  return mProfileX;
185 };
186 inline TProfile* StFgtCosmicTrackPlots::getProfileY(){
187  return mProfileY;
188 };
189 
190 #endif
void Clear(Option_t *opt="")
User defined functions.