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

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