/
EtmOrphans.cc
41 lines (29 loc) · 1.22 KB
/
EtmOrphans.cc
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
#include <math.h>
#include <TString.h>
#include <EtmOrphans.h>
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
//
// This looks a bit stupid, but try-catch dos not improve things much; want to
// keep going in the interactive mode rather than exit;
//
bool ConditionChecker(bool condition, const char *fmt, const char *message)
{
if (!condition && fmt) {
TString wrapperfmt; wrapperfmt.Form("\n\n !!! %s !!!\n\n\n", fmt);
message ? printf(wrapperfmt.Data(), message) : printf(wrapperfmt.Data());
} //if
return condition;
} // EicDetector::ConditionChecker()
// ---------------------------------------------------------------------------------------
double Eta2Theta(double eta)
{
return 2*atan(exp(-eta));
} // Eta2Theta()
// ---------------------------------------------------------------------------------------
double Theta2Eta(double theta)
{
return -log(tan(theta/2));
} // Theta2Eta()
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------