Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcousticsToolkit.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JACOUSTICSTOOLKIT__
2 #define __JACOUSTICS__JACOUSTICSTOOLKIT__
3 
4 #include "JDetector/JModule.hh"
5 #include "JDetector/JBase.hh"
6 
7 
8 /**
9  * \file
10  *
11  * Acoustics toolkit.
12  * \author mdejong
13  */
14 namespace JACOUSTICS {}
15 namespace JPP { using namespace JACOUSTICS; }
16 
17 namespace JACOUSTICS {
18 
19  using JDETECTOR::JModule;
20  using JDETECTOR::JBase;
21 
22 
23  /**
24  * Get time offset of optical module.
25  *
26  * \param module module
27  * \return time offset [ns]
28  */
29  inline double getT0(const JModule& module)
30  {
31  double t0 = 0.0;
32 
33  if (!module.empty()) {
34 
35  for (JModule::const_iterator i = module.begin(); i != module.end(); ++i) {
36  t0 += i->getT0();
37  }
38 
39  t0 /= module.size();
40  }
41 
42  return t0;
43  }
44 
45 
46  /**
47  * Get time offset of base module.
48  *
49  * \param base base
50  * \return time offset [ns]
51  */
52  inline double getT0(const JBase& base)
53  {
54  return base.getT0();
55  }
56 }
57 
58 #endif
Data structure for a composite optical module.
Definition: JModule.hh:50
Data structure for base module.
double getT0(const JModule &module)
Get time offset of optical module.
Type definition of base module.
Definition: JBase.hh:28
Data structure for a composite optical module.
double getT0() const
Get time offset.