Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
JDETECTOR Namespace Reference

file Auxiliary data structures and methods for detector calibration. More...

Classes

class  JAnchor
 Data structure for anchor position on sea bed. More...
 
class  JCalibration
 Data structure for time calibration. More...
 
struct  JCalibrator
 Auxiliary class to apply (de-)calibration to template hit. More...
 
struct  JCalibrator< T, true >
 Template specialisation of JCalibrator for primitive data types. More...
 
struct  JCalibrator< JHit_t, false >
 Template specialisation of JCalibrator for non-primitive data types. More...
 
class  JTransferFunction1D
 Auxiliary class for a non-linear transfer function of TDC inside FPGA. More...
 
class  JCLBDefaultSimulator
 Default CLB simulation. More...
 
class  JCLBDefaultSimulatorInterface
 Default CLB simulation. More...
 
struct  JCLBInput
 Wrapper for CLB input. More...
 
class  JCLBSimulator
 Interface for CLB simulation. More...
 
class  JCompass
 Data structure for compass in three dimensions. More...
 
class  JDAQHitRouter
 Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structure for DAQ hits. More...
 
class  JDetector
 Detector data structure. More...
 
class  JDetectorAddressMap
 Lookup table for PMT addresses in detector. More...
 
struct  JPPM_DU_t
 Type definitions for different detectors.PPM_DU. More...
 
struct  JKM3NeT_t
 KM3NeT More...
 
struct  JMonteCarlo_t
 Monte Carlo. More...
 
struct  JAntares_t
 Antares More...
 
struct  JObsolete_t
 obsolete detector More...
 
struct  JKM3NeTDB_t
 KM3NeT with cable swaps according database (see JPMTSwapDB.cc) More...
 
class  JTemplateDetectorAddressMap
 Template lookup table for PMT addresses in detector. More...
 
class  JTemplateDetectorAddressMap< JObsolete_t >
 Template specialisation of JTemplateDetectorAddressMap for obsolete detector. More...
 
class  JTemplateDetectorAddressMap< JPPM_DU_t >
 Template specialisation of JTemplateDetectorAddressMap for PPM_DU detector. More...
 
class  JTemplateDetectorAddressMap< JKM3NeT_t >
 Template specialisation of JTemplateDetectorAddressMap for KM3NeT detector. More...
 
class  JTemplateDetectorAddressMap< JMonteCarlo_t >
 Template specialisation of JTemplateDetectorAddressMap for Monte Carlo detector. More...
 
class  JTemplateDetectorAddressMap< JKM3NeTDB_t >
 Template specialisation of JTemplateDetectorAddressMap for KM3NeT detector. More...
 
struct  JDetectorAddressMap_t
 Auxiliary class to extract detector address map from detector identifier. More...
 
struct  JDetectorAddressMap_t< JTypeList< JHead_t, JTail_t > >
 
struct  JDetectorAddressMap_t< JTypeList< JHead_t, JNullType > >
 
struct  JModuleMap_t
 Auxiliary data structure for module address map. More...
 
struct  JPMTCalibration_t
 Auxiliary data structure for PMT time calibration. More...
 
struct  JPMTStatus_t
 Auxiliary data structure for PMT status. More...
 
struct  JHVCalibration_t
 Data structure for PMT high-voltage calibration. More...
 
struct  JPMTThresholdCalibration_t
 Data structure for PMT threshold calibration. More...
 
struct  JModulePosition_t
 Auxiliary data structure for module position. More...
 
struct  JModuleRotation_t
 Auxiliary data structure for module rotation. More...
 
struct  JModuleStatus_t
 Auxiliary data structure for module status. More...
 
struct  JModuleCalibration_t
 Auxiliary data structure for module time calibration. More...
 
struct  JCompassRotation_t
 Auxiliary data structure for compass rotation. More...
 
class  JDetectorHeader
 Data structure for detector header. More...
 
class  JDetectorParameters
 Data structure for parameters for detector geometry. More...
 
class  JDetectorParametersHelper
 Auxiliary class for I/O of JDetectorParameters data structure. More...
 
class  JDetectorSimulator
 Detector simulation. More...
 
class  JDetectorSubset_t
 Detector subset without binary search functionality. More...
 
class  JDetectorSubset
 Detector subset with binary search functionality. More...
 
struct  JRotation
 Auxiliary class to get rotation matrix between two optical modules. More...
 
struct  JDetectorVersion
 Detector version. More...
 
struct  JGetDetectorVersion
 Auxiliary class to map detector version to numerical value. More...
 
struct  JPutDetectorVersion
 Auxiliary class to map numerical value to detector version. More...
 
struct  JHydrophone
 Type definition of hydrophone. More...
 
class  JK40DefaultSimulator
 Default implementation of the simulation of K40 background. More...
 
class  JK40DefaultSimulatorInterface
 Default K40 simulator interface. More...
 
class  JK40Simulator
 Interface for simulation of K40 background. More...
 
class  JLocation
 Logical location of module. More...
 
class  JModule
 Data structure for a composite optical module. More...
 
class  JModuleAddress
 Address of module in detector data structure. More...
 
struct  JPMTAddressTranslator
 Data structure to translate PMT physical to readout address. More...
 
class  JModuleAddressMap
 Lookup table for PMT addresses in optical module. More...
 
struct  JModuleComparator3Z_t
 Module comparator according its z-position. More...
 
struct  JModuleComparator3D_t
 Module comparator according its distance to origin. More...
 
class  JModuleGeometry
 Module geometry. More...
 
struct  JUTCDistance
 Auxiliary class for distance beteen UTC times. More...
 
struct  JModuleAttributes
 Data structure for module address and module attributes. More...
 
struct  JMaximalDistance
 Auxiliary class to match modules according maximal distance. More...
 
class  JModuleMapper
 Mapper for directly addressing of associated modules in the detector data structure. More...
 
class  JModuleRouter
 Router for direct addressing of module data in detector data structure. More...
 
struct  JGetModuleStatusBit
 Auxiliary class to map key to module status bit. More...
 
class  JMonteCarloDetector
 Monte Carlo detector (i.e. so-called .det file). More...
 
class  JPMT
 Data structure for PMT geometry, calibration and status. More...
 
class  JPMTAddress
 Address of PMT in detector data structure. More...
 
struct  JPMTAnalogueSignalProcessor
 PMT analogue signal processor. More...
 
class  JPMTChannel
 Auxiliary class to uniquely identify PMT readout channel. More...
 
struct  JModuleAnalogueSignalProcessor
 Auxiliary container for PMT analogue signal processors in same optical module. More...
 
class  JPMTDefaultSimulator
 Default PMT simulation. More...
 
class  JPMTDefaultSimulatorInterface
 Default PMT simulation interface. More...
 
class  JPMTIdentifier
 PMT identifier. More...
 
class  JPMTParameters
 Data structure for PMT parameters. More...
 
class  JPMTParametersMap
 Auxiliary class for map of PMT parameters. More...
 
class  JPMTPhysicalAddress
 Data structure for PMT physical address. More...
 
struct  JPMTRateRange
 Data structure for range of PMT rates. More...
 
class  JPMTReadoutAddress
 Data structure for PMT readout address. More...
 
class  JPMTRouter
 Router for direct addressing of PMT data in detector data structure. More...
 
class  JPMTSignalProcessorInterface
 PMT signal processor interface. More...
 
struct  JPhotoElectron
 Data structure for single photo-electron. More...
 
struct  JPMTSignal
 Data structure for PMT analogue signal. More...
 
struct  JPMTPulse
 Data structure for PMT digital pulse. More...
 
class  JPMTData
 Template data structure for PMT I/O. More...
 
class  JModuleData
 Data structure for PMT data corresponding to a detector module. More...
 
class  JPMTSimulator
 Interface for PMT simulation. More...
 
struct  JGetPMTStatusBit
 Auxiliary class to map key to PMT status bit. More...
 
struct  JTransitionTimeGenerator_t
 Auxiliary base class to generate PMT transition times based on measurements. More...
 
struct  JTransitionTimeGenerator
 Implementation to generate PMT transition times based on measurements by Oleg Kalekin et al. (see also examples/JDetector/JTTS.cc). More...
 
struct  JTransitionTimeGenerator38
 Implementation to generate PMT transition times based on measurements. More...
 
struct  JTransitionTimeGenerator41
 Implementation to generate PMT transition times based on measurements. More...
 
struct  JTransitionTimeGenerator67
 Implementation to generate PMT transition times based on measurements. More...
 
struct  JTransitionTimeGeneratorXX
 Implementation to generate PMT transition times based on measurements. More...
 
struct  getTransitionTime
 
struct  JTransitionTimeProbability_t
 Auxiliary base class for probability distibution of the PMT transition times based on measurements. More...
 
struct  JTransitionTimeProbability
 Implementation of probability distibution of the PMT transition times based on measurements by Oleg Kalekin et al. More...
 
struct  JTransitionTimeProbability38
 Implementation of probability distibution of the PMT transition times based on measurements. More...
 
struct  JTransitionTimeProbability41
 Implementation of probability distibution of the PMT transition times based on measurements. More...
 
struct  JTransitionTimeProbability67
 Implementation of probability distibution of the PMT transition times based on measurements. More...
 
struct  JTransitionTimeProbabilityXX
 Implementation of probability distibution of the PMT transition times based on measurements. More...
 
struct  getTransitionTimeProbability
 
class  JTransitionTimeProbability2D
 Auxiliary class to generate twofold PMT transition times. More...
 
struct  JStringCounter
 Auxiliary class for counting unique strings. More...
 
struct  JStringRouter
 Router for mapping of string identifier to index. More...
 
struct  JTransmitter
 Type definition of transmitter. More...
 
class  JTripod
 Data structure for tripod. More...
 
struct  JVersion
 Auxiliary class for version identifier. More...
 

Typedefs

typedef JPMTData< JPMTPulseJPMTOutput
 Type definition of PMT base output. More...
 
typedef JTYPELIST< JPPM_DU_t,
JKM3NeTDB_t, JKM3NeT_t,
JMonteCarlo_t >::typelist 
JDetectorTypes_t
 Type list of KM3NeT detector types (specific detectors first). More...
 
typedef std::vector
< JHVCalibration_t
JHVCalibration
 PMT high voltage calibration. More...
 
typedef std::vector
< JPMTThresholdCalibration_t
JPMTThresholdCalibration
 PMT threshold calibration. More...
 
typedef std::vector< JModuleMap_tJModuleMap
 module map More...
 
typedef std::vector
< JPMTCalibration_t
JPMTCalibration
 PMT time calibration. More...
 
typedef std::vector< JPMTStatus_tJPMTStatus
 PMT status. More...
 
typedef std::vector
< JModulePosition_t
JModulePosition
 Module position. More...
 
typedef std::vector
< JModuleRotation_t
JModuleRotation
 Module rotation. More...
 
