CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
FWTGeoRecoGeometryESProducer.cc File Reference
#include "Fireworks/Geometry/interface/FWTGeoRecoGeometryESProducer.h"
#include "Fireworks/Geometry/interface/FWTGeoRecoGeometry.h"
#include "Fireworks/Geometry/interface/FWTGeoRecoGeometryRecord.h"
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
#include "DataFormats/SiStripDetId/interface/TIBDetId.h"
#include "DataFormats/SiStripDetId/interface/TIDDetId.h"
#include "DataFormats/SiStripDetId/interface/TOBDetId.h"
#include "DataFormats/SiStripDetId/interface/TECDetId.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
#include "DataFormats/MuonDetId/interface/GEMDetId.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "Geometry/DTGeometry/interface/DTGeometry.h"
#include "Geometry/CSCGeometry/interface/CSCChamber.h"
#include "Geometry/CSCGeometry/interface/CSCLayer.h"
#include "Geometry/DTGeometry/interface/DTChamber.h"
#include "Geometry/DTGeometry/interface/DTLayer.h"
#include "Geometry/RPCGeometry/interface/RPCGeometry.h"
#include "Geometry/GEMGeometry/interface/GEMEtaPartition.h"
#include "Geometry/GEMGeometry/interface/GEMGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
#include "Geometry/CommonTopologies/interface/StripTopology.h"
#include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
#include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
#include "Geometry/CaloGeometry/interface/IdealZPrism.h"
#include "Geometry/CaloGeometry/interface/IdealObliquePrism.h"
#include "Geometry/CaloGeometry/interface/TruncatedPyramid.h"
#include "TGeoManager.h"
#include "TGeoArb8.h"
#include "TGeoMatrix.h"
#include "TFile.h"
#include "TTree.h"
#include "TError.h"
#include "TMath.h"
#include "TEveVector.h"
#include "TEveTrans.h"

Go to the source code of this file.

Functions

TGeoHMatrix * getEcalTrans (CaloCellGeometry::CornersVec const &gc)
 
TGeoShape * makeEcalShape (const TruncatedPyramid *cell)
 

Function Documentation

TGeoHMatrix* getEcalTrans ( CaloCellGeometry::CornersVec const &  gc)

Definition at line 962 of file FWTGeoRecoGeometryESProducer.cc.

References i, dbtoconf::out, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by FWTGeoRecoGeometryESProducer::addEcalCaloGeometry().

963 {
964 
965  TEveVector gCenter;
966  for (int i = 0; i < 8; ++i)
967  gCenter += TEveVector(gc[i].x(), gc[i].y(), gc[i].z());
968  gCenter *= 0.125;
969 
970  TEveVector tgCenter; // top center 4 corners
971  for (int i = 4; i < 8; ++i)
972  tgCenter += TEveVector(gc[i].x(), gc[i].y(), gc[i].z());
973  tgCenter *= 0.25;
974 
975 
976  TEveVector axis = tgCenter - gCenter;
977  axis.Normalize();
978 
979  TEveTrans tr;
980  TVector3 v1t;
981  tr.GetBaseVec(1, v1t);
982 
983 
984  TEveVector v1(v1t.x(), v1t.y(), v1t.z());
985  double dot13 = axis.Dot(v1);
986  TEveVector gd = axis;
987  gd*= dot13;
988  v1 -= gd;
989  v1.Normalize();
990  TEveVector v2;
991  TMath::Cross(v1.Arr(), axis.Arr(), v2.Arr());
992  TMath::Cross(axis.Arr(), v1.Arr(), v2.Arr());
993  v2.Normalize();
994 
995  tr.SetBaseVec(1, v1.fX, v1.fY, v1.fZ);
996  tr.SetBaseVec(2, v2.fX, v2.fY, v2.fZ);
997  tr.SetBaseVec(3, axis.fX, axis.fY, axis.fZ);
998  tr.Move3PF(gCenter.fX, gCenter.fY, gCenter.fZ);
999 
1000  TGeoHMatrix* out = new TGeoHMatrix();
1001  tr.SetGeoHMatrix(*out);
1002  return out;
1003 }
int i
Definition: DBlmapReader.cc:9
float float float z
tuple out
Definition: dbtoconf.py:99
Definition: DDAxes.h:10
TGeoShape* makeEcalShape ( const TruncatedPyramid cell)

Definition at line 1005 of file FWTGeoRecoGeometryESProducer.cc.

References trackerHits::c.

Referenced by FWTGeoRecoGeometryESProducer::addEcalCaloGeometry().

1006 {
1007  // printf("BEGIN EE SHAPE --------------------------------\n");
1008  // std::cout << detid << std::endl;
1009  const HepGeom::Transform3D idtr;
1012  TruncatedPyramid::localCorners( co, cell->param(), ref);
1013  //for( int c = 0; c < 8; ++c)
1014  // printf("lc.push_back(TEveVector(%.4f, %.4f, %.4f));\n", co[c].x(),co[c].y(),co[c].z() );
1015 
1016  double points[16];
1017  for( int c = 0; c < 8; ++c )
1018  {
1019  points[c*2 ] = co[c].x();
1020  points[c*2+1] = co[c].y();
1021  }
1022  TGeoShape* solid = new TGeoArb8(cell->param()[0], points);
1023  return solid;
1024 }
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec