GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gear::TPCParametersImpl Class Reference

A Container for TPCModules which describe the geometry properties of a given TPC. More...

#include <TPCParametersImpl.h>

Inheritance diagram for gear::TPCParametersImpl:
gear::TPCParameters gear::GearParametersImpl gear::GearParameters gear::GearParameters

Public Member Functions

 TPCParametersImpl (double maxDriftLength=-1., int coordinateType=-1)
 
 TPCParametersImpl (const TPCParametersImpl &)
 
TPCParametersImploperator= (const TPCParametersImpl &)
 Assignment operator.
 
virtual ~TPCParametersImpl ()
 Copy constructor for base parameters. More...
 
virtual const TPCModulegetModule (int moduleID) const
 Returns module with the given module ID. More...
 
virtual int getNModules () const
 Returns the number of modules in the TPC (endplate) More...
 
virtual const TPCModulegetNearestModule (double c0, double c1) const
 Returns nearest module to given coordinates (2D). More...
 
virtual const TPCModulegetNearestModule (double c0, double c1, double z) const
 Returns nearest module to given coordinates (3D). More...
 
virtual double getMaxDriftLength () const
 The maximum drift length in the TPC in mm.
 
virtual bool isInsideModule (double c0, double c1) const
 True if coordinate (c0,c1) is within any module. More...
 
virtual bool isInsideModule (double c0, double c1, double z) const
 First determines the correct end plate from the z coordinate and then calls the same function as the 2D version on the modules from the correct end cap.
 
virtual bool isInsidePad (double c0, double c1) const
 True if coordinate (c0,c1) is within any pad, on any module. More...
 
virtual bool isInsidePad (double c0, double c1, double z) const
 First determines the correct end plate from the z coordinate and then calls the same function as the 2D version on the modules from the correct end cap.
 
virtual GlobalPadIndex getNearestPad (double c0, double c1) const
 Returns globalPadindex Object for nearest pad to given coordinates (2D). More...
 
virtual GlobalPadIndex getNearestPad (double c0, double c1, double z) const
 Returns globalPadindex Object for nearest pad to given coordinates (3D). More...
 
virtual const std::vector
< double > & 
getPlaneExtent () const
 Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR. More...
 
virtual int getCoordinateType () const
 Returns coordinate type as an int (see PadRowLayout2D::CARTESIAN, PadRowLayout2D::POLAR) More...
 
virtual const std::vector
< TPCModule * > & 
getModules () const
 Returns vector of all modules in this TPC (endplate). More...
 
virtual void addModule (TPCModule *TPCModule)
 Adds a Module to the vector of modules, or throws an exception.
 
virtual const PadRowLayout2DgetPadLayout () const
 Kept for backward compatibility. More...
 
virtual double getDriftVelocity () const
 The electron drift velocity in the TPC in mm/s. More...
 
virtual double getReadoutFrequency () const
 Kept for backward compatibility. More...
 
virtual void setPadLayout (PadRowLayout2D *padLayout)
 
virtual void setMaxDriftLength (double maxDriftLength)
 
virtual void setDriftVelocity (double driftVelocity)
 
virtual void setReadoutFrequency (double readoutFrequency)
 
- Public Member Functions inherited from gear::TPCParameters
virtual ~TPCParameters ()
 Destructor.
 
- Public Member Functions inherited from gear::GearParameters
virtual ~GearParameters ()
 Destructor.
 
- Public Member Functions inherited from gear::GearParametersImpl
virtual ~GearParametersImpl ()
 Destructor.
 
virtual int getIntVal (const std::string &key) const
 Integer value for key. More...
 
virtual double getDoubleVal (const std::string &key) const
 Double value for key. More...
 
virtual const std::string & getStringVal (const std::string &key) const
 String value for key. More...
 
virtual const std::vector< int > & getIntVals (const std::string &key) const
 Integer values for key. More...
 
virtual const std::vector
< double > & 
getDoubleVals (const std::string &key) const
 Double values for key. More...
 
virtual const std::vector
< std::string > & 
getStringVals (const std::string &key) const
 String values for key. More...
 
virtual void setIntVal (const std::string &key, int val)
 Set Integer value for key.
 
virtual void setDoubleVal (const std::string &key, double val)
 Double value for key.
 
virtual void setStringVal (const std::string &key, const std::string &val)
 String value for key.
 
virtual void setIntVals (const std::string &key, const std::vector< int > &vals)
 Integer values for key.
 
virtual void setDoubleVals (const std::string &key, const std::vector< double > &vals)
 Double values for key.
 
virtual void setStringVals (const std::string &key, const std::vector< std::string > &vals)
 String values for key.
 
virtual const std::vector
< std::string > & 
getIntKeys () const
 All keys of int variables. More...
 
virtual const std::vector
< std::string > & 
getDoubleKeys () const
 All keys of double variables. More...
 
virtual const std::vector
< std::string > & 
getStringKeys () const
 All keys of string variables. More...
 
virtual const std::vector
< std::string > & 
getIntVecKeys () const
 All keys of IntVec variables. More...
 
virtual const std::vector
< std::string > & 
getDoubleVecKeys () const
 All keys of DoubleVec variables. More...
 
virtual const std::vector
< std::string > & 
getStringVecKeys () const
 All keys of StringVec variables. More...
 

Protected Member Functions

const TPCModulegetNearestModule (double c0, double c1, std::vector< TPCModule * > const &modulesVector) const
 Version for internal usage, for both all modules or only one half TPC. More...
 
bool isInsideModule (double c0, double c1, std::vector< TPCModule * > const &modulesVector) const
 Versions for internal usage, for both all modules or only one half TPC.
 
bool isInsidePad (double c0, double c1, std::vector< TPCModule * > const &modulesVector) const
 Versions for internal usage, for both all modules or only one half TPC.
 
GlobalPadIndex getNearestPad (double c0, double c1, std::vector< TPCModule * > const &modulesVector) const
 Versions for internal usage, for both all modules or only one half TPC.
 
void copy_and_assign (const TPCParametersImpl &)
 function to copy all internal variables, incl. More...
 
void cleanup ()
 function to delete all the objects pointed to and owned by the GearMgr. More...
 
void setCathodePosition ()
 

Protected Attributes

std::vector< TPCModule * > _TPCModules {}
 
std::vector< TPCModule * > _modulesPositiveHalfTPC {}
 
std::vector< TPCModule * > _modulesNegativeHalfTPC {}
 
double _maxDriftLength {}
 
int _coordinateType {}
 
double _cathodePosition {}
 The cathode position is needed internally to distinguish the half TPCs. More...
 
std::map< int, int > _moduleIDMap {}
 A map with the moduleID as key and the index in the _TPCModules vector as value. More...
 
std::vector< double > _planeExtent {}
 
double _driftVelocity {}
 Drift velocity is deprecated, should come from conditions data.
 
- Protected Attributes inherited from gear::GearParametersImpl
std::map< std::string, int > _intMap {}
 
std::map< std::string, double > _doubleMap {}
 
std::map< std::string,
std::string > 
_stringMap {}
 
std::map< std::string, IntVec > _intVecMap {}
 
std::map< std::string, DoubleVec > _doubleVecMap {}
 
std::map< std::string, StringVec > _stringVecMap {}
 
StringVec _intKeys {}
 
StringVec _doubleKeys {}
 
StringVec _stringKeys {}
 
StringVec _intVecKeys {}
 
StringVec _doubleVecKeys {}
 
StringVec _stringVecKeys {}
 

Additional Inherited Members

- Public Types inherited from gear::GearParametersImpl
typedef std::map< std::string,
int > 
IntMap
 
typedef std::map< std::string,
double > 
DoubleMap
 
typedef std::map< std::string,
std::string > 
StringMap
 
typedef std::map< std::string,
IntVec > 
IntVecMap
 
typedef std::map< std::string,
DoubleVec > 
DoubleVecMap
 
typedef std::map< std::string,
StringVec > 
StringVecMap
 

Detailed Description

A Container for TPCModules which describe the geometry properties of a given TPC.


This assumes nothing about the layouts of the pads within the modules Most of the functionality is derived from calling functions of constained TPCModules

Author
M, Killenberg, (Bonn) S, Turnbull, (Saclay/Carleton)
Version
$Id$

Definition at line 25 of file TPCParametersImpl.h.

Constructor & Destructor Documentation

gear::TPCParametersImpl::TPCParametersImpl ( double  maxDriftLength = -1.,
int  coordinateType = -1 
)
Author
M, Killenberg, (Bonn) S, Turnbull, (Saclay/Carleton)
Version
Id:
TPCParametersImpl.cc,v 1.3 2009-02-27 09:00:50 gaede Exp

Definition at line 14 of file TPCParametersImpl.cc.

gear::TPCParametersImpl::~TPCParametersImpl ( )
virtual

Copy constructor for base parameters.

Destructor.

Definition at line 85 of file TPCParametersImpl.cc.

References cleanup().

Member Function Documentation

void gear::TPCParametersImpl::cleanup ( )
protected

function to delete all the objects pointed to and owned by the GearMgr.

Used by desctructor and assigment operator to avoid code duplication

Definition at line 99 of file TPCParametersImpl.cc.

Referenced by operator=(), and ~TPCParametersImpl().

void gear::TPCParametersImpl::copy_and_assign ( const TPCParametersImpl right)
protected

function to copy all internal variables, incl.

the objects pointed to and owned by the TPCParameters. Used by constructor and assigment operator to avoid code duplication

Definition at line 43 of file TPCParametersImpl.cc.

References _cathodePosition, _driftVelocity, and _moduleIDMap.

Referenced by operator=().

int gear::TPCParametersImpl::getCoordinateType ( ) const
virtual

Returns coordinate type as an int (see PadRowLayout2D::CARTESIAN, PadRowLayout2D::POLAR)

returns Coordinate type as an int

Implements gear::TPCParameters.

Definition at line 309 of file TPCParametersImpl.cc.

double gear::TPCParametersImpl::getDriftVelocity ( ) const
virtual

The electron drift velocity in the TPC in mm/s.

Kept for backwards compatibility.

Deprecated:
{This should come from conditions data.}

Kept for backwards compatibility.

Deprecated:
{This should come from conditions data.}

Implements gear::TPCParameters.

Definition at line 421 of file TPCParametersImpl.cc.

References _driftVelocity.

const TPCModule & gear::TPCParametersImpl::getModule ( int  moduleID) const
virtual

Returns module with the given module ID.

Attention! This is NOT the position/index in the vector which can be accessed with getModules()!

Implements gear::TPCParameters.

Definition at line 116 of file TPCParametersImpl.cc.

References _moduleIDMap.

const std::vector< TPCModule * > & gear::TPCParametersImpl::getModules ( ) const
virtual

Returns vector of all modules in this TPC (endplate).

returns refeance to vector of Modules

Implements gear::TPCParameters.

Definition at line 380 of file TPCParametersImpl.cc.

const TPCModule & gear::TPCParametersImpl::getNearestModule ( double  c0,
double  c1 
) const
virtual

Returns nearest module to given coordinates (2D).

In case of a full TPC with two end caps the first matching module is returned, although a module from the other end plate might be closer in 3D. Use the 3D version of getNearestModule in this case to get the module from the correct half TPC.

Implements gear::TPCParameters.

Definition at line 162 of file TPCParametersImpl.cc.

Referenced by getNearestModule().

const TPCModule & gear::TPCParametersImpl::getNearestModule ( double  c0,
double  c1,
double  z 
) const
virtual

Returns nearest module to given coordinates (3D).

The z coordinate is only used to determine whether the positive or negative half TPC is to be used.

Implements gear::TPCParameters.

Definition at line 168 of file TPCParametersImpl.cc.

References _cathodePosition, and getNearestModule().

const TPCModule & gear::TPCParametersImpl::getNearestModule ( double  c0,
double  c1,
std::vector< TPCModule * > const &  modulesVector 
) const
protected

Version for internal usage, for both all modules or only one half TPC.

Returns nearest module to given coordinates.

Definition at line 139 of file TPCParametersImpl.cc.

References gear::TPCModule::getDistanceToModule().

GlobalPadIndex gear::TPCParametersImpl::getNearestPad ( double  c0,
double  c1 
) const
virtual

Returns globalPadindex Object for nearest pad to given coordinates (2D).

returns globalPadindex Object for nearest Pad to given co-ordinates.

In case of a full TPC with two end caps the first matching module ID is returned, although a module from the other end plate might be closer in 3D. Use the 3D version of getNearestPad in this case to get the pad from a module from the correct half TPC.

2D Version, run internal version on all modules

Implements gear::TPCParameters.

Definition at line 243 of file TPCParametersImpl.cc.

Referenced by getNearestPad().

GlobalPadIndex gear::TPCParametersImpl::getNearestPad ( double  c0,
double  c1,
double  z 
) const
virtual

Returns globalPadindex Object for nearest pad to given coordinates (3D).

The z coordinate is only used to determine whether the positive or negative half TPC is to be used.

Implements gear::TPCParameters.

Definition at line 248 of file TPCParametersImpl.cc.

References _cathodePosition, and getNearestPad().

int gear::TPCParametersImpl::getNModules ( ) const
virtual

Returns the number of modules in the TPC (endplate)

Returns number of modules in TPC.

Implements gear::TPCParameters.

Definition at line 133 of file TPCParametersImpl.cc.

const PadRowLayout2D & gear::TPCParametersImpl::getPadLayout ( ) const
virtual

Kept for backward compatibility.

In case there is only one module, which has no angle and no offset wrt. the gobal coordinate systen, it gives back the PadRowLayout2D of this module. Otherwise it throws a gear::Exception.

