Diana Software
DrawAveragePulse.C
Go to the documentation of this file.
1 using namespace Diana;
2 
3 void DrawAveragePulse(int chan, const char* input)
4 {
6  dm.SetOwner("DrawAveragePulse");
7  GlobalHandle<QVector> apHandle("Samples");
8  apHandle.SetChannel(chan);
9 
10  dm.Get("TutorialAveragePulse",&apHandle,input);
11 
12  QVector ap = apHandle.Get();
13  QVector baseline(ap.Size());
14  baseline.Initialize(ap[0]);
15  ap -= baseline;
16  ap /= ap.GetMax();
17 
18 
19  TGraph* apGraph = ap.GetGraph();
20  apGraph->Draw("AL");
21 
22  GlobalHandle<QVector> apHandle2("Samples");
23  apHandle2.SetChannel(chan);
24  apHandle2.Set(ap);
25  dm.Set(&apHandle2,"avg/averagepulse_normalized.txt");
26 
27 }
ap
Definition: CheckOFShape.C:47
void DrawAveragePulse(int chan, const char *input)
QGlobalDataManager dm
Object to manage I/O (DB, file, or memory) of diana global quantities.
void SetOwner(const std::string &owner)
set the module that is accessing this object
QError Set(GlobalHandle< Q > *gh, const std::string &outSource, bool printError=true) const
Set a QObject using a GlobalHandle.
QError Get(const std::string &owner, GlobalHandle< Q > *gh, const std::string &inSource, bool printError=true) const
Get an object using a global handle.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...