test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
FWGeometry Class Reference

#include <FWGeometry.h>

Classes

struct  GeomDetInfo
 
struct  Range
 
class  VersionInfo
 

Public Types

enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5
}
 
typedef std::vector
< FWGeometry::GeomDetInfo
IdToInfo
 
typedef std::vector
< FWGeometry::GeomDetInfo >
::const_iterator 
IdToInfoItr
 
enum  SubDetector {
  PixelBarrel = 1, PixelEndcap = 2, TIB = 3, TID = 4,
  TOB = 5, TEC = 6, CSC = 7, DT = 8,
  RPCBarrel = 9, RPCEndcap = 10
}
 

Public Member Functions

void clear (void)
 
bool contains (unsigned int id) const
 
IdToInfoItr find (unsigned int) const
 
 FWGeometry (void)
 
const float * getCorners (unsigned int id) const
 
TEveGeoShape * getEveShape (unsigned int id) const
 
std::vector< unsigned int > getMatchedIds (Detector det, SubDetector subdet) const
 
const TGeoMatrix * getMatrix (unsigned int id) const
 
const float * getParameters (unsigned int id) const
 
TGeoShape * getShape (unsigned int id) const
 
const float * getShapePars (unsigned int id) const
 
void initMap (const FWRecoGeom::InfoMap &map)
 
void loadMap (const char *fileName)
 
void localToGlobal (unsigned int id, const float *local, float *global, bool translatep=true) const
 
void localToGlobal (unsigned int id, const float *local1, float *global1, const float *local2, float *global2, bool translatep=true) const
 
void localToGlobal (const GeomDetInfo &info, const float *local, float *global, bool translatep=true) const
 
bool match_id (const GeomDetInfo &o, unsigned int mask) const
 
const VersionInfoversionInfo () const
 
 ~FWGeometry (void)
 

Static Public Member Functions

static TFile * findFile (const char *fileName)
 

Static Public Attributes

static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Private Member Functions

TGeoShape * getShape (const GeomDetInfo &info) const
 

Private Attributes

IdToInfo m_idToInfo
 
std::map< unsigned int,
TGeoMatrix * > 
m_idToMatrix
 
std::string m_prodTag
 
VersionInfo m_versionInfo
 

Detailed Description

Definition at line 24 of file FWGeometry.h.

Member Typedef Documentation

Definition at line 106 of file FWGeometry.h.

typedef std::vector<FWGeometry::GeomDetInfo>::const_iterator FWGeometry::IdToInfoItr

Definition at line 107 of file FWGeometry.h.

Member Enumeration Documentation

Enumerator
Tracker 
Muon 
Ecal 
Hcal 
Calo 

Definition at line 30 of file FWGeometry.h.

Enumerator
PixelBarrel 
PixelEndcap 
TIB 
TID 
TOB 
TEC 
CSC 
DT 
RPCBarrel 
RPCEndcap 

Definition at line 31 of file FWGeometry.h.

Constructor & Destructor Documentation

FWGeometry::FWGeometry ( void  )

Definition at line 19 of file FWGeometry.cc.

20 {}
FWGeometry::~FWGeometry ( void  )

Definition at line 22 of file FWGeometry.cc.

23 {}

Member Function Documentation

void FWGeometry::clear ( void  )
inline
bool FWGeometry::contains ( unsigned int  id) const
inline
FWGeometry::IdToInfoItr FWGeometry::find ( unsigned int  id) const

Definition at line 355 of file FWGeometry.cc.

References begin, end, and m_idToInfo.

Referenced by FWCSCRecHitProxyBuilder::build(), FWRPCRecHitProxyBuilder::buildViewType(), FWGEMRecHitProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), contains(), getCorners(), getEveShape(), getMatrix(), getParameters(), getShape(), getShapePars(), localToGlobal(), and FWRPZViewGeometry::makeMuonGeometryRhoZ().

356 {
359  return std::lower_bound( begin, end, id );
360 }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TFile * FWGeometry::findFile ( const char *  fileName)
static