typedef std::vector
< JModuleStatus_t
JModuleStatus
 Module status. More...
 
typedef std::vector
< JModuleCalibration_t
JModuleCalibration
 Module time calibration. More...
 
typedef std::vector
< JCompassRotation_t
JCompassRotation
 Compass rotation. More...
 
typedef JLANG::JObjectID JDetectorID
 Type definition of detector identifier. More...
 
typedef JTOOLS::JRange< int > floor_range
 Type definition for range of floors. More...
 
typedef JLANG::JComparator
< double(JVector3D::*)() const > 
JModuleComparator
 Type definition of a module comparator using 3D position information. More...
 
typedef JLANG::JObjectID JModuleIdentifier
 
typedef JPutStatusBit JPutModuleStatusBit
 Type definition to map module status bit to key. More...
 
typedef std::map
< JPMTIdentifier,
JPMTParameters
JPMTParametersMap_t
 Type definition of map PMT identifier to PMT parameters. More...
 
typedef JPutStatusBit JPutPMTStatusBit
 Type definition to map PMT status bit to key. More...
 
typedef JTOOLS::JRange< double > JTimeRange
 Type definition for time range (unit [ns]). More...
 

Functions

bool operator< (const JAnchor &first, const JAnchor &second)
 Sort anchors in ascending distance from (0,0). More...
 
template<class T >
double getTime (const T &t1, const JCalibration &cal)
 Get calibrated time. More...
 
template<class T >
double putTime (const T &t1, const JCalibration &cal)
 Get de-calibrated time. More...
 
template<class T >
double getToT (const T &tot, const JCalibration &cal)
 Get calibrated time-over-threshold of hit. More...
 
template<class T >
double putToT (const T &tot, const JCalibration &cal)
 Get de-calibrated time-over-threshold of hit. More...
 
bool hasDetector (JType< JPPM_DU_t > type, const int id)
 Check validity of detector identifier. More...
 
bool hasDetector (JType< JKM3NeTDB_t > type, const int id)
 
bool hasDetector (JType< JKM3NeT_t > type, const int id)
 
bool hasDetector (JType< JMonteCarlo_t > type, const int id)
 
template<class JDetector_t >
JDetectorAddressMapgetDetectorAddressMap ()
 Get detector address map. More...
 
template<class JDetector_t >
JModuleAddressMapgetModuleAddressMap (int id)
 Get module address map. More...
 
template<class JDetector_t >
const JPMTAddressTranslatorgetPMTAddressTranslator (int id, int tdc)
 Get PMT address translator for given module identifier and TDC channel. More...
 
template<class JDetector_t >
int getPMTLogicalIndex (int id, int tdc)
 Get PMT logical index for given module identifier and TDC channel. More...
 
JDetectorAddressMapgetDetectorAddressMap (const int id)
 Get detector address map. More...
 
bool hasDetectorAddressMap (const int id)
 Check if detector address map is available. More...
 
template<class T >
std::vector< std::stringget_string_array (T value)
 Cast single value to array of strings, conform the DB-format. More...
 
double retrieve_value (std::vector< std::string > string_value_array)
 Retrieve value from json array of strings. More...
 
JUTMGrid getARCAUTMGrid ()
 Get UTM grid for ARCA. More...
 
JUTMGrid getORCAUTMGrid ()
 Get UTM grid for ORCA. More...
 
JDetectorHeader getARCADetectorHeader ()
 Get detector header for ARCA. More...
 
JDetectorHeader getORCADetectorHeader ()
 Get detector header for ORCA. More...
 
bool isARCADetector (const JDetectorHeader &header)
 Check if given detector header is compatible with tat of ARCA. More...
 
bool isORCADetector (const JDetectorHeader &header)
 Check if given detector header is compatible with that of ORCA. More...
 
double getMaximalDistance (const JDetector &detector, const bool option=false)
 Get maximal distance between modules in detector. More...
 
double GetXrotationG4 (const JVersor3D dir)
 Get rotation over X axis in Geant4 coordinate system. More...
 
double GetYrotationG4 (const JVersor3D dir)
 Get rotation over Y axis in Geant4 coordinate system. More...
 
void read_gdml (std::istream &, JDetector &)
 
void write_gdml (std::ostream &out, const JDetector &detector)
 Writes KM3Sim GDML input file from detector. More...
 
double getMaximalTime (const JDetector &detector)
 Get maximal time between optical modules in detector following causality. More...
 
double getMaximalTime (const JDetector &detector, const double roadWidth_m)
 Get maximal time between optical modules in detector following causality. More...
 
JTimeRange getTimeRange (const JTimeRange &timeRange, const JModule &module)
 Get de-calibrated time range. More...
 
int getNumberOfPMTs (const JModule &module)
 Get number of PMTs. More...
 
int getNumberOfPMTs (const JDetector &detector)
 Get number of PMTs. More...
 
std::set< int > getStringIDs (const JDetector &detector)
 Get list of strings identifiers. More...
 
int getNumberOfFloors (const JDetector &detector)
 Get number of floors. More...
 
floor_range getRangeOfFloors (const JDetector &detector)
 Get range of floors. More...
 
int getNumberOfModules (const JDetector &detector)
 Get number of modules. More...
 
void load (const std::string &file_name, JDetector &detector)
 Load detector from input file. More...
 
void store (const std::string &file_name, const JDetector &detector)
 Store detector to output file. More...
 
const JModulegetModule (const JModuleAddressMap &memo, const int id=-1, const JLocation &location=JLocation())
 Get module according module address map. More...
 
template<class JDetector_t >
const JModulegetModule (const JType< JDetector_t > type, const int id, const JLocation &location=JLocation())
 Get module according given detector type. More...
 
const JModulegetModule (const JType< JAntares_t > type, const int id, const JLocation &location=JLocation())
 Get module according Antares detector type. More...
 
template<class JDetector_t >
const JModulegetModule (const int id, const JLocation &location=JLocation())
 Get module according detector template. More...
 
JPosition3D getPosition (const JModule &first, const JModule &second)
 Get position to go from first to second module. More...
 
JCalibration getCalibration (const JCalibration &first, const JCalibration &second)
 Get calibration to go from first to second calibration. More...
 
std::vector< std::stringgetDetectorVersions (const JType< std::string > &type)
 Get detector versions. More...
 
std::vector
< JDetectorVersion::JVersion_t
getDetectorVersions (const JType< JDetectorVersion::JVersion_t > &type)
 Get detector versions. More...
 
template<class T >
std::vector< TgetDetectorVersions ()
 Get detector versions. More...
 
std::string getLatestDetectorVersion (const JType< std::string > &type)
 Get latest detector version. More...
 
JVersion getLatestDetectorVersion (const JType< JVersion > &type)
 Get latest detector version. More...
 
JDetectorVersion::JVersion_t getLatestDetectorVersion (const JType< JDetectorVersion::JVersion_t > &type)
 Get latest detector version. More...
 
template<class T >
T getLatestDetectorVersion ()
 Get latest detector version. More...
 
std::string getLabel (const JLocation &location)
 Get module label for monitoring and other applications. More...
 
template<class JAttributes_t >
void setAttributes (const JModule &first, const JModule &second, JAttributes_t &attributes)
 Template method to set module attributes. More...
 
template<>
void setAttributes< JNullType > (const JModule &first, const JModule &second, JNullType &attributes)
 Template specialisation to set no attributes for the default empty object. More...
 
std::vector< std::stringgetModuleStatusBits (const JType< std::string > &type)
 Get module status bits. More...
 
std::vector< int > getModuleStatusBits (const JType< int > &type)
 Get module status bits. More...
 
template<class T >
std::vector< TgetModuleStatusBits ()
 Get module status bits. More...
 
JPosition3D getPiezoPosition ()
 Get relative position of piezo in optical module. More...
 
double getTimeOverThresholdProbability (const JPMTAnalogueSignalProcessor &pmt, const double tot_ns, const double NPE, const double precision=1.0e-4)
 Get time-over-threshold probability. More...
 
bool operator< (const JPMTIdentifier &first, const JPMTIdentifier &second)
 Less than operator for PMT identifiers. More...
 
bool operator== (const JPMTIdentifier &first, const JPMTIdentifier &second)
 Equal operator for PMT identifiers. More...
 
std::string getLabel (const JPMTIdentifier &id)
 Get PMT label for monitoring and other applications. More...
 
double getSurvivalProbability (const JPMTParameters &parameters)
 Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assuming QE = 1. More...
 
double getHitProbability (const double QE, const double mu)
 Get ratio of hit probabilities for given QE and expectation value of the number of photo-electrons. More...
 
double getMaximalHitProbability (const double mu)
 Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-electrons. More...
 
double getQE (const double R, const double mu)
 Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons. More...
 
double getChargeProbability (const JPMTSignalProcessorInterface &pmt, const double npe, const double NPE, const double precision=1.0e-4)
 Get charge probability. More...
 
bool operator< (const JPhotoElectron &first, const JPhotoElectron &second)
 Less than operator for photo-elecrons. More...
 
bool operator< (const JPMTSignal &first, const JPMTSignal &second)
 Less than operator for PMT signals. More...
 
bool operator< (const JPMTPulse &first, const JPMTPulse &second)
 Less than operator for PMT pulses. More...
 
JTimeRange getTimeRange (const JPMTData< JPMTSignal > &input)
 Get time range (i.e. earlist and latest hit time) of PMT data. More...
 
JTimeRange getTimeRange (const JModuleData &input)
 Get time range (i.e. earlist and latest hit time) of module data. More...
 
std::vector< std::stringgetPMTStatusBits (const JType< std::string > &type)
 Get PMT status bits. More...
 
std::vector< int > getPMTStatusBits (const JType< int > &type)
 Get PMT status bits. More...
 
template<class T >
std::vector< TgetPMTStatusBits ()
 Get PMT status bits. More...
 

Variables

const double TIME_OVER_THRESHOLD_NS = 25.08
 Specification for time-over-threshold corresponding to a one photo-electron pulse. More...
 
const double NOMINAL_GAIN = 1.0
 Specification for normalized gain corresponding to a one photo-electron pulse. More...
 
static const double ORCA_TBARZ_M = 0.91
 ORCA T-bar position relative to seabed [m]. More...
 
static const double ARCA_TBARZ_M = 0.95
 ORCA T-bar position relative to seabed [m]. More...
 
static const char *const GENDET_DETECTOR_FILE_FORMAT = "det"
 File name extensions. More...
 
static const char *const BINARY_DETECTOR_FILE_FORMAT [] = { "dat", "datx" }
 JIO binary file format. More...
 
static const char *const KM3NET_DETECTOR_FILE_FORMAT = "detx"
 KM3NeT standard ASCII format More...
 
static const char *const ZIPPED_DETECTOR_FILE_FORMAT = "gz"
 zipped KM3NeT standard ASCII format More...
 
