MarlinUtil  1.12.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MarlinCED Class Reference

Singleton class to manage access to CED from several processors. More...

#include <MarlinCED.h>

Public Member Functions

void printMCFamily (MCParticle *part, unsigned int daughterBranches, unsigned int motherBranches, unsigned int daughterIndent=0, unsigned int motherIndent=0)
 
void printAndDrawMCFamily (MCParticle *part, LCEvent *evt, unsigned int daughterBranches, unsigned int motherBranches, unsigned int daughterIndent=0, unsigned int motherIndent=0)
 

Static Public Member Functions

static MarlinCEDinstance ()
 
static void init (Processor *proc)
 To be called by every processor that uses CED in intit().
 
static void newEvent (Processor *proc, int modelID=0, LCEvent *evt=0)
 To be called by every processor that uses CED in processEvent() before actually drawing something. More...
 
static void draw (Processor *proc, int waitForKeyboard=1)
 To be called by every processor that uses CED in processEvent() after drawing everything. More...
 
static void getParticleFromID (int, LCEvent *)
 
static void printMCParticle (MCParticle *mcp, int daughterIndent=0, int motherIndent=0)
 
template<class In >
static void drawObjectsWithPosition (In first, In last, int marker, int size, unsigned int color, unsigned int layer=0, const char *PickingMessage="")
 Draw all objects in iterator range [first,last) which have a method getPosition() with the given color marker and size in the given layer (default 0). More...
 
template<class In >
static void drawObjectsWithPositionID (LCCollection *col, In first, In last, int marker, int size, unsigned int color, unsigned int layer=0)
 
static void drawHelix (float b, float charge, float x, float y, float z, float px, float py, float pz, int marker, int size, unsigned int col, float rmin=10.0, float rmax=3000.0, float zmax=4500.0, unsigned int id=0)
 Draws a helix from the given point(x,y,z) for momentum(px,py,pz) in a B-field b (in Tesla) More...
 
static void drawTrajectory (const Trajectory *t, const int marker, const int size, const unsigned int col, const float rmin=10.0, const float rmax=3000.0, const float zmax=4500.0, unsigned int id=0)
 Draws a trajectory in the volume described by rmin, rmax, zmax.
 
static void drawSpike (float x0, float y0, float z0, float x1, float y1, float z1, unsigned int color, unsigned int layer, unsigned int id=0)
 Draws a 'spike', i.e. More...
 
static void drawGEARDetector ()
 Draws the detector using the geometry parameters from GEAR.
 
static void drawDetectorFromGear (gear::GearMgr *gearMgr)
 
static void drawGEARTelescope ()
 Draws the telescope using the geometry parameters from GEAR.
 
static void drawDetector (int modelID)
 Draws the detector only. More...
 
static void drawMCParticle (MCParticle *MCP, bool drawSimHits, LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0, double bField=4.0, double rmin=0.0, double zmin=0.0, double rmax=3000.0, double zmax=4500.0, bool drawOnDifferentLayers=true)
 Draws a thin line between vertex-point and end-point of a MC particle, another thin line at the vertex-point symbolising the initial momentum vector and all the hits in the SimTrackerHit- and SimCalorimeterHitCollections which are produced by this MC particle, if toggle drawSimHits is true. More...
 
static void drawMCParticleTree (LCEvent *event, std::string colNameMC, double energyCut, double bField=4.0, double rIn=0.0, double zIn=0.0, double rOut=3000.0, double zOut=4500.0)
 Draws the full MC Particle Tree on the layers 1, 2 and 3. More...
 
static void drawSimTrackerHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all SimTrackerHit Collections of event with a marker of size and color on layer.
 
static void drawSimCalorimeterHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all SimCalorimeterHit Collections of event with a marker of size and color on layer.
 
static void drawSimHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all SimHit Collections of event with a marker of size and color on layer.
 
static void drawTrackerHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all TrackerHit Collections of event with a marker of size and color on layer.
 
static void drawCalorimeterHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all CalorimeterHit Collections of event with a marker of size and color on layer.
 
