Jpp 21.0.0-rc.1-88-g0130508c4
the software that should make you happy
Loading...
Searching...
No Matches
JCALIBRATE::JModel Struct Reference

Fit model. More...

#include <JFitK40.hh>

Inheritance diagram for JCALIBRATE::JModel:
JCALIBRATE::JModel_t JDETECTOR::JModule JCALIBRATE::JCombinatorics_t JTOOLS::JCombinatorics std::vector< JPMT > JLANG::JStatus JDETECTOR::JCalibration JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JPosition3D JDETECTOR::JLocation JLANG::JObjectID< T >

Classes

struct  real_type
 Auxiliary data structure for derived quantities of a given PMT pair. More...
 

Public Types

typedef int status_type
 

Public Member Functions

 JModel ()
 Default constructor.
 
 JModel (const JModule &module, const JK40Parameters &parameters, const JTDC_t::range_type &TDC, const int option)
 Constructor.
 
 JModel (const JModule &module, const JK40Parameters &parameters)
 Constructor.
 
JOption_t getOption () const
 Get fit option.
 
void setOption (const int option)
 Set fit option.
 
bool hasFixedTimeOffset () const
 Check if time offset is fixed.
 
double getFixedTimeOffset () const
 Get time offset.
 
int getIndex () const
 Get index of PMT used for fixed time offset.
 
void setIndex ()
 Set index of PMT used for fixed time offset.
 
size_t getN () const
 Get number of fit parameters.
 
double getSigmaK40 () const
 Get intrinsic K40 arrival time spread.
 
void setSigmaK40 (const double sigma)
 Set intrinsic K40 arrival time spread.
 
const real_typegetReal (const pair_type &pair) const
 Get derived quantities.
 
double getValue (const double ct) const
 Get K40 coincidence rate as a function of cosine angle between PMT axes.
 
double getValue (const pair_type &pair, const double dt_ns) const
 Get K40 coincidence rate.
 
void reset ()
 Reset.
 
const JPMT & getPMT (const int index) const
 Get PMT.
 
JPMT & getPMT (const int index)
 Get PMT.
 
void setPMT (const int index, const JPMT &pmt)
 Set PMT.
 
JVector3D getCenter () const
 Get center of module based on crossing point of PMT axes.
 
void compile ()
 Compile module data.
 
void rotate (const JRotation3D &R)
 Rotate module.
 
void rotate (const JQuaternion3D &Q)
 Rotate module.
 
JPosition3Drotate (const JRotation3X &R)
 Rotate around X-axis.
 
JPosition3Drotate (const JRotation3Y &R)
 Rotate around Y-axis.
 
JPosition3Drotate (const JRotation3Z &R)
 Rotate around Z-axis.
 
void rotate (double &__x, double &__y, double &__z) const
 Rotate.
 
void rotate_back (const JRotation3D &R)
 Rotate back module.
 
void rotate_back (const JQuaternion3D &Q)
 Rotate back module.
 
JPosition3Drotate_back (const JRotation3X &R)
 Rotate back around X-axis.
 
JPosition3Drotate_back (const JRotation3Y &R)
 Rotate back around Y-axis.
 
JPosition3Drotate_back (const JRotation3Z &R)
 Rotate back around Z-axis.
 
void rotate_back (double &__x, double &__y, double &__z) const
 Rotate back.
 
void transform (const JRotation3D &R, const JVector3D &pos)
 Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&, const JVector3D&)).
 
void transform (const JTransformation3D &T)
 Transformation of geometry.
 
JVector3Dtransform (const JMatrix3D &T)
 Transform.
 
JModuleset (const JVector3D &pos)
 Set position.
 
JModuleset (const double t0)
 Set time offset.
 
void set (const int bit)
 Set PMT status.
 
JModuleadd (const JVector3D &pos)
 Add position.
 
JModuleadd (const double t0)
 Add time offset.
 
JQuaternion3Dadd (const JQuaternion3D &quaternion)
 Add quaternion.
 
JModulesub (const JVector3D &pos)
 Subtract position.
 
JModulesub (const double t0)
 Subtract time offset.
 
JQuaternion3Dsub (const JQuaternion3D &quaternion)
 Subtract quaternion.
 
JModuleoperator+= (const JVector3D &pos)
 Add position.
 
JModuleoperator-= (const JVector3D &pos)
 Subtract position.
 
bool has (const int bit) const
 Test PMT status.
 
void reset (const int bit)
 Reset PMT status.
 
int getID () const
 Get identifier.
 
int & getID ()
 Get identifier.
 
void setID (const int id)
 Set identifier.
 
bool less (const JObjectID &object) const
 Less than method.
 
bool less (const int id) const
 Less than method.
 
bool less (const JLocation &location) const
 Less than method.
 
bool more (const int id) const
 More than method.
 
const JLocationgetLocation () const
 Get location.
 
JLocationgetLocation ()
 Get location.
 
void setLocation (const JLocation &location)
 Set location.
 
std::string toString () const
 Convert module location to string.
 
std::string toString (const std::string &fmt, const std::string target="%") const
 Convert module loation to string.
 
int getString () const
 Get string number.
 
int getFloor () const
 Get floor number.
 
const JPosition3DgetPosition () const
 Get position.
 
JPosition3DgetPosition ()
 Get position.
 
void setPosition (const JVector3D &pos)
 Set position.
 
 operator JAngle3D () const
 Type conversion operator.
 
 operator JVersor3D () const
 Type conversion operator.
 
 operator JVersor3D () const
 Type conversion operator.
 
void transform_back (const JRotation3D &R, const JVector3D &pos)
 Transform back position.
 
double getDot (const JAngle3D &angle) const
 Get dot product.
 
double getDot (const JVersor3D &dir) const
 Get dot product.
 
double getDot (const JVersor3Z &dir) const
 Get dot product.
 
double getDot (const JVector3D &vector) const
 Get dot product.
 
double getDot (const JQuaternion3D &quaternion) const
 Get dot product.
 
 operator JVector2D () const
 Type conversion operator.
 
double getX () const
 Get x position.
 
double getY () const
 Get y position.
 
double getZ () const
 Get z position.
 
JVector3Dnegate ()
 Negate vector.
 
JQuaternion3Dnegate ()
 Negate quaternion.
 
JVector3Dmul (const double factor)
 Scale vector.
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object.
 
JQuaternion3Dmul (const double factor)
 Scale quaternion.
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3X &second)
 Quaternion multiplication.
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3Y &second)
 Quaternion multiplication.
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3Z &second)
 Quaternion multiplication.
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3D &second)
 Quaternion multiplication.
 
JQuaternion3Dmul (const JQuaternion3X &qx, const JQuaternion3Y &qy, const JQuaternion3Z &qz)
 Quaternion multiplication.
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object.
 
JVector3Ddiv (const double factor)
 Scale vector.
 
JQuaternion3Ddiv (const double factor)
 Scale quaternion.
 
bool equals (const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
 Check equality.
 
bool equals (const JQuaternion3D &quaternion, const double precision=std::numeric_limits< double >::min()) const
 Check equality.
 
bool equals (const JStatus &status) const
 Equal method.
 
double getLengthSquared () const
 Get length squared.
 
double getLengthSquared () const
 Get length squared.
 
double getLength () const
 Get length.
 
double getLength () const
 Get length.
 
double getDistanceSquared (const JVector3D &pos) const
 Get squared of distance to point.
 
double getDistanceSquared (const JQuaternion3D &quaternion) const
 Get squared of distance to quaternion.
 
double getDistance (const JVector3D &pos) const
 Get distance to point.
 
double getDistance (const JQuaternion3D &quaternion) const
 Get distance to quaternion.
 
JVector3DgetCross (const JVector3D &first, const JVector3D &second)
 Get cross product.
 
const JQuaternion3DgetQuaternion () const
 Get quaternion.
 
JQuaternion3DgetQuaternion ()
 Get quaternion.
 
void setQuaternion (const JQuaternion3D &quaternion)
 Set quaternion.
 
 operator JVector3D () const
 Type conversion operator.
 
double getAngle () const
 Get rotation angle.
 
double getA () const
 Get a value.
 
double getB () const
 Get b value.
 
double getC () const
 Get c value.
 
double getD () const
 Get d value.
 
JQuaternion3DsetIdentity ()
 Set to identity quaternion.
 
JQuaternion3Dconjugate ()
 Conjugate quaternion.
 
bool isIdentity (const double precision=std::numeric_limits< double >::min()) const
 Test identity.
 
JQuaternion3D getConjugate () const
 Get conjugate of this quaternion.
 
JQuaternion3Dnormalise ()
 Normalise quaternion.
 
JQuaternion3Dpow (const double y)
 Raise quaternion to given power.
 
JQuaternion3Dinterpolate (const JQuaternion3D &object, const double alpha)
 Interpolation between quaternions.
 
const JCalibrationgetCalibration () const
 Get calibration.
 
JCalibrationgetCalibration ()
 Get calibration.
 
void setCalibration (const JCalibration &cal)
 Set calibration.
 
double getT0 () const
 Get time offset.
 
void setT0 (const double t0)
 Set time offset.
 
void addT0 (const double t0)
 Add time offset.
 
void subT0 (const double t0)
 Subtract time offset.
 
status_type getStatus (const JType< status_type > &type) const
 Get status.
 
JStatus getStatus (const JType< JStatus > &type) const
 Get status.
 
template<class T >
const T getStatus () const
 Get status.
 
const JStatusgetStatus () const
 Get status.
 
status_typegetStatus (const JType< status_type > &type)
 Get status.
 
JStatusgetStatus (const JType< JStatus > &type)
 Get status.
 
template<class T >
T & getStatus ()
 Get status.
 
JStatusgetStatus ()
 Get status.
 
void setStatus (const JStatus &status)
 Set status.
 
JStatus getAND (const JStatus &status) const
 Get combined status.
 
JStatus getOR (const JStatus &status) const
 Get combined status.
 
const JCombinatoricsgetCombinatorics () const
 Get combinatorics.
 
void configure (const int numberOfIndices)
 Configure.
 
size_t getNumberOfIndices () const
 Get number of indices.
 
size_t getNumberOfPairs () const
 Get number of pairs.
 
int getIndex (const int first, const int second) const
 Get index of pair of indices.
 
int getIndex (const pair_type &pair) const
 Get index of pair.
 
const pair_typegetPair (const int index) const
 Get pair of indices for given index.
 
template<class JComparator_t >
void sort (JComparator_t comparator)
 Sort address pairs.
 

Static Public Member Functions

static int & getVersion ()
 Get detector version.
 
static void setVersion (const JVersion &version)
 Set detector version.
 
static bool compare (const JModule &first, const JModule &second, const double precision=1.0e-3)
 Compare modules.
 
static const JQuaternion3DgetIdentity ()
 Get identity quaternion.
 
static int getSign (const int first, const int second)
 Sign of pair of indices.
 
static int getSign (const pair_type &pair)
 Sign of pair of indices.
 

Public Attributes

JK40Parameters model
 
JTransmittance transmittance
 
JPMTParameters_t parameters [NUMBER_OF_PMTS]
 

Static Public Attributes

static const int NUMBER_OF_STATUS_BITS = sizeof(status_type) * 8
 number of status bits
 

Protected Attributes

int _id_
 
int string
 
int floor
 
double __x
 
double __y
 
double __z
 
double __a
 
double __b
 
double __c
 
double __d
 
double t0
 
status_type status
 
std::vector< pair_typezbuf1D
 
std::vector< std::vector< int > > zbuf2D
 

Private Attributes

int index
 index of PMT used for fixed time offset
 
double sigmaK40_ns = 0.54
 intrinsic K40 arrival time spread [ns]
 
JOption_t option
 fit option (see JCALIBRATE::JOption_t)
 
real_type real
 

Friends

std::ostream & operator<< (std::ostream &out, const JModel &object)
 Write model parameters to output stream.
 

Detailed Description

Fit model.

In the absence of TDC constraints, the average time offset is fixed to zero.

Definition at line 1210 of file JFitK40.hh.

Member Typedef Documentation

◆ status_type

Definition at line 32 of file JStatus.hh.

Constructor & Destructor Documentation

◆ JModel() [1/3]

JCALIBRATE::JModel::JModel ( )
inline

Default constructor.

Definition at line 1235 of file JFitK40.hh.

1236 {}

◆ JModel() [2/3]

JCALIBRATE::JModel::JModel ( const JModule & module,
const JK40Parameters & parameters,
const JTDC_t::range_type & TDC,
const int option )
inline

Constructor.

Parameters
moduledetector module
parametersK40 parameters
TDCTDC constraints
optionoption

Definition at line 1247 of file JFitK40.hh.

1250 :
1251 JModule (module),
1252 JCombinatorics_t(module)
1253 {
1254 model = parameters;
1256
1257 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1259 }
1260
1261 for (JTDC_t::const_iterator i = TDC.first; i != TDC.second; ++i) {
1262
1263 if (i->second != JTDC_t::WILDCARD) {
1264
1265 this->parameters[i->second].t0.fix();
1266
1267 } else {
1268
1269 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1270 this->parameters[i].t0.fix();
1271 }
1272 }
1273 }
1274
1275 this->index = (TDC.first == TDC.second ? 0 : INVALID_INDEX);
1276
1278 }
void fix()
Fix current value.
Definition JFitK40.hh:287
JModule()
Default constructor.
Definition JModule.hh:86
static const int INVALID_INDEX
invalid index
Definition JFitK40.hh:61
JCombinatorics_t()
Default constructor.
JTransmittance transmittance
Definition JFitK40.hh:1164
JK40Parameters model
Definition JFitK40.hh:1163
JPMTParameters_t parameters[NUMBER_OF_PMTS]
Definition JFitK40.hh:1165
void setOption(const int option)
Set fit option.
Definition JFitK40.hh:1317
JOption_t option
fit option (see JCALIBRATE::JOption_t)
Definition JFitK40.hh:1623
int index
index of PMT used for fixed time offset
Definition JFitK40.hh:1621
JParameter_t t0
time offset [ns]
Definition JFitK40.hh:605
static const JPMTParameters_t & getInstance()
Get default values.
Definition JFitK40.hh:495
static const JTransmittance & getInstance()
Get default values.
Definition JFitK40.hh:1069

◆ JModel() [3/3]

JCALIBRATE::JModel::JModel ( const JModule & module,
const JK40Parameters & parameters )
inline

Constructor.

Parameters
moduledetector module
parametersK40 parameters

Definition at line 1287 of file JFitK40.hh.

1288 :
1289 JModule (module),
1290 JCombinatorics_t(module)
1291 {
1292 model = parameters;
1294
1295 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1297 }
1298 }

Member Function Documentation

◆ getOption()

JOption_t JCALIBRATE::JModel::getOption ( ) const
inline

Get fit option.

Returns
option

Definition at line 1306 of file JFitK40.hh.

1307 {
1308 return option;
1309 }

◆ setOption()

void JCALIBRATE::JModel::setOption ( const int option)
inline

Set fit option.

Parameters
optionoption

Definition at line 1317 of file JFitK40.hh.

1318 {
1319 switch (option) {
1320
1321 case FIT_PMTS_t:
1322
1323 model.R .fix();
1324 model.p1.fix();
1325 model.p2.fix();
1326 model.p3.fix();
1327 model.p4.fix();
1328
1329 for (int i = 0; i != NUMBER_OF_RINGS; ++i) {
1330 transmittance[i].fix();
1331 }
1332
1333 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1334 parameters[i].bg.fix();
1335 }
1336
1337 break;
1338
1340
1341 model.R .fix();
1342
1343 for (int i = 0; i != NUMBER_OF_RINGS; ++i) {
1344 transmittance[i].fix();
1345 }
1346
1347 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1348 parameters[i].bg.fix();
1349 }
1350
1351 break;
1352
1354
1355 model.R .fix();
1356 model.p1.fix();
1357 model.p2.fix();
1358 model.p3.fix();
1359 model.p4.fix();
1360
1361 for (int i = 0; i != NUMBER_OF_RINGS; ++i) {
1362 transmittance[i].fix();
1363 }
1364
1365 break;
1366
1368
1369 model.R .fix();
1370 model.p1.fix();
1371 model.p2.fix();
1372 model.p3.fix();
1373 model.p4.fix();
1374
1375 for (int i = 0; i != NUMBER_OF_RINGS; ++i) {
1376 transmittance[i].fix();
1377 }
1378
1379 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1380 parameters[i].QE.fix();
1381 parameters[i].bg.fix();
1382 }
1383
1384 break;
1385
1386 case FIT_MODEL_t:
1387
1389
1390 //cc.fix();
1391 //bc.fix();
1392
1393 for (int i = 0; i != NUMBER_OF_RINGS; ++i) {
1394 transmittance[i].fix();
1395 }
1396
1397 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1398 parameters[i].QE.fix();
1399 parameters[i].t0.fix();
1400 parameters[i].bg.fix();
1401 }
1402
1403 break;
1404
1405 default:
1406
1407 THROW(JValueOutOfRange, "Invalid option " << option);
1408 }
1409
1410 this->option = static_cast<JOption_t>(option);
1411 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
@ FIT_PMTS_QE_FIXED_t
fit parameters of PMTs with QE fixed
Definition JFitK40.hh:57
@ FIT_PMTS_AND_ANGULAR_DEPENDENCE_t
fit parameters of PMTs and angular dependence of K40 rate
Definition JFitK40.hh:55
@ FIT_MODEL_t
fit parameters of K40 rate and TTSs of PMTs
Definition JFitK40.hh:58
@ FIT_PMTS_AND_BACKGROUND_t
fit parameters of PMTs and background
Definition JFitK40.hh:56
@ FIT_PMTS_t
fit parameters of PMTs
Definition JFitK40.hh:54
static const int NUMBER_OF_RINGS
number of rings in optical module.
Definition JFitK40.hh:63
JParameter_t R
maximal coincidence rate [Hz]
Definition JFitK40.hh:711
JParameter_t p1
1st order angle dependence coincidence rate
Definition JFitK40.hh:712
JParameter_t p2
2nd order angle dependence coincidence rate
Definition JFitK40.hh:713
JParameter_t p3
3rd order angle dependence coincidence rate
Definition JFitK40.hh:714
JParameter_t p4
4th order angle dependence coincidence rate
Definition JFitK40.hh:715
JParameter_t bg
background [Hz/ns]
Definition JFitK40.hh:606
JParameter_t QE
relative quantum efficiency [unit]
Definition JFitK40.hh:603

◆ hasFixedTimeOffset()

bool JCALIBRATE::JModel::hasFixedTimeOffset ( ) const
inline

Check if time offset is fixed.

Returns
true if time offset fixed; else false

Definition at line 1419 of file JFitK40.hh.

1420 {
1421 return index != INVALID_INDEX;
1422 }

◆ getFixedTimeOffset()

double JCALIBRATE::JModel::getFixedTimeOffset ( ) const
inline

Get time offset.

Returns
time offset

Definition at line 1430 of file JFitK40.hh.

1431 {
1432 double t0 = 0.0;
1433 size_t N = 0;
1434
1435 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1436 if (parameters[i].t0.isFree()) {
1437 t0 += parameters[i].t0;
1438 N += 1;
1439 }
1440 }
1441
1442 return t0 /= N;
1443 }

◆ getIndex() [1/3]

int JCALIBRATE::JModel::getIndex ( ) const
inline

Get index of PMT used for fixed time offset.

Returns
index

Definition at line 1451 of file JFitK40.hh.

1452 {
1453 return index;
1454 }

◆ setIndex()

void JCALIBRATE::JModel::setIndex ( )
inline

Set index of PMT used for fixed time offset.

Definition at line 1460 of file JFitK40.hh.

1461 {
1462 if (index != INVALID_INDEX) {
1463
1464 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1465
1466 if (parameters[i].status) {
1467
1468 index = i;
1469
1471
1472 return;
1473 }
1474 }
1475
1476 THROW(JValueOutOfRange, "No valid index.");
1477 }
1478 }
status_type status
Definition JStatus.hh:252

