CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< CaloSubdetectorGeometry
load (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

Id:
EcalTBHodoscopeGeometryLoaderFromDDD.h,v 1.3 2011/06/03 19:20:55 heltsley Exp
Author
P. Meridiani - INFN Roma 1

Definition at line 24 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Constructor & Destructor Documentation

EcalTBHodoscopeGeometryLoaderFromDDD::EcalTBHodoscopeGeometryLoaderFromDDD ( )
inline

Definition at line 28 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

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

Definition at line 30 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

30 {} ;

Member Function Documentation

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

Referenced by makeGeometry().

DDFilter * EcalTBHodoscopeGeometryLoaderFromDDD::getDDFilter ( )
private

Definition at line 133 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

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

Referenced by makeGeometry().

134 {
136 
137  filter->setCriteria( DDValue( "SensitiveDetector",
138  "EcalTBH4BeamDetector",
139  0 ),
142  true,
143  true ) ;
144 
145  filter->setCriteria( DDValue( "ReadOutName",
146  "EcalTBH4BeamHits",
147  0 ),
150  true,
151  true ) ;
152  return filter;
153 }
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:285
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:37
unsigned int EcalTBHodoscopeGeometryLoaderFromDDD::getDetIdForDDDNode ( const DDFilteredView fv)
private

Definition at line 112 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

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

Referenced by makeGeometry().

114 {
115  // perform some consistency checks
116  // get the parents and grandparents of this node
118 
119  assert(parents.size() >= 3);
120 
121  EcalBaseNumber baseNumber;
122  //baseNumber.setSize(parents.size());
123 
124  for( unsigned int i=1 ;i <= parents.size(); i++)
125  {
126  baseNumber.addLevel( parents[ parents.size() - i ].logicalPart().name().name(),
127  parents[ parents.size() - i ].copyno() ) ;
128  }
129 
130  return _scheme.getUnitID( baseNumber ) ;
131 }
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
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 21 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

References gather_cfg::cout, and makeGeometry().

Referenced by EcalTBHodoscopeGeometryEP::produce().

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

Definition at line 36 of file EcalTBHodoscopeGeometryLoaderFromDDD.cc.

References DDFilteredView::addFilter(), CaloSubdetectorGeometry::allocateCorners(), CaloSubdetectorGeometry::allocatePar(), submit::answer, CaloSubdetectorGeometry::cornersMgr(), ddbox, edm::hlt::Exception, alcazmumu_cfi::filter, DDFilteredView::firstChild(), getDDDString(), getDDFilter(), getDetIdForDDDNode(), CaloCellGeometry::getParmPtr(), i, CaloCellGeometry::k_ScaleFromDDDtoGeant, CaloTowerDetId::kSizeForDenseIndexing, DDFilteredView::logicalPart(), CaloSubdetectorGeometry::newCell(), DDFilteredView::nextSibling(), DDSolid::parameters(), CaloSubdetectorGeometry::parMgr(), CaloSubdetectorGeometry::parVecVec(), DDFilteredView::rotation(), DDSolid::shape(), DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by load().

39 {
41  if( ebg->parMgr() == 0 ) ebg->allocatePar( 10, 3 ) ;
42 
44 
45  DDFilteredView fv(*cpv);
46  fv.addFilter(*filter);
47 
48  bool doSubDets;
49  for (doSubDets = fv.firstChild(); doSubDets ; doSubDets = fv.nextSibling())
50  {
51 
52 #if 0
53  std::string answer = getDDDString("ReadOutName",&fv);
54  if (answer != "EcalTBH4BeamHits")
55  continue;
56 #endif
57 
58  const DDSolid & solid = fv.logicalPart().solid();
59 
60  if( solid.shape() != ddbox )
61  {
62  throw cms::Exception("DDException") << std::string(__FILE__)
63  << "\n CaloGeometryEcalTBHodoscope::upDate(...): currently only box fiber shapes supported ";
64  edm::LogWarning("EcalTBHodoscopeGeometry") << "Wrong shape for sensitive volume!" << solid;
65  }
66 
67  std::vector<double> pv = solid.parameters();
68 
69  // use preshower strip as box in space representation
70 
71  // rotate the box and then move it
72  DD3Vector x, y, z;
73  fv.rotation().GetComponents(x,y,z);
74  CLHEP::Hep3Vector hx(x.X(), x.Y(), x.Z());
75  CLHEP::Hep3Vector hy(y.X(), y.Y(), y.Z());
76  CLHEP::Hep3Vector hz(z.X(), z.Y(), z.Z());
77  CLHEP::HepRotation hrot(hx, hy, hz);
78  CLHEP::Hep3Vector htran ( fv.translation().X(),
79  fv.translation().Y(),
80  fv.translation().Z() );
81 
82  const HepGeom::Transform3D ht3d ( hrot, // only scale translation
84 
85  const HepGeom::Point3D<float> ctr (
86  ht3d*HepGeom::Point3D<float> (0,0,0) ) ;
87 
88  const GlobalPoint refPoint ( ctr.x(), ctr.y(), ctr.z() ) ;
89 
90  std::vector<CCGFloat> vv ;
91  vv.reserve( pv.size() + 1 ) ;
92  for( unsigned int i ( 0 ) ; i != pv.size() ; ++i )
93  {
94  vv.push_back( CaloCellGeometry::k_ScaleFromDDDtoGeant*pv[i] ) ;
95  }
96  vv.push_back( 0. ) ; // tilt=0 here
97  const CCGFloat* pP ( CaloCellGeometry::getParmPtr( vv,
98  ebg->parMgr(),
99  ebg->parVecVec() ) ) ;
100 
101  const DetId detId ( getDetIdForDDDNode(fv) ) ;
102 
103  //Adding cell to the Geometry
104 
105  ebg->newCell( refPoint, refPoint, refPoint,
106  pP,
107  detId ) ;
108  } // loop over all children
109 }
answer
Definition: submit.py:44
int i
Definition: DBlmapReader.cc:9
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
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)
float float float z
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
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
CaloCellGeometry::CCGFloat CCGFloat
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:144
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
static const CCGFloat k_ScaleFromDDDtoGeant
Definition: DetId.h:20
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:18
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
Definition: DDAxes.h:10

Member Data Documentation

EcalHodoscopeNumberingScheme EcalTBHodoscopeGeometryLoaderFromDDD::_scheme
private

Definition at line 45 of file EcalTBHodoscopeGeometryLoaderFromDDD.h.

Referenced by getDetIdForDDDNode().