static const char *const GDML_DETECTOR_FILE_FORMAT = "gdml"
 KM3Sim input format. More...
 
static const char *const GDML_SCHEMA = getenv("GDML_SCHEMA_DIR")
 directory necessary for correct GDML header output More...
 
static const char *const CAN_MARGIN_M = getenv("CAN_MARGIN_M")
 extension of the detector size to comply with the can definition More...
 
static const char *const G4GDML_DEFAULT_SCHEMALOCATION = "http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd"
 
static JRotation getRotation
 Function object to get rotation matrix to go from first to second module. More...
 
static const JGetDetectorVersion getDetectorVersion
 Function object to map detector version to numerical value. More...
 
static const JPutDetectorVersion putDetectorVersion (getDetectorVersion)
 Function object to map numerical value to detector version. More...
 
static const JGetModuleStatusBit getModuleStatusBit
 Function object to map key to module status bit. More...
 
static const JPutModuleStatusBit putModuleStatusBit (getModuleStatusBit)
 Function object to map module status bit to key. More...
 
static const double PIEZO_V1_DELAYTIME_US = 170.3
 Piezo delay time [us]. More...
 
static const double PIEZO_V2_DELAYTIME_US = 242.1
 Piezo delay time [us]. More...
 
static const double PIEZO_V3_DELAYTIME_US = 242.1
 Piezo delay time [us]. More...
 
static const double HYDROPHONE_DELAYTIME_US = 50.7
 Hydrophone delay time [us]. More...
 
static const int LED_BEACON_PMT_TYPE = 2
 PMT type of LED beacon. More...
 
static const JGetPMTStatusBit getPMTStatusBit
 Function object to map key to PMT status bit. More...
 
static const JPutPMTStatusBit putPMTStatusBit (getPMTStatusBit)
 Function object to map PMT status bit to key. More...
 
JDETECTOR::getTransitionTime getTransitionTime
 Function object to generate transition time. More...
 
JDETECTOR::getTransitionTimeProbability getTransitionTimeProbability
 Function object of transition time prabability. More...
 
static const
JTransitionTimeProbability2D 
getTransitionTimeProbability2D
 Function object of twofold transition time prabability. More...
 
static const JStringCounter getNumberOfStrings
 Function object to count unique strings. More...
 

Detailed Description

file Auxiliary data structures and methods for detector calibration.

Auxiliary classes and methods for detector calibration and simulation.

Auxiliary classes and methods for detector calibration.

Author
mdejong
mdejong, bjung, acreusot

Typedef Documentation

Type definition of PMT base output.

Definition at line 27 of file JCLBSimulator.hh.

Type list of KM3NeT detector types (specific detectors first).

Definition at line 44 of file JDetectorAddressMapToolkit.hh.

PMT high voltage calibration.

Definition at line 809 of file JDetectorCalibration.hh.

PMT threshold calibration.

Definition at line 810 of file JDetectorCalibration.hh.

module map

Definition at line 811 of file JDetectorCalibration.hh.

PMT time calibration.

Definition at line 812 of file JDetectorCalibration.hh.

PMT status.

Definition at line 813 of file JDetectorCalibration.hh.

Module position.

Definition at line 814 of file JDetectorCalibration.hh.

Module rotation.

Definition at line 815 of file JDetectorCalibration.hh.

Module status.

Definition at line 816 of file JDetectorCalibration.hh.

Module time calibration.

Definition at line 817 of file JDetectorCalibration.hh.

Compass rotation.

Definition at line 818 of file JDetectorCalibration.hh.

Type definition of detector identifier.

Definition at line 19 of file JDetectorID.hh.

Type definition for range of floors.

Definition at line 435 of file JDetectorToolkit.hh.

typedef JLANG::JComparator<double (JVector3D::*)() const> JDETECTOR::JModuleComparator

Type definition of a module comparator using 3D position information.

Definition at line 22 of file JModuleComparator.hh.

Definition at line 16 of file JModuleIdentifier.hh.

Type definition to map module status bit to key.

Definition at line 58 of file JModuleStatus.hh.

Type definition of map PMT identifier to PMT parameters.

Definition at line 47 of file JPMTParametersMap.hh.

Type definition to map PMT status bit to key.

Definition at line 59 of file JPMTStatus.hh.

Type definition for time range (unit [ns]).

Definition at line 19 of file JDetector/JTimeRange.hh.

Function Documentation

bool JDETECTOR::operator< ( const JAnchor first,
const JAnchor second 
)
inline

Sort anchors in ascending distance from (0,0).

Parameters
firstfirst anchor
secondsecond anchor
Returns
true if first anchor closer to (0,0); else false

Definition at line 99 of file JAnchor.hh.

100  {
101  return first.getLengthSquared() < second.getLengthSquared();
102  }
double getLengthSquared() const
Get length squared.
Definition: JVector2D.hh:188
template<class T >
double JDETECTOR::getTime ( const T t1,
const JCalibration cal 
)
inline

Get calibrated time.

Parameters
t1time [ns]
calcalibration
Returns
time [ns]

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

223  {
224  return JCalibrator<T>::getTime(t1, cal);
225  }
double getTime(const Hit &hit)
Get true time of hit.
template<class T >
double JDETECTOR::putTime ( const T t1,
const JCalibration cal 
)
inline

Get de-calibrated time.

Parameters
t1time [ns]
calcalibration
Returns
time [ns]

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

237  {
238  return JCalibrator<T>::putTime(t1, cal);
239  }
double putTime(const T &t1, const JCalibration &cal)
Get de-calibrated time.
template<class T >
double JDETECTOR::getToT ( const T tot,
const JCalibration cal 
)
inline

Get calibrated time-over-threshold of hit.

Parameters
tottime-over-threshold [ns]
calcalibration
Returns
time-over-threshold [ns]

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

251  {
252  return JCalibrator<T>::getToT(tot, cal);
253  }
double getToT(const T &tot, const JCalibration &cal)
Get calibrated time-over-threshold of hit.
template<class T >
double JDETECTOR::putToT ( const T tot,
const JCalibration cal 
)
inline

Get de-calibrated time-over-threshold of hit.

Parameters
tottime-over-threshold [ns]
calcalibration
Returns
time-over-threshold [ns]

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

265  {
266  return JCalibrator<T>::putToT(tot, cal);
267  }
double putToT(const T &tot, const JCalibration &cal)
Get de-calibrated time-over-threshold of hit.
bool JDETECTOR::hasDetector ( JType< JPPM_DU_t type,
const int  id 
)
inline

Check validity of detector identifier.

Parameters
typedetector type
iddetector identifier
Returns
true if valid match; else false

Definition at line 54 of file JDetectorAddressMapToolkit.hh.

54 { return id == 1; }
bool JDETECTOR::hasDetector ( JType< JKM3NeTDB_t type,
const int  id 
)
inline

Definition at line 55 of file JDetectorAddressMapToolkit.hh.

55 { return id >= 116; }
bool JDETECTOR::hasDetector ( JType< JKM3NeT_t type,
const int  id 
)
inline

Definition at line 56 of file JDetectorAddressMapToolkit.hh.

56 { return id >= 2 && id <= 2000000000; }
bool JDETECTOR::hasDetector ( JType< JMonteCarlo_t type,
const int  id 
)
inline

Definition at line 57 of file JDetectorAddressMapToolkit.hh.

57 { return id >= -2000000000 && id <= -2; }
template<class JDetector_t >
JDetectorAddressMap& JDETECTOR::getDetectorAddressMap ( )
inline

Get detector address map.

Returns
detector address map

Definition at line 388 of file JDetectorAddressMapToolkit.hh.

389  {
391 
392  return demo;
393  }
Template lookup table for PMT addresses in detector.
template<class JDetector_t >
JModuleAddressMap& JDETECTOR::getModuleAddressMap ( int  id)
inline

Get module address map.

Parameters
idmodule identifier
Returns
module address map

Definition at line 403 of file JDetectorAddressMapToolkit.hh.

404  {
405  return getDetectorAddressMap<JDetector_t>().get(id);
406  }
template<class JDetector_t >
const JPMTAddressTranslator& JDETECTOR::getPMTAddressTranslator ( int  id,
int  tdc 
)
inline

Get PMT address translator for given module identifier and TDC channel.

Parameters
idmodule identifier
tdcTDC
Returns
PMT address translator

Definition at line 417 of file JDetectorAddressMapToolkit.hh.

418  {
419  return getModuleAddressMap<JDetector_t>(id).getAddressTranslator(tdc);
420  }
template<class JDetector_t >
int JDETECTOR::getPMTLogicalIndex ( int  id,
int  tdc 
)
inline

Get PMT logical index for given module identifier and TDC channel.

Parameters
idmodule identifier
tdcTDC
Returns
PMT logical index

Definition at line 431 of file JDetectorAddressMapToolkit.hh.

432  {
433  return getModuleAddressMap<JDetector_t>(id).getIndex(tdc);
434  }
int getIndex()
Get index for user I/O manipulation.
Definition: JManip.hh:26
JDetectorAddressMap& JDETECTOR::getDetectorAddressMap ( const int  id)
inline

Get detector address map.

Parameters
iddetector identifier
Returns
detector address map

Definition at line 512 of file JDetectorAddressMapToolkit.hh.

513  {
515  }
T get(const JHead &header)
Get object from header.
bool JDETECTOR::hasDetectorAddressMap ( const int  id)
inline

Check if detector address map is available.

Parameters
iddetector identifier
Returns
true if detector address map available; else false

Definition at line 524 of file JDetectorAddressMapToolkit.hh.

525  {
527  }
Auxiliary class to extract detector address map from detector identifier.
template<class T >
std::vector<std::string> JDETECTOR::get_string_array ( T  value)
inline

Cast single value to array of strings, conform the DB-format.

Parameters
valuevalue
Returns
std::vector containing value casted to string

Definition at line 62 of file JDetectorCalibration.hh.

63  {
64  using namespace std;
65 
66  return vector<string>{ to_string(value) };
67  }
std::string to_string(const T &value)
Convert value to string.
double JDETECTOR::retrieve_value ( std::vector< std::string string_value_array)
inline

Retrieve value from json array of strings.

Parameters
string_value_arrayarray of string-casted values
Returns
double-casted value

Definition at line 76 of file JDetectorCalibration.hh.

77  {
78  return std::stod(string_value_array[0]);
79  }
JUTMGrid JDETECTOR::getARCAUTMGrid ( )
inline

Get UTM grid for ARCA.

Returns
UTM grid

Definition at line 252 of file JDetectorHeader.hh.

253  {
254  return JUTMGrid("UTM", "WGS84", "33N");
255  }
JUTMGrid JDETECTOR::getORCAUTMGrid ( )
inline

Get UTM grid for ORCA.

Returns
UTM grid