◆ getN()

size_t JCALIBRATE::JModel::getN ( ) const
inline

Get number of fit parameters.

Returns
number of parameters

Definition at line 1486 of file JFitK40.hh.

1487 {
1488 size_t N = 0;
1489
1490 N += model .getN();
1491 N += transmittance.getN();
1492
1493 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1494 N += parameters[i].getN();
1495 }
1496
1497 return N;
1498 }
size_t getN() const
Get number of fit parameters.
Definition JFitK40.hh:762
size_t getN() const
Get number of fit parameters.
Definition JFitK40.hh:545
size_t getN() const
Get number of fit parameters.
Definition JFitK40.hh:1086

◆ getSigmaK40()

double JCALIBRATE::JModel::getSigmaK40 ( ) const
inline

Get intrinsic K40 arrival time spread.

Returns
sigma [ns]

Definition at line 1506 of file JFitK40.hh.

1507 {
1508 return this->sigmaK40_ns;
1509 }
double sigmaK40_ns
intrinsic K40 arrival time spread [ns]
Definition JFitK40.hh:1622

◆ setSigmaK40()

void JCALIBRATE::JModel::setSigmaK40 ( const double sigma)
inline

Set intrinsic K40 arrival time spread.

Parameters
sigmasigma [ns]

Definition at line 1517 of file JFitK40.hh.

1518 {
1519 this->sigmaK40_ns = sigma;
1520 }

◆ getReal()

const real_type & JCALIBRATE::JModel::getReal ( const pair_type & pair) const
inline

Get derived quantities.

Parameters
pairPMT pair
Returns
quantities

Definition at line 1529 of file JFitK40.hh.

1530 {
1531 real.pair.first = getRing((*this)[pair.first] .getDZ()).getIndex();
1532 real.pair.second = getRing((*this)[pair.second].getDZ()).getIndex();
1533
1534 real.ct = JPP::getDot((*this)[pair.first].getDirection(), (*this)[pair.second].getDirection());
1535
1536 real.t0 = (pair.first == this->index ? -this->parameters[pair.second].t0() :
1537 pair.second == this->index ? +this->parameters[pair.first ].t0() :
1538 this->parameters[pair.first].t0() - this->parameters[pair.second].t0());
1539
1540 real.sigma = sqrt(this->parameters[pair.first ].TTS() * this->parameters[pair.first ].TTS() +
1541 this->parameters[pair.second].TTS() * this->parameters[pair.second].TTS() +
1542 this->getSigmaK40() * this->getSigmaK40());
1543
1544 real.signal = this->parameters[pair.first].QE() * this->parameters[pair.second].QE();
1545
1546 real.background = this->parameters[pair.first].bg() + this->parameters[pair.second].bg();
1547
1548 real.cc = real.signal * model.cc();
1549 real.bc = model.bc();
1550
1551 const double z1 = (*this)[pair.first ].getDirection().getDZ();
1552 const double z2 = (*this)[pair.second].getDirection().getDZ();
1553
1554 if (fabs(z1) <= TEROSTAT_DZ &&
1555 fabs(z2) <= TEROSTAT_DZ &&
1556 signbit(z1) != signbit(z2)) {
1557
1559 }
1560
1561 return real;
1562 }
static double TEROSTAT_R1
scaling factor
Definition JFitK40.hh:66
static double TEROSTAT_DZ
maximal PMT inclination
Definition JFitK40.hh:65
ring_type getRing(const double dz)
Get ring.
Definition JFitK40.hh:988
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
JParameter_t bc
constant background
Definition JFitK40.hh:717
JParameter_t cc
fraction of signal correlated background
Definition JFitK40.hh:716
double signal
combined signal
Definition JFitK40.hh:1225
double sigma
total width [ns]
Definition JFitK40.hh:1224
double cc
correlated background
Definition JFitK40.hh:1227
double background
combined background
Definition JFitK40.hh:1226
double t0
time offset [ns]
Definition JFitK40.hh:1223
ring_pair pair
PMT ring pair.
Definition JFitK40.hh:1221
double bc
uncorrelated background
Definition JFitK40.hh:1228
double ct
cosine angle between PMT axes
Definition JFitK40.hh:1222
JParameter_t TTS
transition-time spread [ns]
Definition JFitK40.hh:604
int getIndex() const
Get index.
Definition JFitK40.hh:918

◆ getValue() [1/2]

double JCALIBRATE::JModel::getValue ( const double ct) const
inline

Get K40 coincidence rate as a function of cosine angle between PMT axes.

Parameters
ctcosine angle between PMT axes
Returns
rate [Hz]

Definition at line 1571 of file JFitK40.hh.

1572 {
1573 return model.getValue(ct);
1574 }
double getValue(const double ct) const
Get K40 coincidence rate as a function of cosine angle between PMT axes.
Definition JFitK40.hh:806

◆ getValue() [2/2]

double JCALIBRATE::JModel::getValue ( const pair_type & pair,
const double dt_ns ) const
inline

Get K40 coincidence rate.

Parameters
pairPMT pair
dt_nstime difference [ns]
Returns
rate [Hz/ns]

Definition at line 1584 of file JFitK40.hh.

1585 {
1586 using namespace std;
1587 using namespace JPP;
1588
1589 const real_type& real = getReal(pair);
1590
1591 const JBell bell(real.t0, real.sigma, real.signal, 0.0, BELL_SHAPE);
1592
1593 const double R1 = model.getValue(real.ct);
1594 const double R2 = bell .getValue(dt_ns);
1595
1596 return real.bc + real.background + R1 * (real.cc + R2);
1597 }
#define R1(x)
static double BELL_SHAPE
Bell shape.
Definition JFitK40.hh:67
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const real_type & getReal(const pair_type &pair) const
Get derived quantities.
Definition JFitK40.hh:1529
Bell function object.
Definition JBell.hh:32

◆ reset() [1/2]

void JCALIBRATE::JModel_t::reset ( )
inlineinherited

Reset.

Definition at line 1171 of file JFitK40.hh.

1172 {
1173 model .reset();
1175
1176 for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
1177 parameters[i].reset();
1178 }
1179 }

◆ getVersion()

static int & JDETECTOR::JModule::getVersion ( )
inlinestaticinherited

Get detector version.

Definition at line 118 of file JModule.hh.

119 {
120 static int version = 0;
121
122 return version;
123 }

◆ setVersion()

static void JDETECTOR::JModule::setVersion ( const JVersion & version)
inlinestaticinherited

Set detector version.

Parameters
versionversion

Definition at line 131 of file JModule.hh.

132 {
133 getVersion() = getDetectorVersion(version);
134 }
static int & getVersion()
Get detector version.
Definition JModule.hh:118
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.

◆ compare()

static bool JDETECTOR::JModule::compare ( const JModule & first,
const JModule & second,
const double precision = 1.0e-3 )
inlinestaticinherited

Compare modules.

The comparison only covers the orientations of the modules.

Parameters
firstfirst module
secondsecond module
precisionprecision
Returns
true if two modules are equal; else false

Definition at line 147 of file JModule.hh.

150 {
151 if (first.size() == second.size()) {
152
153 for (size_t i = 0; i != first.size(); ++i) {
154 if (first[i].getDirection().getDot(second[i].getDirection()) < 1.0 - precision) {
155 return false;
156 }
157 }
158
159 return true;
160 }
161
162 return false;
163 }
double getDot(const JAngle3D &angle) const
Get dot product.
JDirection3D getDirection(const Vec &dir)
Get direction.

◆ getPMT() [1/2]

const JPMT & JDETECTOR::JModule::getPMT ( const int index) const
inlineinherited

Get PMT.

Parameters
indexreadout channel (TDC)
Returns
PMT at given index

Definition at line 173 of file JModule.hh.

174 {
175 return at(index);
176 }

◆ getPMT() [2/2]

JPMT & JDETECTOR::JModule::getPMT ( const int index)
inlineinherited

Get PMT.

Parameters
indexreadout channel (TDC)
Returns
PMT at given index

Definition at line 185 of file JModule.hh.

186 {
187 return at(index);
188 }

◆ setPMT()

void JDETECTOR::JModule::setPMT ( const int index,
const JPMT & pmt )
inlineinherited

Set PMT.

Parameters
indexreadout channel (TDC)
pmtPMT

Definition at line 197 of file JModule.hh.

198 {
199 if (index >= (int) size()) {
200 resize(index + 1);
201 }
202
203 (*this)[index] = pmt;
204 }

◆ getCenter()

JVector3D JDETECTOR::JModule::getCenter ( ) const
inlineinherited

Get center of module based on crossing point of PMT axes.

This method perform a fit of the crossing point of the PMT axes.
A general purpose implementation of such a fit is available in JFIT::JEstimator<JPoint3D>.

Returns
center

Definition at line 215 of file JModule.hh.

216 {
217 using namespace JPP;
218
219 if (this->size() > 1u) {
220
221 double x = 0;
222 double y = 0;
223 double z = 0;
224
225 JMatrix3S V;
226
227 for (const_iterator pmt = this->begin(); pmt != this->end(); ++pmt) {
228
229 const double xx = 1.0 - pmt->getDX() * pmt->getDX();
230 const double yy = 1.0 - pmt->getDY() * pmt->getDY();
231 const double zz = 1.0 - pmt->getDZ() * pmt->getDZ();
232
233 const double xy = -pmt->getDX() * pmt->getDY();
234 const double xz = -pmt->getDX() * pmt->getDZ();
235 const double yz = -pmt->getDY() * pmt->getDZ();
236
237 V.a00 += xx;
238 V.a01 += xy;
239 V.a02 += xz;
240
241 V.a11 += yy;
242 V.a12 += yz;
243
244 V.a22 += zz;
245
246 x += xx * pmt->getX() + xy * pmt->getY() + xz * pmt->getZ();
247 y += xy * pmt->getX() + yy * pmt->getY() + yz * pmt->getZ();
248 z += xz * pmt->getX() + yz * pmt->getY() + zz * pmt->getZ();
249 }
250
251 V.a10 = V.a01;
252 V.a20 = V.a02;
253 V.a21 = V.a12;
254
255 V.invert();
256
257 return JVector3D(V.a00 * x + V.a01 * y + V.a02 * z,
258 V.a10 * x + V.a11 * y + V.a12 * z,
259 V.a20 * x + V.a21 * y + V.a22 * z);
260
261 } else {
262 throw JValueOutOfRange("JModule::getCenter(): Not enough PMTs.");
263 }
264 }
JVector3D()
Default constructor.
Definition JVector3D.hh:41
Exception for accessing a value in a collection that is outside of its range.
3 x 3 symmetric matrix
Definition JMatrix3S.hh:31
void invert()
Invert matrix.
Definition JMatrix3S.hh:80

