/
SamplingFractionReco.h
executable file
·72 lines (52 loc) · 1.88 KB
/
SamplingFractionReco.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Tell emacs that this is a C++ source
// -*- C++ -*-.
#ifndef SAMPLINGFRACTIONRECO_H
#define SAMPLINGFRACTIONRECO_H
#include <fun4all/SubsysReco.h>
#include <string>
class PHCompositeNode;
class TFile;
class TNtuple;
class SamplingFractionReco : public SubsysReco
{
public:
SamplingFractionReco(const std::string &name = "SamplingFractionReco", const std::string &filename = "output.root");
virtual ~SamplingFractionReco();
/** Called during initialization.
Typically this is where you can book histograms, and e.g.
register them to Fun4AllServer (so they can be output to file
using Fun4AllServer::dumpHistos() method).
*/
int Init(PHCompositeNode *topNode) override;
/** Called for first event when run number is known.
Typically this is where you may want to fetch data from
database, because you know the run number. A place
to book histograms which have to know the run number.
*/
int InitRun(PHCompositeNode *topNode) override;
/** Called for each event.
This is where you do the real work.
*/
int process_event(PHCompositeNode *topNode) override;
/// Clean up internals after each event.
int ResetEvent(PHCompositeNode *topNode) override;
/// Called at the end of each run.
int EndRun(const int runnumber) override;
/// Called at the end of all processing.
int End(PHCompositeNode *topNode) override;
/// Reset
int Reset(PHCompositeNode * /*topNode*/) override;
void Print(const std::string &what = "ALL") const override;
void Detector(const std::string &name);
void add_support_eloss(const int i = 1) { m_SupportFlag = i; }
private:
TNtuple *ntup = nullptr;
TFile *outfile = nullptr;
int m_SupportFlag = 0;
std::string outfilename;
std::string m_Detector;
std::string m_HitNodeName;
std::string m_AbsorberNodeName;
std::string m_SupportNodeName;
};
#endif // SAMPLINGFRACTIONRECO_H