Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DGeometry Class Reference

#include <DGeometry.h>

Classes

struct  cdc_offset_t
 
struct  fdc_cathode_offset_t
 
struct  fdc_wire_offset_t
 
struct  fdc_wire_rotation_t
 

Public Types

typedef pair< string, map
< string, string > > 
node_t
 
typedef vector< node_txpathparsed_t
 

Public Member Functions

 DGeometry (JGeometry *jgeom, DApplication *dapp, int32_t runnumber)
 
virtual ~DGeometry ()
 
virtual const char * className (void)
 
JGeometry * GetJGeometry (void)
 
DMagneticFieldMapGetBfield (void) const
 
DLorentzDeflectionsGetLorentzDeflections (void)
 
bool Get (string xpath, string &sval) const
 
bool Get (string xpath, map< string, string > &svals) const
 
template<class T >
bool Get (string xpath, T &val) const
 
template<class T >
bool Get (string xpath, vector< T > &vals, string delimiter=" ") const
 
template<class T >
bool Get (string xpath, map< string, T > &vals) const
 
bool Get (string xpath, vector< double > &vals, string delimiter=" ") const
 
bool Get (string xpath, vector< int > &vals, string delimiter=" ") const
 
bool Get (string xpath, vector< float > &vals, string delimiter=" ") const
 
bool GetMultiple (string xpath, vector< vector< double > > &vals, string delimiter=" ") const
 
void FindNodes (string xpath, vector< xpathparsed_t > &matched_xpaths) const
 
jerror_t FindMat (DVector3 &pos, double &rhoZ_overA, double &rhoZ_overA_logI, double &RadLen) const
 
jerror_t FindMat (DVector3 &pos, double &density, double &A, double &Z, double &RadLen) const
 
jerror_t FindMatALT1 (DVector3 &pos, DVector3 &mom, double &KrhoZ_overA, double &rhoZ_overA, double &LnI, double &X0, double *s_to_boundary=NULL) const
 
jerror_t FindMatKalman (const DVector3 &pos, const DVector3 &mom, double &KrhoZ_overA, double &rhoZ_overA, double &LnI, double &Z, double &chi2c_factor, double &chi2a_factor, double &chi2a_factor2, unsigned int &last_index, double *s_to_boundary=NULL) const
 
jerror_t FindMatKalman (const DVector3 &pos, double &KrhoZ_overA, double &rhoZ_overA, double &LnI, double &Z, double &chi2c_factor, double &chi2a_factor, double &chi2a_factor2, unsigned int &last_index) const
 
const DMaterialMap::MaterialNodeFindMatNode (DVector3 &pos) const
 
const DMaterialMapFindDMaterialMap (DVector3 &pos) const
 
const DMaterialGetDMaterial (string name) const
 
bool GetFDCWires (vector< vector< DFDCWire * > > &fdcwires) const
 
bool GetFDCCathodes (vector< vector< DFDCCathode * > > &fdccathodes) const
 
bool GetFDCZ (vector< double > &z_wires) const
 z-locations for each of the FDC wire planes in cm More...
 
bool GetFDCStereo (vector< double > &stereo_angles) const
 stereo angles of each of the FDC wire layers More...
 
bool GetFDCRmin (vector< double > &rmin_packages) const
 beam hole size for each FDC package in cm More...
 
bool GetFDCRmax (double &rmax_active_fdc) const
 outer radius of FDC active area in cm More...
 
bool GetCDCWires (vector< vector< DCDCWire * > > &cdcwires) const
 
bool GetCDCOption (string &cdc_option) const
 get the centralDC_option-X string More...
 
bool GetCDCCenterZ (double &cdc_center_z) const
 z-location of center of CDC wires in cm More...
 
bool GetCDCAxialLength (double &cdc_axial_length) const
 length of CDC axial wires in cm More...
 
bool GetCDCStereo (vector< double > &cdc_stereo) const
 stereo angle for each CDC layer in degrees More...
 
bool GetCDCRmid (vector< double > &cdc_rmid) const
 Distance of the center of CDC wire from beamline for each layer in cm. More...
 
bool GetCDCNwires (vector< int > &cdc_nwires) const
 Number of wires for each CDC layer. More...
 
bool GetCDCEndplate (double &z, double &dz, double &rmin, double &rmax) const
 
bool GetCDCAxialWires (unsigned int ring, unsigned int ncopy, double zcenter, double dz, vector< vector< cdc_offset_t > > &cdc_offsets, vector< DCDCWire * > &axialwires, vector< double > &rot_angles, double dx, double dy) const
 Extract the axial wire data from the XML. More...
 
bool GetCDCStereoWires (unsigned int ring, unsigned int ncopy, double zcenter, double dz, vector< vector< cdc_offset_t > > &cdc_offsets, vector< DCDCWire * > &stereowires, vector< double > &rot_angles, double dx, double dy) const
 Find the materials traversed by a particle swimming from a specific position with a specific momentum through the magnetic field until it reaches a specific z-location. Energy loss is not included in the swimming since this method itself is assumed to be one of the primary means of determining energy loss. As such, one should not pass in a value of z_end that is far from pos. More...
 
bool GetBCALRmin (float &bcal_rmin) const
 minimum distance of BCAL module from beam line More...
 
bool GetBCALfADCRadii (vector< float > &fADC_radii) const
 fADC radii including the outer radius of the last layer More...
 
bool GetBCALNmodules (unsigned int &bcal_nmodules) const
 Number of BCAL modules. More...
 
bool GetBCALCenterZ (float &bcal_center_z) const
 z-location of center of BCAL module in cm More...
 
bool GetBCALLength (float &bcal_length) const
 length of BCAL module in cm More...
 
bool GetBCALDepth (float &bcal_depth) const
 depth (or height) of BCAL module in cm More...
 
bool GetBCALPhiShift (float &bcal_phi_shift) const
 phi angle in degrees that first BCAL module is shifted from being centered at ph=0.0 More...
 
bool GetCCALZ (double &z_ccal) const
 
bool GetFCALZ (double &z_fcal) const
 z-location of front face of CCAL in cm More...
 
bool GetDIRCZ (double &z_dirc) const
 z-location of DIRC in cm More...
 
bool GetTOFZ (vector< double > &z_tof) const
 z-location of front face of each of TOF in cm More...
 
bool GetTOFPaddlePerpPositions (vector< double > &y_tof) const
 
bool GetTOFPaddleParameters (map< string, double > &paddle_params) const
 
bool GetTargetZ (double &z_target) const
 z-location of center of target More...
 
bool GetTargetLength (double &target_length) const
 z-location of center of target More...
 
bool GetStartCounterGeom (vector< vector< DVector3 > > &pos, vector< vector< DVector3 > > &norm) const
 
vector< DMaterialMap * > GetMaterialMapVector (void) const
 

Static Public Member Functions

static const char * static_className (void)
 

Protected Member Functions

 DGeometry ()
 
void ReadMaterialMaps (void) const
 
void GetMaterials (void) const
 
bool GetCompositeMaterial (const string &name, double &density, double &radlen) const
 

Private Attributes

JGeometry * jgeom
 
DApplicationdapp
 
DMagneticFieldMapbfield
 
int32_t runnumber
 
vector< DMaterial * > materials
 
vector< DMaterialMap * > materialmaps
 Older implementation to keep track of material specs without ranges. More...
 
bool materialmaps_read
 Material maps generated automatically(indirectly) from XML with ranges and specs. More...
 
bool materials_read
 
pthread_mutex_t bfield_mutex
 
pthread_mutex_t materialmap_mutex
 
pthread_mutex_t materials_mutex
 

Detailed Description

Definition at line 35 of file DGeometry.h.

Member Typedef Documentation

typedef pair<string, map<string,string> > DGeometry::node_t

Definition at line 81 of file DGeometry.h.

Definition at line 82 of file DGeometry.h.

Constructor & Destructor Documentation

DGeometry::DGeometry ( JGeometry *  jgeom,
DApplication dapp,
int32_t  runnumber 
)

Definition at line 26 of file DGeometry.cc.

References dapp.

DGeometry::~DGeometry ( )
virtual

Definition at line 45 of file DGeometry.cc.

DGeometry::DGeometry ( )
inlineprotected

Definition at line 178 of file DGeometry.h.

Member Function Documentation

virtual const char* DGeometry::className ( void  )
inlinevirtual