Definition at line 263 of file JDetectorHeader.hh.

264  {
265  return JUTMGrid("UTM", "WGS84", "32N");
266  }
JDetectorHeader JDETECTOR::getARCADetectorHeader ( )
inline

Get detector header for ARCA.

Returns
detector header

Definition at line 274 of file JDetectorHeader.hh.

275  {
276  return JDetectorHeader(JUTCTimeRange(0.0, 999999999999.9), getARCAUTMGrid(), JUTMPosition(587600, 4016800, -3450));
277  }
Data structure for detector header.
JUTMGrid getARCAUTMGrid()
Get UTM grid for ARCA.
JDetectorHeader JDETECTOR::getORCADetectorHeader ( )
inline

Get detector header for ORCA.

Returns
detector header

Definition at line 285 of file JDetectorHeader.hh.

286  {
287  return JDetectorHeader(JUTCTimeRange(0.0, 999999999999.9), getORCAUTMGrid(), JUTMPosition(256500, 4743000, -2440));
288  }
Data structure for detector header.
JUTMGrid getORCAUTMGrid()
Get UTM grid for ORCA.
bool JDETECTOR::isARCADetector ( const JDetectorHeader header)
inline

Check if given detector header is compatible with tat of ARCA.

Parameters
headerheader
Returns
true if ARCA; else false

Definition at line 297 of file JDetectorHeader.hh.

298  {
299  return header.getUTMGrid() == getARCADetectorHeader();
300  }
const JUTMGrid & getUTMGrid() const
Get UTM grid.
Definition: JUTMGrid.hh:73
JDetectorHeader getARCADetectorHeader()
Get detector header for ARCA.
bool JDETECTOR::isORCADetector ( const JDetectorHeader header)
inline

Check if given detector header is compatible with that of ORCA.

Parameters
headerheader
Returns
true if ORCA; else false

Definition at line 309 of file JDetectorHeader.hh.

310  {
311  return header.getUTMGrid() == getORCADetectorHeader();
312  }
JDetectorHeader getORCADetectorHeader()
Get detector header for ORCA.
const JUTMGrid & getUTMGrid() const
Get UTM grid.
Definition: JUTMGrid.hh:73
double JDETECTOR::getMaximalDistance ( const JDetector detector,
const bool  option = false 
)
inline

Get maximal distance between modules in detector.

The option can be used to include base modules, if any.

Parameters
detectordetector
optionoption
Returns
maximal distance [m]

Definition at line 80 of file JDetectorToolkit.hh.

81  {
82  using namespace JPP;
83 
84  double dmax = 0.0;
85 
86  for (JDetector::const_iterator i1 = detector.begin(); i1 != detector.end(); ++i1) {
87  for (JDetector::const_iterator i2 = detector.begin(); i2 != i1; ++i2) {
88 
89  if (option || (i1->getFloor() != 0 && i2->getFloor() != 0)) {
90 
91  const double ds = getDistance(i1->getPosition(), i2->getPosition());
92 
93  if (ds > dmax) {
94  dmax = ds;
95  }
96  }
97  }
98  }
99 
100  return dmax;
101  }
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
double JDETECTOR::GetXrotationG4 ( const JVersor3D  dir)
inline

Get rotation over X axis in Geant4 coordinate system.

Parameters
dirdirection
Returns
X-rotation [deg]

Definition at line 110 of file JDetectorToolkit.hh.

111  {
112  using namespace JPP;
113 
114  const double phi = atan2(dir.getDY(), dir.getDZ())*(180.0/PI);
115 
116  if (phi < 0.0){
117  return phi + 360.0;
118  }
119  else{
120  return phi;
121  }
122  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
static const double PI
Mathematical constants.
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JDETECTOR::GetYrotationG4 ( const JVersor3D  dir)
inline

Get rotation over Y axis in Geant4 coordinate system.

Parameters
dirdirection
Returns
Y-rotation [deg]

Definition at line 131 of file JDetectorToolkit.hh.

132  {
133  using namespace JPP;
134 
135  return asin(-dir.getDX())*(180.0/PI);
136  }
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
static const double PI
Mathematical constants.
void JDETECTOR::read_gdml ( std::istream &  ,
JDetector  
)
inline

Definition at line 139 of file JDetectorToolkit.hh.

140  {
141  THROW(JException, "Operation not defined.");
142  }
General exception.
Definition: JException.hh:23
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
void JDETECTOR::write_gdml ( std::ostream &  out,
const JDetector detector 
)
inline

Writes KM3Sim GDML input file from detector.

Parameters
outoutput stream
detectordetector

Definition at line 151 of file JDetectorToolkit.hh.

152  {
153  using namespace std;
154  using namespace JPP;
155 
156  const double DEFAULT_CAN_MARGIN_M = 350.0; // default can margin [m]
157  const double DEFAULT_WORLD_MARGIN_M = 50.0; // default world margin [m]
158 
159  const JCylinder3D cylinder(detector.begin(), detector.end());
160 
161  double can_margin;
162 
163  if (CAN_MARGIN_M) {
164  can_margin = atof(CAN_MARGIN_M);
165  } else {
166  cerr << "CAN_MARGIN_M not defined! Setting standard CAN_MARGIN_M " << DEFAULT_CAN_MARGIN_M << " m." << endl;
167  can_margin = DEFAULT_CAN_MARGIN_M; //this is given in meters like all the dimensions in the GDML file (look at the unit field of every position and solid definition)
168  }
169 
170  const double WorldCylinderHeight = 2*(cylinder.getZmax() - cylinder.getZmin() + can_margin + DEFAULT_WORLD_MARGIN_M);
171  const double WorldRadius = cylinder.getLength() + cylinder.getRadius() + can_margin + DEFAULT_WORLD_MARGIN_M;
172 
173  const double Crust_Z_size = WorldCylinderHeight/2;
174  const double Crust_Z_position = -WorldCylinderHeight/4;
175 
176  out << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<gdml xmlns:gdml=\"http://cern.ch/2001/Schemas/GDML\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"";
177  if (!GDML_SCHEMA) {
178  cerr << "GDML_SCHEMA_DIR NOT DEFINED! Setting default path." << endl;
179  out << G4GDML_DEFAULT_SCHEMALOCATION << "\">\n\n\n";
180  } else {
181  out << GDML_SCHEMA << "gdml.xsd\">\n\n\n";
182  }
183  out << "<!-- Jpp version: "<< getGITVersion() << " -->\n";
184  out << "<define>\n";
185  out << "<rotation name=\"identity\"/>\n<position name=\"zero\"/>\n";
186 
187  int PMTs_NO = 0;
188 
189  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
190 
191  if(module->empty()) continue;
192 
193  const JVector3D center = module->getCenter();
194 
195  out << "<position name=\"PosString" << module->getString() << "_Dom" << module->getID() << "\" unit=\"m\" x=\"" << module->getX() << "\" y=\"" << module->getY() << "\" z=\"" << module->getZ() << "\"/>\n";
196 
197  for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
198 
199  const JVector3D vec = static_cast<JVector3D>(*pmt).sub(center);
200  out << "<position name=\"CathodPosition" << pmt->getID() << "_" << module->getID() << "\" unit=\"m\" x=\"" << vec.getX() << "\" y=\"" << vec.getY() << "\" z=\"" << vec.getZ() << "\"/>\n";
201  out << "<rotation name=\"CathodRotation" << pmt->getID() << "_" << module->getID() << "\" unit=\"deg\" x=\"" << GetXrotationG4(*pmt) << "\" y=\"" << GetYrotationG4(*pmt) << "\" z=\"0.000000\"/>\n";
202  out << "<constant name=\"CathodID_" << PMTs_NO << "\" value=\"" << pmt->getID() << "\"/>\n";
203  PMTs_NO++;
204  }
205 
206  }
207 
208  out << "<position name=\"OMShift\" unit=\"m\" x=\"0\" y=\"0\" z=\"0.0392\"/>\n";
209  out << "\n\n\n";
210  out << "<!-- end of DU position definitions -->\n<position name=\"CrustPosition\" unit=\"m\" x=\"0\" y=\"0\" z=\"" << Crust_Z_position << "\"/>\n";
211 
212  out << "</define>\n";
213  out << "<materials>\n";
214  out << "</materials>\n";
215  out << "<solids>\n";
216  out << " <box name=\"CrustBox\" lunit=\"m\" x=\"2200\" y=\"2200\" z=\"" << Crust_Z_size << "\"/>\n";
217  out << " <box name=\"StoreyBox\" lunit=\"m\" x=\"0.6\" y=\"0.6\" z=\"0.6\"/>\n";
218  out << " <sphere name=\"OMSphere\" lunit=\"cm\" aunit=\"deg\" rmin=\"0.0\" rmax=\"21.6\" startphi=\"0.0\" deltaphi=\"360.0\" starttheta=\"0.0\" deltatheta=\"180.0\"/>\n";
219  out << " <tube name=\"CathodTube\" lunit=\"cm\" aunit=\"deg\" rmin=\"0.0\" rmax=\"4.7462\" z=\"0.5\" startphi=\"0.0\" deltaphi=\"360.0\"/>\n";
220  out << " <tube name=\"WorldTube\" lunit=\"m\" aunit=\"deg\" rmin=\"0.0\" rmax=\"" << WorldRadius << "\" z=\"" << WorldCylinderHeight << "\" startphi=\"0.0\" deltaphi=\"360.0\"/>\n";
221  out << "</solids>\n\n\n";
222 
223  out << "<structure>\n";
224  out << " <volume name=\"CathodVolume\">\n";
225  out << " <materialref ref=\"Cathod\"/>\n";
226  out << " <solidref ref=\"CathodTube\"/>\n";
227  out << " </volume>\n";
228 
229  out << "<!-- OMVolume(s) construction -->\n";
230 
231  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
232 
233  if(module->empty()) continue;
234  out << " <volume name=\"OMVolume" << module->getID() << "\">\n";
235  out << " <materialref ref=\"Water\"/>\n";
236  out << " <solidref ref=\"OMSphere\"/>\n";
237 
238  for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
239  out << " <physvol>\n";
240  out << " <volumeref ref=\"CathodVolume\"/>\n";
241  out << " <positionref ref=\"CathodPosition" << pmt->getID() << "_" << module->getID() << "\"/>\n";
242  out << " <rotationref ref=\"CathodRotation" << pmt->getID() << "_" << module->getID() << "\"/>\n";
243  out << " </physvol>\n";
244  }
245 
246  out << " </volume>\n";
247  }
248 
249  out << "<!-- StoreyVolume(s) construction -->\n";
250 
251  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
252  if(module->empty()) continue;
253  out << " <volume name=\"StoreyVolume" << module->getID() << "\">\n";
254  out << " <materialref ref=\"Water\"/>\n";
255  out << " <solidref ref=\"StoreyBox\"/>\n";
256  out << " <physvol>\n";
257  out << " <volumeref ref=\"OMVolume" << module->getID() << "\"/>\n";
258  out << " <positionref ref=\"OMShift\"/>\n";
259  out << " <rotationref ref=\"identity\"/>\n";
260  out << " </physvol>\n";
261  out << " </volume>\n";
262  }
263 
264  out << "<!-- Crust Volume construction-->\n";
265  out << "<volume name=\"CrustVolume\">\n";
266  out << " <materialref ref=\"Crust\"/>\n";
267  out << " <solidref ref=\"CrustBox\"/>\n";
268  out << "</volume>\n";
269 
270  out << "<!-- World Volume construction-->\n";
271  out << "<volume name=\"WorldVolume\">\n";
272  out << " <materialref ref=\"Water\"/>\n";
273  out << " <solidref ref=\"WorldTube\"/>\n";
274 
275  out << " <physvol>\n";
276  out << " <volumeref ref=\"CrustVolume\"/>\n";
277  out << " <positionref ref=\"CrustPosition\"/>\n";
278  out << " <rotationref ref=\"identity\"/>\n";
279  out << " </physvol>\n";
280 
281  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
282  if(module->empty()) continue;
283  out << " <physvol>\n";
284  out << " <volumeref ref=\"StoreyVolume" << module->getID() << "\"/>\n";
285  out << " <positionref ref=\"PosString" << module->getString() << "_Dom" << module->getID() << "\"/>\n";
286  out << " <rotationref ref=\"identity\"/>\n";
287  out << " </physvol>\n";
288  }
289 
290  out << "</volume>\n";
291 
292  out << "</structure>\n";
293  out << "<setup name=\"Default\" version=\"1.0\">\n";
294  out << "<world ref=\"WorldVolume\"/>\n";
295  out << "</setup>\n";
296  out << "</gdml>\n";
297  }
double GetYrotationG4(const JVersor3D dir)
Get rotation over Y axis in Geant4 coordinate system.
static const char *const GDML_SCHEMA
directory necessary for correct GDML header output
static const char *const CAN_MARGIN_M
extension of the detector size to comply with the can definition
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition: JVector3D.hh:158
Cylinder object.
Definition: JCylinder3D.hh:39
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
static const char *const G4GDML_DEFAULT_SCHEMALOCATION
double GetXrotationG4(const JVersor3D dir)
Get rotation over X axis in Geant4 coordinate system.
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JDETECTOR::getMaximalTime ( const JDetector detector)
inline