Definition at line 26 of file FWGeometry.cc.

References convertXMLtoSQLite_cfg::fileName, i, cmsHarvester::path, mergeAndRegister::paths, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by loadMap(), and FWGeometryTableViewManager::setGeoManagerFromFile().

27 {
28  std::string searchPath = ".";
29 
30  if (gSystem->Getenv( "CMSSW_SEARCH_PATH" ))
31  {
32  TString paths = gSystem->Getenv( "CMSSW_SEARCH_PATH" );
33  TObjArray* tokens = paths.Tokenize( ":" );
34  for( int i = 0; i < tokens->GetEntries(); ++i )
35  {
36  TObjString* path = (TObjString*)tokens->At( i );
37  searchPath += ":";
38  searchPath += path->GetString();
39  searchPath += "/Fireworks/Geometry/data/";
40  }
41  }
42 
43  TString fn = fileName;
44  const char* fp = gSystem->FindFile(searchPath.c_str(), fn, kFileExists);
45  return fp ? TFile::Open( fp) : 0;
46 }
int i
Definition: DBlmapReader.cc:9
tuple path
else: Piece not in the list, fine.
const float * FWGeometry::getCorners ( unsigned int  id) const
TEveGeoShape * FWGeometry::getEveShape ( unsigned int  id) const

Definition at line 250 of file FWGeometry.cc.

References find(), fwLog, getShape(), info(), fwlog::kWarning, m_idToInfo, FWGeometry::GeomDetInfo::matrix, and FWGeometry::GeomDetInfo::translation.

Referenced by FWTrackHitsDetailView::addModules(), FWConvTrackHitsDetailView::addModules(), FWSiStripClusterProxyBuilder::build(), FWSiPixelClusterDetProxyBuilder::build(), FWTracksModulesProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWRPCRecHitProxyBuilder::buildViewType(), FWGEMRecHitProxyBuilder::buildViewType(), FWDTSegmentProxyBuilder::buildViewType(), FWRPZViewGeometry::makeMuonGeometryRhoPhi(), FWRPZViewGeometry::makeMuonGeometryRhoZ(), FWRPZViewGeometry::showGEM(), FW3DViewGeometry::showMuonBarrel(), FW3DViewGeometry::showMuonBarrelFull(), FW3DViewGeometry::showMuonEndcap(), FWRPZViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FW3DViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showRpcEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), and FW3DViewGeometry::showTrackerEndcap().

251 {
252  IdToInfoItr it = FWGeometry::find( id );
253  if( it == m_idToInfo.end())
254  {
255  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
256  return 0;
257  }
258  else
259  {
260  const GeomDetInfo& info = *it;
261  double array[16] = { info.matrix[0], info.matrix[3], info.matrix[6], 0.,
262  info.matrix[1], info.matrix[4], info.matrix[7], 0.,
263  info.matrix[2], info.matrix[5], info.matrix[8], 0.,
264  info.translation[0], info.translation[1], info.translation[2], 1.
265  };
266  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
267  TEveGeoShape* shape = new TEveGeoShape(TString::Format("RecoGeom Id=%u", id));
268  TGeoShape* geoShape = getShape( info );
269  shape->SetShape( geoShape );
270  // Set transformation matrix from a column-major array
271  shape->SetTransMatrix( array );
272  return shape;
273  }
274 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:209
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
std::vector< unsigned int > FWGeometry::getMatchedIds ( Detector  det,
SubDetector  subdet 
) const

Definition at line 194 of file FWGeometry.cc.

References m_idToInfo, and match_id().

Referenced by FWRPZViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FW3DViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), and FW3DViewGeometry::showTrackerEndcap().

