| 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 |
|
|---|
| 41 | class Pixel
|
|---|
| 42 | {
|
|---|
| 43 | public:
|
|---|
| 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
|
|---|
| 99 | protected:
|
|---|
| 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 Manipulation
|
|---|
| 112 | void SetRangeUser(float xMin, float xMax, int order);
|
|---|
| 113 |
|
|---|
| 114 | void NormalizeSamplesTH2F(TH2F *histo);
|
|---|
| 115 | void Normalize2Dhistos(int order);
|
|---|
| 116 | //Histogram appeareance
|
|---|
| 117 | void
|
|---|
| 118 | MakeTH1Pretty(
|
|---|
| 119 | TH1* histo,
|
|---|
| 120 | TString histName,
|
|---|
| 121 | TString histTitle,
|
|---|
| 122 | int order
|
|---|
| 123 | );
|
|---|
| 124 | void
|
|---|
| 125 | MakeTH2Pretty(
|
|---|
| 126 | TH2* histo,
|
|---|
| 127 | TString histName,
|
|---|
| 128 | TString histTitle,
|
|---|
| 129 | int order
|
|---|
| 130 | );
|
|---|
| 131 | void
|
|---|
| 132 | MakeTProfilePretty(
|
|---|
| 133 | TProfile* histo,
|
|---|
| 134 | TString histName,
|
|---|
| 135 | TString histTitle,
|
|---|
| 136 | int order
|
|---|
| 137 | );
|
|---|
| 138 |
|
|---|
| 139 | public:
|
|---|
| 140 | //Histogram Drawing
|
|---|
| 141 | void DrawOverlayHistograms(
|
|---|
| 142 | TCanvas **pixelCanvas, //Array of Canvases
|
|---|
| 143 | int *histoFrameNR //Array with Canvas Frame numbers
|
|---|
| 144 | );
|
|---|
| 145 | void DrawDistributionHistograms(
|
|---|
| 146 | TCanvas **pixelCanvas, //Array of Canvases
|
|---|
| 147 | int *histoFrameNr //Array with Canvas Frame numbers
|
|---|
| 148 | );
|
|---|
| 149 | void DrawTemplateHistograms(
|
|---|
| 150 | TCanvas **pixelCanvas, //Array of Canvases
|
|---|
| 151 | int *histoFrameNr //Array with Canvas Frame numbers
|
|---|
| 152 | );
|
|---|
| 153 | void DrawEdgeTemplateHistograms(
|
|---|
| 154 | TCanvas **pixelCanvas, //Array of Canvases
|
|---|
| 155 | int *histoFrameNr //Array with Canvas Frame numbers
|
|---|
| 156 | );
|
|---|
| 157 |
|
|---|
| 158 | //File Handling
|
|---|
| 159 | void SavePixelHistograms( TString loc_fname, bool);
|
|---|
| 160 |
|
|---|
| 161 | protected:
|
|---|
| 162 | void LoadPulseHistos( );
|
|---|
| 163 |
|
|---|
| 164 | public:
|
|---|
| 165 | //File Handling Service Functions
|
|---|
| 166 | TString HistoTitle(TString, int );
|
|---|
| 167 | TString HistoName(TString, int);
|
|---|
| 168 | TString ChooseCycleNumber(TString , int);
|
|---|
| 169 | virtual TString CsvFileName(TString, TString, int );
|
|---|
| 170 |
|
|---|
| 171 | //fit funcitons
|
|---|
| 172 | // void FitFallingEdge(
|
|---|
| 173 | // TString histoType, //Max or Edge
|
|---|
| 174 | // double ,
|
|---|
| 175 | // double ,
|
|---|
| 176 | // TH1F* hMaximumTemp
|
|---|
| 177 | // );
|
|---|
| 178 |
|
|---|
| 179 | // double
|
|---|
| 180 | // PolExp(double* x, double* par);
|
|---|
| 181 |
|
|---|
| 182 | //shifting
|
|---|
| 183 | void ShiftHistoInY(TH1*, float);
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 | // ACCESS
|
|---|
| 189 | // INQUIRY
|
|---|
| 190 | int mChid;
|
|---|
| 191 | bool mStats;
|
|---|
| 192 | int mMaxPulseOrder;
|
|---|
| 193 | int mVerbosityLevel;
|
|---|
| 194 | int mPixelOverlayXaxisLeft;
|
|---|
| 195 | int mPixelOverlayXaxisRight;
|
|---|
| 196 | float mBSLMean;
|
|---|
| 197 | float mGainMean;
|
|---|
| 198 | int mMarkerStyle;
|
|---|
| 199 | TString mOptions;
|
|---|
| 200 |
|
|---|
| 201 | //Pixel Histos
|
|---|
| 202 | TH2F** hMaxOverlay; //histogrammm for overlay of detected Peaks
|
|---|
| 203 | TH2F** hEdgeOverlay;
|
|---|
| 204 | TProfile** hMaxProfile; //histogrammm for Profile of detected Peaks
|
|---|
| 205 | TProfile** hEdgeProfile; //histogrammm for Profile of detected Peaks
|
|---|
| 206 |
|
|---|
| 207 | //Distribution Histos
|
|---|
| 208 | TH1F** hSlopeRisingEdge;
|
|---|
| 209 | TH1I** hRisingEdgeToMax;
|
|---|
| 210 | TH1I** hPosOfMax;
|
|---|
| 211 | TH1F** hChi2EdgetoMax;
|
|---|
| 212 | TH1F* hMaxPos;
|
|---|
| 213 | TH1F* hEdgePos;
|
|---|
| 214 | TH1F* hEdgeSlope;
|
|---|
| 215 | TH1F* hMaxEdgeSlope;
|
|---|
| 216 | TH1F* hIntercept;
|
|---|
| 217 | TH1F* hEdgeLength;
|
|---|
| 218 | TH1F* hPulseLength;
|
|---|
| 219 | TH1F* hPulseLengthAPcutoff;
|
|---|
| 220 | TH1F* hPulseLengthTLcutoff;
|
|---|
| 221 | TH1F* hMaxAmpl;
|
|---|
| 222 | TProfile* hDiscartedPulses;
|
|---|
| 223 | TH2F* hAfterPulses;
|
|---|
| 224 |
|
|---|
| 225 | //Max Overlay Template Histos
|
|---|
| 226 | TH1F** hPixelMax;
|
|---|
| 227 | TH1F** hPixelMedian;
|
|---|
| 228 | TH1F** hPixelMean;
|
|---|
| 229 | //Edge OverlayTemplate Histos
|
|---|
| 230 | TH1F** hPixelEdgeMax;
|
|---|
| 231 | TH1F** hPixelEdgeMedian;
|
|---|
| 232 | TH1F** hPixelEdgeMean;
|
|---|
| 233 |
|
|---|
| 234 | //Lists
|
|---|
| 235 | TList* hList;
|
|---|
| 236 | TList* hMemberlist;
|
|---|
| 237 |
|
|---|
| 238 | TFile* mRootFile;
|
|---|
| 239 | TFile* mOutRootFile;
|
|---|
| 240 | TDirectory* mDirectory;
|
|---|
| 241 |
|
|---|
| 242 | protected:
|
|---|
| 243 | int mConstructorType; //0 delete distributions, 1 delete TemplateHistos
|
|---|
| 244 | private:
|
|---|
| 245 | };
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
|
|---|
| 249 | #endif // _PIXEL_H_
|
|---|