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::auto_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 23 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Constructor & Destructor Documentation

EcalTBHodoscopeGeometryLoaderFromDDD::EcalTBHodoscopeGeometryLoaderFromDDD ( )
inline

Definition at line 27 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

27 {} ;
virtual EcalTBHodoscopeGeometryLoaderFromDDD::~EcalTBHodoscopeGeometryLoaderFromDDD ( )
inlinevirtual

Member Function Documentation

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

Definition at line 132 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

References AND, equals, ALCARECOTkAlBeamHalo_cff::filter, and DDSpecificsFilter::setCriteria().

Referenced by makeGeometry(), and ~EcalTBHodoscopeGeometryLoaderFromDDD().

133 {
135 
136  filter->setCriteria( DDValue( "SensitiveDetector",
137  "EcalTBH4BeamDetector",
138  0 ),
140  DDLogOp::AND,
141  true,
142  true ) ;
143 
144  filter->setCriteria( DDValue( "ReadOutName",
145  "EcalTBH4BeamHits",
146  0 ),
148  DDLogOp::AND,
149  true,
150  true ) ;
151  return filter;
152 }
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:253
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:33
unsigned int EcalTBHodoscopeGeometryLoaderFromDDD::getDetIdForDDDNode ( const DDFilteredView fv)
private

Definition at line 111 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

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

Referenced by makeGeometry(), and ~EcalTBHodoscopeGeometryLoaderFromDDD().

113 {
114  // perform some consistency checks
115  // get the parents and grandparents of this node
117 
118  assert(parents.size() >= 3);
119 
120  EcalBaseNumber baseNumber;
121  //baseNumber.setSize(parents.size());
122 
123  for( unsigned int i=1 ;i <= parents.size(); i++)
124  {
125  baseNumber.addLevel( parents[ parents.size() - i ].logicalPart().name().name(),
126  parents[ parents.size() - i ].copyno() ) ;
127  }
128 
129  return _scheme.getUnitID( baseNumber ) ;
130 }
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:21
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void addLevel(const std::string &name, const int &copyNumber)
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const
std::auto_ptr< CaloSubdetectorGeometry > EcalTBHodoscopeGeometryLoaderFromDDD::load ( const DDCompactView cpv)

Definition at line 20 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

References gather_cfg::cout, and makeGeometry().

Referenced by EcalTBHodoscopeGeometryEP::produce(), and ~EcalTBHodoscopeGeometryLoaderFromDDD().

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

Definition at line 35 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

References DDFilteredView::addFilter(), CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), submit::answer, CaloSubdetectorGeometry::cornersMgr(), ddbox, Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), getDDDString(), getDDFilter(), getDetIdForDDDNode(), CaloCellGeometry::getParmPtr(), 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(), and ~EcalTBHodoscopeGeometryLoaderFromDDD().

38 {
40  if( ebg->parMgr() == 0 ) ebg->allocatePar( 10, 3 ) ;
41 
43 
44  DDFilteredView fv(*cpv);
45  fv.addFilter(*filter);
46 
47  bool doSubDets;
48  for (doSubDets = fv.firstChild(); doSubDets ; doSubDets = fv.nextSibling())
49  {
50 
51 #if 0
52  std::string answer = getDDDString("ReadOutName",&fv);
53  if (answer != "EcalTBH4BeamHits")
54  continue;
55 #endif
56 
57  const DDSolid & solid = fv.logicalPart().solid();
58 
59  if( solid.shape() != ddbox )
60  {
61  throw cms::Exception("DDException") << std::string(__FILE__)
62  << "\n CaloGeometryEcalTBHodoscope::upDate(...): currently only box fiber shapes supported ";
63  edm::LogWarning("EcalTBHodoscopeGeometry") << "Wrong shape for sensitive volume!" << solid;
64  }
65 
66  std::vector<double> pv = solid.parameters();
67 
68  // use preshower strip as box in space representation
69 
70  // rotate the box and then move it
71  DD3Vector x, y, z;
72  fv.rotation().GetComponents(x,y,z);
73  CLHEP::Hep3Vector hx(x.X(), x.Y(), x.Z());
74  CLHEP::Hep3Vector hy(y.X(), y.Y(), y.Z());
75  CLHEP::Hep3Vector hz(z.X(), z.Y(), z.Z());
76  CLHEP::HepRotation hrot(hx, hy, hz);
77  CLHEP::Hep3Vector htran ( fv.translation().X(),
78  fv.translation().Y(),
79  fv.translation().Z() );
80 
81  const HepGeom::Transform3D ht3d ( hrot, // only scale translation
83 
84  const HepGeom::Point3D<float> ctr (
85  ht3d*HepGeom::Point3D<float> (0,0,0) ) ;
86 
87  const GlobalPoint refPoint ( ctr.x(), ctr.y(), ctr.z() ) ;
88 
89  std::vector<CCGFloat> vv ;
90  vv.reserve( pv.size() + 1 ) ;
91  for( unsigned int i ( 0 ) ; i != pv.size() ; ++i )
92  {
93  vv.push_back( CaloCellGeometry::k_ScaleFromDDDtoGeant*pv[i] ) ;
94  }
95  vv.push_back( 0. ) ; // tilt=0 here
96  const CCGFloat* pP ( CaloCellGeometry::getParmPtr( vv,
97  ebg->parMgr(),
98  ebg->parVecVec() ) ) ;
99 
100  const DetId detId ( getDetIdForDDDNode(fv) ) ;
101 
102  //Adding cell to the Geometry
103 
104  ebg->newCell( refPoint, refPoint, refPoint,
105  pP,
106  detId ) ;
107  } // loop over all children
108 }
int i
Definition: DBlmapReader.cc:9
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:157
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
void allocatePar(ParVec::size_type n, unsigned int m)
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
std::string getDDDString(std::string s, DDFilteredView *fv)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
def pv(vc)
Definition: MetAnalyzer.py:6
CaloCellGeometry::CCGFloat CCGFloat
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:151
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
static const CCGFloat k_ScaleFromDDDtoGeant
Definition: DetId.h:18
CaloCellGeometry::CornersMgr * cornersMgr()
unsigned int getDetIdForDDDNode(const DDFilteredView &fv)
A Filter accepts or rejects a DDExpandedNode based on a user-coded decision rule. ...
Definition: DDFilter.h:19
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
answer
Definition: submit.py:44

Member Data Documentation

EcalHodoscopeNumberingScheme EcalTBHodoscopeGeometryLoaderFromDDD::_scheme
private

Definition at line 44 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Referenced by getDetIdForDDDNode().