195 {
196  std::vector<unsigned int> ids;
197  unsigned int mask = ( det << 4 ) | ( subdet );
198  for( IdToInfoItr it = m_idToInfo.begin(), itEnd = m_idToInfo.end();
199  it != itEnd; ++it )
200  {
201  if( FWGeometry::match_id( *it, mask ))
202  ids.push_back(( *it ).id );
203  }
204 
205  return ids;
206 }
bool match_id(const GeomDetInfo &o, unsigned int mask) const
Definition: FWGeometry.h:101
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
const TGeoMatrix * FWGeometry::getMatrix ( unsigned int  id) const

Definition at line 166 of file FWGeometry.cc.

References find(), fwLog, info(), fwlog::kWarning, m_idToInfo, m_idToMatrix, FWGeometry::GeomDetInfo::matrix, makeMuonMisalignmentScenario::matrix, idealTransformation::rotation, edmStreamStallGrapher::trans, and FWGeometry::GeomDetInfo::translation.

Referenced by FWTrackResidualDetailView::getSignedResidual(), ValidateGeometry::validateCSChamberGeometry(), ValidateGeometry::validateCSCLayerGeometry(), ValidateGeometry::validateDTChamberGeometry(), ValidateGeometry::validateDTLayerGeometry(), ValidateGeometry::validateRPCGeometry(), and ValidateGeometry::validateTrackerGeometry().

167 {
168  std::map<unsigned int, TGeoMatrix*>::iterator mit = m_idToMatrix.find( id );
169  if( mit != m_idToMatrix.end()) return mit->second;
170 
171  IdToInfoItr it = FWGeometry::find( id );
172  if( it == m_idToInfo.end())
173  {
174  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
175  return 0;
176  }
177  else
178  {
179  const GeomDetInfo& info = *it;
180  TGeoTranslation trans( info.translation[0], info.translation[1], info.translation[2] );
181  TGeoRotation rotation;
182  const Double_t matrix[9] = { info.matrix[0], info.matrix[1], info.matrix[2],
183  info.matrix[3], info.matrix[4], info.matrix[5],
184  info.matrix[6], info.matrix[7], info.matrix[8]
185  };
186  rotation.SetMatrix( matrix );
187 
188  m_idToMatrix[id] = new TGeoCombiTrans( trans, rotation );
189  return m_idToMatrix[id];
190  }
191 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
std::map< unsigned int, TGeoMatrix * > m_idToMatrix
Definition: FWGeometry.h:120
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
const float * FWGeometry::getParameters ( unsigned int  id) const

Definition at line 293 of file FWGeometry.cc.

References find(), fwLog, fwlog::kWarning, and m_idToInfo.

Referenced by fireworks::addSiStripClusters(), FWSiStripClusterProxyBuilder::build(), FWSiStripDigiProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWGEMDigiProxyBuilder::build(), FWSiPixelClusterProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), FWDTDigiProxyBuilder::buildViewType(), fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), ValidateGeometry::validateCSCLayerGeometry(), ValidateGeometry::validateDTLayerGeometry(), ValidateGeometry::validatePixelTopology(), ValidateGeometry::validateRPCGeometry(), and ValidateGeometry::validateStripTopology().

