CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | 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::GeomDetInfoIdToInfo
 
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, GEM = 11, ME0 = 12
}
 

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
 
int getProducerVersion () const
 
TGeoShape * getShape (unsigned int id) const
 
TGeoShape * getShape (const GeomDetInfo &info) const
 
const float * getShapePars (unsigned int id) const
 
const TrackerTopologygetTrackerTopology () 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
 
IdToInfoItr mapEnd () 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 Attributes

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

Detailed Description

Definition at line 27 of file FWGeometry.h.

Member Typedef Documentation

Definition at line 109 of file FWGeometry.h.

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

Definition at line 110 of file FWGeometry.h.

Member Enumeration Documentation

Enumerator
Tracker 
Muon 
Ecal 
Hcal 
Calo 

Definition at line 33 of file FWGeometry.h.

Enumerator
PixelBarrel 
PixelEndcap 
TIB 
TID 
TOB 
TEC 
CSC 
DT 
RPCBarrel 
RPCEndcap 
GEM 
ME0 

Definition at line 34 of file FWGeometry.h.

Constructor & Destructor Documentation

FWGeometry::FWGeometry ( void  )

Definition at line 23 of file FWGeometry.cc.

Referenced by FWGeometry::VersionInfo::VersionInfo().

24 {}
int m_producerVersion
Definition: FWGeometry.h:140
FWGeometry::~FWGeometry ( void  )

Definition at line 26 of file FWGeometry.cc.

Referenced by FWGeometry::VersionInfo::VersionInfo().

27 {}

Member Function Documentation

void FWGeometry::clear ( void  )
inline
bool FWGeometry::contains ( unsigned int  id) const
inline
FWGeometry::IdToInfoItr FWGeometry::find ( unsigned int  id) const
TFile * FWGeometry::findFile ( const char *  fileName)
static

Definition at line 30 of file FWGeometry.cc.

References MillePedeFileConverter_cfg::fileName, mps_fire::i, callgraph::path, and AlCaHLTBitMon_QueryRunRegistry::string.

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

31 {
32  std::string searchPath = ".";
33 
34  if (gSystem->Getenv( "CMSSW_SEARCH_PATH" ))
35  {
36 
37  TString paths = gSystem->Getenv( "CMSSW_SEARCH_PATH" );
38 
39  TObjArray* tokens = paths.Tokenize( ":" );
40  for( int i = 0; i < tokens->GetEntries(); ++i )
41  {
42  TObjString* path = (TObjString*)tokens->At( i );
43  searchPath += ":";
44  searchPath += static_cast<const char *>(path->GetString());
45  if (gSystem->Getenv("CMSSW_VERSION"))
46  searchPath += "/Fireworks/Geometry/data/";
47  }
48  }
49 
50  TString fn = fileName;
51  const char* fp = gSystem->FindFile(searchPath.c_str(), fn, kFileExists);
52  return fp ? TFile::Open( fp) : nullptr;
53 }
#define nullptr
const float * FWGeometry::getCorners ( unsigned int  id) const

Definition at line 297 of file FWGeometry.cc.

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

Referenced by FWPFCandidateWithHitsProxyBuilder::addHitsForCandidate(), FWCaloRecHitDigitSetProxyBuilder::build(), FWPRCaloTowerProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWHGCalMultiClusterProxyBuilder::build(), FWPCaloHitProxyBuilder::build(), FWCaloParticleProxyBuilder::build(), FWPFEcalRecHitRPProxyBuilder::build(), FWPFEcalRecHitLegoProxyBuilder::build(), FWPhotonProxyBuilder::buildViewType(), FWECALCaloDataDetailViewBuilder::fillData(), FWECALDetailViewBuilder::fillEtaPhi(), FWHFTowerProxyBuilderBase::fillTowerForDetId(), FWHGTowerProxyBuilderBase::fillTowerForDetId(), FWHGTowerSliceSelector::findBinFromId(), FWHFTowerSliceSelector::findBinFromId(), fireworks::makeRhoPhiSuperCluster(), fireworks::makeRhoZSuperCluster(), FWCaloRecHitDigitSetProxyBuilder::scaleProduct(), FWPFCandidateWithHitsProxyBuilder::scaleProduct(), FW3DViewBase::showEcalBarrel(), ValidateGeometry::validateCaloGeometry(), and FWGeometry::VersionInfo::VersionInfo().