Definition at line 39 of file DGeometry.h.

Referenced by DApplication::GetDGeometry().

const DMaterialMap * DGeometry::FindDMaterialMap ( DVector3 pos) const

Definition at line 363 of file DGeometry.cc.

References DMaterialMap::IsInMap().

Referenced by main().

jerror_t DGeometry::FindMat ( DVector3 pos,
double &  rhoZ_overA,
double &  rhoZ_overA_logI,
double &  RadLen 
) const

Definition at line 327 of file DGeometry.cc.

Referenced by main().

jerror_t DGeometry::FindMat ( DVector3 pos,
double &  density,
double &  A,
double &  Z,
double &  RadLen 
) const

Definition at line 341 of file DGeometry.cc.

jerror_t DGeometry::FindMatALT1 ( DVector3 pos,
DVector3 mom,
double &  KrhoZ_overA,
double &  rhoZ_overA,
double &  LnI,
double &  X0,
double *  s_to_boundary = NULL 
) const

Definition at line 221 of file DGeometry.cc.

jerror_t DGeometry::FindMatKalman ( const DVector3 pos,
const DVector3 mom,
double &  KrhoZ_overA,
double &  rhoZ_overA,
double &  LnI,
double &  Z,
double &  chi2c_factor,
double &  chi2a_factor,
double &  chi2a_factor2,
unsigned int &  last_index,
double *  s_to_boundary = NULL 
) const
jerror_t DGeometry::FindMatKalman ( const DVector3 pos,
double &  KrhoZ_overA,
double &  rhoZ_overA,
double &  LnI,
double &  Z,
double &  chi2c_factor,
double &  chi2a_factor,
double &  chi2a_factor2,
unsigned int &  last_index 
) const

Definition at line 299 of file DGeometry.cc.

const DMaterialMap::MaterialNode* DGeometry::FindMatNode ( DVector3 pos) const
void DGeometry::FindNodes ( string  xpath,
vector< xpathparsed_t > &  matched_xpaths 
) const

Find all nodes that match the specified xpath and return them as fully parsed lists of the nodes and attributes.

The matched_xpaths variable has 4 levels of STL containers nested together! The node_t data type contains 2 of them and represents a single tag with the "first" member being the tag name and the "second" member being a map of all of the attributes of that tag along with their values.

The xpathparsed_t data type is a STL vector of node_t objects that comprises a complete xpath. The data type of matched_xpaths is a STL vector if xpathparsed_t objects and so comprises a list of complete xpaths.

We do this by calling the GetXPaths() method of JGeometry to get a list of all xpaths. Then we pass all of those in to JGeometryXML::ParseXPath() to get a parsed list for each. This is compared to the parsed values of the xpath passed to us (also parsed by JGeometryXML::ParseXPath()) to find matches.

Definition at line 176 of file DGeometry.cc.

bool DGeometry::Get ( string  xpath,
map< string, string > &  svals 
) const
inline

Definition at line 51 of file DGeometry.h.

template<class T >
bool DGeometry::Get ( string  xpath,
T &  val 
) const
inline

Definition at line 52 of file DGeometry.h.

template<class T >
bool DGeometry::Get ( string  xpath,
vector< T > &  vals,
string  delimiter = " " 
) const
inline

Definition at line 53 of file DGeometry.h.

template<class T >
bool DGeometry::Get ( string  xpath,
map< string, T > &  vals 
) const
inline

Definition at line 54 of file DGeometry.h.

bool DGeometry::Get ( string  xpath,
vector< double > &  vals,
string  delimiter = " " 
) const
inline

Definition at line 60 of file DGeometry.h.

bool DGeometry::Get ( string  xpath,
vector< int > &  vals,
string  delimiter = " " 
) const
inline

Definition at line 61 of file DGeometry.h.

bool DGeometry::Get ( string  xpath,
vector< float > &  vals,
string  delimiter = " " 
) const
inline

Definition at line 62 of file DGeometry.h.

bool DGeometry::GetBCALCenterZ ( float &  bcal_center_z) const

z-location of center of BCAL module in cm

Definition at line 1611 of file DGeometry.cc.

References _DBG_.

Referenced by DBCALGeometry::Initialize().

bool DGeometry::GetBCALDepth ( float &  bcal_depth) const

depth (or height) of BCAL module in cm

Definition at line 1659 of file DGeometry.cc.

References _DBG_.

bool DGeometry::GetBCALfADCRadii ( vector< float > &  fADC_radii) const

fADC radii including the outer radius of the last layer

Definition at line 1567 of file DGeometry.cc.

Referenced by DBCALGeometry::Initialize().

bool DGeometry::GetBCALLength ( float &  bcal_length) const

length of BCAL module in cm

Definition at line 1635 of file DGeometry.cc.

References _DBG_.

Referenced by DBCALGeometry::Initialize().

bool DGeometry::GetBCALNmodules ( unsigned int &  bcal_nmodules) const

Number of BCAL modules.

Definition at line 1589 of file DGeometry.cc.

References _DBG_.

bool DGeometry::GetBCALPhiShift ( float &  bcal_phi_shift) const

phi angle in degrees that first BCAL module is shifted from being centered at ph=0.0

Definition at line 1683 of file DGeometry.cc.

Referenced by hdv_mainframe::hdv_mainframe(), and DBCALGeometry::Initialize().

bool DGeometry::GetBCALRmin ( float &  bcal_rmin) const

minimum distance of BCAL module from beam line

Definition at line 1544 of file DGeometry.cc.

References _DBG_.

Referenced by DBCALGeometry::Initialize().

DMagneticFieldMap * DGeometry::GetBfield ( void  ) const

Definition at line 61 of file DGeometry.cc.

References dapp, and DApplication::GetBfield().

Referenced by DEventProcessor_trackeff_hists2::brun().

bool DGeometry::GetCCALZ ( double &  z_ccal) const

Definition at line 1700 of file DGeometry.cc.

References _DBG_.

Referenced by DCCALShower_factory::brun().

bool DGeometry::GetCDCAxialLength ( double &  cdc_axial_length) const

length of CDC axial wires in cm

Definition at line 1425 of file DGeometry.cc.

References _DBG_.

Referenced by DEventProcessor_trackeff_hists2::brun().

bool DGeometry::GetCDCAxialWires ( unsigned int  ring,
unsigned int  ncopy,
double  zcenter,
double  dz,
vector< vector< cdc_offset_t > > &  cdc_offsets,
vector< DCDCWire * > &  axialwires,
vector< double > &  rot_angles,
double  dx,
double  dy 
) const
bool DGeometry::GetCDCCenterZ ( double &  cdc_center_z) const

z-location of center of CDC wires in cm

Definition at line 1416 of file DGeometry.cc.

bool DGeometry::GetCDCEndplate ( double &  z,
double &  dz,
double &  rmin,
double &  rmax 
) const
bool DGeometry::GetCDCNwires ( vector< int > &  cdc_nwires) const

Number of wires for each CDC layer.

Definition at line 1459 of file DGeometry.cc.

bool DGeometry::GetCDCOption ( string cdc_option) const

get the centralDC_option-X string

Definition at line 1402 of file DGeometry.cc.

References _DBG_.

bool DGeometry::GetCDCRmid ( vector< double > &  cdc_rmid) const

Distance of the center of CDC wire from beamline for each layer in cm.

Definition at line 1450 of file DGeometry.cc.

bool DGeometry::GetCDCStereo ( vector< double > &  cdc_stereo) const

stereo angle for each CDC layer in degrees

Definition at line 1441 of file DGeometry.cc.

bool DGeometry::GetCDCStereoWires ( unsigned int  ring,
unsigned int  ncopy,
double  zcenter,
double  dz,
vector< vector< cdc_offset_t > > &  cdc_offsets,
vector< DCDCWire * > &  stereowires,
vector< double > &  rot_angles,
double  dx,
double  dy 
) const

Find the materials traversed by a particle swimming from a specific position with a specific momentum through the magnetic field until it reaches a specific z-location. Energy loss is not included in the swimming since this method itself is assumed to be one of the primary means of determining energy loss. As such, one should not pass in a value of z_end that is far from pos.

The vector materialsteps will be filled with DMaterialStep objects corresponding to each of the materials traversed.

The real work here is done by the DMaterialStepper class Extract the stereo wire data from the XML

Definition at line 583 of file DGeometry.cc.

References DCoordinateSystem::origin, DCDCWire::phi, DCDCWire::phiStraw, DCDCWire::phiX, DCDCWire::phiY, DCDCWire::phiZ, DCDCWire::r0, DCDCWire::ring, DCoordinateSystem::sdir, sin(), DCDCWire::stereo, DCDCWire::stereo_raw, DCDCWire::straw, DCoordinateSystem::tdir, DCoordinateSystem::udir, DCDCWire::udir_mag, DCDCWire::x0, DCDCWire::y0, and DCDCWire::z0.

bool DGeometry::GetCompositeMaterial ( const string name,
double &  density,
double &  radlen 
) const
protected

Definition at line 527 of file DGeometry.cc.

References _DBG_, and sprintf().

bool DGeometry::GetDIRCZ ( double &  z_dirc) const
const DMaterial * DGeometry::GetDMaterial ( string  name) const

Get a pointer to the DMaterial object with the specified name.

Definition at line 396 of file DGeometry.cc.

bool DGeometry::GetFDCRmax ( double &  rmax_active_fdc) const

outer radius of FDC active area in cm

Definition at line 1381 of file DGeometry.cc.

References _DBG_.

Referenced by DTrackFitterKalmanSIMD::DTrackFitterKalmanSIMD().

bool DGeometry::GetFDCRmin ( vector< double > &  rmin_packages) const

beam hole size for each FDC package in cm

Definition at line 1361 of file DGeometry.cc.

Referenced by DTrackFitterKalmanSIMD::DTrackFitterKalmanSIMD().

bool DGeometry::GetFDCStereo ( vector< double > &  stereo_angles) const

stereo angles of each of the FDC wire layers

Definition at line 1299 of file DGeometry.cc.

bool DGeometry::GetFDCZ ( vector< double > &  z_wires) const

z-locations for each of the FDC wire planes in cm

Definition at line 1221 of file DGeometry.cc.

Referenced by DEventProcessor_fdc_covariance_hists::brun(), DTrackCandidate_factory_FDCCathodes::brun(), and DTrackFitterKalmanSIMD::DTrackFitterKalmanSIMD().

JGeometry* DGeometry::GetJGeometry ( void  )
inline

Definition at line 42 of file DGeometry.h.

DLorentzDeflections * DGeometry::GetLorentzDeflections ( void  )

Definition at line 73 of file DGeometry.cc.

References dapp, and DApplication::GetLorentzDeflections().

vector< DMaterialMap * > DGeometry::GetMaterialMapVector ( void  ) const

Definition at line 81 of file DGeometry.cc.

void DGeometry::GetMaterials ( void  ) const
protected

Read in all of the materials from the geometry source and create a DMaterial object for each one.

Definition at line 420 of file DGeometry.cc.

References sprintf(), and DMaterial::toString().

bool DGeometry::GetMultiple ( string  xpath,
vector< vector< double > > &  vals,
string  delimiter = " " 
) const
inline

Definition at line 64 of file DGeometry.h.

bool DGeometry::GetTargetLength ( double &  target_length) const
bool DGeometry::GetTargetZ ( double &  z_target) const

z-location of center of target

Definition at line 1933 of file DGeometry.cc.

Referenced by DBCALShower_factory_CURVATURE::brun(), JEventProcessor_BCAL_TDC_Timing::brun(), DBeamPhoton_factory_TRUTH::brun(), DFCALCluster_factory::brun(), DBCALCluster_factory_SINGLE::brun(), DCCALShower_factory::brun(), JEventProcessor_CCAL_online::brun(), JEventProcessor_FCAL_online::brun(), JEventProcessor_BCAL_attenlength_gainratio::brun(), DFCALShower_factory::brun(), DBCALCluster_factory::brun(), DEventProcessor_coherent_peak_skim::brun(), DVertex_factory::brun(), DNeutralShower_factory::brun(), DBCALShower_factory_IU::brun(), JEventProcessor_FCAL_invmass::brun(), JEventProcessor_FCALgains::brun(), DBeamPhoton_factory::brun(), DBCALShower_factory_KLOE::brun(), JEventProcessor_CDC_Efficiency::brun(), JEventProcessor_FDCProjectionResiduals::brun(), DMCThrownMatching_factory::brun(), JEventProcessor_BCAL_Hadronic_Eff::brun(), DTrackCandidate_factory_FDCCathodes::brun(), DBCALPoint_factory::brun(), DNeutralParticleHypothesis_factory::brun(), DTrackCandidate_factory::brun(), DEventRFBunch_factory_Calibrations::brun(), DEventRFBunch_factory_CalorimeterOnly::brun(), DFDCSegment_factory::brun(), DEventRFBunch_factory::brun(), DTrackCandidate_factory_CDC::brun(), DAnalysisUtilities::DAnalysisUtilities(), DAnalysis::DParticleComboCreator::DParticleComboCreator(), DParticleID::DParticleID(), DAnalysis::DSourceComboer::DSourceComboer(), DAnalysis::DSourceComboTimeHandler::DSourceComboTimeHandler(), DAnalysis::DSourceComboVertexer::DSourceComboVertexer(), DTrackFitterKalmanSIMD::DTrackFitterKalmanSIMD(), JEventProcessor_FCAL_TimingOffsets::evnt(), DEventSourceREST::GetObjects(), DEventSourceHDDM::GetObjects(), hdv_mainframe::hdv_mainframe(), DEventWriterROOT::Initialize(), DHistogramAction_ParticleComboGenReconComparison::Initialize(), DHistogramAction_Reconstruction::Initialize(), DHistogramAction_ParticleComboKinematics::Initialize(), DHistogramAction_GenReconTrackComparison::Initialize(), DHistogramAction_Neutrals::Initialize(), and DHistogramAction_DetectorMatchParams::Initialize().

bool DGeometry::GetTOFPaddleParameters ( map< string, double > &  paddle_params) const

Definition at line 1783 of file DGeometry.cc.

Referenced by DTOFGeometry::DTOFGeometry().

bool DGeometry::GetTOFPaddlePerpPositions ( vector< double > &  y_tof) const

Definition at line 1841 of file DGeometry.cc.

Referenced by DTOFGeometry::DTOFGeometry().

bool DGeometry::GetTOFZ ( vector< double > &  z_tof) const

z-location of front face of each of TOF in cm

Definition at line 1761 of file DGeometry.cc.

Referenced by DTOFGeometry::DTOFGeometry().

void DGeometry::ReadMaterialMaps ( void  ) const
protected

This gets called by several "FindMat" methods below. It will return immediately if the material maps have already been read in. If they have not been read in, then it reads them and sets a flag so that they are only read in once.

Orginally, this code resided in the constructor, but was moved here so that programs not requiring the material maps could start up quicker and skip reading them in altogether.

Definition at line 91 of file DGeometry.cc.

References _DBG_, dapp, DMaterialMap::GetNr(), DMaterialMap::GetNz(), and DMaterialMap::IS_VALID.

static const char* DGeometry::static_className ( void  )
inlinestatic

Definition at line 40 of file DGeometry.h.

Member Data Documentation

DMagneticFieldMap* DGeometry::bfield
mutableprivate

Definition at line 186 of file DGeometry.h.

pthread_mutex_t DGeometry::bfield_mutex
mutableprivate

Definition at line 193 of file DGeometry.h.

DApplication* DGeometry::dapp
private

Definition at line 185 of file DGeometry.h.

JGeometry* DGeometry::jgeom
private

Definition at line 184 of file DGeometry.h.

pthread_mutex_t DGeometry::materialmap_mutex
mutableprivate

Definition at line 194 of file DGeometry.h.

vector<DMaterialMap*> DGeometry::materialmaps
mutableprivate

Older implementation to keep track of material specs without ranges.

Definition at line 189 of file DGeometry.h.

bool DGeometry::materialmaps_read
mutableprivate

Material maps generated automatically(indirectly) from XML with ranges and specs.

Definition at line 190 of file DGeometry.h.

vector<DMaterial*> DGeometry::materials
mutableprivate

Definition at line 188 of file DGeometry.h.

pthread_mutex_t DGeometry::materials_mutex
mutableprivate

Definition at line 195 of file DGeometry.h.

bool DGeometry::materials_read
mutableprivate

Definition at line 191 of file DGeometry.h.

int32_t DGeometry::runnumber
private

Definition at line 187 of file DGeometry.h.


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