GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SpectraViewerWatcher.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 #include <fstream>
4 #include <sstream>
5 #include <vector>
6 #include <string>
7 #include <map>
8 
9 #include "TString.h"
10 #include "TObjArray.h"
11 #include "BashColor.h"
12 
13 #include "SpectraViewerWatcher.h"
14 
15 using namespace std;
16 
20 
21 SpectraViewerWatcher::SpectraViewerWatcher(const char* name, const char *title) :
22  TTask(name,title),
23  CanvasVisu(name,title),
24  fLibNumber(0),
25  fFileName(""),
26  fRunName("")
27 {
28 
29 }
30 
32 
34 {
35 
36 }
37 
39 
41 {
42  fFileName = name;
43 
44  TObjArray *TokenArray = name.Tokenize("/");
45  TObject *a_token = 0x0;
46  TIter iter(TokenArray);
47 
48  while ( (a_token = iter()) )
49  {
50  TString TokenName = a_token->GetName();
51  if(TokenName.BeginsWith("run_",TString::kIgnoreCase)) fRunName = TokenName;
52  }
53 
54  if(fRunName == "") fRunName = "CurrentRun";
55 }
56 
58 
60 {
62  cout<<endl;
63  cout<<" _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "<<endl;
64  cout<<"|*******************************************************************************************************************************************************************|"<<endl;
65  cout<<"|**| |**|"<<endl;
66  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
67  cout<<"|**|----------------------------------------------------------- Help on the PropagateTask method ------------------------------------------------------------|**|"<<endl;
68  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
69  cout<<"|**| |**|"<<endl;
70  cout<<"|**| ==> The PropagateTask method is used to propagate instructions in all sub-tasks as showing spectra, calibrating segments or plotting fit results. |**|"<<endl;
71  cout<<"|**| ==> Different instructions (InstructionType + Options) can be send at the same time, separated by \";\" |**|"<<endl;
72  cout<<"|**| |**|"<<endl;
73  cout<<"|**| ==> The last instruction is used to select the concerned crystals |**|"<<endl;
74  cout<<"|**| --> To treat the whole array, the command \"all\" must be added, |**|"<<endl;
75  cout<<"|**| --> To treat only several crystals, crystal names must be entered (ex: 03A 04B 12C) |**|"<<endl;
76  cout<<"|**| --> To unselect several crystals, crystal names must be entered preceded by \"!\" (ex: all !03B) |**|"<<endl;
77  cout<<"|**| |**|"<<endl;
78  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
79  cout<<"|**|---------------------------------------------------------------- Drawing multipad spectra ----------------------------------------------------------------|**|"<<endl;
80  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
81  cout<<"|**| |**|"<<endl;
82  cout<<"|**| ==> To draw multipad spectra : InstructionType=\"ShowSpectra\" |**|"<<endl;
83  cout<<"|**| --> Options : Lib=LibNbr ................................... Library number (default Lib=1) |**|"<<endl;
84  cout<<"|**| |**|"<<endl;
85  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
86  cout<<"|**|-------------------------------------------------------- Crystal calibration using the Recal code --------------------------------------------------------|**|"<<endl;
87  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
88  cout<<"|**| |**|"<<endl;
89  cout<<"|**| ==> To calibrate crystals : InstructionType=\"Recal\" |**|"<<endl;
90  cout<<"|**| --> Options : Lib=LibNbr ................................... Library number (default Lib=1) |**|"<<endl;
91  cout<<"|**| Source=TheSource ................................... Source definition (default 60Co) |**|"<<endl;
92  cout<<"|**| CL=ChMin,ChMax ................................... Global channel limits |**|"<<endl;
93  cout<<"|**| PL=FWHM,Ampli ................................... Global peak limits |**|"<<endl;
94  cout<<"|**| |**|"<<endl;
95  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
96  cout<<"|**|------------------------------------------------------------ Plot of the calibration results -------------------------------------------------------------|**|"<<endl;
97  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
98  cout<<"|**| |**|"<<endl;
99  cout<<"|**| ==> To plot calibration results : InstructionType=\"Plot\" |**|"<<endl;
100  cout<<"|**| --> For help on the plot options, see GWRecal/PlotResults/PrintPlotHelp |**|"<<endl;
101  cout<<"|**| |**|"<<endl;
102  cout<<"|**| --> Options : Exp ................................... Expression to plot |**|"<<endl;
103  cout<<"|**| Sel ................................... Optional cut(s) on the expression |**|"<<endl;
104  cout<<"|**| Opt ................................... Plot options (ex: same for overimpose all crystals) |**|"<<endl;
105  cout<<"|**| |**|"<<endl;
106  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
107  cout<<"|**|------------------------------------------------------------------------ Example -------------------------------------------------------------------------|**|"<<endl;
108  cout<<"|**|-------------------------------------------------------------------------------------------------------------------------------------------------------------|**|"<<endl;
109  cout<<"|**| |**|"<<endl;
110  cout<<"|**| ==> The following command: \"ShowSpectra Lib=1 ; Recal Source=152Eu PL=20,10 ; Plot Exp=FW05:spec Opt=same ; all !03A\" |**|"<<endl;
111  cout<<"|**| will plot the first library of all segments of all crystals except the 03A one. |**|"<<endl;
112  cout<<"|**| Spectra will then be fitted with the Recal code using an Europium source and limiting the peak search to peaks FWHM < 20 and amplitude > 20. |**|"<<endl;
113  cout<<"|**| FWHM of the reference peak for each crystal will finally been plotted on a same Canvas. |**|"<<endl;
114  cout<<"|**| |**|"<<endl;
115  cout<<"|*******************************************************************************************************************************************************************|"<<endl;
116  cout<<" ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ "<<endl;
117  cout<<endl;
119 }
120 
121 
BashColor * fBashColor
Definition: CanvasVisu.h:34
SpectraViewerWatcher(const char *name, const char *title)
*/
void SetFileName(TString name)
******************************************************************************************/// ...
virtual ~SpectraViewerWatcher()
******************************************************************************************/// ...
ClassImp(BaseNucleus)
ADF::LogMessage & endl(ADF::LogMessage &log)
void PrintHelpOnPropagateTask()
******************************************************************************************/// ...