BBQ
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
VisTPC Class Reference

Main visualization class. It is used to draw GEAR detector geometries and LCIO data. It is a self-contained class that depends only on ROOT, TEve, GEAR and LCIO. This means you can use this class outside and independent of BBQ. More...

#include <vistpc.h>

Classes

struct  PadMetric
 The PadMetric is used for holding the geometric properties of a pad. More...
 

Public Types

enum  LCCollectionType_enum { kUNDEFINEDTYPE, kPULSE, kHIT, kTRACK }
 
enum  LeftRight_enum { kLEFT, kRIGHT }
 

Public Member Functions

 VisTPC (gear::GearMgr *aGearMgr=0)
 
 ~VisTPC ()
 
void updateGearMgr (gear::GearMgr *aGearMgr)
 A function to update the vistpc with information from a new gear file. More...
 
Setters/Getters
float getReadoutFrequency ()
 
float getDriftVelocity ()
 
float getMaxDriftLength ()
 
int getMaxPoints ()
 
int getOption (std::string &option)
 
void setReadoutFrequency (float frequency)
 
void setDriftVelocity (float velocity)
 
void setMaxDriftLength (float length)
 
void setMaxPoints (int points)
 
void setOption (std::string option, int value)
 
GEAR methods

These methods are for drawing the detector and modules as described in the GEAR file.

When the "parent" is NULL, the visualized data will also be added to the global scene. When the "parent" is not NULL, the visualized data will be added to "parent".

void drawTPC ()
 
void drawModule (gear::TPCModule *aModule, TEveElement *parent=NULL)
 
void drawModules (TEveElement *parent=NULL)
 
void drawPads (gear::TPCModule *aModule, TEveElement *parent=NULL)
 
LCIO methods

These methods are for visualizing the data in the LCIO file.

When there is no "parent" in the argument list, the visualized data will be added to the event scene. When the "parent" is NULL, the visualized data will also be added to the event scene. When the "parent" is not NULL, the visualized data will be added to "parent".

When a TEveElement* value is returned, it can be used to set properties in the caller function.

This inconsistency is due to historical/evolutionary reasons. Both styles has pro's and con's.

void drawEvent (EVENT::LCEvent *event, std::vector< std::string > &selectedEntries, TEveElement *parent=NULL, const char *name="Event")
 
void drawEvent (EVENT::LCEvent *event, TList &selectedEntries, TEveElement *parent=NULL, const char *name="Event")
 
void drawHit (EVENT::TrackerHit *hit, TEvePointSet *parent, int wantTooltip=false)
 
TEveElement * drawHits (IMPL::LCCollectionVec *hits, int wantTooltip=true)
 
TEveElement * drawHits (const EVENT::TrackerHitVec &hits, int wantTooltip=true)
 
TEveElement * drawPulses (IMPL::LCCollectionVec *pulses)
 
TEveElement * drawTracks (IMPL::LCCollectionVec *tracks, TEveElement *parent=NULL)
 
Helper methods

These methods are more generic drawing functions that are used by all other methods.

void drawCircularPolygon (TEveStraightLineSet *ls, float r, int nDivisions, float z)
 
void drawCircularPolygon (TEveStraightLineSet *ls, float r, float phi_min, float phi_max, int nDivisions, float z)
 
void drawPadBox (const PadMetric &pad, float z_front, float z_back, TEveBoxSet *bs)
 
void drawPadQuad (const PadMetric &pad, float z, TEveQuadSet *qs)
 
const LCCollectionType_enum getCollectionType (const std::string &)
 
void getGlobalPadMetric (const gear::TPCModule *aModule, const int padIndex, PadMetric &pad)
 Get the pad geometric properties in the global coordinate system of the detector. More...
 
void getLocalPadMetric (const gear::TPCModule *aModule, const int padIndex, PadMetric &pad)
 Get the pad geometric properties in the local coordinate system of the module. More...
 
void toGlobal (const gear::TPCModule *aModule, TEveElement *element)
 Transform a TEveElement to the global coordinate system of the detector using OpenGL matrix transformation. The transformation matrix is constructed using the information of the TPCModule. More...
 
Tests of GEAR functionality

These methods are for visualization of some important GEAR functions.

void drawTwoConnectingPads (const gear::TPCModule &aModule, TEveElement *parent, int pad1, int pad2, LeftRight_enum leftright)
 
void drawNearestPad (const gear::TPCModule &aModule, TEveElement *parent, int padIndex, const gear::Vector2D &position, int i)
 
void testLeftRightNeighbour (int moduleID=0)
 