Get maximal time between optical modules in detector following causality.

Parameters
detectordetector
Returns
maximal time [ns]

Definition at line 306 of file JDetectorToolkit.hh.

307  {
308  using namespace JPP;
309 
311  }
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
double JDETECTOR::getMaximalTime ( const JDetector detector,
const double  roadWidth_m 
)
inline

Get maximal time between optical modules in detector following causality.

The road width corresponds to the maximal distance traveled by the light.

Parameters
detectordetector
roadWidth_mroad width [m]
Returns
maximal time [ns]

Definition at line 322 of file JDetectorToolkit.hh.

323  {
324  using namespace JPP;
325 
326  const double Dmax_m = getMaximalDistance(detector);
327 
328  return (sqrt((Dmax_m + roadWidth_m*getSinThetaC()) *
329  (Dmax_m - roadWidth_m*getSinThetaC())) +
330  roadWidth_m * getSinThetaC() * getTanThetaC()) * getInverseSpeedOfLight();
331  }
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
double getSinThetaC()
Get average sine of Cherenkov angle of water corresponding to group velocity.
JTimeRange JDETECTOR::getTimeRange ( const JTimeRange timeRange,
const JModule module 
)
inline

Get de-calibrated time range.

The de-calibrated time range is corrected for minimal and maximal time offset of PMTs in given module.

Parameters
timeRangetime range [ns]
modulemodule
Returns
time range [ns]

Definition at line 343 of file JDetectorToolkit.hh.

344  {
345  if (!module.empty()) {
346 
347  JTimeRange time_range(JTimeRange::DEFAULT_RANGE);
348 
349  for (JModule::const_iterator pmt = module.begin(); pmt != module.end(); ++pmt) {
350 
351  const JCalibration& calibration = pmt->getCalibration();
352 
353  time_range.include(putTime(timeRange.getLowerLimit(), calibration));
354  time_range.include(putTime(timeRange.getUpperLimit(), calibration));
355  }
356 
357  return time_range;
358 
359  } else {
360 
361  return timeRange;
362  }
363  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
const JCalibration & getCalibration() const
Get calibration.
Data structure for time calibration.
double putTime(const T &t1, const JCalibration &cal)
Get de-calibrated time.
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
int JDETECTOR::getNumberOfPMTs ( const JModule module)
inline

Get number of PMTs.

Parameters
modulemodule
Returns
number of PMTs

Definition at line 372 of file JDetectorToolkit.hh.

373  {
374  return module.size();
375  }
int JDETECTOR::getNumberOfPMTs ( const JDetector detector)
inline

Get number of PMTs.

Parameters
detectordetector
Returns
number of PMTs

Definition at line 384 of file JDetectorToolkit.hh.

385  {
386  int number_of_pmts = 0;
387 
388  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
389  number_of_pmts += getNumberOfPMTs(*module);
390  }
391 
392  return number_of_pmts;
393  }
int getNumberOfPMTs(const JModule &module)
Get number of PMTs.
std::set<int> JDETECTOR::getStringIDs ( const JDetector detector)
inline

Get list of strings identifiers.

Parameters
detectordetector
Returns
list of string identifiers

Definition at line 402 of file JDetectorToolkit.hh.

403  {
404  std::set<int> buffer;
405 
406  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
407  buffer.insert(module->getString());
408  }
409 
410  return buffer;
411  }
int JDETECTOR::getNumberOfFloors ( const JDetector detector)
inline

Get number of floors.

Parameters
detectordetector
Returns
number of floors

Definition at line 420 of file JDetectorToolkit.hh.

421  {
422  std::set<int> buffer;
423 
424  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
425  buffer.insert(module->getFloor());
426  }
427 
428  return buffer.size();
429  }
floor_range JDETECTOR::getRangeOfFloors ( const JDetector detector)
inline

Get range of floors.

Parameters
detectordetector
Returns
range of floors

Definition at line 444 of file JDetectorToolkit.hh.

445  {
446  floor_range buffer = floor_range::DEFAULT_RANGE;
447 
448  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
449  buffer.include(module->getFloor());
450  }
451 
452  return buffer;
453  }
range_type & include(argument_type x)
Include given value to range.
Definition: JRange.hh:397
int JDETECTOR::getNumberOfModules ( const JDetector detector)
inline

Get number of modules.

Parameters
detectordetector
Returns
number of modules

Definition at line 462 of file JDetectorToolkit.hh.

463  {
464  std::set<int> buffer;
465 
466  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
467  buffer.insert(module->getID());
468  }
469 
470  return buffer.size();
471  }
void JDETECTOR::load ( const std::string file_name,
JDetector detector 
)
inline

Load detector from input file.

Supported file formats:

Parameters
file_namefile name
detectordetector

Definition at line 486 of file JDetectorToolkit.hh.

487  {
488  using namespace std;
489  using namespace JPP;
490 
492 
493  JMonteCarloDetector buffer(true);
494 
495  ifstream in(file_name.c_str());
496 
497  if (!in) {
498  THROW(JFileOpenException, "File not opened for reading: " << file_name);
499  }
500 
501  in >> buffer;
502 
503  in.close();
504 
505  detector.swap(buffer);
506 
507  } else if (getFilenameExtension(file_name) == BINARY_DETECTOR_FILE_FORMAT[0] ||
509 
510  JFileStreamReader in(file_name.c_str());
511 
512  if (!in) {
513  THROW(JFileOpenException, "File not opened for reading: " << file_name);
514  }
515 
516  try {
517 
518  detector.read(in);
519 
520  } catch(const exception& error) {
521 
522  // recovery procedure for old format of comments
523 
524  JDetector::setStartOfComment(JDetector::OLD_START_OF_COMMENT);
525 
526  in.clear();
527  in.rewind();
528 
529  detector.read(in);
530 
531  JDetector::setStartOfComment(JDetector::NEW_START_OF_COMMENT);
532  }
533 
534  in.close();
535 
536  } else if (getFilenameExtension(file_name) == KM3NET_DETECTOR_FILE_FORMAT) {
537 
538  ifstream in(file_name.c_str());
539 
540  if (!in) {
541  THROW(JFileOpenException, "File not opened for reading: " << file_name);
542  }
543 
544  in >> detector;
545 
546  in.close();
547 
548  } else if (getFilenameExtension(file_name) == ZIPPED_DETECTOR_FILE_FORMAT) {
549 
550  igzstream in(file_name.c_str());
551 
552  if (!in) {
553  THROW(JFileOpenException, "File not opened for reading: " << file_name);
554  }
555 
556  in >> detector;
557 
558  in.close();
559 
560  } else {
561 
562  THROW(JProtocolException, "Protocol not defined: " << file_name);
563  }
564  }
Exception for opening of file.
Definition: JException.hh:342
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
static const char *const BINARY_DETECTOR_FILE_FORMAT[]
JIO binary file format.
Monte Carlo detector (i.e. so-called .det file).
virtual JReader & read(JReader &in) override
Read from input.
Definition: JDetector.hh:455
Protocol exception.
Definition: JException.hh:648
static const char *const KM3NET_DETECTOR_FILE_FORMAT
KM3NeT standard ASCII format
static const char *const ZIPPED_DETECTOR_FILE_FORMAT
zipped KM3NeT standard ASCII format
static const char *const GENDET_DETECTOR_FILE_FORMAT
File name extensions.
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
Definition: JeepToolkit.hh:109
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
Binary buffered file input.
void JDETECTOR::store ( const std::string file_name,
const JDetector detector 
)
inline

Store detector to output file.

Supported file formats:

Parameters
file_namefile name
detectordetector

Definition at line 579 of file JDetectorToolkit.hh.

580  {
581  using namespace std;
582  using namespace JPP;
583 
584  if (getFilenameExtension(file_name) == BINARY_DETECTOR_FILE_FORMAT[1]) {
585 
586  JFileStreamWriter out(file_name.c_str());
587 
588  if (!out) {
589  THROW(JFileOpenException, "File not opened for writing: " << file_name);
590  }
591 
592  detector.write(out);
593 
594  out.close();
595 
596  } else if (getFilenameExtension(file_name) == KM3NET_DETECTOR_FILE_FORMAT) {
597 
598  std::ofstream out(file_name.c_str());
599 
600  if (!out) {
601  THROW(JFileOpenException, "File not opened for writing: " << file_name);
602  }
603 
604  out << detector;
605 
606  out.close();
607 
608  } else if (getFilenameExtension(file_name) == ZIPPED_DETECTOR_FILE_FORMAT) {
609 
610  ogzstream out(file_name.c_str());
611 
612  if (!out) {
613  THROW(JFileOpenException, "File not opened for writing: " << file_name);
614  }
615 
616  out << detector;
617 
618  out.close();
619 
620  } else if (getFilenameExtension(file_name) == GDML_DETECTOR_FILE_FORMAT) {
621 
622  std::ofstream out(file_name.c_str());
623 
624  if (!out) {
625  THROW(JFileOpenException, "File not opened for writing: " << file_name);
626  }
627 
628  write_gdml(out, detector);
629 
630  out.close();
631 
632  } else {
633 
634  THROW(JProtocolException, "Protocol not defined: " << file_name);
635  }
636  }
Exception for opening of file.
Definition: JException.hh:342
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
static const char *const BINARY_DETECTOR_FILE_FORMAT[]
JIO binary file format.
virtual JWriter & write(JWriter &out) const override
Write to output.
Definition: JDetector.hh:507
Protocol exception.
Definition: JException.hh:648
static const char *const KM3NET_DETECTOR_FILE_FORMAT
KM3NeT standard ASCII format
static const char *const ZIPPED_DETECTOR_FILE_FORMAT
zipped KM3NeT standard ASCII format
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
Definition: JeepToolkit.hh:109
do set_variable DETECTOR_TXT $WORKDIR detector
Binary buffered file output.
static const char *const GDML_DETECTOR_FILE_FORMAT
KM3Sim input format.
void write_gdml(std::ostream &out, const JDetector &detector)
Writes KM3Sim GDML input file from detector.
const JModule& JDETECTOR::getModule ( const JModuleAddressMap memo,
const int  id = -1,
const JLocation location = JLocation() 
)
inline

Get module according module address map.

Parameters
memomodule address map
idmodule identifier
locationmodule location
Returns
module

Definition at line 647 of file JDetectorToolkit.hh.

650  {
651  static JModule module;
652 
653 
654  module.setID(id);
655 
656  module.setLocation(location);
657 
658  module.resize(memo.size());
659 
660  if (memo.has( 0)) { module[memo[ 0].tdc] = JPMT( 1, JAxis3D(JVector3D(+0.000, +0.000, -0.200), JVersor3D(+0.000, +0.000, -1.000))); }
661 
662  if (memo.has( 1)) { module[memo[ 1].tdc] = JPMT( 2, JAxis3D(JVector3D(+0.000, +0.105, -0.170), JVersor3D(+0.000, +0.527, -0.850))); }
663  if (memo.has( 2)) { module[memo[ 2].tdc] = JPMT( 3, JAxis3D(JVector3D(+0.091, +0.053, -0.170), JVersor3D(+0.456, +0.263, -0.850))); }
664  if (memo.has( 3)) { module[memo[ 3].tdc] = JPMT( 4, JAxis3D(JVector3D(+0.091, -0.053, -0.170), JVersor3D(+0.456, -0.263, -0.850))); }
665  if (memo.has( 4)) { module[memo[ 4].tdc] = JPMT( 5, JAxis3D(JVector3D(+0.000, -0.105, -0.170), JVersor3D(+0.000, -0.527, -0.850))); }
666  if (memo.has( 5)) { module[memo[ 5].tdc] = JPMT( 6, JAxis3D(JVector3D(-0.091, -0.053, -0.170), JVersor3D(-0.456, -0.263, -0.850))); }
667  if (memo.has( 6)) { module[memo[ 6].tdc] = JPMT( 7, JAxis3D(JVector3D(-0.091, +0.053, -0.170), JVersor3D(-0.456, +0.263, -0.850))); }
668 
669  if (memo.has( 7)) { module[memo[ 7].tdc] = JPMT( 8, JAxis3D(JVector3D(+0.083, +0.144, -0.111), JVersor3D(+0.416, +0.720, -0.555))); }
670  if (memo.has( 8)) { module[memo[ 8].tdc] = JPMT( 9, JAxis3D(JVector3D(+0.166, +0.000, -0.111), JVersor3D(+0.832, +0.000, -0.555))); }
671  if (memo.has( 9)) { module[memo[ 9].tdc] = JPMT(10, JAxis3D(JVector3D(+0.083, -0.144, -0.111), JVersor3D(+0.416, -0.720, -0.555))); }
672  if (memo.has(10)) { module[memo[10].tdc] = JPMT(11, JAxis3D(JVector3D(-0.083, -0.144, -0.111), JVersor3D(-0.416, -0.720, -0.555))); }
673  if (memo.has(11)) { module[memo[11].tdc] = JPMT(12, JAxis3D(JVector3D(-0.166, +0.000, -0.111), JVersor3D(-0.832, +0.000, -0.555))); }
674  if (memo.has(12)) { module[memo[12].tdc] = JPMT(13, JAxis3D(JVector3D(-0.083, +0.144, -0.111), JVersor3D(-0.416, +0.720, -0.555))); }
675 
676  if (memo.has(13)) { module[memo[13].tdc] = JPMT(14, JAxis3D(JVector3D(+0.000, +0.191, -0.059), JVersor3D(+0.000, +0.955, -0.295))); }
677  if (memo.has(14)) { module[memo[14].tdc] = JPMT(15, JAxis3D(JVector3D(+0.165, +0.096, -0.059), JVersor3D(+0.827, +0.478, -0.295))); }
678  if (memo.has(15)) { module[memo[15].tdc] = JPMT(16, JAxis3D(JVector3D(+0.165, -0.096, -0.059), JVersor3D(+0.827, -0.478, -0.295))); }
679  if (memo.has(16)) { module[memo[16].tdc] = JPMT(17, JAxis3D(JVector3D(+0.000, -0.191, -0.059), JVersor3D(+0.000, -0.955, -0.295))); }
680  if (memo.has(17)) { module[memo[17].tdc] = JPMT(18, JAxis3D(JVector3D(-0.165, -0.096, -0.059), JVersor3D(-0.827, -0.478, -0.295))); }
681  if (memo.has(18)) { module[memo[18].tdc] = JPMT(19, JAxis3D(JVector3D(-0.165, +0.096, -0.059), JVersor3D(-0.827, +0.478, -0.295))); }
682 
683  if (memo.has(19)) { module[memo[19].tdc] = JPMT(20, JAxis3D(JVector3D(+0.096, +0.165, +0.059), JVersor3D(+0.478, +0.827, +0.295))); }
684  if (memo.has(20)) { module[memo[20].tdc] = JPMT(21, JAxis3D(JVector3D(+0.191, +0.000, +0.059), JVersor3D(+0.955, +0.000, +0.295))); }
685  if (memo.has(21)) { module[memo[21].tdc] = JPMT(22, JAxis3D(JVector3D(+0.096, -0.165, +0.059), JVersor3D(+0.478, -0.827, +0.295))); }
686  if (memo.has(22)) { module[memo[22].tdc] = JPMT(23, JAxis3D(JVector3D(-0.096, -0.165, +0.059), JVersor3D(-0.478, -0.827, +0.295))); }
687  if (memo.has(23)) { module[memo[23].tdc] = JPMT(24, JAxis3D(JVector3D(-0.191, +0.000, +0.059), JVersor3D(-0.955, +0.000, +0.295))); }
688  if (memo.has(24)) { module[memo[24].tdc] = JPMT(25, JAxis3D(JVector3D(-0.096, +0.165, +0.059), JVersor3D(-0.478, +0.827, +0.295))); }
689 
690  if (memo.has(25)) { module[memo[25].tdc] = JPMT(26, JAxis3D(JVector3D(+0.000, +0.166, +0.111), JVersor3D(+0.000, +0.832, +0.555))); }
691  if (memo.has(26)) { module[memo[26].tdc] = JPMT(27, JAxis3D(JVector3D(+0.144, +0.083, +0.111), JVersor3D(+0.720, +0.416, +0.555))); }
692  if (memo.has(27)) { module[memo[27].tdc] = JPMT(28, JAxis3D(JVector3D(+0.144, -0.083, +0.111), JVersor3D(+0.720, -0.416, +0.555))); }
693  if (memo.has(28)) { module[memo[28].tdc] = JPMT(29, JAxis3D(JVector3D(+0.000, -0.166, +0.111), JVersor3D(+0.000, -0.832, +0.555))); }
694  if (memo.has(29)) { module[memo[29].tdc] = JPMT(30, JAxis3D(JVector3D(-0.144, -0.083, +0.111), JVersor3D(-0.720, -0.416, +0.555))); }
695  if (memo.has(30)) { module[memo[30].tdc] = JPMT(31, JAxis3D(JVector3D(-0.144, +0.083, +0.111), JVersor3D(-0.720, +0.416, +0.555))); }
696 
697  module.compile();
698 
699  return module;
700  }
Data structure for a composite optical module.
Definition: JModule.hh:68
void setLocation(const JLocation &location)
Set location.
Definition: JLocation.hh:91
Axis object.
Definition: JAxis3D.hh:38
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Data structure for PMT geometry, calibration and status.
Definition: JPMT.hh:43
void compile()
Compile module data.
Definition: JModule.hh:282
void setID(const int id)
Set identifier.
Definition: JObjectID.hh:72
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
bool has(const int index) const
Test whether index is available.
template<class JDetector_t >
const JModule& JDETECTOR::getModule ( const JType< JDetector_t >  type,
const int  id,
const JLocation location = JLocation() 
)
inline

Get module according given detector type.

Parameters
typedetector type
idmodule identifier
locationmodule location
Returns
module

Definition at line 712 of file JDetectorToolkit.hh.

715  {
716  return getModule(getModuleAddressMap<JDetector_t>(id), id, location);
717  }
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
const JModule& JDETECTOR::getModule ( const JType< JAntares_t type,
const int  id,
const JLocation location = JLocation() 
)
inline

Get module according Antares detector type.

Parameters
typeAntares detector type
idmodule identifier
locationmodule location
Returns
module

Definition at line 728 of file JDetectorToolkit.hh.

731  {
732  static JModule module;
733 
734  module.setID(id);
735 
736  module.setLocation(location);
737 
738  if (module.empty()) {
739 
740  module.resize(3);
741 
742  const double R = 0.5; // [m]
743 
744  const double st = sin(0.75*PI);
745  const double ct = cos(0.75*PI);
746 
747  for (int i = 0; i != 3; ++i) {
748 
749  const double phi = (2.0*PI*i) / 3.0;
750  const double cp = cos(phi);
751  const double sp = sin(phi);
752 
753  module[i] = JPMT(i, JAxis3D(JVector3D(R*st*cp, R*st*sp, R*ct), JVersor3D(st*cp, st*sp, ct)));
754  }
755  }
756 
757  return module;
758  }
Data structure for a composite optical module.
Definition: JModule.hh:68
void setLocation(const JLocation &location)
Set location.
Definition: JLocation.hh:91
Axis object.
Definition: JAxis3D.hh:38
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Data structure for PMT geometry, calibration and status.
Definition: JPMT.hh:43
static const double PI
Mathematical constants.
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
void setID(const int id)
Set identifier.
Definition: JObjectID.hh:72
then cp
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
template<class JDetector_t >
const JModule& JDETECTOR::getModule ( const int  id,
const JLocation location = JLocation() 
)
inline

