source: fact/tools/rootmacros/PulseTemplates/pixel.h@ 14813

Last change on this file since 14813 was 14813, checked in by Jens Buss, 12 years ago
whitespace
File size: 5.4 KB
Line 
1/** container with all attributes and histograms of a pixel.
2 *
3 * #include "XX.h" <BR>
4 * -llib
5 *
6 * A longer description.
7 *
8 * @see something
9 */
10
11#ifndef PIXEL_H
12#define PIXEL_H
13
14// SYSTEM INCLUDES
15//
16
17// PROJECT INCLUDES
18#include <TROOT.h>
19#include <TProfile.h>
20#include <TH2F.h>
21#include <TH1I.h>
22#include <TH1F.h>
23#include <TString.h>
24#include <TFile.h>
25
26#include "TCanvas.h"
27#include "TObjArray.h"
28//
29
30//#include "rootfilehandler.h"
31//#include "rootfilehandler.C"
32
33// LOCAL INCLUDES
34//
35
36// FORWARD REFERENCES
37//
38
39
40class Pixel
41{
42public:
43// LIFECYCLE
44
45 /** Default constructor.
46 */
47 Pixel(
48 int pixelID,
49 int maxPulsorder,
50 int verbosityLevel,
51 bool stats,
52 TString options,
53 int pixelOverlayXaxisLeft,
54 int pixelOverlayXaxisRight,
55 float bSLMean,
56 float gainMean,
57 TFile* filename,
58 TFile* outfilename
59 );
60
61 Pixel(
62 int pixelID,
63 int maxPulsorder,
64 int verbosityLevel,
65 bool stats,
66 TString options,
67 int pixelOverlayXaxisLeft,
68 int pixelOverlayXaxisRight,
69 float bSLMean,
70 float gainMean
71 );
72
73
74 // /** Copy constructor.
75 // *
76 // * @param from The value to copy to this object.
77 // */
78
79
80 /** Destructor.
81 */
82 ~Pixel();
83
84
85// OPERATORS
86
87// /** Assignment operator.
88// *
89// * @param from THe value to assign to this object.
90// *
91// * @return A reference to this object.
92// */
93// XX& operator=(const XX& from);
94
95// OPERATIONS
96
97 //Histogram Booking
98protected:
99 void BookPixelHistos();
100 void BookDistributionHistos();
101 void BookTemplateHistos();
102 void BookEdgeTemplateHistos();
103
104 //Histogram deletion
105 void DeletePixelHistos();
106 void DeleteDistributionHistos();
107 void DeleteTemplateHistos();
108 void DeleteEdgeTemplateHistos();
109
110 //Histogram appeareance
111 void
112 MakeTH1Pretty(
113 TH1* histo,
114 TString histName,
115 TString histTitle,
116 int order
117 );
118 void
119 MakeTH2Pretty(
120 TH2* histo,
121 TString histName,
122 TString histTitle,
123 int order
124 );
125 void
126 MakeTProfilePretty(
127 TProfile* histo,
128 TString histName,
129 TString histTitle,
130 int order
131 );
132
133public:
134 //Histogram Drawing
135 void DrawOverlayHistograms(
136 TCanvas **pixelCanvas, //Array of Canvases
137 int *histoFrameNR //Array with Canvas Frame numbers
138 );
139 void DrawDistributionHistograms(
140 TCanvas **pixelCanvas, //Array of Canvases
141 int *histoFrameNr //Array with Canvas Frame numbers
142 );
143 void DrawTemplateHistograms(
144 TCanvas **pixelCanvas, //Array of Canvases
145 int *histoFrameNr //Array with Canvas Frame numbers
146 );
147 void DrawEdgeTemplateHistograms(
148 TCanvas **pixelCanvas, //Array of Canvases
149 int *histoFrameNr //Array with Canvas Frame numbers
150 );
151
152 //File Handling
153 void SavePixelHistograms( TString loc_fname, bool);
154
155protected:
156 void LoadPulseHistos( );
157
158public:
159 //File Handling Service Functions
160 TString HistoTitle(TString, int );
161 TString HistoName(TString, int);
162 TString ChooseCycleNumber(TString , int);
163 virtual TString CsvFileName(TString, TString, int );
164
165 //fit funcitons
166// void FitFallingEdge(
167// TString histoType, //Max or Edge
168// double ,
169// double ,
170// TH1F* hMaximumTemp
171// );
172
173// double
174// PolExp(double* x, double* par);
175
176 //shifting
177 void ShiftHistoInY(TH1*, float);
178
179
180
181
182// ACCESS
183// INQUIRY
184 int mChid;
185 bool mStats;
186 int mMaxPulseOrder;
187 int mVerbosityLevel;
188 int mPixelOverlayXaxisLeft;
189 int mPixelOverlayXaxisRight;
190 float mBSLMean;
191 float mGainMean;
192 int mMarkerStyle;
193 TString mOptions;
194
195 //Pixel Histos
196 TH2F** hMaxOverlay; //histogrammm for overlay of detected Peaks
197 TH2F** hEdgeOverlay;
198 TProfile** hMaxProfile; //histogrammm for Profile of detected Peaks
199 TProfile** hEdgeProfile; //histogrammm for Profile of detected Peaks
200
201 //Distribution Histos
202 TH1F** hSlopeRisingEdge;
203 TH1I** hRisingEdgeToMax;
204 TH1I** hPosOfMax;
205 TH1F** hChi2EdgetoMax;
206
207 //Max Overlay Template Histos
208 TH1F** hPixelMax;
209 TH1F** hPixelMedian;
210 TH1F** hPixelMean;
211 //Edge OverlayTemplate Histos
212 TH1F** hPixelEdgeMax;
213 TH1F** hPixelEdgeMedian;
214 TH1F** hPixelEdgeMean;
215
216 TList* hList;
217
218 TFile* mRootFile;
219 TFile* mOutRootFile;
220 TDirectory* mDirectory;
221
222protected:
223 int mConstructorType; //0 delete distributions, 1 delete TemplateHistos
224private:
225};
226
227
228
229#endif // _PIXEL_H_
Note: See TracBrowser for help on using the repository browser.