CMS 3D CMS Logo

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

#include <FastTimeGeometryLoader.h>

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< float > ParmVec
 

Public Member Functions

FastTimeGeometrybuild (const FastTimeTopology &)
 
 FastTimeGeometryLoader ()
 
 ~FastTimeGeometryLoader ()
 

Private Member Functions

void buildGeom (const ParmVec &, const HepGeom::Transform3D &, const DetId &, const FastTimeTopology &, FastTimeGeometry *)
 

Detailed Description

Definition at line 8 of file FastTimeGeometryLoader.h.

Member Typedef Documentation

Definition at line 10 of file FastTimeGeometryLoader.h.

typedef std::vector<float> FastTimeGeometryLoader::ParmVec

Definition at line 11 of file FastTimeGeometryLoader.h.

Constructor & Destructor Documentation

FastTimeGeometryLoader::FastTimeGeometryLoader ( )

Definition at line 13 of file FastTimeGeometryLoader.cc.

13 {}
FastTimeGeometryLoader::~FastTimeGeometryLoader ( )

Definition at line 14 of file FastTimeGeometryLoader.cc.

14 {}

Member Function Documentation

FastTimeGeometry * FastTimeGeometryLoader::build ( const FastTimeTopology topology)

Definition at line 16 of file FastTimeGeometryLoader.cc.

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), cms::cuda::assert(), buildGeom(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, counter, gather_cfg::cout, FastTimeTopology::dddConstants(), FastTimeTopology::detectorType(), relativeConstraints::geom, FastTimeDDDConstants::getRin(), FastTimeDDDConstants::getRout(), FastTimeDDDConstants::getZHalf(), FastTimeDDDConstants::getZPos(), FastTimeGeometry::k_NumberOfParametersPerShape, FastTimeGeometry::k_NumberOfShapes, submitPVValidationJobs::params, idealTransformation::rotation, FastTimeGeometry::sortDetIds(), FastTimeTopology::subDetector(), FastTimeTopology::totalGeomModules(), ecaldqm::zside(), and gpuVertexFinder::zv.

Referenced by FastTimeGeometryESProducer::produce().

16  {
17  // allocate geometry
18  FastTimeGeometry* geom = new FastTimeGeometry(topology);
19  unsigned int numberOfCells = topology.totalGeomModules(); // both sides
20  int detType = topology.detectorType();
21 #ifdef EDM_ML_DEBUG
22  std::cout << "Number of Cells " << numberOfCells << " for type " << detType << " of sub-detector "
23  << topology.subDetector() << " Shape parameters " << FastTimeGeometry::k_NumberOfShapes << ":"
25 #endif
26  geom->allocateCorners(numberOfCells);
28 
29  // loop over modules
31  unsigned int counter(0);
32 #ifdef EDM_ML_DEBUG
33  std::cout << "FastTimeGeometryLoader with # of transformation matrices " << numberOfCells << std::endl;
34 #endif
35  for (unsigned itr = 0; itr < numberOfCells; ++itr) {
36  int zside = (itr == 0) ? 1 : -1;
37 #ifdef EDM_ML_DEBUG
38  std::cout << "FastTimeGeometryLoader:: Z:Layer:Type " << zside << ":" << detType << std::endl;
39 #endif
40  double zv = zside * (topology.dddConstants().getZPos(detType));
41  const CLHEP::HepRep3x3 rotation =
42  (zside > 0) ? CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, 1) : CLHEP::HepRep3x3(-1, 0, 0, 0, 1, 0, 0, 0, -1);
43  const CLHEP::HepRotation hr(rotation);
44  const CLHEP::Hep3Vector h3v(0, 0, zv);
45  const HepGeom::Transform3D ht3d(hr, h3v);
46  DetId detId = (DetId)(FastTimeDetId(detType, 0, 0, zside));
47 #ifdef EDM_ML_DEBUG
48  std::cout << "FastTimeGeometryLoader:: transf " << ht3d.getTranslation() << " and " << ht3d.getRotation();
49 #endif
50  params[0] = topology.dddConstants().getZHalf(detType);
51  params[1] = params[2] = 0;
52  params[3] = params[7] = topology.dddConstants().getRin(detType);
53  params[4] = params[8] = topology.dddConstants().getRout(detType);
54  params[5] = params[9] = topology.dddConstants().getRout(detType);
55  params[6] = params[10] = 0;
56  params[11] = zside;
57  buildGeom(params, ht3d, detId, topology, geom);
58  counter++;
59  }
60 
61  geom->sortDetIds();
62 
63  if (counter != numberOfCells) {
64  std::cerr << "inconsistent # of cells: expected " << numberOfCells << " , inited " << counter << std::endl;
65  assert(counter == numberOfCells);
66  }
67 
68  return geom;
69 }
double getZPos(int type) const
unsigned int totalGeomModules() const
ForwardSubdetector subDetector() const
float *__restrict__ zv
std::vector< float > ParmVec
int detectorType() const
int zside(DetId const &)
assert(be >=bs)
void allocatePar(ParVec::size_type n, unsigned int m)
void buildGeom(const ParmVec &, const HepGeom::Transform3D &, const DetId &, const FastTimeTopology &, FastTimeGeometry *)
Definition: DetId.h:17
double getRin(int type) const
double getRout(int type) const
static std::atomic< unsigned int > counter
double getZHalf(int type) const
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
tuple cout
Definition: gather_cfg.py:144
const FastTimeDDDConstants & dddConstants() const
void FastTimeGeometryLoader::buildGeom ( const ParmVec params,
const HepGeom::Transform3D &  ht3d,
const DetId detId,
const FastTimeTopology topology,
FastTimeGeometry geom 
)
private

Definition at line 71 of file FastTimeGeometryLoader.cc.

References gather_cfg::cout, FlatTrd::createCorners(), FastTimeTopology::dddConstants(), FastTimeDDDConstants::getCorners(), CaloCellGeometry::getParmPtr(), mps_fire::i, PV3DBase< T, PVType, FrameType >::mag2(), FastTimeGeometry::newCell(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), std::swap(), x, y, z, and ecaldqm::zside().

Referenced by build().

75  {
76 #ifdef EDM_ML_DEBUG
77  std::cout << "Volume Parameters";
78  for (unsigned int i = 0; i < 12; ++i)
79  std::cout << " : " << params[i];
80  std::cout << std::endl;
81 #endif
82  FastTimeDetId id = FastTimeDetId(detId);
83  std::vector<GlobalPoint> corners = topology.dddConstants().getCorners(id.type(), 1, 1, id.zside());
84 
85  FlatTrd::createCorners(params, ht3d, corners);
86 
87  const CCGFloat* parmPtr(CaloCellGeometry::getParmPtr(params, geom->parMgr(), geom->parVecVec()));
88 
89  GlobalPoint front(0.25 * (corners[0].x() + corners[1].x() + corners[2].x() + corners[3].x()),
90  0.25 * (corners[0].y() + corners[1].y() + corners[2].y() + corners[3].y()),
91  0.25 * (corners[0].z() + corners[1].z() + corners[2].z() + corners[3].z()));
92 
93  GlobalPoint back(0.25 * (corners[4].x() + corners[5].x() + corners[6].x() + corners[7].x()),
94  0.25 * (corners[4].y() + corners[5].y() + corners[6].y() + corners[7].y()),
95  0.25 * (corners[4].z() + corners[5].z() + corners[6].z() + corners[7].z()));
96 
97  if (front.mag2() > back.mag2()) { // front should always point to the center, so swap front and back
98  std::swap(front, back);
99  std::swap_ranges(corners.begin(), corners.begin() + 4, corners.begin() + 4);
100  }
101 
102  geom->newCell(front, back, corners[0], parmPtr, detId);
103 }
int zside(DetId const &)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
std::vector< GlobalPoint > getCorners(int type, int izeta, int iphi, int zside) const
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatTrd.cc:133
tuple cout
Definition: gather_cfg.py:144
const FastTimeDDDConstants & dddConstants() const