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
 
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
 
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 
GEM 
ME0 

Definition at line 31 of file FWGeometry.h.

Constructor & Destructor Documentation

FWGeometry::FWGeometry ( void  )

Definition at line 19 of file FWGeometry.cc.

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

20 {}
int m_producerVersion
Definition: FWGeometry.h:136
FWGeometry::~FWGeometry ( void  )

Definition at line 22 of file FWGeometry.cc.

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

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
TFile * FWGeometry::findFile ( const char *  fileName)
static

Definition at line 26 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().

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

Definition at line 286 of file FWGeometry.cc.

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

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

287 {
288  // reco geometry points
289  IdToInfoItr it = FWGeometry::find( id );
290  if( it == m_idToInfo.end())
291  {
292  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
293  return 0;
294  }
295  else
296  {
297  return ( *it ).points;
298  }
299 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TEveGeoShape * FWGeometry::getEveShape ( unsigned int  id) const

Definition at line 259 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().

260 {
261  IdToInfoItr it = FWGeometry::find( id );
262  if( it == m_idToInfo.end())
263  {
264  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
265  return 0;
266  }
267  else
268  {
269  const GeomDetInfo& info = *it;
270  double array[16] = { info.matrix[0], info.matrix[3], info.matrix[6], 0.,
271  info.matrix[1], info.matrix[4], info.matrix[7], 0.,
272  info.matrix[2], info.matrix[5], info.matrix[8], 0.,
273  info.translation[0], info.translation[1], info.translation[2], 1.
274  };
275  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
276  TEveGeoShape* shape = new TEveGeoShape(TString::Format("RecoGeom Id=%u", id));
277  TGeoShape* geoShape = getShape( info );
278  shape->SetShape( geoShape );
279  // Set transformation matrix from a column-major array
280  shape->SetTransMatrix( array );
281  return shape;
282  }
283 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:218
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
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 203 of file FWGeometry.cc.

References 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().

204 {
205  std::vector<unsigned int> ids;
206  unsigned int mask = ( det << 4 ) | ( subdet );
207  for( IdToInfoItr it = m_idToInfo.begin(), itEnd = m_idToInfo.end();
208  it != itEnd; ++it )
209  {
210  if( FWGeometry::match_id( *it, mask ))
211  ids.push_back(( *it ).id );
212  }
213 
214  return ids;
215 }
bool match_id(const GeomDetInfo &o, unsigned int mask) const
Definition: FWGeometry.h:101
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
const TGeoMatrix * FWGeometry::getMatrix ( unsigned int  id) const

Definition at line 175 of file FWGeometry.cc.

References find(), fwLog, hcalTTPDigis_cfi::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().

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

Definition at line 302 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().

303 {
304  // reco geometry parameters
305  IdToInfoItr it = FWGeometry::find( id );
306  if( it == m_idToInfo.end())
307  {
308  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
309  return 0;
310  }
311  else
312  {
313  return ( *it ).parameters;
314  }
315 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
int FWGeometry::getProducerVersion ( ) const
inline

Definition at line 122 of file FWGeometry.h.

References getShape(), and m_producerVersion.

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

Definition at line 218 of file FWGeometry.cc.

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

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

219 {
220  IdToInfoItr it = FWGeometry::find( id );
221  if( it == m_idToInfo.end())
222  {
223  fwLog( fwlog::kWarning ) << "no reco geoemtry found for id " << id << std::endl;
224  return 0;
225  }
226  else
227  {
228  return getShape( *it );
229  }
230 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
TGeoShape * getShape(unsigned int id) const
Definition: FWGeometry.cc:218
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TGeoShape * FWGeometry::getShape ( const GeomDetInfo info) const

Definition at line 233 of file FWGeometry.cc.

References FWGeometry::GeomDetInfo::shape.

234 {
235  TEveGeoManagerHolder gmgr( TEveGeoShape::GetGeoMangeur());
236  TGeoShape* geoShape = 0;
237  if( info.shape[0] == 1 )
238  {
239  geoShape = new TGeoTrap(
240  info.shape[3], //dz
241  0, //theta
242  0, //phi
243  info.shape[4], //dy1
244  info.shape[1], //dx1
245  info.shape[2], //dx2
246  0, //alpha1
247  info.shape[4], //dy2
248  info.shape[1], //dx3
249  info.shape[2], //dx4
250  0); //alpha2
251  }
252  else
253  geoShape = new TGeoBBox( info.shape[1], info.shape[2], info.shape[3] );
254 
255  return geoShape;
256 }
static const TGPicture * info(bool iBackgroundIsBlack)
const float * FWGeometry::getShapePars ( unsigned int  id) const

Definition at line 318 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().

319 {
320  // reco geometry parameters
321  IdToInfoItr it = FWGeometry::find( id );
322  if( it == m_idToInfo.end())
323  {
324  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
325  return 0;
326  }
327  else
328  {
329  return ( *it ).shape;
330  }
331 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
void FWGeometry::initMap ( const FWRecoGeom::InfoMap map)

Definition at line 149 of file FWGeometry.cc.

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

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

150 {
151  FWRecoGeom::InfoMapItr begin = map.begin();
153  unsigned int mapSize = map.size();
154  if( m_idToInfo.size() != mapSize )
155  m_idToInfo.resize( mapSize );
156  unsigned int i = 0;
157  for( FWRecoGeom::InfoMapItr it = begin;
158  it != end; ++it, ++i )
159  {
160  m_idToInfo[i].id = it->id;
161  for( unsigned int j = 0; j < 24; ++j )
162  m_idToInfo[i].points[j] = it->points[j];
163  for( unsigned int j = 0; j < 9; ++j )
164  m_idToInfo[i].parameters[j] = it->topology[j];
165  for( unsigned int j = 0; j < 5; ++j )
166  m_idToInfo[i].shape[j] = it->shape[j];
167  for( unsigned int j = 0; j < 3; ++j )
168  m_idToInfo[i].translation[j] = it->translation[j];
169  for( unsigned int j = 0; j < 9; ++j )
170  m_idToInfo[i].matrix[j] = it->matrix[j];
171  }
172 }
std::vector< FWRecoGeom::Info >::const_iterator InfoMapItr
Definition: FWRecoGeom.h:28
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
void FWGeometry::loadMap ( const char *  fileName)

Definition at line 52 of file FWGeometry.cc.

References FWGeometry::VersionInfo::cmsswVersion, FWGeometry::VersionInfo::extraDetectors, FrontierConditions_GlobalTag_cff::file, findFile(), fwLog, mps_fire::i, hcalTTPDigis_cfi::id, fwlog::kInfo, PhysicsTools::loadMatrix(), m_idToInfo, m_producerVersion, m_versionInfo, makeMuonMisalignmentScenario::matrix, metProducer_cfi::parameters, callgraph::path, PixelPairStep_cff::points, FWGeometry::VersionInfo::productionTag, and ecaldqm::topology().

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

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

Definition at line 334 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().

335 {
336  IdToInfoItr it = FWGeometry::find( id );
337  if( it == m_idToInfo.end())
338  {
339  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
340  }
341  else
342  {
343  localToGlobal( *it, local, global, translatep );
344  }
345 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:334
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
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 348 of file FWGeometry.cc.

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

350 {
351  IdToInfoItr it = FWGeometry::find( id );
352  if( it == m_idToInfo.end())
353  {
354  fwLog( fwlog::kWarning ) << "no reco geometry found for id " << id << std::endl;
355  }
356  else
357  {
358  localToGlobal( *it, local1, global1, translatep );
359  localToGlobal( *it, local2, global2, translatep );
360  }
361 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:364
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:334
#define fwLog(_level_)
Definition: fwLog.h:50
IdToInfo m_idToInfo
Definition: FWGeometry.h:130
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 372 of file FWGeometry.cc.

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

373 {
374  for( int i = 0; i < 3; ++i )
375  {
376  global[i] = translatep ? info.translation[i] : 0;
377  global[i] += local[0] * info.matrix[3 * i]
378  + local[1] * info.matrix[3 * i + 1]
379  + local[2] * info.matrix[3 * i + 2];
380  }
381 }
static const TGPicture * info(bool iBackgroundIsBlack)
IdToInfoItr FWGeometry::mapEnd ( ) const
inline

Definition at line 114 of file FWGeometry.h.

References m_idToInfo.

Referenced by FWRPZViewGeometry::makeMuonGeometryRhoZ().

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

Definition at line 101 of file FWGeometry.h.

References FWGeometry::GeomDetInfo::id.

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

Member Data Documentation

const int FWGeometry::kDetOffset = 28
static

Definition at line 27 of file FWGeometry.h.

const int FWGeometry::kSubdetOffset = 25
static

Definition at line 28 of file FWGeometry.h.

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

Definition at line 128 of file FWGeometry.h.

Referenced by clear(), and getMatrix().

std::string FWGeometry::m_prodTag
private

Definition at line 132 of file FWGeometry.h.

int FWGeometry::m_producerVersion
private

Definition at line 136 of file FWGeometry.h.

Referenced by getProducerVersion(), and loadMap().

VersionInfo FWGeometry::m_versionInfo
private

Definition at line 134 of file FWGeometry.h.

Referenced by loadMap(), and versionInfo().