Jpp
Public Types | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
JDETECTOR::JDetectorSimulator Class Reference

Detector simulation. More...

#include <JDetectorSimulator.hh>

Inheritance diagram for JDETECTOR::JDetectorSimulator:
JDETECTOR::JPMTRouter JDETECTOR::JK40Simulator JDETECTOR::JPMTSimulator JDETECTOR::JCLBSimulator JLANG::JReference< JClass_t >

Public Types

typedef JDetector::const_iterator const_iterator
 

Public Member Functions

 JDetectorSimulator (const JDetector &detector)
 Constructor. More...
 
bool hasK40Simulator () const
 Check availability of K40 simulator. More...
 
bool hasPMTSimulator () const
 Check availability of PMT simulator. More...
 
bool hasCLBSimulator () const
 Check availability of CLB simulator. More...
 
const JK40SimulatorgetK40Simulator () const
 Get K40 simulator. More...
 
const JPMTSimulatorgetPMTSimulator () const
 Get PMT simulator. More...
 
const JCLBSimulatorgetCLBSimulator () const
 Get CLB simulator. More...
 
void reset (JK40Simulator *k40Simulator)
 Reset K40 simulator. More...
 
void reset (JPMTSimulator *pmtSimulator)
 Reset PMT simulator. More...
 
void reset (JCLBSimulator *clbSimulator)
 Reset CLB simulator. More...
 
virtual void generateHits (const JModule &module, const JTimeRange &period, JModuleData &output) const
 Generate hits. More...
 
virtual void processHits (const JPMTIdentifier &ID, const JCalibration &calibration, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const
 Process hits. More...
 
virtual void processData (const JCLBInput &input, JDAQFrame &output) const
 Process data. More...
 
virtual void operator() (const JModule &module, JModuleData &input, JDAQFrame &output) const
 Process module data in one step. More...
 
const JPMTRoutergetPMTRouter () const
 Get PMT router. More...
 
const JPMTAddressgetAddress (const JObjectID &id) const
 Get address of PMT. More...
 
const JPMTgetPMT (const JPMTAddress &address) const
 Get PMT. More...
 
const JPMTgetPMT (const JObjectID &id) const
 Get PMT. More...
 
bool hasPMT (const JObjectID &id) const
 Has PMT. More...
 
JPMTIdentifier getIdentifier (const JPMTAddress &address) const
 Get identifier of PMT. More...
 
JPMTIdentifier getIdentifier (const JObjectID &id) const
 Get identifier of PMT. More...
 
const JModulegetModule (const JModuleAddress &address) const
 Get module. More...
 
const JModulegetParentModule (const JObjectID &id) const
 Get parent module. More...
 
int getParentModuleID (const JObjectID &id) const
 Get parent module identifier. More...
 
JPMTChannel getPMTChannel (const JPMTAddress &address) const
 Get PMT channel. More...
 
JPMTChannel getPMTChannel (const JObjectID &id) const
 Get PMT channel. More...
 
JUTMPosition getUTMPosition (const JObjectID &id) const
 Get UTM position of given PMT identifier. More...
 
const JClass_t & getReference () const
 Get reference to object. More...
 
JClass_t & getReference ()
 Get reference to object. More...
 
bool is_valid () const
 Check validity of reference. More...
 
const JClass_t * operator-> () const
 Smart pointer. More...
 
JClass_t * operator-> ()
 Smart pointer. More...
 
const JClass_t & operator* () const
 Dereference operator. More...
 
JClass_t & operator* ()
 Dereference operator. More...
 

Protected Attributes

JLANG::JSinglePointer< JK40Simulatork40Simulator
 
JLANG::JSinglePointer< JPMTSimulatorpmtSimulator
 
JLANG::JSinglePointer< JCLBSimulatorclbSimulator
 
JClass_t & __object
 

Private Types

typedef JReference< const JDetectorJReference_t
 

Private Member Functions

 JDetectorSimulator (const JDetectorSimulator &)
 Make copy constructor inaccesible. More...
 
JDetectorSimulatoroperator= (const JDetectorSimulator &)
 Make assignment operator inaccesible. More...
 

Private Attributes

JCLBInput buffer
 
JTOOLS::JRouter< JPMTAddressrouter
 

Detailed Description

Detector simulation.

This class implements the JK40Simulator, JPMTSimulator and JCLBSimulator interfaces. The implementations of these interfaces should be provided via pointers to corresponding objects.

N.B: This class owns the objects pointed to using class JLANG::JSinglePointer.

Definition at line 33 of file JDetectorSimulator.hh.

Member Typedef Documentation

◆ JReference_t

typedef JReference<const JDetector> JDETECTOR::JPMTRouter::JReference_t
privateinherited

Definition at line 37 of file JPMTRouter.hh.

◆ const_iterator

typedef JDetector::const_iterator JDETECTOR::JPMTRouter::const_iterator
inherited

Definition at line 41 of file JPMTRouter.hh.

Constructor & Destructor Documentation

◆ JDetectorSimulator() [1/2]

JDETECTOR::JDetectorSimulator::JDetectorSimulator ( const JDetectorSimulator )
private

Make copy constructor inaccesible.

◆ JDetectorSimulator() [2/2]

JDETECTOR::JDetectorSimulator::JDetectorSimulator ( const JDetector detector)
inline

Constructor.

Parameters
detectordetector

Definition at line 58 of file JDetectorSimulator.hh.

58  :
59  JPMTRouter(detector)
60  {}

Member Function Documentation

◆ operator=()

JDetectorSimulator& JDETECTOR::JDetectorSimulator::operator= ( const JDetectorSimulator )
private

Make assignment operator inaccesible.

◆ hasK40Simulator()

bool JDETECTOR::JDetectorSimulator::hasK40Simulator ( ) const
inline

Check availability of K40 simulator.

Returns
true if simulator available; else false

Definition at line 68 of file JDetectorSimulator.hh.

69  {
70  return k40Simulator.get() != NULL;
71  }

◆ hasPMTSimulator()

bool JDETECTOR::JDetectorSimulator::hasPMTSimulator ( ) const
inline

Check availability of PMT simulator.

Returns
true if simulator available; else false

Definition at line 80 of file JDetectorSimulator.hh.

81  {
82  return pmtSimulator.get() != NULL;
83  }

◆ hasCLBSimulator()

bool JDETECTOR::JDetectorSimulator::hasCLBSimulator ( ) const
inline

Check availability of CLB simulator.

Returns
true if simulator available; else false

Definition at line 91 of file JDetectorSimulator.hh.

92  {
93  return clbSimulator.get() != NULL;
94  }

◆ getK40Simulator()

const JK40Simulator& JDETECTOR::JDetectorSimulator::getK40Simulator ( ) const
inline

Get K40 simulator.

Returns
K40 simulator

Definition at line 102 of file JDetectorSimulator.hh.

103  {
104  if (hasK40Simulator())
105  return *k40Simulator;
106  else
107  THROW(JPointerException, "JDetectorSimulator: K40 simulator not avaliable.");
108  }

◆ getPMTSimulator()

const JPMTSimulator& JDETECTOR::JDetectorSimulator::getPMTSimulator ( ) const
inline

Get PMT simulator.

Returns
PMT simulator

Definition at line 116 of file JDetectorSimulator.hh.

117  {
118  if (hasPMTSimulator())
119  return *pmtSimulator;
120  else
121  THROW(JPointerException, "JDetectorSimulator: PMT simulator not avaliable.");
122  }

◆ getCLBSimulator()

const JCLBSimulator& JDETECTOR::JDetectorSimulator::getCLBSimulator ( ) const
inline

Get CLB simulator.

Returns
CLB simulator

Definition at line 130 of file JDetectorSimulator.hh.

131  {
132  if (hasCLBSimulator())
133  return *clbSimulator;
134  else
135  THROW(JPointerException, "JDetectorSimulator: CLB simulator not avaliable.");
136  }

◆ reset() [1/3]

void JDETECTOR::JDetectorSimulator::reset ( JK40Simulator k40Simulator)
inline

Reset K40 simulator.

Parameters
k40SimulatorK40 simulator

Definition at line 144 of file JDetectorSimulator.hh.

145  {
146  this->k40Simulator.reset(k40Simulator);
147  }

◆ reset() [2/3]

void JDETECTOR::JDetectorSimulator::reset ( JPMTSimulator pmtSimulator)
inline

Reset PMT simulator.

Parameters
pmtSimulatorPMT simulator

Definition at line 156 of file JDetectorSimulator.hh.

157  {
158  this->pmtSimulator.reset(pmtSimulator);
159  }

◆ reset() [3/3]

void JDETECTOR::JDetectorSimulator::reset ( JCLBSimulator clbSimulator)
inline

Reset CLB simulator.

Parameters
clbSimulatorCLB simulator

Definition at line 167 of file JDetectorSimulator.hh.

168  {
169  this->clbSimulator.reset(clbSimulator);
170  }

◆ generateHits()

virtual void JDETECTOR::JDetectorSimulator::generateHits ( const JModule module,
const JTimeRange &  period,
JModuleData output 
) const
inlinevirtual

Generate hits.

Parameters
modulemodule
periodtime window [ns]
outputbackground data

Implements JDETECTOR::JK40Simulator.

Definition at line 180 of file JDetectorSimulator.hh.

183  {
184  getK40Simulator().generateHits(module, period, output);
185  }

◆ processHits()

virtual void JDETECTOR::JDetectorSimulator::processHits ( const JPMTIdentifier ID,
const JCalibration calibration,
const JPMTData< JPMTSignal > &  input,
JPMTData< JPMTPulse > &  output 
) const
inlinevirtual

Process hits.

Parameters
IDPMT identifier
calibrationPMT calibration
inputPMT signals
outputPMT hits

Implements JDETECTOR::JPMTSimulator.

Definition at line 196 of file JDetectorSimulator.hh.

200  {
201  getPMTSimulator().processHits(ID, calibration, input, output);
202  }

◆ processData()

virtual void JDETECTOR::JDetectorSimulator::processData ( const JCLBInput input,
JDAQFrame output 
) const
inlinevirtual

Process data.

Parameters
inputPMT data
outputCLB data

Implements JDETECTOR::JCLBSimulator.

Definition at line 211 of file JDetectorSimulator.hh.

213  {
214  getCLBSimulator().processData(input, output);
215  }

◆ operator()()

virtual void JDETECTOR::JDetectorSimulator::operator() ( const JModule module,
JModuleData input,
JDAQFrame output 
) const
inlinevirtual

Process module data in one step.

Parameters
modulemodule
inputPMT signals
outputCLB data

Definition at line 225 of file JDetectorSimulator.hh.

228  {
229  // PMT simulation
230 
231  JDETECTOR::reset(buffer, input.size());
232 
233  for (unsigned int pmt = 0; pmt != input.size(); ++pmt) {
234 
235  input[pmt].sort();
236 
237  processHits(JPMTIdentifier(module.getID(), pmt), module.getPMT(pmt), input[pmt], buffer[pmt]);
238  }
239 
240  // CLB simulation
241 
242  processData(buffer, output);
243  }

◆ getPMTRouter()

const JPMTRouter& JDETECTOR::JPMTRouter::getPMTRouter ( ) const
inlineinherited

Get PMT router.

Returns
PMT router

Definition at line 66 of file JPMTRouter.hh.

67  {
68  return static_cast<const JPMTRouter&>(*this);
69  }

◆ getAddress()

const JPMTAddress& JDETECTOR::JPMTRouter::getAddress ( const JObjectID id) const
inlineinherited

Get address of PMT.

Parameters
idPMT identifier
Returns
address

Definition at line 78 of file JPMTRouter.hh.

79  {
80  return router.get(id.getID());
81  }

◆ getPMT() [1/2]

const JPMT& JDETECTOR::JPMTRouter::getPMT ( const JPMTAddress address) const
inlineinherited

Get PMT.

Parameters
addressPMT address
Returns
PMT

Definition at line 90 of file JPMTRouter.hh.

91  {
92  return getReference().getPMT(address);
93  }

◆ getPMT() [2/2]

const JPMT& JDETECTOR::JPMTRouter::getPMT ( const JObjectID id) const
inlineinherited

Get PMT.

Parameters
idPMT identifier
Returns
PMT

Definition at line 102 of file JPMTRouter.hh.

103  {
104  return getReference().getPMT(this->getAddress(id));
105  }

◆ hasPMT()

bool JDETECTOR::JPMTRouter::hasPMT ( const JObjectID id) const
inlineinherited

Has PMT.

Parameters
idPMT identifier
Returns
true if PMT present; else false

Definition at line 114 of file JPMTRouter.hh.

115  {
116  return router.has(id.getID());
117  }

◆ getIdentifier() [1/2]

JPMTIdentifier JDETECTOR::JPMTRouter::getIdentifier ( const JPMTAddress address) const
inlineinherited

Get identifier of PMT.

Parameters
addressPMT address
Returns
address

Definition at line 126 of file JPMTRouter.hh.

127  {
128  return JPMTIdentifier(getReference().getModule(address), address.second);
129  }

◆ getIdentifier() [2/2]

JPMTIdentifier JDETECTOR::JPMTRouter::getIdentifier ( const JObjectID id) const
inlineinherited

Get identifier of PMT.

Parameters
idPMT identifier
Returns
address

Definition at line 138 of file JPMTRouter.hh.

139  {
140  return getIdentifier(this->getAddress(id));
141  }

◆ getModule()

const JModule& JDETECTOR::JPMTRouter::getModule ( const JModuleAddress address) const
inlineinherited

Get module.

Parameters
addressmodule address
Returns
module

Definition at line 150 of file JPMTRouter.hh.

151  {
152  return getReference().getModule(address);
153  }

◆ getParentModule()

const JModule& JDETECTOR::JPMTRouter::getParentModule ( const JObjectID id) const
inlineinherited

Get parent module.

Parameters
idPMT identifier
Returns
module

Definition at line 162 of file JPMTRouter.hh.

163  {
164  return getModule(this->getAddress(id));
165  }

◆ getParentModuleID()

int JDETECTOR::JPMTRouter::getParentModuleID ( const JObjectID id) const
inlineinherited

Get parent module identifier.

Parameters
idPMT identifier
Returns
module identifier

Definition at line 174 of file JPMTRouter.hh.

175  {
176  return getParentModule(id).getID();
177  }

◆ getPMTChannel() [1/2]

JPMTChannel JDETECTOR::JPMTRouter::getPMTChannel ( const JPMTAddress address) const
inlineinherited

Get PMT channel.

Parameters
addressPMT address
Returns
PMT channel

Definition at line 186 of file JPMTRouter.hh.

187  {
188  return JPMTChannel(getReference().getID(),
190  JPMTReadoutAddress(address.second));
191  }

◆ getPMTChannel() [2/2]

JPMTChannel JDETECTOR::JPMTRouter::getPMTChannel ( const JObjectID id) const
inlineinherited

Get PMT channel.

Parameters
idPMT identifier
Returns
PMT channel

Definition at line 200 of file JPMTRouter.hh.

201  {
202  return getPMTChannel(getAddress(id));
203  }

◆ getUTMPosition()

JUTMPosition JDETECTOR::JPMTRouter::getUTMPosition ( const JObjectID id) const
inlineinherited

Get UTM position of given PMT identifier.

Parameters
idPMT identifier
Returns
UTM position

Definition at line 212 of file JPMTRouter.hh.

213  {
214  return JUTMPosition(getPMT(id).getPosition() + getReference().getPosition());
215  }

◆ getReference() [1/2]

template<class JClass_t>
const JClass_t& JLANG::JReference< JClass_t >::getReference ( ) const
inlineinherited

Get reference to object.

Returns
reference to object

Definition at line 38 of file JReference.hh.

39  {
40  return __object;
41  }

◆ getReference() [2/2]

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::getReference ( )
inlineinherited

Get reference to object.

Returns
reference to object

Definition at line 49 of file JReference.hh.

50  {
51  return __object;
52  }

◆ is_valid()

template<class JClass_t>
bool JLANG::JReference< JClass_t >::is_valid ( ) const
inlineinherited

Check validity of reference.

Returns
true

Definition at line 60 of file JReference.hh.

61  {
62  return true;
63  }

◆ operator->() [1/2]

template<class JClass_t>
const JClass_t* JLANG::JReference< JClass_t >::operator-> ( ) const
inlineinherited

Smart pointer.

Returns
pointer to object

Definition at line 71 of file JReference.hh.

72  {
73  return &__object;
74  }

◆ operator->() [2/2]

template<class JClass_t>
JClass_t* JLANG::JReference< JClass_t >::operator-> ( )
inlineinherited

Smart pointer.

Returns
pointer to object

Definition at line 82 of file JReference.hh.

83  {
84  return &__object;
85  }

◆ operator*() [1/2]

template<class JClass_t>
const JClass_t& JLANG::JReference< JClass_t >::operator* ( ) const
inlineinherited

Dereference operator.

Returns
reference to object

Definition at line 93 of file JReference.hh.

94  {
95  return __object;
96  }

◆ operator*() [2/2]

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::operator* ( )
inlineinherited

Dereference operator.

Returns
reference to object

Definition at line 104 of file JReference.hh.

105  {
106  return __object;
107  }

Member Data Documentation

◆ k40Simulator

JLANG::JSinglePointer<JK40Simulator> JDETECTOR::JDetectorSimulator::k40Simulator
protected

Definition at line 247 of file JDetectorSimulator.hh.

◆ pmtSimulator

JLANG::JSinglePointer<JPMTSimulator> JDETECTOR::JDetectorSimulator::pmtSimulator
protected

Definition at line 248 of file JDetectorSimulator.hh.

◆ clbSimulator

JLANG::JSinglePointer<JCLBSimulator> JDETECTOR::JDetectorSimulator::clbSimulator
protected

Definition at line 249 of file JDetectorSimulator.hh.

◆ buffer

JCLBInput JDETECTOR::JDetectorSimulator::buffer
mutableprivate

Definition at line 252 of file JDetectorSimulator.hh.

◆ router

JTOOLS::JRouter<JPMTAddress> JDETECTOR::JPMTRouter::router
privateinherited

Definition at line 218 of file JPMTRouter.hh.

◆ __object

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::__object
protectedinherited

Definition at line 110 of file JReference.hh.


The documentation for this class was generated from the following file:
JDETECTOR::JPMTChannel
Auxiliary class to uniquely identify PMT readout channel.
Definition: JPMTChannel.hh:28
JDETECTOR::JPMTRouter::router
JTOOLS::JRouter< JPMTAddress > router
Definition: JPMTRouter.hh:218
JDETECTOR::JDetectorSimulator::getCLBSimulator
const JCLBSimulator & getCLBSimulator() const
Get CLB simulator.
Definition: JDetectorSimulator.hh:130
JDETECTOR::JPMTSimulator::processHits
virtual void processHits(const JPMTIdentifier &id, const JCalibration &calibration, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const =0
Process hits.
JDETECTOR::JCLBSimulator::processData
virtual void processData(const JCLBInput &input, JDAQFrame &output) const =0
Process data.
JLANG::JReference::__object
JClass_t & __object
Definition: JReference.hh:110
JDETECTOR::JK40Simulator::generateHits
virtual void generateHits(const JModule &module, const JTimeRange &period, JModuleData &output) const =0
Generate hits.
JDETECTOR::JDetectorSimulator::processHits
virtual void processHits(const JPMTIdentifier &ID, const JCalibration &calibration, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const
Process hits.
Definition: JDetectorSimulator.hh:196
JDETECTOR::JModuleLocation
Logical location of module.
Definition: JModuleLocation.hh:36
JDETECTOR::JModule::getPMT
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:173
JDETECTOR::JDetectorSimulator::hasPMTSimulator
bool hasPMTSimulator() const
Check availability of PMT simulator.
Definition: JDetectorSimulator.hh:80
JDETECTOR::JDetectorSimulator::processData
virtual void processData(const JCLBInput &input, JDAQFrame &output) const
Process data.
Definition: JDetectorSimulator.hh:211
JLANG::JReference::getReference
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
JLANG::JObjectID::getID
int getID() const
Get identifier.
Definition: JObjectID.hh:55
JDETECTOR::JDetectorSimulator::clbSimulator
JLANG::JSinglePointer< JCLBSimulator > clbSimulator
Definition: JDetectorSimulator.hh:249
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:669
JDETECTOR::JPMTRouter::getAddress
const JPMTAddress & getAddress(const JObjectID &id) const
Get address of PMT.
Definition: JPMTRouter.hh:78
ID
Definition: raw_data_converter.cpp:43
JDETECTOR::reset
void reset(JCLBInput &data, size_t size)
Reset CLB buffers.
Definition: JCLBSimulator.hh:41
JDETECTOR::JDetectorSimulator::getK40Simulator
const JK40Simulator & getK40Simulator() const
Get K40 simulator.
Definition: JDetectorSimulator.hh:102
JDETECTOR::JPMTRouter::getIdentifier
JPMTIdentifier getIdentifier(const JPMTAddress &address) const
Get identifier of PMT.
Definition: JPMTRouter.hh:126
JDETECTOR::JPMTIdentifier
PMT identifier.
Definition: JPMTIdentifier.hh:30
JDETECTOR::JDetectorSimulator::buffer
JCLBInput buffer
Definition: JDetectorSimulator.hh:252
JDETECTOR::getPosition
JPosition3D getPosition(const JModule &first, const JModule &second)
Get position to go from first to second module.
Definition: JDetectorToolkit.hh:833
JDETECTOR::JPMTRouter::getPMTChannel
JPMTChannel getPMTChannel(const JPMTAddress &address) const
Get PMT channel.
Definition: JPMTRouter.hh:186
JDETECTOR::JDetectorSimulator::hasK40Simulator
bool hasK40Simulator() const
Check availability of K40 simulator.
Definition: JDetectorSimulator.hh:68
JDETECTOR::JDetectorSimulator::pmtSimulator
JLANG::JSinglePointer< JPMTSimulator > pmtSimulator
Definition: JDetectorSimulator.hh:248
JDETECTOR::JPMTRouter::getParentModule
const JModule & getParentModule(const JObjectID &id) const
Get parent module.
Definition: JPMTRouter.hh:162
JDETECTOR::JDetectorSimulator::getPMTSimulator
const JPMTSimulator & getPMTSimulator() const
Get PMT simulator.
Definition: JDetectorSimulator.hh:116
JDETECTOR::JPMTRouter::JPMTRouter
JPMTRouter(const JDetector &detector)
Constructor.
Definition: JPMTRouter.hh:49
JDETECTOR::JDetectorSimulator::hasCLBSimulator
bool hasCLBSimulator() const
Check availability of CLB simulator.
Definition: JDetectorSimulator.hh:91
JDETECTOR::JDetectorSimulator::k40Simulator
JLANG::JSinglePointer< JK40Simulator > k40Simulator
Definition: JDetectorSimulator.hh:247
JDETECTOR::JPMTReadoutAddress
Data structure for PMT readout address.
Definition: JPMTReadoutAddress.hh:27
JDETECTOR::JPMTRouter::getModule
const JModule & getModule(const JModuleAddress &address) const
Get module.
Definition: JPMTRouter.hh:150
JDETECTOR::JPMTRouter::getPMT
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
Definition: JPMTRouter.hh:90
JDETECTOR::JPMTAddress::second
int second
index of PMT in module data structure.
Definition: JPMTAddress.hh:100