| 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 |  | 
|---|
| 40 | class Pixel | 
|---|
| 41 | { | 
|---|
| 42 | public: | 
|---|
| 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 | 
|---|
| 98 | protected: | 
|---|
| 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 |  | 
|---|
| 133 | public: | 
|---|
| 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 |  | 
|---|
| 155 | protected: | 
|---|
| 156 | void LoadPulseHistos( ); | 
|---|
| 157 |  | 
|---|
| 158 | public: | 
|---|
| 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 | // ACCESS | 
|---|
| 179 | // INQUIRY | 
|---|
| 180 | int             mChid; | 
|---|
| 181 | bool            mStats; | 
|---|
| 182 | int             mMaxPulseOrder; | 
|---|
| 183 | int             mVerbosityLevel; | 
|---|
| 184 | int             mPixelOverlayXaxisLeft; | 
|---|
| 185 | int             mPixelOverlayXaxisRight; | 
|---|
| 186 | float           mBSLMean; | 
|---|
| 187 | float           mGainMean; | 
|---|
| 188 | TString         mOptions; | 
|---|
| 189 |  | 
|---|
| 190 | //Pixel Histos | 
|---|
| 191 | TH2F**          hMaxOverlay;      //histogrammm for overlay of detected Peaks | 
|---|
| 192 | TH2F**          hEdgeOverlay; | 
|---|
| 193 | TProfile**      hMaxProfile;      //histogrammm for Profile of detected Peaks | 
|---|
| 194 | TProfile**      hEdgeProfile;  //histogrammm for Profile of detected Peaks | 
|---|
| 195 |  | 
|---|
| 196 | //Distribution Histos | 
|---|
| 197 | TH1F**          hSlopeRisingEdge; | 
|---|
| 198 | TH1I**          hRisingEdgeToMax; | 
|---|
| 199 | TH1I**          hPosOfMax; | 
|---|
| 200 | TH1F**          hChi2EdgetoMax; | 
|---|
| 201 |  | 
|---|
| 202 | //Max Overlay Template Histos | 
|---|
| 203 | TH1F**          hPixelMax; | 
|---|
| 204 | TH1F**          hPixelMedian; | 
|---|
| 205 | TH1F**          hPixelMean; | 
|---|
| 206 | //Edge OverlayTemplate Histos | 
|---|
| 207 | TH1F**          hPixelEdgeMax; | 
|---|
| 208 | TH1F**          hPixelEdgeMedian; | 
|---|
| 209 | TH1F**          hPixelEdgeMean; | 
|---|
| 210 |  | 
|---|
| 211 | TList*      hList; | 
|---|
| 212 |  | 
|---|
| 213 | TFile*          mRootFile; | 
|---|
| 214 | TFile*          mOutRootFile; | 
|---|
| 215 | TDirectory*     mDirectory; | 
|---|
| 216 |  | 
|---|
| 217 | protected: | 
|---|
| 218 | int             mConstructorType; //0 delete distributions, 1 delete TemplateHistos | 
|---|
| 219 | private: | 
|---|
| 220 | }; | 
|---|
| 221 |  | 
|---|
| 222 |  | 
|---|
| 223 |  | 
|---|
| 224 | #endif  // _PIXEL_H_ | 
|---|