Go to top,
UgliGeometry Package
UgliGeometry
- Provides geometry of detector elements (planes, scint modules, strips).
- Access elements via lightweight handles
- Handles avoid ownership issues without memory leaks.
- Cache allows for reuse of geometries without need to
rebuild from database info for each new record.
- Geometry is time and simulation flag (MC vs. data)
and detector obviously
dependent -- user must
supply a context to get UgliGeomHandle, e.g.:
const VldContext* vldc = rawrec->GetVldContext();
UgliGeomHandle ugh(*vldc);
- Multiple concurrent geometries are possible.
- Two different versions possible for same
VldContext;
one frozen at Database constants, one that can be user
modified.
- Different cached geometries for non-overlapping
VldRange
Planes & Strips
- Use UgliGeomHandle
to get plane handles, e.g.:
PlexPlaneId scintplnid = ...
// associated steel is downstream of scintillator
PlexPlaneId steelplnid = scintplnid.GetNext(PlexPlaneId::kSteel);
UgliScintPlnHandle scintpln = ugh.GetScintPlnHandle(scintplnid);
UgliSteelPlnHandle steelpln = ugh.GetSteelPlnHandle(steelplnid);
- Give a PlexStripEndId
to get a strip:
UgliStripHandle strip = ugh.GetStripHandle(seid);
UgliStripHandle strip2 = scintpln.GetStripHandle(seid);
- Use the handles to get desired information, e.g.:
float sthick = 2.0 * steelpln.GetHalfThickness();
int nstrips = scintpln.NumberOfStrips();
float hlength = strip.GetHalfLength();
float transverse_pos = strip.GetTPos();
TVector3 strip_center = strip.GlobalPos(0,0);
TVector3 strip_end = strip.GlobalPos(hlength);
float wls_west = strip.WlsPigtail(StripEnd::kWest);
float clear_east = strip.ClearFiber(StripEnd::kEast);
Planes & Strips
- Navigation between handles
UgliScintMdlHandle usmh = strip.GetScintMdlHandle();
UgliScintPlnHandle usph = strip.GetScintPlnHandle();
UgliScintPlnHandle usph2 = usmh.GetScintPlnHandle();
vector allstrips =
scintpln.GetStripHandleVector();
- Continuing evolution as needs/requirements become clear...
- Thus ... if you think there are missing services: Ask for them!
Notes and Further References
To access the UgliGeometry you need to create a UgliGeomHandle, and for that you need
a context. This concept was introduced
in the Validity slide and the
associated notes explained how to get a VldContext for a RawRecord:-
const VldContext* vc = raw->GetVldContext();
although any class that inherits from RecMinos (the base class for all Records)
will provide a context. From the context a lightweight UgliGeomHandle
can be constructed:-
GeomHandle ugh(*vc);
You can examine
UgliGeomHandle.h
to see what methods are available, in particular
it has the methods:-
UgliScintPlnHandle GetScintPlnHandle(PlexPlaneId planeid);
UgliSteelPlnHandle GetSteelPlnHandle(PlexPlaneId planeid);
UgliStripHandle GetStripHandle(PlexStripEndId seid);
Which, given plane or strip end ids (for example from the
Plex
) will give handle to objects that represent the geometry of
as plane or a strip. You can examine their headers:-
to see what information they provide.
Exercises
Loading the database tables for the Far Detector
Geometry takes time and it may be that if lots of people
run this demo at the same time it will overload the computer
hosting the the tutorial. In which case we should run this
as a demonstration, rather than an exercise.
This exercise builds on the
Adding Plex to loon
exercise. Procede as follows:-
- After the Plex headers add the following Ugli headers.
#include "UgliGeometry/UgliGeomHandle.h"
#include "UgliGeometry/UgliSteelPlnHandle.h"
- In the modified UserAnalysis::Ana after:-
const VldContext* vc = raw->GetVldContext();
PlexHandle plxh(*vc);
add:-
UgliGeomHandle ugh(*vc);
and after:-
cout << " RawChannelId " << rcid
<< " has " << psal.GetSize() << " alternative(s)\n"
<< " currently the \"best\" alternative has weight "
<< psal.GetBestWeight();
PlexStripEndId pseid = psal.GetBestSEId();
replace:-
cout << " and comes from plane " << pseid.GetPlane() << endl;
by:-
UgliSteelPlnHandle ugsph = ugh.GetSteelPlnHandle(pseid);
cout << " and comes from plane " << pseid.GetPlane()
<< " at Z = " << ugsph.GetZ0() << endl;
These modifications show how the PlexPlaneId (from which PlexStripEndId inherits)
can be used to get a UgliSteelPlnHandle from which the planes'z Z can be determined.
To run the exercise first rebuild loon and then type:-
loon -q run_UserAnalysis.C $ROOT_DATA/fardet_data/2002_06/F00005963_0000.mdaq.root