CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTBHodoscopeGeometryLoaderFromDDD Class Reference

#include <EcalTBHodoscopeGeometryLoaderFromDDD.h>

Public Member Functions

 EcalTBHodoscopeGeometryLoaderFromDDD ()
 
std::unique_ptr< CaloSubdetectorGeometryload (const DDCompactView *cpv)
 
virtual ~EcalTBHodoscopeGeometryLoaderFromDDD ()
 

Private Member Functions

std::string getDDDString (std::string s, DDFilteredView *fv)
 
DDFiltergetDDFilter ()
 
unsigned int getDetIdForDDDNode (const DDFilteredView &fv)
 
void makeGeometry (const DDCompactView *cpv, CaloSubdetectorGeometry *ebg)
 

Private Attributes

EcalHodoscopeNumberingScheme _scheme
 

Detailed Description

Author
P. Meridiani - INFN Roma 1

Definition at line 22 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Constructor & Destructor Documentation

◆ EcalTBHodoscopeGeometryLoaderFromDDD()

EcalTBHodoscopeGeometryLoaderFromDDD::EcalTBHodoscopeGeometryLoaderFromDDD ( )
inline

Definition at line 24 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

24 {};

◆ ~EcalTBHodoscopeGeometryLoaderFromDDD()

virtual EcalTBHodoscopeGeometryLoaderFromDDD::~EcalTBHodoscopeGeometryLoaderFromDDD ( )
inlinevirtual

Definition at line 26 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

26 {};

Member Function Documentation

◆ getDDDString()

std::string EcalTBHodoscopeGeometryLoaderFromDDD::getDDDString ( std::string  s,
DDFilteredView fv 
)
private

Referenced by makeGeometry().

◆ getDDFilter()

DDFilter * EcalTBHodoscopeGeometryLoaderFromDDD::getDDFilter ( )
private

Definition at line 113 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

113  {
115  DDSpecificsMatchesValueFilter{DDValue("SensitiveDetector", "EcalTBH4BeamDetector", 0)},
116  DDSpecificsMatchesValueFilter{DDValue("ReadOutName", "EcalTBH4BeamHits", 0)});
117 }

Referenced by makeGeometry().

◆ getDetIdForDDDNode()

unsigned int EcalTBHodoscopeGeometryLoaderFromDDD::getDetIdForDDDNode ( const DDFilteredView fv)
private

Definition at line 96 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

96  {
97  // perform some consistency checks
98  // get the parents and grandparents of this node
100 
101  assert(parents.size() >= 3);
102 
103  EcalBaseNumber baseNumber;
104  //baseNumber.setSize(parents.size());
105 
106  for (unsigned int i = 1; i <= parents.size(); i++) {
107  baseNumber.addLevel(parents[parents.size() - i].logicalPart().name().name(), parents[parents.size() - i].copyno());
108  }
109 
110  return _scheme.getUnitID(baseNumber);
111 }

References _scheme, EcalBaseNumber::addLevel(), cms::cuda::assert(), DDFilteredView::geoHistory(), EcalHodoscopeNumberingScheme::getUnitID(), mps_fire::i, and parents.

Referenced by makeGeometry().

◆ load()

std::unique_ptr< CaloSubdetectorGeometry > EcalTBHodoscopeGeometryLoaderFromDDD::load ( const DDCompactView cpv)

Definition at line 21 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

21  {
22  std::cout << "[EcalTBHodoscopeGeometryLoaderFromDDD]:: start the construction of EcalTBHodoscope" << std::endl;
23 
24  std::unique_ptr<CaloSubdetectorGeometry> ebg(new EcalTBHodoscopeGeometry());
25 
26  makeGeometry(cpv, ebg.get());
27 
28  std::cout << "[EcalTBHodoscopeGeometryLoaderFromDDD]:: Returning EcalTBHodoscopeGeometry" << std::endl;
29 
30  return ebg;
31 }

References gather_cfg::cout, and makeGeometry().

Referenced by EcalTBHodoscopeGeometryEP::produce().

◆ makeGeometry()

void EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry ( const DDCompactView cpv,
CaloSubdetectorGeometry ebg 
)
private

Definition at line 33 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

