EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EtmOrphans.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EtmOrphans.cc
1 
2 #include <math.h>
3 
4 #include <TString.h>
5 
6 #include <EtmOrphans.h>
7 
8 // ---------------------------------------------------------------------------------------
9 // ---------------------------------------------------------------------------------------
10 
11 //
12 // This looks a bit stupid, but try-catch dos not improve things much; want to
13 // keep going in the interactive mode rather than exit;
14 //
15 
16 bool ConditionChecker(bool condition, const char *fmt, const char *message)
17 {
18  if (!condition && fmt) {
19  TString wrapperfmt; wrapperfmt.Form("\n\n !!! %s !!!\n\n\n", fmt);
20  message ? printf(wrapperfmt.Data(), message) : printf(wrapperfmt.Data());
21  } //if
22 
23  return condition;
24 } // EicDetector::ConditionChecker()
25 
26 // ---------------------------------------------------------------------------------------
27 
28 double Eta2Theta(double eta)
29 {
30  return 2*atan(exp(-eta));
31 } // Eta2Theta()
32 
33 // ---------------------------------------------------------------------------------------
34 
35 double Theta2Eta(double theta)
36 {
37  return -log(tan(theta/2));
38 } // Theta2Eta()
39 
40 // ---------------------------------------------------------------------------------------
41 // ---------------------------------------------------------------------------------------