61 return std::distance(buffer.begin(), buffer.find(value));
84 int scal = 0xFFFFFFFF;
96 properties[
TCAL] = precision.tcal;
97 properties[
PCAL] = precision.pcal;
98 properties[
RCAL] = precision.rcal;
99 properties[
ACAL] = precision.acal;
100 properties[
CCAL] = precision.ccal;
101 properties[
SCAL] = precision.scal;
103 JParser<> zap(
"Auxiliary program to find differences between two detector files.");
113 catch(
const exception &error) {
137 bool is_equal =
true;
148 DEBUG(
"* Different detector identifiers "
160 DEBUG(
" * different UTM position: "
201 DEBUG(
"Comparing module by module." <<
endl);
225 DEBUG(
" * different location: "
236 DEBUG(
" * different T0: "
250 DEBUG(
" * different quaternion calibration: "
251 <<
module_a->getQuaternion() <<
" (A), "
252 <<
module_b->getQuaternion() <<
" (B) "
262 DEBUG(
" * different position: "
263 <<
module_a->getPosition() <<
" (A), "
264 <<
module_b->getPosition() <<
" (B)"
274 DEBUG(
" * different number of PMTs: "
288 if (fabs(q.
getMean()) > precision.tcal) {
290 DEBUG(
" * different average t0: "
302 DEBUG(
" * different status module " <<
module_a->getID() <<
": "
303 <<
module_a->getStatus() <<
" (A), "
314 for (
unsigned int pmt = 0; pmt !=
module_a->size() && pmt !=
module_b->size(); ++pmt) {
321 DEBUG(
" * different identifier PMT " <<
setw(2) << pmt <<
": "
324 <<
", B - A " <<
pmt_b.getID() -
pmt_a.getID()
333 for (
unsigned int pmt = 0; pmt !=
module_a->size() && pmt !=
module_b->size(); ++pmt) {
338 if (fabs(
pmt_a.getT0() -
pmt_b.getT0()) > precision.tcal) {
340 DEBUG(
" * different T0 PMT " <<
setw(2) << pmt <<
": "
343 <<
", B - A " <<
pmt_b.getT0() -
pmt_a.getT0()
352 for (
unsigned int pmt = 0; pmt !=
module_a->size() && pmt !=
module_b->size(); ++pmt) {
359 if (
pmt_a.getPosition().getDistance(
pmt_b.getPosition()) > precision.pcal) {
361 DEBUG(
" * different PMT position: "
362 <<
pmt_a.getPosition() <<
" (A" <<
FILL(2,
'0') << pmt <<
"), " <<
FILL()
363 <<
pmt_b.getPosition() <<
" (B" <<
FILL(2,
'0') << pmt <<
")" <<
FILL()
372 for (
unsigned int pmt = 0; pmt !=
module_a->size() && pmt !=
module_b->size(); ++pmt) {
379 const double dot =
pmt_a.getDirection().getDot(
pmt_b.getDirection());
381 if ((1.0 - dot) > precision.rcal) {
383 DEBUG(
" * different PMT direction: "
384 <<
pmt_a.getDirection() <<
" (A" <<
FILL(2,
'0') << pmt <<
"), " <<
FILL()
385 <<
pmt_b.getDirection() <<
" (B" <<
FILL(2,
'0') << pmt <<
")" <<
FILL()
394 for (
unsigned int pmt = 0; pmt !=
module_a->size() && pmt !=
module_b->size(); ++pmt) {
399 if (
pmt_a.getAND(precision.scal) !=
pmt_b.getAND(precision.scal)) {
401 DEBUG(
" * different status PMT " <<
setw(2) << pmt <<
": "
402 <<
pmt_a.getStatus() <<
" (A" <<
FILL(2,
'0') << pmt <<
"), " <<
FILL()
403 <<
pmt_b.getStatus() <<
" (B" <<
FILL(2,
'0') << pmt <<
")" <<
FILL()
431 string.size(), -0.5,
string.size() - 0.5,
432 floor .size(), -0.5, floor .size() - 0.5);
456 M2.Fill(
module->getString(),
module->getFloor(), -1.0);
462 M2.Fill(
module->getString(),
module->getFloor(), +1.0);
494 const double phi = (
JVector3Z_t.getDot(
q1.twist) >= 0.0 ? +1.0 : -1.0) *
q1.twist.getAngle();
510 for (
TH2D* h2 : { &
M2,
X2,
Y2,
Z2,
T2,
RMS, R2,
QA,
QB,
QC,
QD,
Q2 }) {
int main(int argc, char **argv)
Data structure for detector geometry and calibration.
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Direct access to module in detector data structure.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Utility class to parse parameter values.
Auxiliary class to define a range between two values.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Data structure for PMT geometry, calibration and status.
Utility class to parse parameter values.
Data structure for position in three dimensions.
Data structure for unit quaternion in three dimensions.
double getAngle() const
Get rotation angle.
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
Template definition of a multi-dimensional oscillation probability interpolation table.
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
static JRotation getRotation
Function object to get rotation matrix to go from first to second module.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
static const JVector3D JVector3Z_t(0, 0, 1)
unit z-vector
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const std::string TCAL
PMT time offsets.
static const std::string PCAL
(optical|base) module positions
static const std::string SCAL
(module|PMT) status
static const std::string RCAL
optical module orientations
static const std::string ACAL
acoustic time offsets (piezo sensor or hydrophone)
static const std::string CCAL
compass alignment (a.k.a. quaternion calibration)
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Auxiliary data structure for decomposition of quaternion in twist and swing quaternions.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...