Deprecated:
{Please use getModule(moduleID) instead. The TPCModule is an implementation of PadRowLayout2D}

In case there is only one module, which has no angle and no offset wrt. the gobal coordinate systen, it gives back the PadRowLayout2D of this module. Otherwise it throws a gear::Exception.

Deprecated:
{Please use getModule(moduleID) instead. The TPCModule is an implementation of PadRowLayout2D}

Implements gear::TPCParameters.

Definition at line 393 of file TPCParametersImpl.cc.

const std::vector< double > & gear::TPCParametersImpl::getPlaneExtent ( ) const
virtual

Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.

These are the outermost coordinates in the respective coordinate system. It does not mean that the complete plane is sensitive as there might be dead space between the modules.

Implements gear::TPCParameters.

Definition at line 299 of file TPCParametersImpl.cc.

double gear::TPCParametersImpl::getReadoutFrequency ( ) const
virtual

Kept for backward compatibility.

In case there is only one module it gives back the redaout frequency of this module. Otherwise it throws a gear::Exception.

Deprecated:
{Use TPCModule::getReadoutFrequency() instead.}

In case there is only one module it gives back the redaout frequency of this module. Otherwise it throws a gear::Exception.

Deprecated:
{Use TPCModule::getReadoutFrequency() instead.}

Implements gear::TPCParameters.

Definition at line 438 of file TPCParametersImpl.cc.

bool gear::TPCParametersImpl::isInsideModule ( double  c0,
double  c1 
) const
virtual

True if coordinate (c0,c1) is within any module.

True if coordinate (c0,c1) is within any module may or may not be on a pad, since with resitive films being on the film is enough.

This may or may not be on a pad, since with resitive films being on the film is enough to generate signal on pads (see TPCModule::getBorderWidth() ). This is the 2D version. Use isInsideModule(double c0, double c1, double z) to limit to correct end plate in case there are two.

2D Version, run internal version on all modules

Implements gear::TPCParameters.

Definition at line 187 of file TPCParametersImpl.cc.

Referenced by isInsideModule().

bool gear::TPCParametersImpl::isInsidePad ( double  c0,
double  c1 
) const
virtual

True if coordinate (c0,c1) is within any pad, on any module.

This is the 2D version. Use isInsideModule(double c0, double c1, double z) to limit to correct end plate in case there are two.

2D Version, run internal version on all modules

Implements gear::TPCParameters.

Definition at line 215 of file TPCParametersImpl.cc.

Referenced by isInsidePad().

void gear::TPCParametersImpl::setDriftVelocity ( double  driftVelocity)
virtual
Deprecated:
{Drift velocity should come from conditons data}

Definition at line 462 of file TPCParametersImpl.cc.

References _driftVelocity.

Referenced by gear::TPCParametersXML::fromXML().

void gear::TPCParametersImpl::setMaxDriftLength ( double  maxDriftLength)
virtual
Deprecated:
{MaxDriftLength should be set in constructor}

Definition at line 449 of file TPCParametersImpl.cc.

void gear::TPCParametersImpl::setPadLayout ( PadRowLayout2D padLayout)
virtual
Deprecated:
{Calls addModule with a module it creates from the padLayout}

Definition at line 488 of file TPCParametersImpl.cc.

References addModule(), and gear::PadRowLayout2D::getPadLayoutImplType().

Referenced by gear::TPCParametersXML::fromXML().

void gear::TPCParametersImpl::setReadoutFrequency ( double  readoutFrequency)
virtual
Deprecated:
{Readout frequency is individual for modules.}

Definition at line 472 of file TPCParametersImpl.cc.

Referenced by gear::TPCParametersXML::fromXML().

Member Data Documentation

double gear::TPCParametersImpl::_cathodePosition {}
protected

The cathode position is needed internally to distinguish the half TPCs.

If only one half TPC is used the cathode positon is _zAnode - _maxDriftLength for positive, _zAnode + _maxDriftLength for negative half TPC ( the latter including _zAnode = 0, prototype case). In case both half TPCs are populated with modules it is ( _zAnode_positive + _zAnode_negative ) / 2;

Definition at line 201 of file TPCParametersImpl.h.

Referenced by copy_and_assign(), getNearestModule(), getNearestPad(), isInsideModule(), and isInsidePad().

std::map<int,int> gear::TPCParametersImpl::_moduleIDMap {}
protected

A map with the moduleID as key and the index in the _TPCModules vector as value.

For internal use in this class only.

Definition at line 206 of file TPCParametersImpl.h.

Referenced by addModule(), copy_and_assign(), and getModule().


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