void testLeftRightNeighbourWithPads (int moduleID, const std::vector< int > &pads, LeftRight_enum leftright)
 
void testNearestPad (int moduleID=0)
 
void testNearestPadWithPoints (int moduleID, const std::vector< gear::Vector2D > &points)
 
void testNearestPadGlobal ()
 
void testNearestPadGlobalWithPoints (const std::vector< gear::Vector2D > &points)
 

Protected Attributes

int debug
 
int maxPoints
 
float outerFieldCageRadius
 Radius of the outer field cage cylinder. More...
 
float innerFieldCageRadius
 Radius of the inner field cage cylinder. More...
 
GEAR properties
gear::GearMgr * gearMgr
 
gear::TPCParameters const * tpcParameters
 
TGeo properties

This is used to draw the TPC ( drawTPC() ) and isn't used anywhere else.

std::map< std::string,
TGeoMaterial * > 
materials
 
std::map< std::string,
TGeoMedium * > 
media
 
std::map< std::string,
TGeoVolume * > 
volumes
 
"Hard coded" detector properties

These properties should be taken from GEAR or LCIO, but aren't for some reason.

float readoutFrequency
 
float driftVelocity
 
float maxDriftLength
 This is used for the z-position of the endcap/modules. More...
 
Visualisation options

These options allow to turn on or off certain features.

std::map< std::string, int > options
 

Private Member Functions

 ClassDef (VisTPC, 1)
 

Detailed Description

Main visualization class. It is used to draw GEAR detector geometries and LCIO data. It is a self-contained class that depends only on ROOT, TEve, GEAR and LCIO. This means you can use this class outside and independent of BBQ.

Author
Ching Bon Lam

Definition at line 65 of file vistpc.h.

Member Enumeration Documentation

Enumerator
kUNDEFINEDTYPE 
kPULSE 
kHIT 
kTRACK 

Definition at line 71 of file vistpc.h.

LeftRight_enum is only used for the method testLeftRightNeighbourWithPads(). It specifies which GEAR function to call: getLeftNeighbour() or getRightNeighbour().

Enumerator
kLEFT 
kRIGHT 

Definition at line 84 of file vistpc.h.

Constructor & Destructor Documentation

VisTPC::VisTPC ( gear::GearMgr *  aGearMgr = 0)

Definition at line 78 of file vistpc.cxx.

References materials, media, options, and updateGearMgr().

VisTPC::~VisTPC ( )
inline

Definition at line 132 of file vistpc.h.

Member Function Documentation

VisTPC::ClassDef ( VisTPC  ,
 
)
private
void VisTPC::drawCircularPolygon ( TEveStraightLineSet *  ls,
float  r,
int  nDivisions,
float  z 
)

Definition at line 108 of file vistpc.cxx.

Referenced by drawModule(), and drawPads().

void VisTPC::drawCircularPolygon ( TEveStraightLineSet *  ls,
float  r,
float  phi_min,
float  phi_max,
int  nDivisions,
float  z 
)

Definition at line 112 of file vistpc.cxx.

void VisTPC::drawEvent ( EVENT::LCEvent *  event,
std::vector< std::string > &  selectedEntries,
TEveElement *  parent = NULL,
const char *  name = "Event" 
)
void VisTPC::drawEvent ( EVENT::LCEvent *  event,
TList &  selectedEntries,
TEveElement *  parent = NULL,
const char *  name = "Event" 
)

Definition at line 150 of file vistpc.cxx.

References drawEvent().

void VisTPC::drawHit ( EVENT::TrackerHit *  hit,
TEvePointSet *  parent,
int  wantTooltip = false 
)

Definition at line 270 of file vistpc.cxx.

References maxDriftLength, and tpcParameters.

Referenced by drawHits().

TEveElement * VisTPC::drawHits ( IMPL::LCCollectionVec *  hits,
int  wantTooltip = true 
)

Definition at line 341 of file vistpc.cxx.

References drawHit(), and maxPoints.

Referenced by drawEvent(), and drawTracks().

TEveElement * VisTPC::drawHits ( const EVENT::TrackerHitVec &  hits,
int  wantTooltip = true 
)

Definition at line 372 of file vistpc.cxx.

References drawHit(), and maxPoints.

void VisTPC::drawModule ( gear::TPCModule *  aModule,
TEveElement *  parent = NULL 
)

Definition at line 403 of file vistpc.cxx.

References drawCircularPolygon(), drawPads(), options, and toGlobal().

Referenced by drawModules().

void VisTPC::drawModules ( TEveElement *  parent = NULL)

Definition at line 556 of file vistpc.cxx.

References debug, drawModule(), and tpcParameters.

Referenced by drawTPC().

