/
functions.h
110 lines (91 loc) · 2.69 KB
/
functions.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
\file
Global function declarations.
\author Thomas Burton
\date 2011-07-07
\copyright 2011 Brookhaven National Lab
*/
#ifndef INCLUDE_EICSMEAR_FUNCTIONS_H_
#define INCLUDE_EICSMEAR_FUNCTIONS_H_
#include <string>
#include <Rtypes.h>
#include <TString.h>
#include "eicsmear/smear/Smear.h"
#include "eicsmear/smear/Detector.h"
class TLorentzVector;
namespace erhic {
class EventMC;
class VirtualEventFactory;
/**
Simple namespace-wide constant to determine the version
*/
const std::string EicSmearVersionString = "1.1.12";
}
/**
\fn
Returns the first non-blank character in a line.
Returns a NULL termination character if there are no non-blank characters
in the line.
*/
char getFirstNonBlank(const std::string&);
/**
\fn
Calculate the hadron azimuthal angle around the virtual photon direction with
respect to the lepton scattering plane in the proton rest frame.
We use the HERMES convention, returning an angle in the range [0,2pi].
The vectors passed as arguments should already be boosted to the proton rest
frame. Incident and scattered leptons, incident protons and virtual photons
all return -999.
*/
double computeHermesPhiH(const TLorentzVector& hadronInPrf,
const TLorentzVector& leptonInPrf,
const TLorentzVector& photonInPrf);
// Forward declarations of functions for which we wish to build dictionaries
// using rootcint
/**
\fn
Function for generating a ROOT TTree file from a plain-text Monte Carlo file.
*/
Long64_t BuildTree(const std::string& inputFileName,
const std::string& outputDirName = ".",
const Long64_t maxEvent = 0,
const std::string& logFileName = "");
/**
\enum
Allows to choose various output formats supported by HepMC
*/
namespace erhic{
enum HepMC_outtype {HepMC3, HepMC2, RootTree, Root };
}
/**
\fn
Function for generating a HepMC file from en EICTree ROOT file.
*/
Long64_t TreeToHepMC(const std::string& inputFileName,
const std::string& outputDirName = ".",
Long64_t maxEvent = 0,
const erhic::HepMC_outtype outtype = erhic::HepMC_outtype::HepMC3);
/**
\fn
Deprecated legacy wrapper
*/
Long64_t TreeToHepMC(const std::string& inputFileName,
const std::string& outputDirName,
Long64_t maxEvent,
const bool createHepMC2=false);
/**
Produces a DOT file describing the particle content of the event.
*/
class EventToDot {
public:
/**
Destructor.
*/
virtual ~EventToDot() { }
/**
Write a DOT file describing an event.
*/
void Generate(const erhic::EventMC&, const std::string& outputName) const;
ClassDef(EventToDot, 0)
};
#endif // INCLUDE_EICSMEAR_FUNCTIONS_H_