static void drawHits (LCEvent *event, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of all Hit Collections of event with a marker of size and color on layer.
 
static void drawTrack (Track *track, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of a track with a marker of size and color on layer.
 
static void drawCluster (Cluster *cluster, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of a cluster with a marker of size and color on layer.
 
static void drawClusterImpl (const ClusterImpl *cluster, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of a cluster implementation with a marker of size and color on layer.
 
static void drawRecoParticle (ReconstructedParticle *reco, int marker, int size, unsigned int color, unsigned int layer=0)
 Draws the hits of a recontructed particle reco with a marker of size and color on layer.
 
static int getIDfromIndex (LCCollection *col, int index)
 
static void set_layer_description (const std::string &desc, int layerID)
 
static void add_layer_description (const std::string &desc, int layerID)
 
static void write_layer_description (void)
 

Public Attributes

LCEvent * _currEvent
 

Static Protected Member Functions

static void drawHitCollectionsByType (LCEvent *event, const char *type, int marker, int size, unsigned int color, unsigned int layer=0)
 
static void drawHitCollectionsByMCContribution (LCEvent *event, MCParticle *MCP, int marker, int size, unsigned int color, unsigned int layer=0)
 

Protected Attributes

Processor * _first
 
Processor * _last
 

Static Protected Attributes

static MarlinCED_me = 0
 

Detailed Description

Singleton class to manage access to CED from several processors.

All processors using CED have to use the methods init(), newEvent() and draw().

Member Function Documentation

void MarlinCED::draw ( Processor *  proc,
int  waitForKeyboard = 1 
)
static

To be called by every processor that uses CED in processEvent() after drawing everything.

Actually draws the event. The flag waitForKeyboard indicates if after an event is drawn an input from the keyboard is expected (waitForKeyboard=1) or not (waitForKeyboard=0).

References CEDPickingHandler::getInstance(), CEDPickingHandler::kbhit(), and CEDPickingHandler::printID().

Referenced by DrawMCParticles::processEvent().

static void MarlinCED::drawDetector ( int  modelID)
inlinestatic

Draws the detector only.

modelID: LDC(0) - default , SID(1), GLD(2), CaliceTestBeam(3). Needed if you would like to draw the detector wire frame several times in one event

Deprecated:
void MarlinCED::drawHelix ( float  b,
float  charge,
float  x,
float  y,
float  z,
float  px,
float  py,
float  pz,
int  marker,
int  size,
unsigned int  col,
float  rmin = 10.0,
float  rmax = 3000.0,
float  zmax = 4500.0,
unsigned int  id = 0 
)
static

Draws a helix from the given point(x,y,z) for momentum(px,py,pz) in a B-field b (in Tesla)

Improved drawHelix() method.

Draws straight lines as well.

void MarlinCED::drawMCParticle ( MCParticle *  MCP,
bool  drawSimHits,
LCEvent *  event,
int  marker,
int  size,
unsigned int  color,
unsigned int  layer = 0,
double  bField = 4.0,
double  rmin = 0.0,
double  zmin = 0.0,
double  rmax = 3000.0,
double  zmax = 4500.0,
bool  drawOnDifferentLayers = true 
)
static

Draws a thin line between vertex-point and end-point of a MC particle, another thin line at the vertex-point symbolising the initial momentum vector and all the hits in the SimTrackerHit- and SimCalorimeterHitCollections which are produced by this MC particle, if toggle drawSimHits is true.

These SimHits are drawn with a marker of size and color. All objects are drawn on the same layer.

Referenced by drawMCParticleTree().

void MarlinCED::drawMCParticleTree ( LCEvent *  event,
std::string  colNameMC,
double  energyCut,
double  bField = 4.0,
double  rIn = 0.0,
double  zIn = 0.0,
double  rOut = 3000.0,
double  zOut = 4500.0 
)
static

Draws the full MC Particle Tree on the layers 1, 2 and 3.

On layer 1 the charged particles are displayed and on layer shift-1 their corresponding SimHits. On layer 2 all the neutral particles are shown, again with their SimHits on layer shift-2. The layers 3 and shift-3 are used for the backscattered MC Particles. The variables energyCut, rIn, zIn, rOut and zOut are cut values meant to reduce the number particles displayed; i.e. only particles with energy larger than 'energyCut' and within the cylinder described by rIn, zIn, rOut, zOut are shown.

References drawMCParticle().

Referenced by DrawMCParticles::processEvent().

template<class In >
static void MarlinCED::drawObjectsWithPosition ( In  first,
In  last,
int  marker,
int  size,
unsigned int  color,
unsigned int  layer = 0,
const char *  PickingMessage = "" 
)
inlinestatic

Draw all objects in iterator range [first,last) which have a method getPosition() with the given color marker and size in the given layer (default 0).

The template takes classes providing a class method 'getPosition()' as template argument.

void MarlinCED::drawSpike ( float  x0,
float  y0,
float  z0,
float  x1,
float  y1,
float  z1,
unsigned int  color,
unsigned int  layer,
unsigned int  id = 0 
)
static

Draws a 'spike', i.e.

a bold arrow, from (x0,y0,z0) to (x1,y1,z1) with color on layer e.g. to display jet thrust axes

void MarlinCED::newEvent ( Processor *  proc,
int  modelID = 0,
LCEvent *  evt = 0 
)
static

To be called by every processor that uses CED in processEvent() before actually drawing something.

Draws the detector depending on modelID:

  • 0: use gear file to draw full detector
  • 99999: draw EUTelescope from gear file
  • other: don't draw a detector model

Referenced by DrawMCParticles::processEvent().


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