33  {
34  if (ebg->cornersMgr() == nullptr)
36  if (ebg->parMgr() == nullptr)
37  ebg->allocatePar(10, 3);
38 
39  std::unique_ptr<DDFilter> filter{getDDFilter()};
40 
41  DDFilteredView fv(*cpv, *filter);
42 
43  bool doSubDets;
44  for (doSubDets = fv.firstChild(); doSubDets; doSubDets = fv.nextSibling()) {
45 #if 0
46  std::string answer = getDDDString("ReadOutName",&fv);
47  if (answer != "EcalTBH4BeamHits")
48  continue;
49 #endif
50 
51  const DDSolid& solid = fv.logicalPart().solid();
52 
53  if (solid.shape() != DDSolidShape::ddbox) {
54  throw cms::Exception("DDException")
55  << std::string(__FILE__)
56  << "\n CaloGeometryEcalTBHodoscope::upDate(...): currently only box fiber shapes supported ";
57  edm::LogWarning("EcalTBHodoscopeGeometry") << "Wrong shape for sensitive volume!" << solid;
58  }
59 
60  std::vector<double> pv = solid.parameters();
61 
62  // use preshower strip as box in space representation
63 
64  // rotate the box and then move it
65  DD3Vector x, y, z;
66  fv.rotation().GetComponents(x, y, z);
67  CLHEP::Hep3Vector hx(x.X(), x.Y(), x.Z());
68  CLHEP::Hep3Vector hy(y.X(), y.Y(), y.Z());
69  CLHEP::Hep3Vector hz(z.X(), z.Y(), z.Z());
70  CLHEP::HepRotation hrot(hx, hy, hz);
71  CLHEP::Hep3Vector htran(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
72 
73  const HepGeom::Transform3D ht3d(hrot, // only scale translation
75 
76  const HepGeom::Point3D<float> ctr(ht3d * HepGeom::Point3D<float>(0, 0, 0));
77 
78  const GlobalPoint refPoint(ctr.x(), ctr.y(), ctr.z());
79 
80  std::vector<CCGFloat> vv;
81  vv.reserve(pv.size() + 1);
82  for (unsigned int i(0); i != pv.size(); ++i) {
83  vv.emplace_back(CaloCellGeometry::k_ScaleFromDDDtoGeant * pv[i]);
84  }
85  vv.emplace_back(0.); // tilt=0 here
86  const CCGFloat* pP(CaloCellGeometry::getParmPtr(vv, ebg->parMgr(), ebg->parVecVec()));
87 
88  const DetId detId(getDetIdForDDDNode(fv));
89 
90  //Adding cell to the Geometry
91 
92  ebg->newCell(refPoint, refPoint, refPoint, pP, detId);
93  } // loop over all children
94 }

References CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), submit::answer, CaloSubdetectorGeometry::cornersMgr(), dqmiodatasetharvest::ctr, ddbox, Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), getDDDString(), getDDFilter(), getDetIdForDDDNode(), CaloCellGeometry::getParmPtr(), mps_fire::i, CaloCellGeometry::k_ScaleFromDDDtoGeant, EBDetId::kSizeForDenseIndexing, DDFilteredView::logicalPart(), CaloSubdetectorGeometry::newCell(), DDFilteredView::nextSibling(), DDSolid::parameters(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), MetAnalyzer::pv(), DDFilteredView::rotation(), DDSolid::shape(), DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), x, y, and z.

Referenced by load().

Member Data Documentation

◆ _scheme

EcalHodoscopeNumberingScheme EcalTBHodoscopeGeometryLoaderFromDDD::_scheme
private

Definition at line 39 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Referenced by getDetIdForDDDNode().

DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
DDGeoHistory
std::vector< DDExpandedNode > DDGeoHistory
Geometrical 'path' of the current node up to the root-node.
Definition: DDExpandedNode.h:82
EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry
void makeGeometry(const DDCompactView *cpv, CaloSubdetectorGeometry *ebg)
Definition: EcalTBHodoscopeGeometryLoaderFromDDD.cc:33
EcalTBHodoscopeGeometry
Definition: EcalTBHodoscopeGeometry.h:9
DDAndFilter
Definition: DDFilter.h:81
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
EcalBaseNumber::addLevel
void addLevel(const std::string &name, const int &copyNumber)
Definition: EcalBaseNumber.cc:16
cms::cuda::assert
assert(be >=bs)
CaloSubdetectorGeometry::newCell
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
EcalBaseNumber
Definition: EcalBaseNumber.h:12
EcalTBHodoscopeGeometryLoaderFromDDD::_scheme
EcalHodoscopeNumberingScheme _scheme
Definition: EcalTBHodoscopeGeometryLoaderFromDDD.h:39
DDAxes::x
CaloSubdetectorGeometry::allocatePar
void allocatePar(ParVec::size_type n, unsigned int m)
Definition: CaloSubdetectorGeometry.cc:113
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DetId
Definition: DetId.h:17
DDSolid::shape
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:119
DDAxes::z
EcalHodoscopeNumberingScheme::getUnitID
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
Definition: EcalHodoscopeNumberingScheme.cc:19
Point3DBase< float, GlobalTag >
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
submit.answer
answer
Definition: submit.py:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Definition: PGeometricDetBuilder.cc:19
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
EcalTBHodoscopeGeometryLoaderFromDDD::getDDFilter
DDFilter * getDDFilter()
Definition: EcalTBHodoscopeGeometryLoaderFromDDD.cc:113
DDFilteredView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDFilteredView.cc:30
CaloSubdetectorGeometry::cornersMgr
CaloCellGeometry::CornersMgr * cornersMgr()
Definition: CaloSubdetectorGeometry.h:82
DDSolidShape::ddbox
DDValue
Definition: DDValue.h:21
Exception
Definition: hltDiff.cc:245
CaloCellGeometry::k_ScaleFromDDDtoGeant
static const CCGFloat k_ScaleFromDDDtoGeant
Definition: CaloCellGeometry.h:68
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
EBDetId::kSizeForDenseIndexing
Definition: EBDetId.h:155
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
CaloSubdetectorGeometry::parMgr
ParMgr * parMgr()
Definition: CaloSubdetectorGeometry.h:86
EcalTBHodoscopeGeometryLoaderFromDDD::getDetIdForDDDNode
unsigned int getDetIdForDDDNode(const DDFilteredView &fv)
Definition: EcalTBHodoscopeGeometryLoaderFromDDD.cc:96
DDFilteredView
Definition: DDFilteredView.h:20
CaloSubdetectorGeometry::allocateCorners
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
Definition: CaloSubdetectorGeometry.cc:106
parents
TPRegexp parents
Definition: eve_filter.cc:21
CaloSubdetectorGeometry::parVecVec
ParVecVec & parVecVec()
Definition: CaloSubdetectorGeometry.h:89
EcalTBHodoscopeGeometryLoaderFromDDD::getDDDString
std::string getDDDString(std::string s, DDFilteredView *fv)