void VisTPC::drawNearestPad ( const gear::TPCModule &  aModule,
TEveElement *  parent,
int  padIndex,
const gear::Vector2D &  position,
int  i 
)
void VisTPC::drawPadBox ( const PadMetric pad,
float  z_front,
float  z_back,
TEveBoxSet *  bs 
)

Definition at line 730 of file vistpc.cxx.

References VisTPC::PadMetric::corners_cartesian.

Referenced by drawPulses().

void VisTPC::drawPadQuad ( const PadMetric pad,
float  z,
TEveQuadSet *  qs 
)

Definition at line 776 of file vistpc.cxx.

References VisTPC::PadMetric::corners_cartesian.

Referenced by drawNearestPad(), drawPulses(), and drawTwoConnectingPads().

void VisTPC::drawPads ( gear::TPCModule *  aModule,
TEveElement *  parent = NULL 
)
TEveElement * VisTPC::drawPulses ( IMPL::LCCollectionVec *  pulses)
void VisTPC::drawTPC ( )
TEveElement * VisTPC::drawTracks ( IMPL::LCCollectionVec *  tracks,
TEveElement *  parent = NULL 
)

Definition at line 1254 of file vistpc.cxx.

References drawHits(), gearMgr, innerFieldCageRadius, maxDriftLength, maxPoints, and outerFieldCageRadius.

Referenced by drawEvent().

void VisTPC::drawTwoConnectingPads ( const gear::TPCModule &  aModule,
TEveElement *  parent,
int  pad1,
int  pad2,
LeftRight_enum  leftright 
)

Definition at line 1522 of file vistpc.cxx.

References drawPadQuad(), getLocalPadMetric(), kLEFT, and toGlobal().

Referenced by testLeftRightNeighbourWithPads().

const VisTPC::LCCollectionType_enum VisTPC::getCollectionType ( const std::string &  collectionType)

Definition at line 1605 of file vistpc.cxx.

References kHIT, kPULSE, kTRACK, and kUNDEFINEDTYPE.

Referenced by TBBQManager::displayEventCollections(), and drawEvent().

float VisTPC::getDriftVelocity ( )
inline

Definition at line 140 of file vistpc.h.

References driftVelocity.

Referenced by TBBQManager::importGEARFile().

void VisTPC::getGlobalPadMetric ( const gear::TPCModule *  aModule,
const int  padIndex,
PadMetric pad 
)

Get the pad geometric properties in the global coordinate system of the detector.

Definition at line 1705 of file vistpc.cxx.

References VisTPC::PadMetric::center_x, VisTPC::PadMetric::center_y, VisTPC::PadMetric::coordinate_system, VisTPC::PadMetric::corners_cartesian, VisTPC::PadMetric::corners_polar, and getLocalPadMetric().

Referenced by drawPulses().

void VisTPC::getLocalPadMetric ( const gear::TPCModule *  aModule,
const int  padIndex,
PadMetric pad 
)
float VisTPC::getMaxDriftLength ( )
inline

Definition at line 141 of file vistpc.h.

References maxDriftLength.

int VisTPC::getMaxPoints ( )
inline

Definition at line 142 of file vistpc.h.

References maxPoints.

int VisTPC::getOption ( std::string &  option)
inline

Definition at line 143 of file vistpc.h.

References options.

float VisTPC::getReadoutFrequency ( )
inline

Definition at line 139 of file vistpc.h.

References readoutFrequency.

Referenced by TBBQManager::importGEARFile().

void VisTPC::setDriftVelocity ( float  velocity)
inline

Definition at line 153 of file vistpc.h.

References driftVelocity.

Referenced by TBBQManager::handleDriftVelocityEntry().

void VisTPC::setMaxDriftLength ( float  length)
inline

Definition at line 154 of file vistpc.h.

References maxDriftLength.

Referenced by TBBQManager::handleMaxDriftLengthEntry().

void VisTPC::setMaxPoints ( int  points)
inline

Definition at line 155 of file vistpc.h.

References maxPoints.

void VisTPC::setOption ( std::string  option,
int  value 
)
inline

Definition at line 156 of file vistpc.h.

References options.

Referenced by TBBQManager::handleCheckbutton().

void VisTPC::setReadoutFrequency ( float  frequency)
inline

Definition at line 152 of file vistpc.h.

References readoutFrequency.

Referenced by TBBQManager::handleReadoutFrequencyEntry().

void VisTPC::testLeftRightNeighbour ( int  moduleID = 0)

Definition at line 1773 of file vistpc.cxx.

References kLEFT, kRIGHT, testLeftRightNeighbourWithPads(), and tpcParameters.