◆ compile()

void JDETECTOR::JModule::compile ( )
inlineinherited

Compile module data.

For detector versions before JDetectorVersion::V4, the position, quaternion data and time offset of the module should be set.
The position is set to the intersection point of the PMT axes (or their average position if this is not possible).
The quaternion data are maintained.
For an optical module (i.e. floor > 0), the time offset is set to the average time offset of the PMTs and for a base module (i.e. floor = 0), the time offset is set to zero.
These time offsets should be corrected for delay in the piezo sensor and hydrophone, respectively.

Definition at line 282 of file JModule.hh.

283 {
284 using namespace std;
285 using namespace JPP;
286
287 if (!this->empty()) {
288
289 JPosition3D& pos = this->getPosition();
290
291 try {
292 pos = this->getCenter();
293 }
294 catch(const exception&) {
295
296 pos = JPosition3D(0.0, 0.0, 0.0);
297
298 for (iterator i = this->begin(); i != this->end(); ++i) {
299 pos.add(i->getPosition());
300 }
301
302 pos.div(size());
303 }
304 }
305
306 this->setCalibration(getAverage(make_array(this->begin(), this->end(), &JModule::getT0), 0.0));
307 }
double getT0() const
Get time offset.
void setCalibration(const JCalibration &cal)
Set calibration.
JVector3D getCenter() const
Get center of module based on crossing point of PMT axes.
Definition JModule.hh:215
Data structure for position in three dimensions.
JPosition3D()
Default constructor.
const JPosition3D & getPosition() const
Get position.
JVector3D & add(const JVector3D &vector)
Add vector.
Definition JVector3D.hh:142
JVector3D & div(const double factor)
Scale vector.
Definition JVector3D.hh:190
std::iterator_traits< T >::value_type getAverage(T __begin, T __end)
Get average.
Definition JMath.hh:494

◆ rotate() [1/6]

void JDETECTOR::JModule::rotate ( const JRotation3D & R)
inlineinherited

Rotate module.

Parameters
Rrotation matrix

Definition at line 315 of file JModule.hh.

316 {
318
319 for (iterator i = this->begin(); i != this->end(); ++i) {
320 i->rotate(R);
321 }
322 }
JPosition3D & rotate(const JRotation3D &R)
Rotate.

◆ rotate() [2/6]

void JDETECTOR::JModule::rotate ( const JQuaternion3D & Q)
inlineinherited

Rotate module.

Parameters
Qquaternion

Definition at line 377 of file JModule.hh.

378 {
380
381 for (iterator i = this->begin(); i != this->end(); ++i) {
382 i->rotate(Q);
383 }
384 }

◆ rotate() [3/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate ( const JRotation3X & R)
inlineinherited

Rotate around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 214 of file JPosition3D.hh.

215 {
216 R.rotate(__y, __z);
217
218 return *this;
219 }

◆ rotate() [4/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Y & R)
inlineinherited

Rotate around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 242 of file JPosition3D.hh.

243 {
244 R.rotate(__x, __z);
245
246 return *this;
247 }

◆ rotate() [5/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Z & R)
inlineinherited

Rotate around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 270 of file JPosition3D.hh.

271 {
272 R.rotate(__x, __y);
273
274 return *this;
275 }

◆ rotate() [6/6]

void JGEOMETRY3D::JQuaternion3D::rotate ( double & __x,
double & __y,
double & __z ) const
inlineinherited

Rotate.

Parameters
__xx value
__yy value
__zz value

Definition at line 805 of file JQuaternion3D.hh.

806 {
807 const double qx = 2.0 * (__c*__z - __d*__y);
808 const double qy = 2.0 * (__d*__x - __b*__z);
809 const double qz = 2.0 * (__b*__y - __c*__x);
810
811 __x = __x + __c*qz - __d*qy + __a*qx;
812 __y = __y - __b*qz + __a*qy + __d*qx;
813 __z = __z + __a*qz + __b*qy - __c*qx;
814 }

◆ rotate_back() [1/6]

void JDETECTOR::JModule::rotate_back ( const JRotation3D & R)
inlineinherited

Rotate back module.

Parameters
Rrotation matrix

Definition at line 330 of file JModule.hh.

331 {
333
334 for (iterator i = this->begin(); i != this->end(); ++i) {
335 i->rotate_back(R);
336 }
337 }
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.

◆ rotate_back() [2/6]

void JDETECTOR::JModule::rotate_back ( const JQuaternion3D & Q)
inlineinherited

Rotate back module.

Parameters
Qquaternion

Definition at line 392 of file JModule.hh.

393 {
395
396 for (iterator i = this->begin(); i != this->end(); ++i) {
397 i->rotate_back(Q);
398 }
399 }

◆ rotate_back() [3/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3X & R)
inlineinherited

Rotate back around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 228 of file JPosition3D.hh.

229 {
230 R.rotate_back(__y, __z);
231
232 return *this;
233 }

◆ rotate_back() [4/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Y & R)
inlineinherited

Rotate back around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 256 of file JPosition3D.hh.

257 {
258 R.rotate_back(__x, __z);
259
260 return *this;
261 }

◆ rotate_back() [5/6]

JPosition3D & JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Z & R)
inlineinherited

Rotate back around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 284 of file JPosition3D.hh.

285 {
286 R.rotate_back(__x, __y);
287
288 return *this;
289 }

◆ rotate_back() [6/6]

void JGEOMETRY3D::JQuaternion3D::rotate_back ( double & __x,
double & __y,
double & __z ) const
inlineinherited

Rotate back.

Parameters
__xx value
__yy value
__zz value

Definition at line 824 of file JQuaternion3D.hh.

825 {
826 const double qx = 2.0 * (__d*__y - __c*__z);
827 const double qy = 2.0 * (__b*__z - __d*__x);
828 const double qz = 2.0 * (__c*__x - __b*__y);
829
830 __x = __x - __c*qz + __d*qy + __a*qx;
831 __y = __y + __b*qz + __a*qy - __d*qx;
832 __z = __z + __a*qz - __b*qy + __c*qx;
833 }

◆ transform() [1/3]

void JDETECTOR::JModule::transform ( const JRotation3D & R,
const JVector3D & pos )
inlineinherited

Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&, const JVector3D&)).

Parameters
Rrotation matrix
posposition of origin (after rotation)

Definition at line 346 of file JModule.hh.

348 {
350
351 for (iterator i = this->begin(); i != this->end(); ++i) {
352 i->transform(R, pos);
353 }
354 }
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.

◆ transform() [2/3]

void JDETECTOR::JModule::transform ( const JTransformation3D & T)
inlineinherited

Transformation of geometry.

Parameters
Ttransformation

Definition at line 362 of file JModule.hh.

363 {
364 JPosition3D::transform(T.getRotation(), T.getPosition());
365
366 for (iterator i = this->begin(); i != this->end(); ++i) {
367 i->transform(T);
368 }
369 }

◆ transform() [3/3]

JVector3D & JGEOMETRY3D::JVector3D::transform ( const JMatrix3D & T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 206 of file JVector3D.hh.

207 {
208 T.transform(__x, __y, __z);
209
210 return *this;
211 }

◆ set() [1/3]

JModule & JDETECTOR::JModule::set ( const JVector3D & pos)
inlineinherited

Set position.

Parameters
posposition
Returns
this module

Definition at line 408 of file JModule.hh.

409 {
410 return add(pos - this->getPosition());
411 }
JModule & add(const JVector3D &pos)
Add position.
Definition JModule.hh:420

◆ set() [2/3]

JModule & JDETECTOR::JModule::set ( const double t0)
inlineinherited

Set time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 456 of file JModule.hh.

457 {
458 for (iterator i = begin(); i != end(); ++i) {
459 i->setT0(t0);
460 }
461
462 return *this;
463 }

◆ set() [3/3]

void JLANG::JStatus::set ( const int bit)
inlineinherited

Set PMT status.

Parameters
bitbit

Definition at line 209 of file JStatus.hh.

210 {
211 this->status |= (1<<bit);
212 }

◆ add() [1/3]

JModule & JDETECTOR::JModule::add ( const JVector3D & pos)
inlineinherited

Add position.

Parameters
posposition
Returns
this module

Definition at line 420 of file JModule.hh.

421 {
422 for (iterator i = begin(); i != end(); ++i) {
423 i->add(pos);
424 }
425
426 JPosition3D::add(pos);
427
428 return *this;
429 }

◆ add() [2/3]

JModule & JDETECTOR::JModule::add ( const double t0)
inlineinherited

Add time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 472 of file JModule.hh.

473 {
474 for (iterator i = begin(); i != end(); ++i) {
475 i->addT0(t0);
476 }
477
478 return *this;
479 }

◆ add() [3/3]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::add ( const JQuaternion3D & quaternion)
inlineinherited

Add quaternion.

Parameters
quaternionquaternion
Returns
this quaternion

Definition at line 637 of file JQuaternion3D.hh.

638 {
639 __a += quaternion.getA();
640 __b += quaternion.getB();
641 __c += quaternion.getC();
642 __d += quaternion.getD();
643
644 return *this;
645 }

◆ sub() [1/3]

JModule & JDETECTOR::JModule::sub ( const JVector3D & pos)
inlineinherited

Subtract position.

Parameters
posposition
Returns
this module

Definition at line 438 of file JModule.hh.

439 {
440 for (iterator i = begin(); i != end(); ++i) {
441 i->sub(pos);
442 }
443
444 JPosition3D::sub(pos);
445
446 return *this;
447 }
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition JVector3D.hh:158

◆ sub() [2/3]

JModule & JDETECTOR::JModule::sub ( const double t0)
inlineinherited

Subtract time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 488 of file JModule.hh.

489 {
490 for (iterator i = begin(); i != end(); ++i) {
491 i->subT0(t0);
492 }
493
494 return *this;
495 }

◆ sub() [3/3]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::sub ( const JQuaternion3D & quaternion)
inlineinherited

Subtract quaternion.

Parameters
quaternionquaternion
Returns
this quaternion

Definition at line 654 of file JQuaternion3D.hh.

655 {
656 __a -= quaternion.getA();
657 __b -= quaternion.getB();
658 __c -= quaternion.getC();
659 __d -= quaternion.getD();
660
661 return *this;
662 }

◆ operator+=()

JModule & JDETECTOR::JModule::operator+= ( const JVector3D & pos)
inlineinherited

Add position.

Parameters
posposition
Returns
this module

Definition at line 504 of file JModule.hh.

505 {
506 return this->add(pos);
507 }

◆ operator-=()

JModule & JDETECTOR::JModule::operator-= ( const JVector3D & pos)
inlineinherited

Subtract position.

Parameters
posposition
Returns
this module

Definition at line 516 of file JModule.hh.

517 {
518 return this->sub(pos);
519 }
JModule & sub(const JVector3D &pos)
Subtract position.
Definition JModule.hh:438

◆ has()

bool JLANG::JStatus::has ( const int bit) const
inlineinherited

Test PMT status.

Parameters
bitbit
Returns
true if bit is set; else false

Definition at line 198 of file JStatus.hh.

199 {
200 return (this->status & (1<<bit)) != 0;
201 }

◆ reset() [2/2]

void JLANG::JStatus::reset ( const int bit)
inlineinherited

Reset PMT status.

Parameters
bitbit

Definition at line 220 of file JStatus.hh.

221 {
222 this->status &= ~(1<<bit);
223 }

◆ getID() [1/2]

template<class T >
int JLANG::JObjectID< T >::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 63 of file JObjectID.hh.

64 {
65 return _id_;
66 }

◆ getID() [2/2]

template<class T >
int & JLANG::JObjectID< T >::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 74 of file JObjectID.hh.

75 {
76 return _id_;
77 }

◆ setID()

template<class T >
void JLANG::JObjectID< T >::setID ( const int id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 85 of file JObjectID.hh.

86 {
87 this->_id_ = id;
88 }

◆ less() [1/3]

template<class T >
bool JLANG::JObjectID< T >::less ( const JObjectID< T > & object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 97 of file JObjectID.hh.

98 {
99 return this->getID() < object.getID();
100 }
int getID() const
Get identifier.
Definition JObjectID.hh:63

◆ less() [2/3]

template<class T >
bool JLANG::JObjectID< T >::less ( const int id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 109 of file JObjectID.hh.

110 {
111 return this->getID() < id;
112 }

◆ less() [3/3]

bool JDETECTOR::JLocation::less ( const JLocation & location) const
inlineinherited

Less than method.

Parameters
locationmodule location
Returns
true if first location before second location; else false

Definition at line 158 of file JLocation.hh.

159 {
160 if (this->getString() == location.getString())
161 return this->getFloor() < location.getFloor();
162 else
163 return this->getString() < location.getString();
164 }
int getFloor() const
Get floor number.
Definition JLocation.hh:146
int getString() const
Get string number.
Definition JLocation.hh:135

◆ more()

template<class T >
bool JLANG::JObjectID< T >::more ( const int id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 121 of file JObjectID.hh.

122 {
123 return this->getID() > id;
124 }

◆ getLocation() [1/2]

const JLocation & JDETECTOR::JLocation::getLocation ( ) const
inlineinherited

Get location.

Returns
location

Definition at line 70 of file JLocation.hh.

71 {
72 return static_cast<const JLocation&>(*this);
73 }
JLocation()
Default constructor.
Definition JLocation.hh:45

◆ getLocation() [2/2]

JLocation & JDETECTOR::JLocation::getLocation ( )
inlineinherited

Get location.

Returns
location

Definition at line 81 of file JLocation.hh.

82 {
83 return static_cast<JLocation&>(*this);
84 }

◆ setLocation()

void JDETECTOR::JLocation::setLocation ( const JLocation & location)
inlineinherited

Set location.

Parameters
locationlocation

Definition at line 92 of file JLocation.hh.

93 {
94 static_cast<JLocation&>(*this) = location;
95 }

◆ toString() [1/2]

std::string JDETECTOR::JLocation::toString ( ) const
inlineinherited

Convert module location to string.

Returns
string

Definition at line 103 of file JLocation.hh.

104 {
105 return toString("% %");
106 }
std::string toString() const
Convert module location to string.
Definition JLocation.hh:103

◆ toString() [2/2]

std::string JDETECTOR::JLocation::toString ( const std::string & fmt,
const std::string target = "%" ) const
inlineinherited

Convert module loation to string.

The targets target in the format string fmt are consecutively replaced by floor and string.

Parameters
fmtformat
targettarget
Returns
string

Definition at line 119 of file JLocation.hh.

120 {
121 JLANG::JString buffer(fmt);
122
123 buffer.replace(target, string, 1);
124 buffer.replace(target, floor, 1);
125
126 return buffer;
127 }
Wrapper class around STL string class.
Definition JString.hh:29

◆ getString()

int JDETECTOR::JLocation::getString ( ) const
inlineinherited

Get string number.

Returns
string number

Definition at line 135 of file JLocation.hh.

136 {
137 return string;
138 }

◆ getFloor()

int JDETECTOR::JLocation::getFloor ( ) const
inlineinherited

Get floor number.

Returns
floor number

Definition at line 146 of file JLocation.hh.

147 {
148 return floor;
149 }

◆ getPosition() [1/2]

const JPosition3D & JGEOMETRY3D::JPosition3D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 130 of file JPosition3D.hh.

131 {
132 return static_cast<const JPosition3D&>(*this);
133 }

◆ getPosition() [2/2]

JPosition3D & JGEOMETRY3D::JPosition3D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 141 of file JPosition3D.hh.

142 {
143 return static_cast<JPosition3D&>(*this);
144 }

◆ setPosition()

void JGEOMETRY3D::JPosition3D::setPosition ( const JVector3D & pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 152 of file JPosition3D.hh.

153 {
154 static_cast<JVector3D&>(*this) = pos;
155 }

◆ operator JAngle3D()

JGEOMETRY3D::JPosition3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 163 of file JPosition3D.hh.

164 {
165 return JAngle3D(getX(), getY(), getZ());
166 }
double getY() const
Get y position.
Definition JVector3D.hh:104
double getZ() const
Get z position.
Definition JVector3D.hh:115
double getX() const
Get x position.
Definition JVector3D.hh:94

◆ operator JVersor3D() [1/2]

JGEOMETRY3D::JPosition3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 174 of file JPosition3D.hh.

175 {
176 return JVersor3D(getX(), getY(), getZ());
177 }

◆ operator JVersor3D() [2/2]

JGEOMETRY3D::JQuaternion3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 520 of file JQuaternion3D.hh.

521 {
522 return JVersor3D(this->getB(), this->getC(), this->getD());
523 }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.

◆ transform_back()

void JGEOMETRY3D::JPosition3D::transform_back ( const JRotation3D & R,
const JVector3D & pos )
inlineinherited

Transform back position.

The final position is obtained as follows:

  1. offset position with position pos;
  2. rotation of postion according matrix R;
Parameters
Rrotation matrix
posposition of origin (before rotation)

Definition at line 359 of file JPosition3D.hh.

361 {
362 // offset with respect to origin
363
364 add(pos);
365
366 // rotate back geometry to system with particle direction along z-axis
367
368 rotate_back(R);
369 }

◆ getDot() [1/5]

double JGEOMETRY3D::JPosition3D::getDot ( const JAngle3D & angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 378 of file JPosition3D.hh.

379 {
380 return
381 getX() * angle.getDX() +
382 getY() * angle.getDY() +
383 getZ() * angle.getDZ();
384 }

◆ getDot() [2/5]

double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3D & dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 393 of file JPosition3D.hh.

394 {
395 return
396 getX() * dir.getDX() +
397 getY() * dir.getDY() +
398 getZ() * dir.getDZ();
399 }

◆ getDot() [3/5]

double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3Z & dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 408 of file JPosition3D.hh.

409 {
410 return
411 getX() * dir.getDX() +
412 getY() * dir.getDY() +
413 getZ() * dir.getDZ();
414 }

◆ getDot() [4/5]

double JGEOMETRY3D::JVector3D::getDot ( const JVector3D & vector) const
inlineinherited

Get dot product.

Parameters
vectorvector
Returns
dot product

Definition at line 282 of file JVector3D.hh.

283 {
284 return
285 getX() * vector.getX() +
286 getY() * vector.getY() +
287 getZ() * vector.getZ();
288 }

◆ getDot() [5/5]

double JGEOMETRY3D::JQuaternion3D::getDot ( const JQuaternion3D & quaternion) const
inlineinherited

Get dot product.

Parameters
quaternionquaternion
Returns
dot product

Definition at line 933 of file JQuaternion3D.hh.

934 {
935 return
936 getA() * quaternion.getA() -
937 getB() * quaternion.getB() -
938 getC() * quaternion.getC() -
939 getD() * quaternion.getD();
940 }
double getA() const
Get a value.

◆ operator JVector2D()

JGEOMETRY3D::JVector3D::operator JVector2D ( ) const
inlineinherited

Type conversion operator.

Returns
JVector2D

Definition at line 83 of file JVector3D.hh.

84 {
85 return JVector2D(this->getX(), this->getY());
86 }

◆ getX()

double JGEOMETRY3D::JVector3D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 94 of file JVector3D.hh.

95 {
96 return __x;
97 }

◆ getY()

double JGEOMETRY3D::JVector3D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 104 of file JVector3D.hh.

105 {
106 return __y;
107 }

◆ getZ()

double JGEOMETRY3D::JVector3D::getZ ( ) const
inlineinherited

Get z position.

Returns
z position

Definition at line 115 of file JVector3D.hh.

116 {
117 return __z;
118 }

◆ negate() [1/2]

JVector3D & JGEOMETRY3D::JVector3D::negate ( )
inlineinherited

Negate vector.

Returns
this vector

Definition at line 126 of file JVector3D.hh.

127 {
128 __x = -__x;
129 __y = -__y;
130 __z = -__z;
131
132 return *this;
133 }

◆ negate() [2/2]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::negate ( )
inlineinherited

Negate quaternion.

Returns
this quaternion

Definition at line 620 of file JQuaternion3D.hh.

621 {
622 __a = -__a;
623 __b = -__b;
624 __c = -__c;
625 __d = -__d;
626
627 return *this;
628 }

◆ mul() [1/9]

JVector3D & JGEOMETRY3D::JVector3D::mul ( const double factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 174 of file JVector3D.hh.

175 {
176 __x *= factor;
177 __y *= factor;
178 __z *= factor;
179
180 return *this;
181 }

◆ mul() [2/9]

template<class JFirst_t , class JSecond_t >
JFirst_t & JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t & object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355 {
356 return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357 }

◆ mul() [3/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const double factor)
inlineinherited

Scale quaternion.

Parameters
factormultiplication factor
Returns
this quaternion

Definition at line 671 of file JQuaternion3D.hh.

672 {
673 __a *= factor;
674 __b *= factor;
675 __c *= factor;
676 __d *= factor;
677
678 return *this;
679 }

◆ mul() [4/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D & first,
const JQuaternion3X & second )
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (also called cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 708 of file JQuaternion3D.hh.

709 {
710 __a = first.getA() * second.getA() - first.getB() * second.getB();
711 __b = first.getA() * second.getB() + first.getB() * second.getA();
712 __c = first.getC() * second.getA() + first.getD() * second.getB();
713 __d = -first.getC() * second.getB() + first.getD() * second.getA();
714
715 return *this;
716 }

◆ mul() [5/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D & first,
const JQuaternion3Y & second )
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 728 of file JQuaternion3D.hh.

730 {
731 __a = first.getA() * second.getA() - first.getC() * second.getC();
732 __b = first.getB() * second.getA() - first.getD() * second.getC();
733 __c = first.getA() * second.getC() + first.getC() * second.getA();
734 __d = first.getB() * second.getC() + first.getD() * second.getA();
735
736 return *this;
737 }

◆ mul() [6/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D & first,
const JQuaternion3Z & second )
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 749 of file JQuaternion3D.hh.

751 {
752 __a = first.getA() * second.getA() - first.getD() * second.getD();
753 __b = first.getB() * second.getA() + first.getC() * second.getD();
754 __c = -first.getB() * second.getD() + first.getC() * second.getA();
755 __d = first.getA() * second.getD() + first.getD() * second.getA();
756
757 return *this;
758 }

◆ mul() [7/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D & first,
const JQuaternion3D & second )
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 770 of file JQuaternion3D.hh.

772 {
773 __a = first.getA() * second.getA() - first.getB() * second.getB() - first.getC() * second.getC() - first.getD() * second.getD();
774 __b = first.getA() * second.getB() + first.getB() * second.getA() + first.getC() * second.getD() - first.getD() * second.getC();
775 __c = first.getA() * second.getC() - first.getB() * second.getD() + first.getC() * second.getA() + first.getD() * second.getB();
776 __d = first.getA() * second.getD() + first.getB() * second.getC() - first.getC() * second.getB() + first.getD() * second.getA();
777
778 return *this;
779 }

◆ mul() [8/9]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3X & qx,
const JQuaternion3Y & qy,
const JQuaternion3Z & qz )
inlineinherited

Quaternion multiplication.

Parameters
qxrotation around x-axis
qyrotation around y-axis
qzrotation around x-axis
Returns
this quaternion

Definition at line 790 of file JQuaternion3D.hh.

793 {
794 return *this = JQuaternion3D().setIdentity().mul(qz).mul(qy).mul(qx);
795 }
JQuaternion3D()
Default constructor.

◆ mul() [9/9]

template<class JFirst_t , class JSecond_t >
JFirst_t & JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t & object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355 {
356 return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357 }

◆ div() [1/2]

JVector3D & JGEOMETRY3D::JVector3D::div ( const double factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 190 of file JVector3D.hh.

191 {
192 __x /= factor;
193 __y /= factor;
194 __z /= factor;
195
196 return *this;
197 }

◆ div() [2/2]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::div ( const double factor)
inlineinherited

Scale quaternion.

Parameters
factordivision factor
Returns
this quaternion

Definition at line 688 of file JQuaternion3D.hh.

689 {
690 __a /= factor;
691 __b /= factor;
692 __c /= factor;
693 __d /= factor;
694
695 return *this;
696 }

◆ equals() [1/3]

bool JGEOMETRY3D::JVector3D::equals ( const JVector3D & vector,
const double precision = std::numeric_limits<double>::min() ) const
inlineinherited

Check equality.

Parameters
vectorvector
precisionprecision
Returns
true if vectors are equal; else false

Definition at line 221 of file JVector3D.hh.

223 {
224 return (fabs(getX() - vector.getX()) <= precision &&
225 fabs(getY() - vector.getY()) <= precision &&
226 fabs(getZ() - vector.getZ()) <= precision);
227 }

◆ equals() [2/3]

bool JGEOMETRY3D::JQuaternion3D::equals ( const JQuaternion3D & quaternion,
const double precision = std::numeric_limits<double>::min() ) const
inlineinherited

Check equality.

Parameters
quaternionquaternion
precisionnumerical precision
Returns
true if quaternions are equal; else false

Definition at line 843 of file JQuaternion3D.hh.

845 {
846 return (fabs(getA() - quaternion.getA()) <= precision &&
847 fabs(getB() - quaternion.getB()) <= precision &&
848 fabs(getC() - quaternion.getC()) <= precision &&
849 fabs(getD() - quaternion.getD()) <= precision);
850 }

◆ equals() [3/3]

bool JLANG::JStatus::equals ( const JStatus & status) const
inlineinherited

Equal method.

Parameters
statusstatus
Returns
true if this status equal to given status; else false

Definition at line 162 of file JStatus.hh.

163 {
164 return this->status == status.status;
165 }

◆ getLengthSquared() [1/2]

double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 235 of file JVector3D.hh.

236 {
237 return getX()*getX() + getY()*getY() + getZ()*getZ();
238 }

◆ getLengthSquared() [2/2]

double JGEOMETRY3D::JQuaternion3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 886 of file JQuaternion3D.hh.

887 {
888 return getA()*getA() + getB()*getB() + getC()*getC() + getD()*getD();
889 }

◆ getLength() [1/2]

double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 246 of file JVector3D.hh.

247 {
248 return sqrt(getLengthSquared());
249 }
double getLengthSquared() const
Get length squared.
Definition JVector3D.hh:235

◆ getLength() [2/2]

double JGEOMETRY3D::JQuaternion3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 897 of file JQuaternion3D.hh.

898 {
899 return sqrt(getLengthSquared());
900 }
double getLengthSquared() const
Get length squared.

◆ getDistanceSquared() [1/2]

double JGEOMETRY3D::JVector3D::getDistanceSquared ( const JVector3D & pos) const
inlineinherited

Get squared of distance to point.

Parameters
posposition
Returns
square of distance

Definition at line 258 of file JVector3D.hh.

259 {
260 return JVector3D(pos).sub(*this).getLengthSquared();
261 }

◆ getDistanceSquared() [2/2]

double JGEOMETRY3D::JQuaternion3D::getDistanceSquared ( const JQuaternion3D & quaternion) const
inlineinherited

Get squared of distance to quaternion.

Parameters
quaternionquaternion
Returns
square of distance

Definition at line 909 of file JQuaternion3D.hh.

910 {
911 return JQuaternion3D(quaternion).sub(*this).getLengthSquared();
912 }

◆ getDistance() [1/2]

double JGEOMETRY3D::JVector3D::getDistance ( const JVector3D & pos) const
inlineinherited

Get distance to point.

Parameters
posposition
Returns
distance

Definition at line 270 of file JVector3D.hh.

271 {
272 return sqrt(getDistanceSquared(pos));
273 }
double getDistanceSquared(const JVector3D &pos) const
Get squared of distance to point.
Definition JVector3D.hh:258

◆ getDistance() [2/2]

double JGEOMETRY3D::JQuaternion3D::getDistance ( const JQuaternion3D & quaternion) const
inlineinherited

Get distance to quaternion.

Parameters
quaternionquaternion
Returns
distance

Definition at line 921 of file JQuaternion3D.hh.

922 {
923 return sqrt(getDistanceSquared(quaternion));
924 }
double getDistanceSquared(const JQuaternion3D &quaternion) const
Get squared of distance to quaternion.

◆ getCross()

JVector3D & JGEOMETRY3D::JVector3D::getCross ( const JVector3D & first,
const JVector3D & second )
inlineinherited

Get cross product.

Note that this vector should not overlap with the first or second vector,

Parameters
firstfirst vector
secondsecond vector
Returns
this vector

Definition at line 299 of file JVector3D.hh.

301 {
302 __x = first .getY() * second.getZ() - second.getY() * first .getZ();
303 __y = second.getX() * first .getZ() - first .getX() * second.getZ();
304 __z = first .getX() * second.getY() - second.getX() * first .getY();
305
306 return *this;
307 }

◆ getIdentity()

static const JQuaternion3D & JGEOMETRY3D::JQuaternion3D::getIdentity ( )
inlinestaticinherited

Get identity quaternion.

Returns
identity quaternion

Definition at line 463 of file JQuaternion3D.hh.

464 {
465 static const JQuaternion3D Q = JQuaternion3D().setIdentity();
466
467 return Q;
468 }

◆ getQuaternion() [1/2]

const JQuaternion3D & JGEOMETRY3D::JQuaternion3D::getQuaternion ( ) const
inlineinherited

Get quaternion.

Returns
quaternion

Definition at line 476 of file JQuaternion3D.hh.

477 {
478 return static_cast<const JQuaternion3D&>(*this);
479 }

◆ getQuaternion() [2/2]

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::getQuaternion ( )
inlineinherited

Get quaternion.

Returns
quaternion

Definition at line 487 of file JQuaternion3D.hh.

488 {
489 return static_cast<JQuaternion3D&>(*this);
490 }

◆ setQuaternion()

void JGEOMETRY3D::JQuaternion3D::setQuaternion ( const JQuaternion3D & quaternion)
inlineinherited

Set quaternion.

Parameters
quaternionquaternion

Definition at line 498 of file JQuaternion3D.hh.

499 {
500 static_cast<JQuaternion3D&>(*this) = quaternion;
501 }

◆ operator JVector3D()

JGEOMETRY3D::JQuaternion3D::operator JVector3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 509 of file JQuaternion3D.hh.

510 {
511 return JVector3D(this->getB(), this->getC(), this->getD());
512 }

◆ getAngle()

double JGEOMETRY3D::JQuaternion3D::getAngle ( ) const
inlineinherited

Get rotation angle.

Returns
angle [rad]

Definition at line 531 of file JQuaternion3D.hh.

532 {
533 return atan2(sqrt(this->getB()*this->getB() +
534 this->getC()*this->getC() +
535 this->getD()*this->getD()),
536 this->getA()) * 2.0;
537 }

◆ getA()

double JGEOMETRY3D::JQuaternion3D::getA ( ) const
inlineinherited

Get a value.

Returns
a value

Definition at line 545 of file JQuaternion3D.hh.

546 {
547 return __a;
548 }

◆ getB()

double JGEOMETRY3D::JQuaternion3D::getB ( ) const
inlineinherited

Get b value.

Returns
b value

Definition at line 556 of file JQuaternion3D.hh.

557 {
558 return __b;
559 }

◆ getC()

double JGEOMETRY3D::JQuaternion3D::getC ( ) const
inlineinherited

Get c value.

Returns
c value

Definition at line 567 of file JQuaternion3D.hh.

568 {
569 return __c;
570 }

◆ getD()

double JGEOMETRY3D::JQuaternion3D::getD ( ) const
inlineinherited

Get d value.

Returns
d value

Definition at line 578 of file JQuaternion3D.hh.

579 {
580 return __d;
581 }

◆ setIdentity()

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::setIdentity ( )
inlineinherited

Set to identity quaternion.

Returns
this quaternion

Definition at line 589 of file JQuaternion3D.hh.

590 {
591 __a = 1.0;
592 __b = 0.0;
593 __c = 0.0;
594 __d = 0.0;
595
596 return *this;
597 }

◆ conjugate()

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::conjugate ( )
inlineinherited

Conjugate quaternion.

Returns
this quaternion

Definition at line 605 of file JQuaternion3D.hh.

606 {
607 __b = -__b;
608 __c = -__c;
609 __d = -__d;
610
611 return *this;
612 }

◆ isIdentity()

bool JGEOMETRY3D::JQuaternion3D::isIdentity ( const double precision = std::numeric_limits<double>::min()) const
inlineinherited

Test identity.

Parameters
precisionprecision
Returns
true if identity quaternion; else false

Definition at line 859 of file JQuaternion3D.hh.

860 {
861 if (fabs(getA()) <= precision) {
862
863 if (fabs(getB()) <= precision)
864 return ((fabs(getC()) <= precision && fabs(fabs(getD()) - 1.0) <= precision) ||
865 (fabs(fabs(getC()) - 1.0) <= precision && fabs(getD()) <= precision));
866 else
867 return (fabs(fabs(getB()) - 1.0) <= precision &&
868 fabs(getC()) <= precision &&
869 fabs(getD()) <= precision);
870
871 } else {
872
873 return (fabs(fabs(getA()) - 1.0) <= precision &&
874 fabs(getB()) <= precision &&
875 fabs(getC()) <= precision &&
876 fabs(getD()) <= precision);
877 }
878 }

◆ getConjugate()

JQuaternion3D JGEOMETRY3D::JQuaternion3D::getConjugate ( ) const
inlineinherited

Get conjugate of this quaternion.

Returns
conjugate quaternion

Definition at line 948 of file JQuaternion3D.hh.

949 {
950 return JQuaternion3D(*this).conjugate();
951 }

◆ normalise()

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::normalise ( )
inlineinherited

Normalise quaternion.

Returns
this quaternion

Definition at line 959 of file JQuaternion3D.hh.

960 {
961 const double v = getLength();
962
963 if (v != 0.0) {
964 mul(1.0 / v);
965 }
966
967 return *this;
968 }
double getLength() const
Get length.
JQuaternion3D & mul(const double factor)
Scale quaternion.

◆ pow()

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::pow ( const double y)
inlineinherited

Raise quaternion to given power.

Parameters
ypower
Returns
this object

Definition at line 977 of file JQuaternion3D.hh.

978 {
979 const double v = sqrt(getB() * getB() +
980 getC() * getC() +
981 getD() * getD());
982
983 if (v != 0.0) {
984
985 const JVersor3D u(getB(), getC(), getD());
986
987 const double theta = atan2(v, getA());
988
989 *this = JQuaternion3D(2.0 * theta * y, u);
990 }
991
992 return *this;
993 }

◆ interpolate()

JQuaternion3D & JGEOMETRY3D::JQuaternion3D::interpolate ( const JQuaternion3D & object,
const double alpha )
inlineinherited

Interpolation between quaternions.

The result is equal to *this = (1 - alpha) * (*this) + (alpha) * (object).

Parameters
objectobject
alphainterpolation factor [0, 1]
Returns
this object

Definition at line 1004 of file JQuaternion3D.hh.

1006 {
1007 const double MAXIMAL_DOT_PRODUCT = 0.9995;
1008
1009 JQuaternion3D v0(*this);
1010 JQuaternion3D v1(object);
1011
1012 v0.normalise();
1013 v1.normalise();
1014
1015 double dot = v0.getDot(v1);
1016
1017 if (dot < 0.0) {
1018 v1 = -v1;
1019 dot = -dot;
1020 }
1021
1022 double s1 = alpha;
1023 double s0 = 1.0 - alpha;
1024
1025 if (dot <= MAXIMAL_DOT_PRODUCT) {
1026
1027 const double theta_0 = acos(dot);
1028 const double theta_1 = theta_0 * alpha;
1029
1030 s1 = sin(theta_1) / sin(theta_0);
1031 s0 = cos(theta_1) - dot * s1;
1032 }
1033
1034 *this = (s0 * v0) + (s1 * v1);
1035
1036 return normalise();
1037 }
JQuaternion3D & normalise()
Normalise quaternion.

◆ getCalibration() [1/2]

const JCalibration & JDETECTOR::JCalibration::getCalibration ( ) const
inlineinherited

Get calibration.

Returns
calibration

Definition at line 67 of file JDetector/JCalibration.hh.

68 {
69 return *this;
70 }

◆ getCalibration() [2/2]

JCalibration & JDETECTOR::JCalibration::getCalibration ( )
inlineinherited

Get calibration.

Returns
calibration

Definition at line 78 of file JDetector/JCalibration.hh.

79 {
80 return *this;
81 }

◆ setCalibration()

void JDETECTOR::JCalibration::setCalibration ( const JCalibration & cal)
inlineinherited

Set calibration.

Parameters
calcalibration

Definition at line 89 of file JDetector/JCalibration.hh.

90 {
91 *this = cal;
92 }

◆ getT0()

double JDETECTOR::JCalibration::getT0 ( ) const
inlineinherited

Get time offset.

Returns
time offset [ns]

Definition at line 100 of file JDetector/JCalibration.hh.

101 {
102 return t0;
103 }

◆ setT0()

void JDETECTOR::JCalibration::setT0 ( const double t0)
inlineinherited

Set time offset.

Parameters
t0time offset [ns]

Definition at line 111 of file JDetector/JCalibration.hh.

112 {
113 this->t0 = t0;
114 }

◆ addT0()

void JDETECTOR::JCalibration::addT0 ( const double t0)
inlineinherited

Add time offset.

Parameters
t0time offset [ns]

Definition at line 122 of file JDetector/JCalibration.hh.

123 {
124 this->t0 += t0;
125 }

◆ subT0()

void JDETECTOR::JCalibration::subT0 ( const double t0)
inlineinherited

Subtract time offset.

Parameters
t0time offset [ns]

Definition at line 133 of file JDetector/JCalibration.hh.

134 {
135 this->t0 -= t0;
136 }

◆ getStatus() [1/8]

status_type JLANG::JStatus::getStatus ( const JType< status_type > & type) const
inlineinherited

Get status.

Returns
status

Definition at line 60 of file JStatus.hh.

61 {
62 return this->status;
63 }

◆ getStatus() [2/8]

JStatus JLANG::JStatus::getStatus ( const JType< JStatus > & type) const
inlineinherited

Get status.

Returns
status

Definition at line 71 of file JStatus.hh.

72 {
73 return *this;
74 }

◆ getStatus() [3/8]

template<class T >
const T JLANG::JStatus::getStatus ( ) const
inlineinherited

Get status.

Returns
status

Definition at line 83 of file JStatus.hh.

84 {
85 return getStatus(JType<T>());
86 }
const T getStatus() const
Get status.
Definition JStatus.hh:83

◆ getStatus() [4/8]

const JStatus & JLANG::JStatus::getStatus ( ) const
inlineinherited

Get status.

Returns
status

Definition at line 94 of file JStatus.hh.

95 {
96 return static_cast<const JStatus&>(*this);
97 }
JStatus()
Default constructor.
Definition JStatus.hh:40

◆ getStatus() [5/8]

status_type & JLANG::JStatus::getStatus ( const JType< status_type > & type)
inlineinherited

Get status.

Returns
status

Definition at line 105 of file JStatus.hh.

106 {
107 return this->status;
108 }

◆ getStatus() [6/8]

JStatus & JLANG::JStatus::getStatus ( const JType< JStatus > & type)
inlineinherited

Get status.

Returns
status

Definition at line 116 of file JStatus.hh.

117 {
118 return *this;
119 }

◆ getStatus() [7/8]

template<class T >
T & JLANG::JStatus::getStatus ( )
inlineinherited

Get status.

Returns
status

Definition at line 128 of file JStatus.hh.

129 {
130 return getStatus(JType<T>());
131 }

◆ getStatus() [8/8]

JStatus & JLANG::JStatus::getStatus ( )
inlineinherited

Get status.

Returns
status

Definition at line 139 of file JStatus.hh.

140 {
141 return static_cast<JStatus&>(*this);
142 }

◆ setStatus()

void JLANG::JStatus::setStatus ( const JStatus & status)
inlineinherited

Set status.

Parameters
statusstatus

Definition at line 150 of file JStatus.hh.

151 {
152 this->status = status.status;
153 }

◆ getAND()

JStatus JLANG::JStatus::getAND ( const JStatus & status) const
inlineinherited

Get combined status.

Parameters
statusstatus
Returns
status

Definition at line 174 of file JStatus.hh.

175 {
176 return JStatus(this->status & status.status);
177 }

◆ getOR()

JStatus JLANG::JStatus::getOR ( const JStatus & status) const
inlineinherited

Get combined status.

Parameters
statusstatus
Returns
status

Definition at line 186 of file JStatus.hh.

187 {
188 return JStatus(this->status | status.status);
189 }

◆ getCombinatorics()

const JCombinatorics & JTOOLS::JCombinatorics::getCombinatorics ( ) const
inlineinherited

Get combinatorics.

Returns
combinatorics

Definition at line 89 of file JCombinatorics.hh.

90 {
91 return *this;
92 }

◆ configure()

void JTOOLS::JCombinatorics::configure ( const int numberOfIndices)
inlineinherited

Configure.

Parameters
numberOfIndicesnumber of indices

Definition at line 100 of file JCombinatorics.hh.

101 {
102 zbuf1D.clear();
103
104 zbuf2D.resize(numberOfIndices);
105
106 for (int i = 0; i != numberOfIndices; ++i) {
107 zbuf2D[i].resize(numberOfIndices);
108 }
109
110 for (int i = 0; i != numberOfIndices; ++i) {
111
112 zbuf2D[i][i] = -1;
113
114 for (int j = i; ++j != numberOfIndices; ) {
115
116 zbuf2D[i][j] = zbuf1D.size();
117 zbuf2D[j][i] = zbuf1D.size();
118
119 zbuf1D.push_back(pair_type(i,j));
120 }
121 }
122 }
std::vector< pair_type > zbuf1D
std::vector< std::vector< int > > zbuf2D
JCombinatorics::pair_type pair_type
int j
Definition JPolint.hh:801

◆ getNumberOfIndices()

size_t JTOOLS::JCombinatorics::getNumberOfIndices ( ) const
inlineinherited

Get number of indices.

Returns
number of indices

Definition at line 130 of file JCombinatorics.hh.

131 {
132 return zbuf2D.size();
133 }

◆ getNumberOfPairs()

size_t JTOOLS::JCombinatorics::getNumberOfPairs ( ) const
inlineinherited

Get number of pairs.

Returns
number of pairs

Definition at line 141 of file JCombinatorics.hh.

142 {
143 return zbuf1D.size();
144 }

◆ getIndex() [2/3]

int JTOOLS::JCombinatorics::getIndex ( const int first,
const int second ) const
inlineinherited

Get index of pair of indices.

Parameters
firstfirst address
secondsecond address
Returns
index (-1 if first and second address are equal)

Definition at line 154 of file JCombinatorics.hh.

155 {
156 return zbuf2D[first][second];
157 }

◆ getIndex() [3/3]

int JTOOLS::JCombinatorics::getIndex ( const pair_type & pair) const
inlineinherited

Get index of pair.

Parameters
pairpair
Returns
index (-1 if first and second address are equal)

Definition at line 166 of file JCombinatorics.hh.

167 {
168 return getIndex(pair.first, pair.second);
169 }
int getIndex(const int first, const int second) const
Get index of pair of indices.

◆ getPair()

const pair_type & JTOOLS::JCombinatorics::getPair ( const int index) const
inlineinherited

Get pair of indices for given index.

Parameters
indexindex
Returns
pair of indices

Definition at line 178 of file JCombinatorics.hh.

179 {
180 return zbuf1D[index];
181 }

◆ sort()

template<class JComparator_t >
void JTOOLS::JCombinatorics::sort ( JComparator_t comparator)
inlineinherited

Sort address pairs.

Parameters
comparatorcomparator for pairs

Definition at line 190 of file JCombinatorics.hh.

191 {
192 std::stable_sort(zbuf1D.begin(), zbuf1D.end(), comparator);
193
194 for (int i = 0; i != (int) zbuf1D.size(); ++i) {
195
196 const pair_type pair = zbuf1D[i];
197
198 zbuf2D[pair.first][pair.second] = i;
199 zbuf2D[pair.second][pair.first] = i;
200 }
201
202 for (int i = 0; i != (int) zbuf2D.size(); ++i) {
203 zbuf2D[i][i] = -1;
204 }
205 }

◆ getSign() [1/2]

static int JTOOLS::JCombinatorics::getSign ( const int first,
const int second )
inlinestaticinherited

Sign of pair of indices.

Parameters
firstfirst address
secondsecond address
Returns
+1 if second >= first; else -1

Definition at line 215 of file JCombinatorics.hh.

216 {
217 return (second >= first ? +1 : -1);
218 }

◆ getSign() [2/2]

static int JTOOLS::JCombinatorics::getSign ( const pair_type & pair)
inlinestaticinherited

Sign of pair of indices.

Parameters
pairpair of indices
Returns
+1 if second >= first; else -1

Definition at line 227 of file JCombinatorics.hh.

228 {
229 return getSign(pair.first, pair.second);
230 }
static int getSign(const int first, const int second)
Sign of pair of indices.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JModel & object )
friend

Write model parameters to output stream.

Parameters
outoutput stream
objectmodel parameters
Returns
output stream

Definition at line 1607 of file JFitK40.hh.

1608 {
1609 using namespace std;
1610
1611 out << "Module " << setw(10) << object.getID() << endl;
1612 out << "option " << object.option << endl;
1613 out << "index " << object.index << endl;
1614
1615 out << static_cast<const JModel_t&>(object);
1616
1617 return out;
1618 }

Member Data Documentation

◆ index

int JCALIBRATE::JModel::index
private

index of PMT used for fixed time offset

Definition at line 1621 of file JFitK40.hh.

◆ sigmaK40_ns

double JCALIBRATE::JModel::sigmaK40_ns = 0.54
private

intrinsic K40 arrival time spread [ns]

Definition at line 1622 of file JFitK40.hh.

◆ option

JOption_t JCALIBRATE::JModel::option
private

fit option (see JCALIBRATE::JOption_t)

Definition at line 1623 of file JFitK40.hh.

◆ real

real_type JCALIBRATE::JModel::real
mutableprivate

Definition at line 1624 of file JFitK40.hh.

◆ model

JK40Parameters JCALIBRATE::JModel_t::model
inherited

Definition at line 1163 of file JFitK40.hh.

◆ transmittance

JTransmittance JCALIBRATE::JModel_t::transmittance
inherited

Definition at line 1164 of file JFitK40.hh.

◆ parameters

JPMTParameters_t JCALIBRATE::JModel_t::parameters[NUMBER_OF_PMTS]
inherited

Definition at line 1165 of file JFitK40.hh.

◆ _id_

template<class T >
int JLANG::JObjectID< T >::_id_
protectedinherited

Definition at line 153 of file JObjectID.hh.

◆ string

int JDETECTOR::JLocation::string
protectedinherited

Definition at line 235 of file JLocation.hh.

◆ floor

int JDETECTOR::JLocation::floor
protectedinherited

Definition at line 236 of file JLocation.hh.

◆ __x

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 310 of file JVector3D.hh.

◆ __y

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 311 of file JVector3D.hh.

◆ __z

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 312 of file JVector3D.hh.

◆ __a

double JGEOMETRY3D::JQuaternion3D::__a
protectedinherited

Definition at line 1117 of file JQuaternion3D.hh.

◆ __b

double JGEOMETRY3D::JQuaternion3D::__b
protectedinherited

Definition at line 1118 of file JQuaternion3D.hh.

◆ __c

double JGEOMETRY3D::JQuaternion3D::__c
protectedinherited

Definition at line 1119 of file JQuaternion3D.hh.

◆ __d

double JGEOMETRY3D::JQuaternion3D::__d
protectedinherited

Definition at line 1120 of file JQuaternion3D.hh.

◆ t0

double JDETECTOR::JCalibration::t0
protectedinherited

Definition at line 202 of file JDetector/JCalibration.hh.

◆ NUMBER_OF_STATUS_BITS

const int JLANG::JStatus::NUMBER_OF_STATUS_BITS = sizeof(status_type) * 8
staticinherited

number of status bits

Definition at line 34 of file JStatus.hh.

◆ status

status_type JLANG::JStatus::status
protectedinherited

Definition at line 252 of file JStatus.hh.

◆ zbuf1D

std::vector<pair_type> JTOOLS::JCombinatorics::zbuf1D
protectedinherited

Definition at line 234 of file JCombinatorics.hh.

◆ zbuf2D

std::vector<std::vector<int> > JTOOLS::JCombinatorics::zbuf2D
protectedinherited

Definition at line 235 of file JCombinatorics.hh.


The documentation for this struct was generated from the following file: