gtouchable
Loading...
Searching...
No Matches
GTouchable Class Reference

Represents a touchable sensitive detector element. More...

#include <gtouchable.h>

Inheritance diagram for GTouchable:
Inheritance graph
Collaboration diagram for GTouchable:
Collaboration graph

Public Member Functions

 GTouchable (const GTouchable &)=default
 
GTouchableoperator= (const GTouchable &)=default
 
 GTouchable (const std::shared_ptr< GOptions > &gopt, const std::string &digitization, const std::string &gidentityString, const std::vector< double > &dimensions)
 Constructs a GTouchable from digitization and identifier strings.
 
 GTouchable (const std::shared_ptr< GLogger > &logger, const std::string &digitization, const std::string &gidentityString, const std::vector< double > &dimensions)
 
 GTouchable (const std::shared_ptr< GTouchable > &base, int newTimeIndex)
 Copy constructor for updating the electronic time index. Used to create a new hit, in case the time indices differ. Used in processTouchable when time indices differ.
 
 ~GTouchable ()
 
bool operator== (const GTouchable &gtouchable) const
 Equality operator comparing two GTouchable objects.
 
void assignTrackId (int tid)
 Assigns a track identifier.
 
double getEnergyMultiplier () const
 Gets the energy multiplier.
 
void assignStepTimeAtElectronicsIndex (int timeIndex)
 Assigns the step time index used in electronics.
 
int getStepTimeAtElectronicsIndex () const
 Gets the electronics time index.
 
std::vector< GIdentifiergetIdentity () const
 Returns the identifier vector.
 
std::string getIdentityString () const
 Returns a string formed by all identifiers.
 
std::vector< double > getDetectorDimensions () const
 Returns the detector dimensions.
 
bool exists_in_vector (const std::vector< GTouchable > &v) const
 Checks if the GTouchable is found in a vector of GTouchable objects.
 

Static Public Member Functions

static std::shared_ptr< GTouchablecreate (const std::shared_ptr< GOptions > &gopt)
 
static std::shared_ptr< GTouchablecreate (const std::shared_ptr< GLogger > &logger)
 

Detailed Description

The GTouchable class encapsulates properties and identification of a sensitive detector element used in hit processing and digitization. The key discriminating factors to check if the hit belongs to an existing hitcollection are:

  • the gidentity vector
  • the gType (if the gidentity vectors are the same) The algorithm is implemented in the operator== method.

Definition at line 103 of file gtouchable.h.

Constructor & Destructor Documentation

◆ GTouchable() [1/4]

GTouchable::GTouchable ( const GTouchable & )
default

◆ GTouchable() [2/4]

GTouchable::GTouchable ( const std::shared_ptr< GOptions > & gopt,
const std::string & digitization,
const std::string & gidentityString,
const std::vector< double > & dimensions )

Called in GDetectorConstruction::ConstructSDandField to register a new GTouchable in the sensitive detector map.

Parameters
goptGOptions
digitizationThe digitization type as a string.
gidentityStringThe string specifying the gidentity (e.g., "sector: 2, layer: 4, wire: 33").
dimensionsThe physical dimensions of the detector element.

Definition at line 14 of file gtouchable.cc.

◆ GTouchable() [3/4]

GTouchable::GTouchable ( const std::shared_ptr< GLogger > & logger,
const std::string & digitization,
const std::string & gidentityString,
const std::vector< double > & dimensions )

Definition at line 46 of file gtouchable.cc.

◆ GTouchable() [4/4]

GTouchable::GTouchable ( const std::shared_ptr< GTouchable > & base,
int newTimeIndex )
inline

Used when the step time index of the hit is different from that of the GTouchable. Base: shallow or deep depending on GBase’s copy

Parameters
basePointer to the base GTouchable.
newTimeIndexThe new electronics time index.

Definition at line 141 of file gtouchable.h.

◆ ~GTouchable()

GTouchable::~GTouchable ( )
inline

Definition at line 149 of file gtouchable.h.

Member Function Documentation

◆ assignStepTimeAtElectronicsIndex()

void GTouchable::assignStepTimeAtElectronicsIndex ( int timeIndex)
inline
Parameters
timeIndexThe new time index.

Definition at line 178 of file gtouchable.h.

◆ assignTrackId()

void GTouchable::assignTrackId ( int tid)
inline
Parameters
tidThe track id. Called in GSensitiveDetector::ProcessHits

Definition at line 166 of file gtouchable.h.

◆ create() [1/2]

static std::shared_ptr< GTouchable > GTouchable::create ( const std::shared_ptr< GLogger > & logger)
inlinestatic

Definition at line 238 of file gtouchable.h.

◆ create() [2/2]

static std::shared_ptr< GTouchable > GTouchable::create ( const std::shared_ptr< GOptions > & gopt)
inlinestatic

Definition at line 227 of file gtouchable.h.

◆ exists_in_vector()

bool GTouchable::exists_in_vector ( const std::vector< GTouchable > & v) const
inline
Parameters
vThe vector of GTouchable objects.
Returns
True if the GTouchable is found in the vector.

Definition at line 214 of file gtouchable.h.

◆ getDetectorDimensions()

std::vector< double > GTouchable::getDetectorDimensions ( ) const
inline
Returns
A vector containing the dimensions.

Definition at line 206 of file gtouchable.h.

◆ getEnergyMultiplier()

double GTouchable::getEnergyMultiplier ( ) const
inline
Returns
The energy multiplier.

Definition at line 172 of file gtouchable.h.

◆ getIdentity()

std::vector< GIdentifier > GTouchable::getIdentity ( ) const
inline
Returns
A vector of GIdentifier objects.

Definition at line 190 of file gtouchable.h.

◆ getIdentityString()

std::string GTouchable::getIdentityString ( ) const
inline
Returns
A vector of GIdentifier objects.

Definition at line 196 of file gtouchable.h.

◆ getStepTimeAtElectronicsIndex()

int GTouchable::getStepTimeAtElectronicsIndex ( ) const
inline
Returns
The step time index.

Definition at line 184 of file gtouchable.h.

◆ operator=()

GTouchable & GTouchable::operator= ( const GTouchable & )
default

◆ operator==()

bool GTouchable::operator== ( const GTouchable & gtouchable) const

Comparison is based on the gidentity vector and, if needed, on a type-specific property.

Parameters
gtouchableThe GTouchable to compare with.
Returns
True if the objects are considered equal.

Definition at line 77 of file gtouchable.cc.


The documentation for this class was generated from the following files: