Upload
chung
View
21
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Graphics Requirements for G4 Trajectories (draft: hastily prepared for trajectories parallel session). Geant4 Workshop, CERN - 1 October 2002 Joseph Perl. Problem with Existing Trajectories. - PowerPoint PPT Presentation
Citation preview
Graphics Requirements for G4 TrajectoriesGraphics Requirements for G4 Trajectories(draft: hastily prepared for trajectories parallel session)(draft: hastily prepared for trajectories parallel session)
Geant4 Workshop, CERN - 1 October 2002 Geant4 Workshop, CERN - 1 October 2002 Joseph PerlJoseph Perl
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
22
Problem with Existing TrajectoriesProblem with Existing Trajectories
Graphics drivers have access to detailed information about Graphics drivers have access to detailed information about geometry since the sceneHandler has access to physical geometry since the sceneHandler has access to physical volume, etc. and can present this information to the end user volume, etc. and can present this information to the end user through labels on graphics objects or through picking.through labels on graphics objects or through picking.
Graphics drivers have no access to detailed information Graphics drivers have no access to detailed information about trajectories (or sensitive detector hits). The about trajectories (or sensitive detector hits). The sceneHandler only sees this data as graphics primitives (no sceneHandler only sees this data as graphics primitives (no pointer back to the trajectory).pointer back to the trajectory).
Graphics drivers have no access to auxiliary points. These Graphics drivers have no access to auxiliary points. These points are not persisted long enough for graphics to use points are not persisted long enough for graphics to use them, hence we can’t draw smooth trajectories.them, hence we can’t draw smooth trajectories.
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
33
Auxiliary PointsAuxiliary Points On this topic, I only know what I’ve learned from John On this topic, I only know what I’ve learned from John
Allison. See his mail of 5 Sept 2002:Allison. See his mail of 5 Sept 2002:
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
44
Effect of lack on information: Example T01Effect of lack on information: Example T01
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
55
Picking on Detector Volumes Gives Detailed AttributesPicking on Detector Volumes Gives Detailed Attributes
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
66
Picking on Trajectory Gives No DetailsPicking on Trajectory Gives No Details
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
77
Picking on Trajectory if Graphics DriversPicking on Trajectory if Graphics Drivershad Better Access to Trajectory Informationhad Better Access to Trajectory Information
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
88
Proposal for Better Graphics from TrajectoriesProposal for Better Graphics from Trajectories
• Give sceneHandler a DrawTrajectories method with pointer back to Trajectory
• Persist Auxiliary Points long enough for sceneHandler to use them to draw smooth trajectories
• Allow attachment of arbitrary attributes to Trajectories and Trajectory Points (and sensitive detector hits)
• A successful scheme for such arbitrary attributes has been used in HepRep for several years
The proposal is NOT for G4 to depend on HepRep The proposal is only for G4 to incorporate two small classes
that hold “HepRep-style” attributes. The HepRep attribute classes are just two simple classes
used in HepRep, they are not the entire HepRep design.
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
99
The HepRep Attribute ClassesThe HepRep Attribute Classes
10/1/2002Joseph Perl HepRep218
*
*
*
**
*
*
1 1
1
1
1
1
1
HepRepInstance
HepRepTypeTree
HepRepInstanceTree
HepRepAttValue
HepRepType
HepRepAttDef
Linked by TypeName
ID: HepRepTreeID ID: HepRepTreeIDTypeTreeID:HRTreeIDInstanceTreeIDs:HRTreeID[]
Name: StringDesc: StringInfoURL: String
TypeName: String
X,Y,Z: Double
Name: StringDesc: StringCategory: StringExtra: String
AttDefName: StringValue: AnyShowLabel: Int
Linked by AttDefName
HepRepPoint
HepRepAction
Name:StringExpression:String
HepRep
Comments: String[]
HepRep: a Generic Interface Definition for HEP Event Display Representables
+getInstanceTreeTop(InstanceTreeName: String,InstanceTreeVersion: String):HepRepInstanceTree;
+getTypeTree(TypeTreeName: String,TypeTreeVersion: String):TypeTree;
+getInstances(InstanceTreeName: String,InstanceTreeVersion: String,TypeNames: String[]):HepRepInstanceTree;
+getInstancesAfterAction(InstanceTreeName: String,InstanceTreeVersion: String,TypeNames: String[],Actions:HepRepAction[],GetPoints: Boolean,GetDrawAtts: Boolean,GetNonDrawAtts: Boolean,InvertAtts: String[]):HepRepInstanceTree;
+getLayerOrder( ):String[];
+checkForException( ):String;
Comments: String[]HepRep HepRepTreeID
Name:StringVersion:String
Linked by TypeTreeID
1
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1010
The HepRep Attribute ClassesThe HepRep Attribute Classes
HepRepAttValue
HepRepAttDef
Name: StringDesc: StringCategory: StringExtra: String
AttDefName: StringValue: AnyShowLabel: Int
In C++, the “any” is handled as a String that is In C++, the “any” is handled as a String that is interpreted according to an extra member of the interpreted according to an extra member of the AttDef called valueType.AttDef called valueType.
G4AttValue
G4AttDef
Name: StringDesc: StringCategory: StringExtra: StringValueType: String
AttDefName: StringValue: StringShowLabel: Int
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1111
G4AttDef.h now in graphics_repsG4AttDef.h now in graphics_reps
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1212
G4AttValue.h now in graphics_repsG4AttValue.h now in graphics_reps
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1313
HepRep is Well Documented ElsewhereHepRep is Well Documented Elsewhere
For details on the exact use of HepRep Attributes, For details on the exact use of HepRep Attributes, see the HepRep Home Page at: see the HepRep Home Page at: http://heprep.freehep.orghttp://heprep.freehep.org
In particular, see the detailed HepRep2 writeup at:In particular, see the detailed HepRep2 writeup at:http://heprep.freehep.org/heprep2/Complete.ppthttp://heprep.freehep.org/heprep2/Complete.ppthttp://heprep.freehep.org/heprep2/Complete.pdfhttp://heprep.freehep.org/heprep2/Complete.pdf
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1414
10/1/2002Joseph Perl HepRep238
Any number of Attributes can be hungfrom a Type, Instance or Point.There are four Categories of Attributes:
•Draw Attributes (such as thicknessand color) can be modified in the clientthrough a draw attribute editor
•Physics Attributes (such as track momentum or hit error) can be used for visibility cuts (client side or server side)
•PickAction Attributes define special things to do when the user picks on theRepresentable (such as remove hit and refit track)
•Association Attributes define loose associations between Representables (such as track cluster matching)
Attribute Categories
To allow for the possible addition of new Categories without backwards compatibility problems, we keep Category as a general String, not an Enum.
*
*1
1
1
HepRepInstance
HepRepType
Linked by TypeName TypeName: String
X,Y,Z: Double
HepRepPoint
**1 1
HepRepAttDef
Name: StringDesc: StringCategory: StringExtra: String
*
Name: StringDesc: StringInfoURL: String
HepRepAttValue
AttDefName: StringValue: AnyShowLabel: Int
Linked by AttDefName
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1515
10/1/2002Joseph Perl HepRep239
Name Desc Extra Category ValueColor Color unused Draw BlueDrawAs DrawAs unused Draw EllipsoidPt Transverse Momentum GeV Physics 1.76PID Particle ID unused Physics PionSystem Detector System unused Physics Vertex DetectorRemove Remove Hit & Refit Track remove PickAction Track(5).Hit(8)Cluster Cluster Association ID Association 7Track Track Association TrkNum Association 5
HepRepAttDef
Name: StringDesc: StringCategory: StringExtra: String
Linked by AttDefName
Attribute Examples
HepRepAttValue
AttDefName: StringValue: AnyShowLabel: Int
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1616
The Way ForwardThe Way Forward
• Give sceneHandler a DrawTrajectories method with pointer back to Trajectory
• Persist Auxiliary Points long enough for sceneHandler to use them to draw smooth trajectories
• Allow user to define arbitrary attributes in G4AttDef objects contained in a G4AttDefStore (map<string,G4AttDef> wrapped in a singelton) instantiated by the runManager.
• Allow attachment of G4AttValue attributes to Trajectories and Trajectory Points (and sensitive detector hits)
• G4AttValues do not contain a pointer to the relevant G4AttDef. The G4AttDef and G4AttValue association is done through a common string AttDefName. This simplifies many aspects of attribute use (AttValue user doesn’t need any way to get pointer, serialization is simpler, etc.).
1 October 20021 October 2002 Graphics Requirements for G4 Trajectories JoseGraphics Requirements for G4 Trajectories Joseph Perl, SLAC Computing Servicesph Perl, SLAC Computing Services
1717
Extra SlideExtra Slidemore implementation details more implementation details
•We will have a singleton G4AttDefStore instantiated by the run manager.We will have a singleton G4AttDefStore instantiated by the run manager.
•Each trajectory (or trajectory point, hit, etc.) can call a method on this Each trajectory (or trajectory point, hit, etc.) can call a method on this G4AttDefStore to tell it to add an attDef, where first argument is name of G4AttDefStore to tell it to add an attDef, where first argument is name of type of objects that will have this attribute (trajectory, trajectory point, hit, type of objects that will have this attribute (trajectory, trajectory point, hit, etc.), and other arguments define the attDef.etc.), and other arguments define the attDef.The G4AttDefStore will just ignore this def if it has already been created for The G4AttDefStore will just ignore this def if it has already been created for some other trajectory (or trajectory point, etc.).some other trajectory (or trajectory point, etc.).
•The trajectory (or trajectory point, hit, etc.) will have a set of G4AttValues.The trajectory (or trajectory point, hit, etc.) will have a set of G4AttValues.The AttValues are linked to the AttDefs by att def name, rather than by a The AttValues are linked to the AttDefs by att def name, rather than by a pointer, thus the trajectory itself doesn't have to have any way to get a pointer, thus the trajectory itself doesn't have to have any way to get a pointer to the particular attDef.pointer to the particular attDef.We already rely on this weak form of association (association by name We already rely on this weak form of association (association by name rather than pointer) in our xml serialization of the HepRep.rather than pointer) in our xml serialization of the HepRep.
•At the end of the run, the run manager will destory the G4AttDefStore.At the end of the run, the run manager will destory the G4AttDefStore.