Get module according detector template.

Parameters
idmodule identifier
locationmodule location
Returns
module

Definition at line 769 of file JDetectorToolkit.hh.

771  {
772  return getModule(JType<JDetector_t>(), id, location);
773  }
Auxiliary class for a type holder.
Definition: JType.hh:19
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
JPosition3D JDETECTOR::getPosition ( const JModule first,
const JModule second 
)
inline

Get position to go from first to second module.

Parameters
firstfirst module
secondsecond module
Returns
position

Definition at line 910 of file JDetectorToolkit.hh.

911  {
912  return second.getPosition() - first.getPosition();
913  }
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
JCalibration JDETECTOR::getCalibration ( const JCalibration first,
const JCalibration second 
)
inline

Get calibration to go from first to second calibration.

Parameters
firstfirst calibration
secondsecond calibration
Returns
calibration

Definition at line 923 of file JDetectorToolkit.hh.

924  {
925  return JCalibration(second.getT0() - first.getT0());
926  }
Data structure for time calibration.
double getT0() const
Get time offset.
std::vector<std::string> JDETECTOR::getDetectorVersions ( const JType< std::string > &  type)
inline

Get detector versions.

Note that the order of the versions is descending.

Parameters
typetype
Returns
versions

Definition at line 317 of file JDetectorVersion.hh.

318  {
319  return JLANG::make_array(putDetectorVersion.rbegin(), putDetectorVersion.rend(), &JPutDetectorVersion::value_type::second);
320  }
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
std::vector<JDetectorVersion::JVersion_t> JDETECTOR::getDetectorVersions ( const JType< JDetectorVersion::JVersion_t > &  type)
inline

Get detector versions.

Note that the order of the versions is descending.

Parameters
typetype
Returns
numerical values

Definition at line 331 of file JDetectorVersion.hh.

