BBQ
|
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) | |
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.
LeftRight_enum is only used for the method testLeftRightNeighbourWithPads(). It specifies which GEAR function to call: getLeftNeighbour() or getRightNeighbour().
Enumerator | |
---|---|
kLEFT | |
kRIGHT |
VisTPC::VisTPC | ( | gear::GearMgr * | aGearMgr = 0 | ) |
Definition at line 78 of file vistpc.cxx.
References materials, media, options, and updateGearMgr().
|
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" |
||
) |
Definition at line 161 of file vistpc.cxx.
References drawHits(), drawPulses(), drawTracks(), getCollectionType(), kHIT, kPULSE, kTRACK, and kUNDEFINEDTYPE.
Referenced by drawEvent(), and TBBQEventManager::GotoEvent().
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.
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 | ||
) |
Definition at line 613 of file vistpc.cxx.
References VisTPC::PadMetric::center_x, VisTPC::PadMetric::center_y, drawPadQuad(), getLocalPadMetric(), maxDriftLength, and toGlobal().
Referenced by testNearestPadGlobalWithPoints(), and testNearestPadWithPoints().
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 |
||
) |
Definition at line 802 of file vistpc.cxx.
References VisTPC::PadMetric::center_x, VisTPC::PadMetric::center_y, VisTPC::PadMetric::corners_cartesian, VisTPC::PadMetric::corners_polar, drawCircularPolygon(), getLocalPadMetric(), options, and toGlobal().
Referenced by drawModule().
TEveElement * VisTPC::drawPulses | ( | IMPL::LCCollectionVec * | pulses | ) |
Definition at line 1000 of file vistpc.cxx.
References VisTPC::PadMetric::center_x, VisTPC::PadMetric::center_y, drawPadBox(), drawPadQuad(), driftVelocity, getGlobalPadMetric(), maxDriftLength, maxPoints, readoutFrequency, and tpcParameters.
Referenced by drawEvent().
void VisTPC::drawTPC | ( | ) |
Definition at line 1220 of file vistpc.cxx.
References drawModules(), innerFieldCageRadius, maxDriftLength, media, outerFieldCageRadius, and volumes.
Referenced by TBBQManager::importGEARFile().
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().
|
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 | ||
) |
Get the pad geometric properties in the local coordinate system of the module.
Definition at line 1613 of file vistpc.cxx.
References VisTPC::PadMetric::center_phi, VisTPC::PadMetric::center_r, VisTPC::PadMetric::center_x, VisTPC::PadMetric::center_y, VisTPC::PadMetric::coordinate_system, VisTPC::PadMetric::corners_cartesian, VisTPC::PadMetric::corners_polar, VisTPC::PadMetric::height, and VisTPC::PadMetric::width.
Referenced by drawNearestPad(), drawPads(), drawTwoConnectingPads(), and getGlobalPadMetric().
|
inline |
Definition at line 141 of file vistpc.h.
References maxDriftLength.
|
inline |
|
inline |
Definition at line 139 of file vistpc.h.
References readoutFrequency.
Referenced by TBBQManager::importGEARFile().
|
inline |
Definition at line 153 of file vistpc.h.
References driftVelocity.
Referenced by TBBQManager::handleDriftVelocityEntry().
|
inline |
Definition at line 154 of file vistpc.h.
References maxDriftLength.
Referenced by TBBQManager::handleMaxDriftLengthEntry().
|
inline |
|
inline |
Definition at line 156 of file vistpc.h.
References options.
Referenced by TBBQManager::handleCheckbutton().
|
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().
|
protected |
Definition at line 282 of file vistpc.h.
Referenced by drawModules().
|
protected |
Definition at line 312 of file vistpc.h.
Referenced by drawPulses(), getDriftVelocity(), and setDriftVelocity().
|
protected |
Definition at line 287 of file vistpc.h.
Referenced by drawTracks(), and updateGearMgr().
|
protected |
Radius of the inner field cage cylinder.
Definition at line 338 of file vistpc.h.
Referenced by drawTPC(), drawTracks(), and updateGearMgr().
|
protected |
|
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().
|
protected |
Definition at line 335 of file vistpc.h.
Referenced by drawHits(), drawPulses(), drawTracks(), getMaxPoints(), and setMaxPoints().
|
protected |
|
protected |
Definition at line 331 of file vistpc.h.
Referenced by drawModule(), drawPads(), getOption(), setOption(), and VisTPC().
|
protected |
Radius of the outer field cage cylinder.
Definition at line 337 of file vistpc.h.
Referenced by drawTPC(), drawTracks(), and updateGearMgr().
|
protected |
Definition at line 311 of file vistpc.h.
Referenced by drawPulses(), getReadoutFrequency(), and setReadoutFrequency().
|
protected |
Definition at line 288 of file vistpc.h.
Referenced by drawHit(), drawModules(), drawPulses(), testLeftRightNeighbour(), testLeftRightNeighbourWithPads(), testNearestPad(), testNearestPadGlobal(), testNearestPadGlobalWithPoints(), testNearestPadWithPoints(), and updateGearMgr().
|
protected |