294 {
295  // reco geometry parameters
296  IdToInfoItr it = FWGeometry::find( id );
297  if( it == m_idToInfo.end())
298  {
299  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
300  return 0;
301  }
302  else
303  {
304  return ( *it ).parameters;
305  }
306 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TGeoShape * FWGeometry::getShape ( unsigned int  id) const

Definition at line 209 of file FWGeometry.cc.

References find(), fwLog, fwlog::kWarning, and m_idToInfo.

Referenced by getEveShape().

210 {
211  IdToInfoItr it = FWGeometry::find( id );
212  if( it == m_idToInfo.end())
213  {
214  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
215  return 0;
216  }
217  else
218  {
219  return getShape( *it );
220  }
221 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:209
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TGeoShape * FWGeometry::getShape ( const GeomDetInfo info) const
private

Definition at line 224 of file FWGeometry.cc.

References FWGeometry::GeomDetInfo::shape.

225 {
226  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
227  TGeoShape* geoShape = 0;
228  if( info.shape[0] == 1 )
229  {
230  geoShape = new TGeoTrap(
231  info.shape[3], //dz
232  0, //theta
233  0, //phi
234  info.shape[4], //dy1
235  info.shape[1], //dx1
236  info.shape[2], //dx2
237  0, //alpha1
238  info.shape[4], //dy2
239  info.shape[1], //dx3
240  info.shape[2], //dx4
241  0); //alpha2
242  }
243  else
244  geoShape = new TGeoBBox( info.shape[1], info.shape[2], info.shape[3] );
245 
246  return geoShape;
247 }
static const TGPicture * info(bool iBackgroundIsBlack)
const float * FWGeometry::getShapePars ( unsigned int  id) const

Definition at line 309 of file FWGeometry.cc.

References find(), fwLog, fwlog::kWarning, and m_idToInfo.

Referenced by FWCSCStripDigiProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), ValidateGeometry::validateCSChamberGeometry(), ValidateGeometry::validateCSCLayerGeometry(), ValidateGeometry::validateDTChamberGeometry(), ValidateGeometry::validateDTLayerGeometry(), ValidateGeometry::validateRPCGeometry(), and ValidateGeometry::validateTrackerGeometry().

310 {
311  // reco geometry parameters
312  IdToInfoItr it = FWGeometry::find( id );
313  if( it == m_idToInfo.end())
314  {
315  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
316  return 0;
317  }
318  else
319  {
320  return ( *it ).shape;
321  }
322 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
void FWGeometry::initMap ( const FWRecoGeom::InfoMap map)

Definition at line 140 of file FWGeometry.cc.

References begin, end, i, j, m_idToInfo, and makeMuonMisalignmentScenario::matrix.

Referenced by FWFFLooper::beginRun(), and FWFFService::postBeginRun().

141 {
142  FWRecoGeom::InfoMapItr begin = map.begin();
144  unsigned int mapSize = map.size();
145  if( m_idToInfo.size() != mapSize )
146  m_idToInfo.resize( mapSize );
147  unsigned int i = 0;
148  for( FWRecoGeom::InfoMapItr it = begin;
149  it != end; ++it, ++i )
150  {
151  m_idToInfo[i].id = it->id;
152  for( unsigned int j = 0; j < 24; ++j )
153  m_idToInfo[i].points[j] = it->points[j];
154  for( unsigned int j = 0; j < 9; ++j )
155  m_idToInfo[i].parameters[j] = it->topology[j];
156  for( unsigned int j = 0; j < 5; ++j )
157  m_idToInfo[i].shape[j] = it->shape[j];
158  for( unsigned int j = 0; j < 3; ++j )
159  m_idToInfo[i].translation[j] = it->translation[j];
160  for( unsigned int j = 0; j < 9; ++j )
161  m_idToInfo[i].matrix[j] = it->matrix[j];
162  }
163 }
std::vector< FWRecoGeom::Info >::const_iterator InfoMapItr
Definition: FWRecoGeom.h:28
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
void FWGeometry::loadMap ( const char *  fileName)

Definition at line 49 of file FWGeometry.cc.

References FWGeometry::VersionInfo::cmsswVersion, FWGeometry::VersionInfo::extraDetectors, mergeVDriftHistosByStation::file, findFile(), fwLog, i, j, fwlog::kInfo, PhysicsTools::loadMatrix(), m_idToInfo, m_versionInfo, makeMuonMisalignmentScenario::matrix, Parameters::parameters, cmsHarvester::path, FWGeometry::VersionInfo::productionTag, ecaldqm::topology(), and MainPageGenerator::tree.

Referenced by CmsShowMainBase::loadGeometry(), and ValidateGeometry::ValidateGeometry().

50 {
51  TFile* file = findFile( fileName );
52  if( ! file )
53  {
54  throw std::runtime_error( "ERROR: failed to find geometry file. Initialization failed." );
55  return;
56  }
57 
58  TTree* tree = static_cast<TTree*>(file->Get( "idToGeo" ));
59  if( ! tree )
60  {
61  throw std::runtime_error( "ERROR: cannot find detector id map in the file. Initialization failed." );
62  return;
63  }
64 
65  unsigned int id;
66  Float_t points[24];
67  Float_t topology[9];
68  Float_t shape[5];
69  Float_t translation[3];
70  Float_t matrix[9];
71  bool loadPoints = tree->GetBranch( "points" ) != 0;
72  bool loadParameters = tree->GetBranch( "topology" ) != 0;
73  bool loadShape = tree->GetBranch( "shape" ) != 0;
74  bool loadTranslation = tree->GetBranch( "translation" ) != 0;
75  bool loadMatrix = tree->GetBranch( "matrix" ) != 0;
76  tree->SetBranchAddress( "id", &id );
77  if( loadPoints )
78  tree->SetBranchAddress( "points", &points );
79  if( loadParameters )
80  tree->SetBranchAddress( "topology", &topology );
81  if( loadShape )
82  tree->SetBranchAddress( "shape", &shape );
83  if( loadTranslation )
84  tree->SetBranchAddress( "translation", &translation );
85  if( loadMatrix )
86  tree->SetBranchAddress( "matrix", &matrix );
87 
88  unsigned int treeSize = tree->GetEntries();
89  if( m_idToInfo.size() != treeSize )
90  m_idToInfo.resize( treeSize );
91  for( unsigned int i = 0; i < treeSize; ++i )
92  {
93  tree->GetEntry( i );
94 
95  m_idToInfo[i].id = id;
96  if( loadPoints )
97  {
98  for( unsigned int j = 0; j < 24; ++j )
99  m_idToInfo[i].points[j] = points[j];
100  }
101  if( loadParameters )
102  {
103  for( unsigned int j = 0; j < 9; ++j )
104  m_idToInfo[i].parameters[j] = topology[j];
105  }
106  if( loadShape )
107  {
108  for( unsigned int j = 0; j < 5; ++j )
109  m_idToInfo[i].shape[j] = shape[j];
110  }
111  if( loadTranslation )
112  {
113  for( unsigned int j = 0; j < 3; ++j )
114  m_idToInfo[i].translation[j] = translation[j];
115  }
116  if( loadMatrix )
117  {
118  for( unsigned int j = 0; j < 9; ++j )
119  m_idToInfo[i].matrix[j] = matrix[j];
120  }
121  }
122 
123 
124  m_versionInfo.productionTag = static_cast<TNamed*>(file->Get( "tag" ));
125  m_versionInfo.cmsswVersion = static_cast<TNamed*>(file->Get( "CMSSW_VERSION" ));
126  m_versionInfo.extraDetectors = static_cast<TObjArray*>(file->Get( "ExtraDetectors" ));
127 
128  TString path = file->GetPath();
129  if (path.EndsWith(":/")) path.Resize(path.Length() -2);
130 
132  fwLog( fwlog::kInfo ) << Form("Load %s %s from %s\n ", tree->GetName(), m_versionInfo.productionTag->GetName(), path.Data());
133  else
134  fwLog( fwlog::kInfo ) << Form("Load %s from %s\n ", tree->GetName(), path.Data());
135 
136  file->Close();
137 }
static TFile * findFile(const char *fileName)
Definition: FWGeometry.cc:26
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
TObjArray * extraDetectors
Definition: FWGeometry.h:46
static void loadMatrix(DOMElement *elem, unsigned int n, TMatrixDBase &matrix)
CaloTopology const * topology(0)
tuple path
else: Piece not in the list, fine.
VersionInfo m_versionInfo
Definition: FWGeometry.h:126
int j
Definition: DBlmapReader.cc:9
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
void FWGeometry::localToGlobal ( unsigned int  id,
const float *  local,
float *  global,
bool  translatep = true 
) const

Definition at line 325 of file FWGeometry.cc.

References find(), fwLog, fwlog::kWarning, and m_idToInfo.

Referenced by fireworks::addSiStripClusters(), FWTrackTrackingRecHitProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWCSCRecHitProxyBuilder::build(), FWSiStripDigiProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), FWGEMDigiProxyBuilder::build(), FWSiPixelClusterProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), FWPSimHitProxyBuilder::buildViewType(), FWDTRecHitProxyBuilder::buildViewType(), FWRPCRecHitProxyBuilder::buildViewType(), FWGEMRecHitProxyBuilder::buildViewType(), FWDTSegmentProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), FWRPZViewGeometry::estimateProjectionSizeDT(), localToGlobal(), and fireworks::pushPixelCluster().