298 {
299  // reco geometry points
300  IdToInfoItr it = FWGeometry::find( id );
301  if( it == m_idToInfo.end())
302  {
303  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
304  return nullptr;
305  }
306  else
307  {
308  return ( *it ).points;
309  }
310 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
TEveGeoShape * FWGeometry::getEveShape ( unsigned int  id) const

Definition at line 270 of file FWGeometry.cc.

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

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

271 {
272  IdToInfoItr it = FWGeometry::find( id );
273  if( it == m_idToInfo.end())
274  {
275  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
276  return nullptr;
277  }
278  else
279  {
280  const GeomDetInfo& info = *it;
281  double array[16] = { info.matrix[0], info.matrix[3], info.matrix[6], 0.,
282  info.matrix[1], info.matrix[4], info.matrix[7], 0.,
283  info.matrix[2], info.matrix[5], info.matrix[8], 0.,
284  info.translation[0], info.translation[1], info.translation[2], 1.
285  };
286  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
287  TEveGeoShape* shape = new TEveGeoShape(TString::Format("RecoGeom Id=%u", id));
288  TGeoShape* geoShape = getShape( info );
289  shape->SetShape( geoShape );
290  // Set transformation matrix from a column-major array
291  shape->SetTransMatrix( array );
292  return shape;
293  }
294 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:229
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
std::vector< unsigned int > FWGeometry::getMatchedIds ( Detector  det,
SubDetector  subdet 
) const

Definition at line 214 of file FWGeometry.cc.

References electrons_cff::ids, m_idToInfo, RecoTauDiscriminantConfiguration::mask, and match_id().

Referenced by FW3DViewBase::showEcalBarrel(), FWRPZViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelBarrel(), FWRPZViewGeometry::showPixelEndcap(), FW3DViewGeometry::showPixelEndcap(), FWRPZViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerBarrel(), FWRPZViewGeometry::showTrackerEndcap(), FW3DViewGeometry::showTrackerEndcap(), and FWGeometry::VersionInfo::VersionInfo().

215 {
216  std::vector<unsigned int> ids;
217  unsigned int mask = ( det << 4 ) | ( subdet );
218  for( IdToInfoItr it = m_idToInfo.begin(), itEnd = m_idToInfo.end();
219  it != itEnd; ++it )
220  {
221  if( FWGeometry::match_id( *it, mask ))
222  ids.push_back(( *it ).id );
223  }
224 
225  return ids;
226 }
bool match_id(const GeomDetInfo &o, unsigned int mask) const
Definition: FWGeometry.h:104
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
const TGeoMatrix * FWGeometry::getMatrix ( unsigned int  id) const

Definition at line 186 of file FWGeometry.cc.

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

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

187 {
188  std::map<unsigned int, TGeoMatrix*>::iterator mit = m_idToMatrix.find( id );
189  if( mit != m_idToMatrix.end()) return mit->second;
190 
191  IdToInfoItr it = FWGeometry::find( id );
192  if( it == m_idToInfo.end())
193  {
194  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
195  return nullptr;
196  }
197  else
198  {
199  const GeomDetInfo& info = *it;
200  TGeoTranslation trans( info.translation[0], info.translation[1], info.translation[2] );
201  TGeoRotation rotation;
202  const Double_t matrix[9] = { info.matrix[0], info.matrix[1], info.matrix[2],
203  info.matrix[3], info.matrix[4], info.matrix[5],
204  info.matrix[6], info.matrix[7], info.matrix[8]
205  };
206  rotation.SetMatrix( matrix );
207 
208  m_idToMatrix[id] = new TGeoCombiTrans( trans, rotation );
209  return m_idToMatrix[id];
210  }
211 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
std::map< unsigned int, TGeoMatrix * > m_idToMatrix
Definition: FWGeometry.h:132
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
const float * FWGeometry::getParameters ( unsigned int  id) const

Definition at line 313 of file FWGeometry.cc.

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

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

314 {
315  // reco geometry parameters
316  IdToInfoItr it = FWGeometry::find( id );
317  if( it == m_idToInfo.end())
318  {
319  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
320  return nullptr;
321  }
322  else
323  {
324  return ( *it ).parameters;
325  }
326 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
int FWGeometry::getProducerVersion ( ) const
inline

Definition at line 125 of file FWGeometry.h.

References getShape(), and m_producerVersion.

125 {return m_producerVersion;}
int m_producerVersion
Definition: FWGeometry.h:140
TGeoShape * FWGeometry::getShape ( unsigned int  id) const

Definition at line 229 of file FWGeometry.cc.

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

Referenced by FWSiStripClusterProxyBuilder::build(), getEveShape(), getProducerVersion(), and FWGeometry::VersionInfo::VersionInfo().

230 {
231  IdToInfoItr it = FWGeometry::find( id );
232  if( it == m_idToInfo.end())
233  {
234  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
235  return nullptr;
236  }
237  else
238  {
239  return getShape( *it );
240  }
241 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:229
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
TGeoShape * FWGeometry::getShape ( const GeomDetInfo info) const

Definition at line 244 of file FWGeometry.cc.

References FWGeometry::GeomDetInfo::shape.

245 {
246  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
247  TGeoShape* geoShape = nullptr;
248  if( info.shape[0] == 1 )
249  {
250  geoShape = new TGeoTrap(
251  info.shape[3], //dz
252  0, //theta
253  0, //phi
254  info.shape[4], //dy1
255  info.shape[1], //dx1
256  info.shape[2], //dx2
257  0, //alpha1
258  info.shape[4], //dy2
259  info.shape[1], //dx3
260  info.shape[2], //dx4
261  0); //alpha2
262  }
263  else
264  geoShape = new TGeoBBox( info.shape[1], info.shape[2], info.shape[3] );
265 
266  return geoShape;
267 }
static const TGPicture * info(bool iBackgroundIsBlack)
const float * FWGeometry::getShapePars ( unsigned int  id) const

Definition at line 329 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(), ValidateGeometry::validateTrackerGeometry(), and FWGeometry::VersionInfo::VersionInfo().

330 {
331  // reco geometry parameters
332  IdToInfoItr it = FWGeometry::find( id );
333  if( it == m_idToInfo.end())
334  {
335  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
336  return nullptr;
337  }
338  else
339  {
340  return ( *it ).shape;
341  }
342 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
const TrackerTopology* FWGeometry::getTrackerTopology ( ) const
inline

Definition at line 129 of file FWGeometry.h.

References m_trackerTopology.

Referenced by FWTrackHitsDetailView::addModules(), fireworks::info(), FW3DViewGeometry::showPixelBarrel(), and FW3DViewGeometry::showPixelEndcap().

129 { return m_trackerTopology.get(); }
std::unique_ptr< TrackerTopology > m_trackerTopology
Definition: FWGeometry.h:142
void FWGeometry::initMap ( const FWRecoGeom::InfoMap map)

Definition at line 160 of file FWGeometry.cc.

References begin, end, mps_fire::i, m_idToInfo, makeMuonMisalignmentScenario::matrix, and hiPixelPairStep_cff::points.

Referenced by FWGeometry::VersionInfo::VersionInfo().

161 {
162  FWRecoGeom::InfoMapItr begin = map.begin();
164  unsigned int mapSize = map.size();
165  if( m_idToInfo.size() != mapSize )
166  m_idToInfo.resize( mapSize );
167  unsigned int i = 0;
168  for( FWRecoGeom::InfoMapItr it = begin;
169  it != end; ++it, ++i )
170  {
171  m_idToInfo[i].id = it->id;
172  for( unsigned int j = 0; j < 24; ++j )
173  m_idToInfo[i].points[j] = it->points[j];
174  for( unsigned int j = 0; j < 9; ++j )
175  m_idToInfo[i].parameters[j] = it->topology[j];
176  for( unsigned int j = 0; j < 5; ++j )
177  m_idToInfo[i].shape[j] = it->shape[j];
178  for( unsigned int j = 0; j < 3; ++j )
179  m_idToInfo[i].translation[j] = it->translation[j];
180  for( unsigned int j = 0; j < 9; ++j )
181  m_idToInfo[i].matrix[j] = it->matrix[j];
182  }
183 }
std::vector< FWRecoGeom::Info >::const_iterator InfoMapItr
Definition: FWRecoGeom.h:28
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
void FWGeometry::loadMap ( const char *  fileName)

Definition at line 56 of file FWGeometry.cc.

References FWGeometry::VersionInfo::cmsswVersion, FWGeometry::VersionInfo::extraDetectors, FrontierConditions_GlobalTag_cff::file, findFile(), StandaloneTrackerTopology::fromTrackerParametersXMLString(), fwLog, mps_fire::i, triggerObjects_cff::id, fwlog::kInfo, PhysicsTools::loadMatrix(), m_idToInfo, m_producerVersion, m_trackerTopology, m_versionInfo, makeMuonMisalignmentScenario::matrix, callgraph::path, hiPixelPairStep_cff::points, FWGeometry::VersionInfo::productionTag, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::topology().

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

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

Definition at line 345 of file FWGeometry.cc.

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

Referenced by fireworks::addSiStripClusters(), FWTrackTrackingRecHitProxyBuilder::build(), FWME0DigiProxyBuilder::build(), FWME0SegmentProxyBuilder::build(), FWSiStripClusterProxyBuilder::build(), FWCSCRecHitProxyBuilder::build(), FWCSCStripDigiProxyBuilder::build(), FWSiStripDigiProxyBuilder::build(), FWRPCDigiProxyBuilder::build(), FWCSCWireDigiProxyBuilder::build(), FWCSCSegmentProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), FWGEMDigiProxyBuilder::build(), FWSiPixelClusterProxyBuilder::build(), FWTrackingParticleProxyBuilderFullFramework::build(), FWTrajectorySeedProxyBuilder::build(), FWGEMPadDigiProxyBuilder::build(), FWGEMSegmentProxyBuilder::buildViewType(), FWME0RecHitProxyBuilder::buildViewType(), FWPSimHitProxyBuilder::buildViewType(), FWDTRecHitProxyBuilder::buildViewType(), FWRPCRecHitProxyBuilder::buildViewType(), FWGEMRecHitProxyBuilder::buildViewType(), FWDTSegmentProxyBuilder::buildViewType(), FWDTDigiProxyBuilder::buildViewType(), clear(), FWRPZViewGeometry::estimateProjectionSizeDT(), localToGlobal(), fireworks::pushPixelCluster(), and FWGeometry::VersionInfo::VersionInfo().

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

Definition at line 359 of file FWGeometry.cc.

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

361 {
362  IdToInfoItr it = FWGeometry::find( id );
363  if( it == m_idToInfo.end())
364  {
365  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
366  }
367  else
368  {
369  localToGlobal( *it, local1, global1, translatep );
370  localToGlobal( *it, local2, global2, translatep );
371  }
372 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:375
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:345
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:110
void FWGeometry::localToGlobal ( const GeomDetInfo info,
const float *  local,
float *  global,
bool  translatep = true 
) const

Definition at line 383 of file FWGeometry.cc.

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

384 {
385  for( int i = 0; i < 3; ++i )
386  {
387  global[i] = translatep ? info.translation[i] : 0;
388  global[i] += local[0] * info.matrix[3 * i]
389  + local[1] * info.matrix[3 * i + 1]
390  + local[2] * info.matrix[3 * i + 2];
391  }
392 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr FWGeometry::mapEnd ( ) const
inline

Definition at line 117 of file FWGeometry.h.

References m_idToInfo.

Referenced by FWRPZViewGeometry::makeMuonGeometryRhoZ().

117 {return m_idToInfo.end();}
IdToInfo m_idToInfo
Definition: FWGeometry.h:134
bool FWGeometry::match_id ( const GeomDetInfo o,
unsigned int  mask 
) const
inline

Definition at line 104 of file FWGeometry.h.

References FWGeometry::GeomDetInfo::id.

Referenced by getMatchedIds().

104  {
105  unsigned int id = o.id;
106  return ((((( id >> kDetOffset ) & 0xF ) << 4) | (( id >> kSubdetOffset ) & 0x7 )) == mask );
107  }
static const int kSubdetOffset
Definition: FWGeometry.h:31
static const int kDetOffset
Definition: FWGeometry.h:30
const VersionInfo& FWGeometry::versionInfo ( ) const
inline

Member Data Documentation

const int FWGeometry::kDetOffset = 28
static

Definition at line 30 of file FWGeometry.h.

const int FWGeometry::kSubdetOffset = 25
static

Definition at line 31 of file FWGeometry.h.

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

Definition at line 132 of file FWGeometry.h.

Referenced by clear(), and getMatrix().

std::string FWGeometry::m_prodTag
private

Definition at line 136 of file FWGeometry.h.

int FWGeometry::m_producerVersion
private

Definition at line 140 of file FWGeometry.h.

Referenced by getProducerVersion(), and loadMap().

std::unique_ptr<TrackerTopology> FWGeometry::m_trackerTopology
private

Definition at line 142 of file FWGeometry.h.

Referenced by getTrackerTopology(), and loadMap().

VersionInfo FWGeometry::m_versionInfo
private

Definition at line 138 of file FWGeometry.h.

Referenced by loadMap(), and versionInfo().