332  {
334  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
template<class T >
std::vector<T> JDETECTOR::getDetectorVersions ( )
inline

Get detector versions.

Returns
versions

Definition at line 343 of file JDetectorVersion.hh.

344  {
345  return getDetectorVersions(JType<T>());
346  }
std::vector< std::string > getDetectorVersions(const JType< std::string > &type)
Get detector versions.
std::string JDETECTOR::getLatestDetectorVersion ( const JType< std::string > &  type)
inline

Get latest detector version.

Parameters
typetype
Returns
version

Definition at line 355 of file JDetectorVersion.hh.

356  {
357  return putDetectorVersion.rbegin()->second;
358  }
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
JVersion JDETECTOR::getLatestDetectorVersion ( const JType< JVersion > &  type)
inline

Get latest detector version.

Parameters
typetype
Returns
version

Definition at line 367 of file JDetectorVersion.hh.

368  {
369  return putDetectorVersion.rbegin()->second;
370  }
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
JDetectorVersion::JVersion_t JDETECTOR::getLatestDetectorVersion ( const JType< JDetectorVersion::JVersion_t > &  type)
inline

Get latest detector version.

Parameters
typetype
Returns
version

Definition at line 379 of file JDetectorVersion.hh.

380  {
381  return putDetectorVersion.rbegin()->first;
382  }
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
template<class T >
T JDETECTOR::getLatestDetectorVersion ( )
inline

Get latest detector version.

Returns
version

Definition at line 391 of file JDetectorVersion.hh.

392  {
393  return getLatestDetectorVersion(JType<T>());
394  }
std::string getLatestDetectorVersion(const JType< std::string > &type)
Get latest detector version.
std::string JDETECTOR::getLabel ( const JLocation location)
inline

Get module label for monitoring and other applications.


The format is "(XXXX,YY)", where XXXX is the string number and YY the floor.

Parameters
locationmodule location
Returns
label

Definition at line 246 of file JLocation.hh.

247  {
248  using namespace std;
249  using namespace JPP;
250 
251  return MAKE_STRING("(" << FILL(4,'0') << location.getString() << "." << FILL(2,'0') << location.getFloor() << ")");
252  }
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
Auxiliary data structure for sequence of same character.
Definition: JManip.hh:328
int getString() const
Get string number.
Definition: JLocation.hh:134
template<class JAttributes_t >
void JDETECTOR::setAttributes ( const JModule first,
const JModule second,
JAttributes_t &  attributes 
)

Template method to set module attributes.

This method should be overloaded for each type of module attributes.

Parameters
firstfirst module
secondsecond module
attributesmodule attributes
template<>
void JDETECTOR::setAttributes< JNullType > ( const JModule first,
const JModule second,
JNullType &  attributes 
)

Template specialisation to set no attributes for the default empty object.

Parameters
firstfirst module
secondsecond module
attributesmodule attributes

Definition at line 49 of file JModuleMapper.hh.

52  {}
std::vector<std::string> JDETECTOR::getModuleStatusBits ( const JType< std::string > &  type)
inline

Get module status bits.

Parameters
typetype
Returns
status bits

Definition at line 79 of file JModuleStatus.hh.

80  {
82  }
static const JGetModuleStatusBit getModuleStatusBit
Function object to map key to module status bit.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
std::vector<int> JDETECTOR::getModuleStatusBits ( const JType< int > &  type)
inline

Get module status bits.

Parameters
typetype
Returns
status bits

Definition at line 91 of file JModuleStatus.hh.

92  {
94  }
static const JPutModuleStatusBit putModuleStatusBit(getModuleStatusBit)
Function object to map module status bit to key.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
template<class T >
std::vector<T> JDETECTOR::getModuleStatusBits ( )
inline

Get module status bits.

Returns
status bits

Definition at line 103 of file JModuleStatus.hh.

104  {
105  return getModuleStatusBits(JType<T>());
106  }
std::vector< std::string > getModuleStatusBits(const JType< std::string > &type)
Get module status bits.
JPosition3D JDETECTOR::getPiezoPosition ( )
inline

Get relative position of piezo in optical module.

Returns
position [m]

Definition at line 30 of file JModuleSupportkit.hh.

31  {
32  return JPosition3D(0.0, 0.0, -0.20);
33  }
double JDETECTOR::getTimeOverThresholdProbability ( const JPMTAnalogueSignalProcessor &  pmt,
const double  tot_ns,
const double  NPE,
const double  precision = 1.0e-4 
)
inline

Get time-over-threshold probability.

Parameters
pmtPMT signal processor
tot_nstime-over-threshold [ns]
NPEexpected number of photo-electrons
precisionprecision
Returns
probability

Definition at line 880 of file JPMTAnalogueSignalProcessor.hh.

884  {
885  int i = (int) (NPE - 5.0 * sqrt(NPE) - 0.5);
886  int M = (int) (NPE + 5.0 * sqrt(NPE) + 0.5);
887 
888  if (i < 1) { i = 1; }
889  if (M < i) { M = i; }
890 
891  double p = NPE * exp(-NPE) / (double) 1;
892 
893  for (int __i = 1; __i != i; ++__i) {
894  p *= NPE / __i;
895  }
896 
897  double P = 0.0;
898 
899  for (double p0 = 0.0; (p >= p0 || p > precision) && i != M; ++i, p0 = p, p *= NPE / (double) i) {
900  P += pmt.getTimeOverThresholdProbability(tot_ns, i) * p;
901  }
902 
903  return P;
904  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
bool JDETECTOR::operator< ( const JPMTIdentifier first,
const JPMTIdentifier second 
)
inline

Less than operator for PMT identifiers.

Parameters
firstPMT identifier
secondPMT identifier
Returns
true if first PMT lower than second PMT; else false

Definition at line 187 of file JPMTIdentifier.hh.

188  {
189  if (first.getModuleID() == second.getModuleID())
190  return first.getPMTAddress() < second.getPMTAddress();
191  else
192  return first.getModuleID() < second.getModuleID();
193  }
int getModuleID() const
Get module identifier.
int getPMTAddress() const
Get PMT address (= TDC).
bool JDETECTOR::operator== ( const JPMTIdentifier first,
const JPMTIdentifier second 
)
inline

Equal operator for PMT identifiers.

Parameters
firstPMT identifier
secondPMT identifier
Returns
true if first PMT equal second PMT; else false

Definition at line 203 of file JPMTIdentifier.hh.

204  {
205  return (first.getModuleID() == second.getModuleID() &&
206  first.getPMTAddress() == second.getPMTAddress());
207  }
int getModuleID() const
Get module identifier.
int getPMTAddress() const
Get PMT address (= TDC).
std::string JDETECTOR::getLabel ( const JPMTIdentifier id)
inline

Get PMT label for monitoring and other applications.


The format is "(XXXXXXXXXX,YY)", where XXXXXXXXXX is the module idetifier and YY the PMT readout channel.

Parameters
idPMT identifier
Returns
label

Definition at line 217 of file JPMTIdentifier.hh.

218  {
219  using namespace std;
220  using namespace JPP;
221 
222  return MAKE_STRING("(" << FILL(10,'0') << id.getID() << "," << FILL(2,'0') << id.getPMTAddress() << ")");
223  }
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
Auxiliary data structure for sequence of same character.
Definition: JManip.hh:328
double JDETECTOR::getSurvivalProbability ( const JPMTParameters parameters)
inline

Get model dependent probability that a one photo-electron hit survives the simulation of the PMT assuming QE = 1.

Parameters
parametersPMT parameters
Returns
probability

Definition at line 32 of file JPMTParametersToolkit.hh.

33  {
35  const int NPE = 1;
36 
37  data.QE = 1.0;
38 
40  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
Data structure for PMT parameters.
double QE
relative quantum efficiency
virtual double getSurvivalProbability(const int NPE) const override
Probability that a hit survives the simulation of the PMT.
double JDETECTOR::getHitProbability ( const double  QE,
const double  mu 
)
inline

Get ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.


The ratio corresponds to the hit probability with given QE divided by that with QE = 1.
The expectation value is defined for a two-fold (or higher) coincidence.

Parameters
QEQE
muexpectation value
Returns
ratio

Definition at line 52 of file JPMTParametersToolkit.hh.

53  {
54  if (mu > 0.0)
55  return (1.0 - exp(-QE*mu)) / (1.0 - exp(-mu));
56  else
57  return QE;
58  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
double JDETECTOR::getMaximalHitProbability ( const double  mu)
inline

Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-electrons.


The ratio corresponds to the hit probability with infinite QE divided by that with QE = 1.
The expectation value is defined for a two-fold (or higher) coincidence.

Parameters
muexpectation value
Returns
ratio

Definition at line 69 of file JPMTParametersToolkit.hh.

70  {
71  using namespace std;
72 
73  if (mu > 0.0)
74  return 1.0 / (1.0 - exp(-mu));
75  else
76  return numeric_limits<double>::max();
77  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
double JDETECTOR::getQE ( const double  R,
const double  mu 
)
inline

Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.


The ratio corresponds to the hit probability with given QE divided by that with QE = 1.
The expectation value is defined for a two-fold (or higher) coincidence.

Parameters
Rratio
muexpectation value
Returns
QE

Definition at line 89 of file JPMTParametersToolkit.hh.

90  {
91  if (R < getMaximalHitProbability(mu)) {
92 
93  if (mu > 0.0)
94  return -log(1.0 - R*(1.0 - exp(-mu))) / mu;
95  else
96  return R;
97 
98  } else {
99 
100  THROW(JValueOutOfRange, "Inconsistent arguments at method getQE(" << R << "," << mu <<")");
101  }
102  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiif[[!-f $DETECTOR]];then JEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOR--!eval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTOR--!donefiif[[!-f $TRIPOD]];then cp-p $TRIPOD_INITIAL $TRIPODfiJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_b 1 0 100.0e-6 0.002 0.1 0 > &stage log
double getMaximalHitProbability(const double mu)
Get maximal ratio of hit probabilities for given QE and expectation value of the number of photo-elec...
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
double JDETECTOR::getChargeProbability ( const JPMTSignalProcessorInterface pmt,
const double  npe,
const double  NPE,
const double  precision = 1.0e-4 
)
inline

Get charge probability.

Parameters
pmtPMT signal processor
npemeasured number of photo-electrons
NPEexpected number of photo-electrons
precisionprecision
Returns
probability

Definition at line 352 of file JPMTSignalProcessorInterface.hh.

356  {
357  int i = (int) (NPE - 5.0 * sqrt(NPE));
358 
359  if (i < 1) {
360  i = 1;
361  }
362 
363  double p = NPE * exp(-NPE) / (double) 1;
364 
365  for (int __i = 1; __i != i; ++__i) {
366  p *= NPE / __i;
367  }
368 
369  double P = 0.0;
370 
371  for (double p0 = 0.0; (p >= p0 || p > precision); ++i, p0 = p, p *= NPE / (double) i) {
372  P += pmt.getChargeProbability(npe, i) * p;
373  }
374 
375  return P;
376  }
virtual double getChargeProbability(const double npe, const int NPE) const
Get probability density for given charge.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
bool JDETECTOR::operator< ( const JPhotoElectron first,
const JPhotoElectron second 
)
inline

Less than operator for photo-elecrons.

Parameters
firstfirst photo-electron
secondsecond photo-electron
Returns
true if first photo-electron earlier than second; else false

Definition at line 70 of file JPMTSimulator.hh.

71  {
72  return first.t_ns < second.t_ns;
73  }
bool JDETECTOR::operator< ( const JPMTSignal first,
const JPMTSignal second 
)
inline

Less than operator for PMT signals.

Parameters
firstfirst PMT signal
secondsecond PMT signal
Returns
true if first PMT signal earlier than second; else false

Definition at line 114 of file JPMTSimulator.hh.

115  {
116  return first.t_ns < second.t_ns;
117  }
double t_ns
time [ns]
bool JDETECTOR::operator< ( const JPMTPulse first,
const JPMTPulse second 
)
inline

Less than operator for PMT pulses.

Parameters
firstfirst PMT pulse
secondsecond PMT pulse
Returns
true if first PMT pulse earlier than second; else false

Definition at line 158 of file JPMTSimulator.hh.

159  {
160  return first.t_ns < second.t_ns;
161  }
double t_ns
time [ns]
JTimeRange JDETECTOR::getTimeRange ( const JPMTData< JPMTSignal > &  input)
inline

Get time range (i.e. earlist and latest hit time) of PMT data.

Parameters
inputPMT data
Returns
time range

Definition at line 287 of file JPMTSimulator.hh.

288  {
289  JTimeRange range(JTimeRange::DEFAULT_RANGE);
290 
291  for (JPMTData<JPMTSignal>::const_iterator hit = input.begin(); hit != input.end(); ++hit) {
292  range.include(hit->t_ns);
293  }
294 
295  return range;
296  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
std::vector< JElement_t >::const_iterator const_iterator
JTimeRange JDETECTOR::getTimeRange ( const JModuleData input)
inline

Get time range (i.e. earlist and latest hit time) of module data.

Parameters
inputmodule data
Returns
time range

Definition at line 305 of file JPMTSimulator.hh.

306  {
307  JTimeRange range(JTimeRange::DEFAULT_RANGE);
308 
309  for (JModuleData::const_iterator frame = input.begin(); frame != input.end(); ++frame) {
310  for (JModuleData::value_type::const_iterator hit = frame->begin(); hit != frame->end(); ++hit) {
311  range.include(hit->t_ns);
312  }
313  }
314 
315  return range;
316  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
std::vector<std::string> JDETECTOR::getPMTStatusBits ( const JType< std::string > &  type)
inline

Get PMT status bits.

Parameters
typetype
Returns
status bits

Definition at line 80 of file JPMTStatus.hh.

81  {
83  }
static const JGetPMTStatusBit getPMTStatusBit
Function object to map key to PMT status bit.
Definition: JPMTStatus.hh:65
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
std::vector<int> JDETECTOR::getPMTStatusBits ( const JType< int > &  type)
inline

Get PMT status bits.

Parameters
typetype
Returns
status bits

Definition at line 92 of file JPMTStatus.hh.

93  {
95  }
static const JPutPMTStatusBit putPMTStatusBit(getPMTStatusBit)
Function object to map PMT status bit to key.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
template<class T >
std::vector<T> JDETECTOR::getPMTStatusBits ( )
inline

Get PMT status bits.

Returns
status bits

Definition at line 104 of file JPMTStatus.hh.

105  {
106  return getPMTStatusBits(JType<T>());
107  }
std::vector< std::string > getPMTStatusBits(const JType< std::string > &type)
Get PMT status bits.
Definition: JPMTStatus.hh:80

Variable Documentation

const double JDETECTOR::TIME_OVER_THRESHOLD_NS = 25.08

Specification for time-over-threshold corresponding to a one photo-electron pulse.

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

const double JDETECTOR::NOMINAL_GAIN = 1.0

Specification for normalized gain corresponding to a one photo-electron pulse.

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

const double JDETECTOR::ORCA_TBARZ_M = 0.91
static

ORCA T-bar position relative to seabed [m].

Definition at line 17 of file JDetectorSupportkit.hh.

const double JDETECTOR::ARCA_TBARZ_M = 0.95
static

ORCA T-bar position relative to seabed [m].

Definition at line 18 of file JDetectorSupportkit.hh.

const char* const JDETECTOR::GENDET_DETECTOR_FILE_FORMAT = "det"
static

File name extensions.

file format used by gendet

Definition at line 61 of file JDetectorToolkit.hh.

const char* const JDETECTOR::BINARY_DETECTOR_FILE_FORMAT[] = { "dat", "datx" }
static

JIO binary file format.

Definition at line 62 of file JDetectorToolkit.hh.

const char* const JDETECTOR::KM3NET_DETECTOR_FILE_FORMAT = "detx"
static

KM3NeT standard ASCII format

Definition at line 63 of file JDetectorToolkit.hh.

const char* const JDETECTOR::ZIPPED_DETECTOR_FILE_FORMAT = "gz"
static

zipped KM3NeT standard ASCII format

Definition at line 64 of file JDetectorToolkit.hh.

const char* const JDETECTOR::GDML_DETECTOR_FILE_FORMAT = "gdml"
static

KM3Sim input format.

Definition at line 65 of file JDetectorToolkit.hh.

const char* const JDETECTOR::GDML_SCHEMA = getenv("GDML_SCHEMA_DIR")
static

directory necessary for correct GDML header output

Definition at line 67 of file JDetectorToolkit.hh.

const char* const JDETECTOR::CAN_MARGIN_M = getenv("CAN_MARGIN_M")
static

extension of the detector size to comply with the can definition

Definition at line 68 of file JDetectorToolkit.hh.

const char* const JDETECTOR::G4GDML_DEFAULT_SCHEMALOCATION = "http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd"
static

Definition at line 69 of file JDetectorToolkit.hh.

JRotation JDETECTOR::getRotation
static

Function object to get rotation matrix to go from first to second module.

Definition at line 900 of file JDetectorToolkit.hh.

const JGetDetectorVersion JDETECTOR::getDetectorVersion
static

Function object to map detector version to numerical value.

Definition at line 300 of file JDetectorVersion.hh.

const JPutDetectorVersion JDETECTOR::putDetectorVersion(getDetectorVersion)
static

Function object to map numerical value to detector version.

const JGetModuleStatusBit JDETECTOR::getModuleStatusBit
static

Function object to map key to module status bit.

Definition at line 64 of file JModuleStatus.hh.

const JPutModuleStatusBit JDETECTOR::putModuleStatusBit(getModuleStatusBit)
static

Function object to map module status bit to key.

const double JDETECTOR::PIEZO_V1_DELAYTIME_US = 170.3
static

Piezo delay time [us].

Definition at line 19 of file JModuleSupportkit.hh.

const double JDETECTOR::PIEZO_V2_DELAYTIME_US = 242.1
static

Piezo delay time [us].

Definition at line 20 of file JModuleSupportkit.hh.

const double JDETECTOR::PIEZO_V3_DELAYTIME_US = 242.1
static

Piezo delay time [us].

Definition at line 21 of file JModuleSupportkit.hh.

const double JDETECTOR::HYDROPHONE_DELAYTIME_US = 50.7
static

Hydrophone delay time [us].

Definition at line 22 of file JModuleSupportkit.hh.

const int JDETECTOR::LED_BEACON_PMT_TYPE = 2
static

PMT type of LED beacon.

Definition at line 37 of file JMonteCarloDetector.hh.

const JGetPMTStatusBit JDETECTOR::getPMTStatusBit
static

Function object to map key to PMT status bit.

Definition at line 65 of file JPMTStatus.hh.

const JPutPMTStatusBit JDETECTOR::putPMTStatusBit(getPMTStatusBit)
static

Function object to map PMT status bit to key.

Function object to generate transition time.

Function object of transition time prabability.

const JTransitionTimeProbability2D JDETECTOR::getTransitionTimeProbability2D
static

Function object of twofold transition time prabability.

Definition at line 2659 of file JPMTTransitTimeProbability.hh.

const JStringCounter JDETECTOR::getNumberOfStrings
static

Function object to count unique strings.

Definition at line 95 of file JStringCounter.hh.