326 {
327  IdToInfoItr it = FWGeometry::find( id );
328  if( it == m_idToInfo.end())
329  {
330  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
331  }
332  else
333  {
334  localToGlobal( *it, local, global, translatep );
335  }
336 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:325
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
void FWGeometry::localToGlobal ( unsigned int  id,
const float *  local1,
float *  global1,
const float *  local2,
float *  global2,
bool  translatep = true 
) const

Definition at line 339 of file FWGeometry.cc.

References find(), fwLog, fwlog::kWarning, localToGlobal(), and m_idToInfo.

341 {
342  IdToInfoItr it = FWGeometry::find( id );
343  if( it == m_idToInfo.end())
344  {
345  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
346  }
347  else
348  {
349  localToGlobal( *it, local1, global1, translatep );
350  localToGlobal( *it, local2, global2, translatep );
351  }
352 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:325
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:122
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
void FWGeometry::localToGlobal ( const GeomDetInfo info,
const float *  local,
float *  global,
bool  translatep = true 
) const

Definition at line 363 of file FWGeometry.cc.

References i, FWGeometry::GeomDetInfo::matrix, and FWGeometry::GeomDetInfo::translation.

364 {
365  for( int i = 0; i < 3; ++i )
366  {
367  global[i] = translatep ? info.translation[i] : 0;
368  global[i] += local[0] * info.matrix[3 * i]
369  + local[1] * info.matrix[3 * i + 1]
370  + local[2] * info.matrix[3 * i + 2];
371  }
372 }
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
bool FWGeometry::match_id ( const GeomDetInfo o,
unsigned int  mask 
) const
inline

Definition at line 101 of file FWGeometry.h.

References FWGeometry::GeomDetInfo::id, kDetOffset, and kSubdetOffset.

Referenced by getMatchedIds().

101  {
102  unsigned int id = o.id;
103  return ((((( id >> kDetOffset ) & 0xF ) << 4) | (( id >> kSubdetOffset ) & 0x7 )) == mask );
104  }
static const int kSubdetOffset
Definition: FWGeometry.h:28
static const int kDetOffset
Definition: FWGeometry.h:27
const VersionInfo& FWGeometry::versionInfo ( ) const
inline

Definition at line 117 of file FWGeometry.h.

References m_versionInfo.

Referenced by FWRPZView::populateController(), and FWRPZViewGeometry::showRpcEndcap().

117 { return m_versionInfo; }
VersionInfo m_versionInfo
Definition: FWGeometry.h:126

Member Data Documentation

const int FWGeometry::kDetOffset = 28
static

Definition at line 27 of file FWGeometry.h.

Referenced by match_id().

const int FWGeometry::kSubdetOffset = 25
static

Definition at line 28 of file FWGeometry.h.

Referenced by match_id().

IdToInfo FWGeometry::m_idToInfo
private
std::map<unsigned int, TGeoMatrix*> FWGeometry::m_idToMatrix
mutableprivate

Definition at line 120 of file FWGeometry.h.

Referenced by clear(), and getMatrix().

std::string FWGeometry::m_prodTag
private

Definition at line 124 of file FWGeometry.h.

VersionInfo FWGeometry::m_versionInfo
private

Definition at line 126 of file FWGeometry.h.

Referenced by loadMap(), and versionInfo().