Referenced by TBBQManager::slotMenu().

void VisTPC::testLeftRightNeighbourWithPads ( int  moduleID,
const std::vector< int > &  pads,
LeftRight_enum  leftright 
)

Definition at line 1806 of file vistpc.cxx.

References drawTwoConnectingPads(), kLEFT, kRIGHT, and tpcParameters.

Referenced by testLeftRightNeighbour().

void VisTPC::testNearestPad ( int  moduleID = 0)

Definition at line 1929 of file vistpc.cxx.

References testNearestPadWithPoints(), and tpcParameters.

Referenced by TBBQManager::slotMenu().

void VisTPC::testNearestPadGlobal ( )

Definition at line 2057 of file vistpc.cxx.

References testNearestPadGlobalWithPoints(), and tpcParameters.

Referenced by TBBQManager::slotMenu().

void VisTPC::testNearestPadGlobalWithPoints ( const std::vector< gear::Vector2D > &  points)

Definition at line 2102 of file vistpc.cxx.

References drawNearestPad(), and tpcParameters.

Referenced by testNearestPadGlobal().

void VisTPC::testNearestPadWithPoints ( int  moduleID,
const std::vector< gear::Vector2D > &  points 
)

Definition at line 2024 of file vistpc.cxx.

References drawNearestPad(), and tpcParameters.

Referenced by testNearestPad().

void VisTPC::toGlobal ( const gear::TPCModule *  aModule,
TEveElement *  element 
)

Transform a TEveElement to the global coordinate system of the detector using OpenGL matrix transformation. The transformation matrix is constructed using the information of the TPCModule.

Definition at line 2134 of file vistpc.cxx.

References maxDriftLength.

Referenced by drawModule(), drawNearestPad(), drawPads(), and drawTwoConnectingPads().

void VisTPC::updateGearMgr ( gear::GearMgr *  aGearMgr)

A function to update the vistpc with information from a new gear file.

Definition at line 2164 of file vistpc.cxx.

References gearMgr, innerFieldCageRadius, maxDriftLength, outerFieldCageRadius, and tpcParameters.

Referenced by TBBQManager::importGEARFile(), and VisTPC().

Member Data Documentation

int VisTPC::debug
protected

Definition at line 282 of file vistpc.h.

Referenced by drawModules().

float VisTPC::driftVelocity
protected

Definition at line 312 of file vistpc.h.

Referenced by drawPulses(), getDriftVelocity(), and setDriftVelocity().

gear::GearMgr* VisTPC::gearMgr
protected

Definition at line 287 of file vistpc.h.

Referenced by drawTracks(), and updateGearMgr().

float VisTPC::innerFieldCageRadius
protected

Radius of the inner field cage cylinder.

Definition at line 338 of file vistpc.h.

Referenced by drawTPC(), drawTracks(), and updateGearMgr().

std::map<std::string, TGeoMaterial*> VisTPC::materials
protected

Definition at line 298 of file vistpc.h.

Referenced by VisTPC().

float VisTPC::maxDriftLength
protected

This is used for the z-position of the endcap/modules.

Yes, this is not good. It is called maxDriftLength because it gets its value from tpcParameters->getMaxDriftLength().

Definition at line 321 of file vistpc.h.

Referenced by drawHit(), drawNearestPad(), drawPulses(), drawTPC(), drawTracks(), getMaxDriftLength(), setMaxDriftLength(), toGlobal(), and updateGearMgr().

int VisTPC::maxPoints
protected

Definition at line 335 of file vistpc.h.

Referenced by drawHits(), drawPulses(), drawTracks(), getMaxPoints(), and setMaxPoints().

std::map<std::string, TGeoMedium*> VisTPC::media
protected

Definition at line 299 of file vistpc.h.

Referenced by drawTPC(), and VisTPC().

std::map<std::string, int> VisTPC::options
protected

Definition at line 331 of file vistpc.h.

Referenced by drawModule(), drawPads(), getOption(), setOption(), and VisTPC().

float VisTPC::outerFieldCageRadius
protected

Radius of the outer field cage cylinder.

Definition at line 337 of file vistpc.h.

Referenced by drawTPC(), drawTracks(), and updateGearMgr().

float VisTPC::readoutFrequency
protected

Definition at line 311 of file vistpc.h.

Referenced by drawPulses(), getReadoutFrequency(), and setReadoutFrequency().

gear::TPCParameters const* VisTPC::tpcParameters
protected
std::map<std::string, TGeoVolume*> VisTPC::volumes
protected

Definition at line 300 of file vistpc.h.

Referenced by drawTPC().


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