GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RawAmpWatcher.h
Go to the documentation of this file.
1 #ifndef RAWAMPWATCHER_H
2 #define RAWAMPWATCHER_H
3 
4 #include "TCanvas.h"
5 #include "TSpectrum.h"
6 #include "TTree.h"
7 
8 #include "RecalEnergy.h"
9 #include "FitFunctions.h"
10 
11 #include "SpectraViewerWatcher.h"
12 
13 class BashColor;
14 
16 {
17 public:
18 
19  double TabArea[38];
20  double TabOffset[38];
21  double TabGain[38];
22  double TabMean[38];
23  double TabE[38];
24  double TabFWHM[38];
25  double TabFWHM_10[38];
26  double TabLTProp[38];
27  double TabRTProp[38];
28 
29  TCanvas *fCanvas;
30 
31  double fWidth;
32  double fThreshold;
33  double fxmin;
34  double fxmax;
35 
36  RawAmpWatcher(const char* name, const char *title);
37  virtual ~RawAmpWatcher(){}
38 
39  virtual void Exec(const char *option);
40 
41  virtual void ShowSpectra(int LibraryNumber=1, const char *DrawOpt=""); //*MENU*
42  virtual void ShowHist(int HistNumber, int LibraryNumber = 1, bool same = false); //*MENU*
43 
44  void FitAllRoot(const char *FitType = "Dino", const char *source = "60Co");
45 
46  void FitSelectedRoot(const char *FitType = "Dino", const char *source = "60Co", bool all=false);
47 
48  bool fUseOffset;
49  void UseOffset(bool offset = false){fUseOffset = offset;}
50 
51  void SearchPeak(int NPeaks=2, double width=50, double threshold=0.1, double xmin=0., double xmax=30000.);
56  bool fSmoothing;
58  bool fCompton;
59 
60  double fFirstLibGain;
61 
62  void SetFirstLibGain(double gain){fFirstLibGain = gain;}
63 
64  void SetPersoBackground(int NumberIterations = 100, int Direction = TSpectrum::kBackDecreasingWindow,int FilterOrder = TSpectrum::kBackOrder8,bool Smoothing = true,int smoothingWindow = TSpectrum::kBackSmoothing3,bool Compton = false);
65 
66 
68 public:
70  Int_t fLasteventX;
71  Int_t fLasteventY;
72 
73  void HandleMovement(Int_t eventType, Int_t eventX, Int_t eventY, TObject *select);
74 
76 
77 public:
78 
80  ofstream fFileOutGWRecal;
81 
83 
85 
87 
89 
90  void PrintHelp(); //*MENU={Hierarchy="GWRecal/PrintHelp"}*
91 
94  void FitAllRecal(); //*MENU={Hierarchy="GWRecal/1) Calibrate/A) FitAll"}*
96  void FitSelectedRecal(bool PrintHeader=true); //*MENU={Hierarchy="GWRecal/1) Calibrate/B) FitSelected"}*
98  void SpecificFit(int NbrOfSpectra=38, int FirstHist=0, int Step=1); //*MENU={Hierarchy="GWRecal/1) Calibrate/C) SpecificFit"}*
99 
103  void SetChannelOffset(int Off){fGWRecal->SetChannelOffset(Off);} //*MENU={Hierarchy="GWRecal/2) Configure/A) Channel/a) SetChannelOffset"}*
105  void SetGlobalChannelLimits(int ChFrom=50, int ChTo=32768); //*MENU={Hierarchy="GWRecal/2) Configure/A) Channel/b) SetGlobalChannelLimits"}*
107  void SetHistChannelLimits(int SpecNbr=0, int lib=1, int ChFrom=50, int ChTo=32768); //*MENU={Hierarchy="GWRecal/2) Configure/A) Channel/c) SetHistChannelLimits"}*
108  void SetSelectedHistChannelLimits(int ChFrom=50, int ChTo=32768);
109 
110 
111 
114  void SetSource(const char * SourcesNames); //*MENU={Hierarchy="GWRecal/2) Configure/B) TheoreticalPeaks/a) SetSource"}*
116  void AddPeak(double EPeak){fGWRecal->AddPeak(EPeak);} //*MENU={Hierarchy="GWRecal/2) Configure/B) TheoreticalPeaks/b) AddPeak"}*
118  void RemoveClosestPeakTo(double EPeak){fGWRecal->RemoveClosestPeakTo(EPeak);} //*MENU={Hierarchy="GWRecal/2) Configure/B) TheoreticalPeaks/c) RemoveClosestPeakTo"}*
120  void SetRefPeak(double EPeak){fGWRecal->SetRefPeak(EPeak);} //*MENU={Hierarchy="GWRecal/2) Configure/B) TheoreticalPeaks/d) SetRefPeak"}*
121 
122 
125  void SetGlobalPeaksLimits(float DefFWHM=15, float DefAmpli=5); //*MENU={Hierarchy="GWRecal/2) Configure/C) PeakSearch/a) SetGlobalPeaksLimits"}*
127  void SetHistPeaksLimits(int SpecNbr=0, int lib=1, float FWHM=15, float Ampli=5);//*MENU={Hierarchy="GWRecal/2) Configure/C) PeakSearch/b) SetHistPeaksLimits"}*
128  void SetSelectedHistPeaksLimits(float FWHM=15, float Ampli=5);
130  void UseFirstDerivativeSearch(){fGWRecal->UseFirstDerivativeSearch();} //*MENU={Hierarchy="GWRecal/2) Configure/C) PeakSearch/c) UseFirstDerivativeSearch"}*
132  void UseSecondDerivativeSearch(){fGWRecal->UseSecondDerivativeSearch();} //*MENU={Hierarchy="GWRecal/2) Configure/C) PeakSearch/d) UseSecondDerivativeSearch"}*
133 
136  void UseFlatBackGround(){fGWRecal->UseFlatBackGround();} //*MENU={Hierarchy="GWRecal/2) Configure/D) BackGround/a) UseFlatBackGround"}*
138  void UseAffineBackGround(){fGWRecal->UseAffineBackGround();} //*MENU={Hierarchy="GWRecal/2) Configure/D) BackGround/b) UseAffineBackGround"}*
140  void NoBackGround(){fGWRecal->NoBackGround();} //*MENU={Hierarchy="GWRecal/2) Configure/D) BackGround/c) NoBackGround"}*
141 
144  void UnsetLeftTail(){fGWRecal->UnsetLeftTail();} //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/a) UnsetLeftTail"}*
146  void UnsetRightTail(){fGWRecal->UnsetRightTail();} //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/b) UnsetRightTail"}*
148  void UseLinearCalib(){fGWRecal->UseLinearCalib();} //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/c) UseLinearCalib"}*
150  void UseAffineCalib(){fGWRecal->UseAffineCalib();} //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/d) UseAffineCalib"}*
152  void UseParabolicCalib(){fGWRecal->UseParabolicCalib();} //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/e) UseParabolicCalib"}*
154  void SetGain(float Gain); //*MENU={Hierarchy="GWRecal/2) Configure/E) FitOptions/f) SetGain"}*
155 
158  void PrintResForXTalk(int VerboseMod=0){fGWRecal->PrintResForXTalk(VerboseMod);} //*MENU={Hierarchy="GWRecal/3) VerboseOptions/A) PrintResForXTalk"}*
160  void SetVerbosityLevel(int Verb=0){fGWRecal->SetVerbosityLevel(Verb);} //*MENU={Hierarchy="GWRecal/3) VerboseOptions/B) SetVerbosityLevel"}*
162  void SetFullVerbosity(){fGWRecal->SetFullVerbosity();} //*MENU={Hierarchy="GWRecal/3) VerboseOptions/C) SetFullVerbosity"}*
163 
165 
166 
167 
168 public:
170  int InitTree();
171 
173  void GetPlotParams(const char *varexp = "FW05:spec", const char *selection="", const char* option="");
174  void PlotCalibResultsAsTreeLaucher(); //*MENU={Hierarchy="GWRecal/4) PlotResults/A) PlotCalibResults"}*
175  void PrintPlotHelp(); //*MENU={Hierarchy="GWRecal/4) PlotResults/B) PrintPlotHelp"}*
176  void PlotCalibResultsAsTree(int LibNbr);
177 
178  virtual void WriteCalibFiles(const char* ConfDirectory = ""); //*MENU={Hierarchy="WriteCalibFiles"}*
179 
180  ClassDef(RawAmpWatcher,1)
181 };
182 
183 #endif
void UseFlatBackGround()
Definition: RecalEnergy.h:121
GWRecal * fGWRecal
Recal Part.
Definition: RawAmpWatcher.h:79
void FitSelectedRecal(bool PrintHeader=true)
B) FitSelected.
void NoBackGround()
Definition: RecalEnergy.h:123
ofstream fFileOutGWRecal
Definition: RawAmpWatcher.h:80
void UseAffineCalib()
Definition: RecalEnergy.h:131
void SetVerbosityLevel(int Verb=0)
A) SetVerbosityLevel.
void UseFirstDerivativeSearch()
Definition: RecalEnergy.h:125
void SetRefPeak(double EPeak)
Definition: RecalEnergy.h:116
TCanvas * fCanvas
Definition: RawAmpWatcher.h:29
void AddPeak(double EPeak)
Definition: RecalEnergy.h:114
TString PlotVarSel
void NoBackGround()
c) NoBackGround
virtual void WriteCalibFiles(const char *ConfDirectory="")
******************************************************************************************/// ...
void SetVerbosityLevel(int Verb)
Definition: RecalEnergy.h:136
double TabRTProp[38]
Definition: RawAmpWatcher.h:27
virtual void Exec(const char *option)
******************************************************************************************/// ...
double fFirstLibGain
Definition: RawAmpWatcher.h:60
void SetGain(float Gain)
f) UseFlatBackGround
double TabE[38]
Definition: RawAmpWatcher.h:23
void SetFirstLibGain(double gain)
Definition: RawAmpWatcher.h:62
void SetSelectedHistChannelLimits(int ChFrom=50, int ChTo=32768)
******************************************************************************************/// ...
double TabLTProp[38]
Definition: RawAmpWatcher.h:26
int InitTree()
******************************************************************************************/// ...
void UseParabolicCalib()
e) UseFlatBackGround
FitFunctions * fFitFunction
Definition: RawAmpWatcher.h:82
virtual ~RawAmpWatcher()
Definition: RawAmpWatcher.h:37
TString PlotVarExp
void SetGlobalChannelLimits(int ChFrom=50, int ChTo=32768)
b) SetChannelLimits
void UseFirstDerivativeSearch()
c) UseFirstDerivativeSearch
void UnsetRightTail()
Definition: RecalEnergy.h:129
void SetSelectedHistPeaksLimits(float FWHM=15, float Ampli=5)
******************************************************************************************/// ...
void AddPeak(double EPeak)
b) AddPeak
double TabFWHM_10[38]
Definition: RawAmpWatcher.h:25
double TabMean[38]
Definition: RawAmpWatcher.h:22
double TabGain[38]
Definition: RawAmpWatcher.h:21
void FitSelectedRoot(const char *FitType="Dino", const char *source="60Co", bool all=false)
******************************************************************************************/// ...
void SearchPeak(int NPeaks=2, double width=50, double threshold=0.1, double xmin=0., double xmax=30000.)
******************************************************************************************/// ...
double fThreshold
Definition: RawAmpWatcher.h:32
void SetFullVerbosity()
Definition: RecalEnergy.h:137
void UseOffset(bool offset=false)
Definition: RawAmpWatcher.h:49
TH1 * fCurrentHist
Definition: RawAmpWatcher.h:84
void RemoveClosestPeakTo(double EPeak)
c) RemoveClosestPeakTo
void PrintPlotHelp()
******************************************************************************************/// ...
void UnsetLeftTail()
E) FitOptions.
virtual void ShowSpectra(int LibraryNumber=1, const char *DrawOpt="")
******************************************************************************************/// ...
void SetPersoBackground(int NumberIterations=100, int Direction=TSpectrum::kBackDecreasingWindow, int FilterOrder=TSpectrum::kBackOrder8, bool Smoothing=true, int smoothingWindow=TSpectrum::kBackSmoothing3, bool Compton=false)
******************************************************************************************/// ...
void RemoveClosestPeakTo(double EPeak)
Definition: RecalEnergy.h:115
void UseSecondDerivativeSearch()
Definition: RecalEnergy.h:126
void SetChannelOffset(int Off)
Definition: RecalEnergy.h:106
void UseFlatBackGround()
D) BackGround.
void SetFileName(TString FileName)
Definition: RecalEnergy.h:97
double TabOffset[38]
Definition: RawAmpWatcher.h:20
void StartCalib()
******************************************************************************************/// ...
Definition: RecalEnergy.cpp:94
void SetGlobalPeaksLimits(float DefFWHM=15, float DefAmpli=5)
C) PeakSearch.
void UnsetLeftTail()
Definition: RecalEnergy.h:128
void GetPlotParams(const char *varexp="FW05:spec", const char *selection="", const char *option="")
******************************************************************************************/// ...
void PrintResForXTalk(int VerboseMod)
Definition: RecalEnergy.h:135
bool fDefinePersoBackground
Definition: RawAmpWatcher.h:52
void PrintResForXTalk(int VerboseMod=0)
3) VerboseOptions
void SetRefPeak(double EPeak)
d) SetRefPeak
void SetSource(const char *SourcesNames)
B) TheoreticalPeaks.
void HandleMovement(Int_t eventType, Int_t eventX, Int_t eventY, TObject *select)
******************************************************************************************/// ...
Int_t fLasteventType
HandleMovement part.
Definition: RawAmpWatcher.h:69
TString PlotVarOpt
void FitAllRoot(const char *FitType="Dino", const char *source="60Co")
******************************************************************************************/// ...
void UnsetRightTail()
b) UseFlatBackGround
int GetCurrentHistAndLib()
******************************************************************************************/// ...
void SetFullVerbosity()
A) SetFullVerbosity.
void UseParabolicCalib()
Definition: RecalEnergy.h:132
virtual void ShowHist(int HistNumber, int LibraryNumber=1, bool same=false)
******************************************************************************************/// ...
void SpecificFit(int NbrOfSpectra=38, int FirstHist=0, int Step=1)
C) SpecificFit.
void UseLinearCalib()
Definition: RecalEnergy.h:130
void PlotCalibResultsAsTreeLaucher()
******************************************************************************************/// ...
void PlotCalibResultsAsTree(int LibNbr)
******************************************************************************************/// ...
void UseAffineBackGround()
b) UseAffineBackGround
RawAmpWatcher(const char *name, const char *title)
*/
double TabArea[38]
Definition: RawAmpWatcher.h:19
void UseSecondDerivativeSearch()
d) UseSecondDerivativeSearch
void UseLinearCalib()
c) UseFlatBackGround
void FitAllRecal()
1) Calibration
TTree * fCalibResultsTree
void UseAffineBackGround()
Definition: RecalEnergy.h:122
void SetHistPeaksLimits(int SpecNbr=0, int lib=1, float FWHM=15, float Ampli=5)
b) SetHistPeaksLimits
void SetChannelOffset(int Off)
2) Configure
void UseAffineCalib()
d) UseFlatBackGround
void SetHistChannelLimits(int SpecNbr=0, int lib=1, int ChFrom=50, int ChTo=32768)
c) SetChannelLimits
double TabFWHM[38]
Definition: RawAmpWatcher.h:24