16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
31 DDValue muval(attribute, value, 0.0);
52 int noOfAnonParams = 0;
53 std::vector<const DDsvalues_type *> spec = fv.
specifics();
54 std::vector<const DDsvalues_type *>::const_iterator spit = spec.begin();
55 std::vector<double> uparvals;
56 std::vector<double> fpar;
57 std::vector<double> dpar;
58 std::vector<double> gtran( 3 );
59 std::vector<double> grmat( 9 );
60 std::vector<double> trm ( 9 );
78 ", octal " << std::oct <<
id <<
", hex " << std::hex <<
id <<
std::dec;
81 int jendcap = detid.
endcap();
83 int jring = detid.
ring();
85 int jlayer = detid.
layer();
96 bool chSpecsAlreadyExist =
false;
104 LogDebug(
myName) <<
"already found a " << chamberType <<
" at index " << ct;
105 chSpecsAlreadyExist =
true;
107 for (; spit != spec.end(); spit++) {
108 DDsvalues_type::const_iterator it = (**spit).begin();
109 for (; it != (**spit).end(); it++) {
111 if (it->second.name() ==
"upar") {
112 uparvals.push_back(it->second.doubles().size());
113 for (
size_t i = 0;
i < it->second.doubles().size(); ++
i) {
114 uparvals.push_back(it->second.doubles()[
i]);
117 }
else if (it->second.name() ==
"NoOfAnonParams") {
118 noOfAnonParams =
static_cast<int>( it->second.doubles()[0] );
119 }
else if (it->second.name() ==
"NumWiresPerGrp") {
121 for (
size_t i = 0 ;
i < it->second.doubles().size();
i++) {
125 }
else if ( it->second.name() ==
"NumGroups" ) {
127 for (
size_t i = 0 ;
i < it->second.doubles().size();
i++) {
130 }
else if ( it->second.name() ==
"WireSpacing" ) {
132 }
else if ( it->second.name() ==
"AlignmentPinToFirstWire" ) {
134 }
else if ( it->second.name() ==
"TotNumWireGroups" ) {
136 }
else if ( it->second.name() ==
"LengthOfFirstWire" ) {
138 }
else if ( it->second.name() ==
"LengthOfLastWire" ) {
140 }
else if ( it->second.name() ==
"RadialExtentOfWirePlane" ) {
160 for (CSCWireGroupPackage::Container::const_iterator it = wg.
wiresInEachGroup.begin();
162 uparvals.push_back(*it);
164 for (CSCWireGroupPackage::Container::const_iterator it = wg.
consecutiveGroups.begin();
166 uparvals.push_back(*it);
184 dpar[4]/cm <<
", " << dpar[8]/cm <<
", " <<
185 dpar[3]/cm <<
", " << dpar[0]/cm;
187 fpar.push_back( ( dpar[4]/cm) );
188 fpar.push_back( ( dpar[8]/cm ) );
189 fpar.push_back( ( dpar[3]/cm ) );
190 fpar.push_back( ( dpar[0]/cm ) );
194 gtran[0] = (float) 1.0 * (fv.
translation().X() / cm);
195 gtran[1] = (float) 1.0 * (fv.
translation().Y() / cm);
196 gtran[2] = (float) 1.0 * (fv.
translation().Z() / cm);
199 gtran[1] <<
", gtran[2]=" << gtran[2];
203 fv.
rotation().GetComponents(trm.begin(), trm.end());
205 for (
size_t i = 0;
i < 9; ++
i) {
206 grmat[
i] = (float) 1.0 * trm[rotindex];
207 rotindex = rotindex + 3;
208 if ( (
i+1) % 3 == 0 ) {
209 rotindex = (
i+1) / 3;
239 " C" << jchamber <<
" L" << jlayer <<
240 " gx=" << gtran[0] <<
", gy=" << gtran[1] <<
", gz=" << gtran[2] <<
241 " thickness=" << fpar[2]*2.;
246 " gap=" << uparvals[32]/10. <<
" panel=" << uparvals[33]/10. <<
" offset=" << uparvals[34]/10.;
248 if ( jstation==1 && jring==1 ) {
254 rig.
insert(
id, gtran, grmat, fpar );
255 if ( !chSpecsAlreadyExist ) {
257 LogDebug(
myName) <<
" inserting chamber type " << chamberType << std::endl;
261 std::copy ( uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
268 const int kNoOfAnonParams = 35;
269 if ( noOfAnonParams == 0 ) { noOfAnonParams = kNoOfAnonParams; }
271 std::copy( uparvals.begin()+noOfAnonParams+1, uparvals.begin()+(2*noOfAnonParams)+2, uparvals.begin()+1 );
274 rig.
insert( detid1a.rawId(), gtran, grmat, fpar );
284 LogDebug(
myName) <<
"found chamber type " << chtypeA <<
" so don't put it in! ";
291 std::copy ( uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
296 rig.
insert(
id, gtran, grmat, fpar );
297 if ( !chSpecsAlreadyExist ) {
303 std::copy ( uparvals.begin(), uparvals.end(), std::back_inserter(rdp.
pfupars));
309 doSubDets = fv.
next();
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
void addFilter(const DDFilter &, log_op op=AND)
static int whatChamberType(int istation, int iring)
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)
double narrowWidthOfWirePlane
Container wiresInEachGroup
virtual ~CSCGeometryParsFromDD()
Destructor.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
A DDSolid represents the shape of a part.
bool build(const DDCompactView *cview, const MuonDDDConstants &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects.
std::vector< float > pfupars
U second(std::pair< T, U > const &p)
bool next()
set current node to the next node in the filtered tree
std::vector< int > pChamberType
std::vector< int > pUserParOffset
DDSolidShape shape(void) const
The type of the solid.
double wideWidthOfWirePlane
DDSolid solidA(void) const
std::string toString() const
std::vector< int > pUserParSize
bool firstChild()
set the current node to the first child ...
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
CSCGeometryParsFromDD()
Constructor.
virtual int baseNumberToUnitNumber(const MuonBaseNumber &)
Container consecutiveGroups
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
double alignmentPinToFirstWire
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.