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
RPCGeometryParsFromDD Class Reference

#include <RPCGeometryParsFromDD.h>

Public Member Functions

void build (const DDCompactView *cview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 RPCGeometryParsFromDD ()
 
 ~RPCGeometryParsFromDD ()
 

Private Member Functions

void buildGeometry (DDFilteredView &fview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
 

Detailed Description

Build the RPCGeometry ftom the DDD description

Author
Port of: MuDDDRPCBuilder, MuonRPCGeometryBuilder (ORCA)
M. Maggi - INFN Bari

Definition at line 22 of file RPCGeometryParsFromDD.h.

Constructor & Destructor Documentation

RPCGeometryParsFromDD::RPCGeometryParsFromDD ( )

Implementation of the RPC Geometry Builder from DDD

Author
Port of: MuDDDRPCBuilder (ORCA)
M. Maggi - INFN Bari

Definition at line 25 of file RPCGeometryParsFromDD.cc.

26 { }
RPCGeometryParsFromDD::~RPCGeometryParsFromDD ( )

Definition at line 28 of file RPCGeometryParsFromDD.cc.

29 { }

Member Function Documentation

void RPCGeometryParsFromDD::build ( const DDCompactView cview,
const MuonDDDConstants muonConstants,
RecoIdealGeometry rgeo 
)

Definition at line 32 of file RPCGeometryParsFromDD.cc.

References DDFilteredView::addFilter(), DDSpecificsFilter::AND, buildGeometry(), alcazmumu_cfi::filter, DDSpecificsFilter::matches, DDSpecificsFilter::setCriteria(), and relativeConstraints::value.

Referenced by RPCRecoIdealDBLoader::beginRun().

34 {
35  std::string attribute = "ReadOutName"; // could come from .orcarc
36  std::string value = "MuonRPCHits"; // could come from .orcarc
37  DDValue val(attribute, value, 0.0);
38 
39  // Asking only for the MuonRPC's
41  filter.setCriteria(val, // name & value of a variable
44  true, // compare strings otherwise doubles
45  true // use merged-specifics or simple-specifics
46  );
47  DDFilteredView fview(*cview);
48  fview.addFilter(filter);
49 
50  this->buildGeometry(fview, muonConstants, rgeo);
51 }
void buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rgeo)
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
void RPCGeometryParsFromDD::buildGeometry ( DDFilteredView fview,
const MuonDDDConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 54 of file RPCGeometryParsFromDD.cc.

References RPCNumberingScheme::baseNumberToUnitNumber(), gather_cfg::cout, DDfetch(), cond::rpcobgas::detid, DDValue::doubles(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), RecoIdealGeometry::insert(), DDFilteredView::logicalPart(), DDName::name(), mergeVDriftHistosByStation::name, DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDSolid::parameters(), DetId::rawId(), DDFilteredView::rotation(), DDLogicalPart::solid(), DDFilteredView::specifics(), DDFilteredView::translation(), tablePrinter::width, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by build().

55 {
56 
57  bool doSubDets = fview.firstChild();
58 
59  while (doSubDets){
60 
61  // Get the Base Muon Number
62  MuonDDDNumbering mdddnum(muonConstants);
63  MuonBaseNumber mbn=mdddnum.geoHistoryToBaseNumber(fview.geoHistory());
64 
65  // Get the The Rpc det Id
66  RPCNumberingScheme rpcnum(muonConstants);
67  int detid = 0;
68 
69  detid = rpcnum.baseNumberToUnitNumber(mbn);
70  RPCDetId rpcid(detid);
71 
72  DDValue numbOfStrips("nStrips");
73 
74  std::vector<const DDsvalues_type* > specs(fview.specifics());
75  std::vector<const DDsvalues_type* >::iterator is=specs.begin();
76  int nStrips=0;
77  for (;is!=specs.end(); is++){
78  if (DDfetch( *is, numbOfStrips)){
79  nStrips=int(numbOfStrips.doubles()[0]);
80  }
81  }
82  if (nStrips == 0 )
83  std::cout <<"No strip found!!"<<std::endl;
84 
85  std::vector<double> dpar=fview.logicalPart().solid().parameters();
86 
87  std::vector<std::string> strpars;
88  std::string name=fview.logicalPart().name().name();
89  strpars.push_back(name);
90  DDTranslation tran = fview.translation();
91 
92  DDRotationMatrix rota = fview.rotation();//.Inverse();
93  DD3Vector x, y, z;
94  rota.GetComponents(x,y,z);
95  std::vector<double> pars;
96  if (dpar.size()==3){
97  double width = dpar[0];
98  double length = dpar[1];
99  double thickness = dpar[2];
100  pars.push_back(width);
101  pars.push_back(length);
102  pars.push_back(thickness);
103  pars.push_back(numbOfStrips.doubles()[0]);
104  }else{
105  pars.push_back(dpar[4]); //b/2;
106  pars.push_back(dpar[8]); //B/2;
107  pars.push_back(dpar[0]); //h/2;
108  pars.push_back(0.4);
109  pars.push_back(numbOfStrips.doubles()[0]); //h/2;
110  }
111 
112 
113  std::vector<double> vtra(3);
114  std::vector<double> vrot(9);
115  vtra[0]=(float) 1.0 * (tran.x());
116  vtra[1]=(float) 1.0 * (tran.y());
117  vtra[2]=(float) 1.0 * (tran.z());
118  vrot[0]=(float) 1.0 * x.X();
119  vrot[1]=(float) 1.0 * x.Y();
120  vrot[2]=(float) 1.0 * x.Z();
121  vrot[3]=(float) 1.0 * y.X();
122  vrot[4]=(float) 1.0 * y.Y();
123  vrot[5]=(float) 1.0 * y.Z();
124  vrot[6]=(float) 1.0 * z.X();
125  vrot[7]=(float) 1.0 * z.Y();
126  vrot[8]=(float) 1.0 * z.Z();
127  rgeo.insert(rpcid.rawId(),vtra,vrot, pars,strpars);
128  doSubDets = fview.nextSibling(); // go to next layer
129  }
130 
131 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:82
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:102
double double double z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
bool firstChild()
set the current node to the first child ...
tuple cout
Definition: gather_cfg.py:121
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
Definition: DDAxes.h:10
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87