CMS 3D CMS Logo

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

◆ CCGFloat

Definition at line 10 of file FastTimeGeometryLoader.h.

◆ ParmVec

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

Definition at line 11 of file FastTimeGeometryLoader.h.

Constructor & Destructor Documentation

◆ FastTimeGeometryLoader()

FastTimeGeometryLoader::FastTimeGeometryLoader ( )

Definition at line 13 of file FastTimeGeometryLoader.cc.

13 {}

◆ ~FastTimeGeometryLoader()

FastTimeGeometryLoader::~FastTimeGeometryLoader ( )

Definition at line 14 of file FastTimeGeometryLoader.cc.

14 {}

Member Function Documentation

◆ build()

FastTimeGeometry * FastTimeGeometryLoader::build ( const FastTimeTopology topology)

Definition at line 16 of file FastTimeGeometryLoader.cc.

16  {
17  // allocate geometry
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 }

References cms::cuda::assert(), buildGeom(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, counter, gather_cfg::cout, relativeConstraints::geom, FastTimeGeometry::k_NumberOfParametersPerShape, FastTimeGeometry::k_NumberOfShapes, CalibrationSummaryClient_cfi::params, idealTransformation::rotation, ecaldqm::topology(), and ecaldqm::zside().

Referenced by FastTimeGeometryESProducer::produce().

◆ buildGeom()

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.

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 }

References gather_cfg::cout, FlatTrd::createCorners(), relativeConstraints::geom, CaloCellGeometry::getParmPtr(), mps_fire::i, PV3DBase< T, PVType, FrameType >::mag2(), CalibrationSummaryClient_cfi::params, std::swap(), ecaldqm::topology(), x, y, z, and ecaldqm::zside().

Referenced by build().

FlatTrd::createCorners
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatTrd.cc:133
counter
Definition: counter.py:1
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FastTimeGeometry::k_NumberOfParametersPerShape
Definition: FastTimeGeometry.h:38
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
cms::cuda::assert
assert(be >=bs)
DDAxes::x
ParmVec
std::vector< float > ParmVec
Definition: FastTimeGeometry.cc:13
DetId
Definition: DetId.h:17
FastTimeGeometry::k_NumberOfShapes
Definition: FastTimeGeometry.h:39
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
ecaldqm::topology
const CaloTopology * topology(nullptr)
DDAxes::z
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, GlobalTag >
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
FastTimeGeometry
Definition: FastTimeGeometry.h:24
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:17
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
FastTimeGeometryLoader::buildGeom
void buildGeom(const ParmVec &, const HepGeom::Transform3D &, const DetId &, const FastTimeTopology &, FastTimeGeometry *)
Definition: FastTimeGeometryLoader.cc:71
FastTimeDetId
Definition: FastTimeDetId.h:8
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8