42int main(
int argc,
char **argv)
48 JLimit_t& numberOfEvents = inputFile.getLimit();
58 JParser<> zap(
"Example program to monitor AHRS data.");
66 zap[
'c'] =
make_field(ahrsFile,
"output of JAHRSCalibration");
72 catch(
const exception &error) {
73 FATAL(error.what() << endl);
95 for (
int counter = 0; inputFile.
hasNext(); ++counter) {
97 STATUS(
"counter: " << setw(8) << counter <<
'\r' << flush);
DEBUG(endl);
99 const JAHRS* parameters = inputFile.
next();
106 data[parameters->
DOMID].push_back(*parameters);
113 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
114 if (frange(module->getFloor())) {
119 DOM_heading_map[module->getID()] = phi;
120 cout <<
"Heading from detector file: " << module->getID() <<
" " <<
module->getString() << " " << module->getFloor() << " " << phi/M_PI*180. << " [deg]" << endl;
134 for (map_type::iterator module = data.begin(); module != data.end(); ++module) {
136 if (!module->second.empty()) {
141 for (buffer_type::const_iterator p = module->second.begin(); p != module->second.end(); ) {
145 buffer_type::const_iterator q = p;
148 for ( ; q !=
module->second.end() && q->UNIXTIME - p->UNIXTIME <= Tmax_s * 1.0e3; ++q) {
154 JDirection3D d(cos(DOM_heading_map[module->first]),sin(DOM_heading_map[module->first]),0);
160 const double t1 = p->UNIXTIME * 1.0e-3 + 0.5*Tmax_s;
162 ZO[module->first].put(t1, atan2(u.
getDY(), u.
getDX()));
164 PD[module->first].put(t1, atan2(d.
getDY(), d.
getDX()));
166 XO[module->first].put(t1, atan2(x.getDY(), x.getDX()));
195 out <<
JGraph(PD_all,
"all_off");
ROOT TTree parameter settings.
Data structure for detector geometry and calibration.
General purpose messaging.
#define DEBUG(A)
Message macros.
Direct access to module in detector data structure.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
Data structure for compass in three dimensions.
JQuaternion3D getQuaternion() const
Get quaternion.
Logical location of module.
int getFloor() const
Get floor number.
int getString() const
Get string number.
Router for direct addressing of module data in detector data structure.
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Data structure for direction in three dimensions.
JDirection3D & rotate(const JRotation3D &R)
Rotate.
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
Data structure for unit quaternion in three dimensions.
double getAngle() const
Get rotation angle.
double getDot(const JVector3D &vector) const
Get dot product.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
int main(int argc, char **argv)
static JRotation getRotation
Function object to get rotation matrix to go from first to second module.
JDetectorBuilder & getDetectorBuilder()
Get detector builder.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
static const JVector3D JVector3Z_t(0, 0, 1)
unit z-vector
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
bool is_valid(const json &js)
Check validity of JSon data.
std::map< int, range_type > map_type
Auxiliary class to map module identifier to AHRS calibration.
Auxiliary data structure to check validity of AHRS data.
long long int UNIXTIME
[ms]
Auxiliary interface for building detector.
const JModule & getModule(const int id=-1, const JLocation &location=JLocation()) const
Get module.
Auxiliary data structure for decomposition of quaternion in twist and swing quaternions.
JQuaternion3D twist
rotation around parallel axis
Auxiliary class to determine average of set of values.
void put(const JValue_t &value, const double w=1.0)
Put value.
Auxiliary data structure to build TGraph.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.