CMS 3D CMS Logo

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

#include <CSCGeometryParsFromDD.h>

Public Member Functions

bool build (const cms::DDCompactView *cview, const cms::MuonNumbering &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
 
bool build (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
 Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects. More...
 
 CSCGeometryParsFromDD ()
 Constructor. More...
 
virtual ~CSCGeometryParsFromDD ()
 Destructor. More...
 

Private Attributes

std::string myName
 

Detailed Description

Definition at line 32 of file CSCGeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ CSCGeometryParsFromDD()

CSCGeometryParsFromDD::CSCGeometryParsFromDD ( )

Constructor.

Definition at line 44 of file CSCGeometryParsFromDD.cc.

44 : myName("CSCGeometryParsFromDD") {}

◆ ~CSCGeometryParsFromDD()

CSCGeometryParsFromDD::~CSCGeometryParsFromDD ( )
virtual

Destructor.

Definition at line 46 of file CSCGeometryParsFromDD.cc.

46 {}

Member Function Documentation

◆ build() [1/2]

bool CSCGeometryParsFromDD::build ( const cms::DDCompactView cview,
const cms::MuonNumbering muonConstants,
RecoIdealGeometry rig,
CSCRecoDigiParameters rdp 
)

end stuff

Definition at line 363 of file CSCGeometryParsFromDD.cc.

366  {
367  const std::string attribute = "MuStructure";
368  const std::string value = "MuonEndcapCSC";
369  cms::DDFilteredView fv(cview->detector(), cview->detector()->worldVolume());
370  cms::DDSpecParRefs refs;
371  const cms::DDSpecParRegistry& mypar = cview->specpars();
372  mypar.filter(refs, attribute, value);
373  fv.mergedSpecifics(refs);
374 
375  int noOfAnonParams = 0;
376 
377  std::vector<double> uparvals;
378  std::vector<double> fpar;
379  std::vector<double> dpar;
380  std::vector<double> gtran(3);
381  std::vector<double> grmat(9);
382  std::vector<double> trm(9);
383  while (fv.firstChild()) {
384  MuonBaseNumber mbn = muonConstants.geoHistoryToBaseNumber(fv.history());
385 
386  cms::CSCNumberingScheme cscnum(muonConstants.values());
387 
388  cscnum.baseNumberToUnitNumber(mbn);
389  int id = cscnum.getDetId();
390 
391  CSCDetId detid = CSCDetId(id);
392  int jendcap = detid.endcap();
393  int jstation = detid.station();
394  int jring = detid.ring();
395  int jchamber = detid.chamber();
396  int jlayer = detid.layer();
397 
398  // Package up the wire group info as it's decoded
400  uparvals.clear();
401 
402  // if the specs are made no need to get all this stuff!
403  int chamberType = CSCChamberSpecs::whatChamberType(jstation, jring);
404 
405  size_t ct = 0;
406  bool chSpecsAlreadyExist = false;
407 
408  for (; ct < rdp.pChamberType.size(); ++ct) {
409  if (chamberType == rdp.pChamberType[ct]) {
410  break;
411  }
412  }
413 
414  if (ct < rdp.pChamberType.size() && rdp.pChamberType[ct] == chamberType) {
415  chSpecsAlreadyExist = true;
416  } else {
417  std::string_view my_name_bis = fv.name();
418  std::string my_name_tris = std::string(my_name_bis);
419  std::vector<std::string_view> namesInPath = mypar.names("//" + my_name_tris);
420  std::string my_string = "ChamberSpecs_";
421  int index = -1;
422  for (vector<string_view>::size_type i = 0; i < namesInPath.size(); ++i) {
423  std::size_t found = namesInPath[i].find(my_string);
424  if (found != std::string::npos)
425  index = i;
426  }
427  uparvals = fv.get<std::vector<double>>(std::string(namesInPath[index]), "upar");
428 
429  auto it = uparvals.begin();
430  it = uparvals.insert(it, uparvals.size());
431  auto noofanonparams = fv.get<double>("NoOfAnonParams");
432  noOfAnonParams = static_cast<int>(noofanonparams);
433 
434  for (auto i : fv.get<std::vector<double>>(std::string(namesInPath[index]), "NumWiresPerGrp")) {
435  wg.wiresInEachGroup.emplace_back(int(i));
436  }
437 
438  for (auto i : fv.get<std::vector<double>>(std::string(namesInPath[index]), "NumGroups")) {
439  wg.consecutiveGroups.emplace_back(int(i));
440  }
441 
442  auto wirespacing = fv.get<double>("WireSpacing");
443  wg.wireSpacing = static_cast<double>(wirespacing);
444 
445  auto alignmentpintofirstwire = fv.get<double>("AlignmentPinToFirstWire");
446  wg.alignmentPinToFirstWire = static_cast<double>(alignmentpintofirstwire);
447 
448  auto totnumwiregroups = fv.get<double>("TotNumWireGroups");
449  wg.numberOfGroups = static_cast<int>(totnumwiregroups);
450 
451  auto lengthoffirstwire = fv.get<double>("LengthOfFirstWire");
452  wg.narrowWidthOfWirePlane = static_cast<double>(lengthoffirstwire);
453 
454  auto lengthoflastwire = fv.get<double>("LengthOfLastWire");
455  wg.wideWidthOfWirePlane = static_cast<double>(lengthoflastwire);
456 
457  auto radialextentofwireplane = fv.get<double>("RadialExtentOfWirePlane");
458  wg.lengthOfWirePlane = static_cast<double>(radialextentofwireplane);
459 
460  uparvals.emplace_back((wg.wireSpacing) * 10.0);
461  uparvals.emplace_back(wg.alignmentPinToFirstWire);
462  uparvals.emplace_back(wg.numberOfGroups);
463  uparvals.emplace_back(wg.narrowWidthOfWirePlane);
464  uparvals.emplace_back(wg.wideWidthOfWirePlane);
465  uparvals.emplace_back(wg.lengthOfWirePlane);
466  uparvals.emplace_back(wg.wiresInEachGroup.size());
467 
468  for (CSCWireGroupPackage::Container::const_iterator it = wg.wiresInEachGroup.begin();
469  it != wg.wiresInEachGroup.end();
470  ++it) {
471  uparvals.emplace_back(*it);
472  }
473  for (CSCWireGroupPackage::Container::const_iterator it = wg.consecutiveGroups.begin();
474  it != wg.consecutiveGroups.end();
475  ++it) {
476  uparvals.emplace_back(*it);
477  }
478 
480  }
481 
482  fpar.clear();
483 
484  std::string my_title(fv.solid()->GetTitle());
485 
486  if (my_title == "Subtraction") {
487  cms::DDSolid mysolid(fv.solid());
488  auto solidA = mysolid.solidA();
489  std::vector<double> dpar = solidA.dimensions();
490 
492  dpar.begin(), dpar.end(), dpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
493 
494  fpar.emplace_back((dpar[1]));
495  fpar.emplace_back((dpar[2]));
496  fpar.emplace_back((dpar[3]));
497  fpar.emplace_back((dpar[4]));
498  } else {
499  dpar = fv.parameters();
500 
502  dpar.begin(), dpar.end(), dpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
503 
504  fpar.emplace_back((dpar[0]));
505  fpar.emplace_back((dpar[1]));
506  fpar.emplace_back((dpar[2]));
507  fpar.emplace_back((dpar[3]));
508  }
509 
510  gtran[0] = static_cast<float>(fv.translation().X());
511  gtran[1] = static_cast<float>(fv.translation().Y());
512  gtran[2] = static_cast<float>(fv.translation().Z());
513 
515  gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
516 
517  fv.rotation().GetComponents(trm.begin(), trm.end());
518  size_t rotindex = 0;
519  for (size_t i = 0; i < 9; ++i) {
520  grmat[i] = static_cast<float>(trm[rotindex]);
521  rotindex = rotindex + 3;
522  if ((i + 1) % 3 == 0) {
523  rotindex = (i + 1) / 3;
524  }
525  }
526 
527  if (wg.numberOfGroups != 0) {
528  for (size_t i = 0; i < wg.consecutiveGroups.size(); i++) {
529  }
530  } else {
531  LogTrace(myName) << myName << " wg.numberOfGroups == 0 ";
532  }
533 
534  if (jlayer == 0) { // Can only build chambers if we're filtering them
535 
536  if (jstation == 1 && jring == 1) {
537  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
539  });
540 
541  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
543  });
544 
546  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
547 
548  rig.insert(id, gtran, grmat, fpar);
549  if (!chSpecsAlreadyExist) {
550  rdp.pChamberType.emplace_back(chamberType);
551  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
552  rdp.pUserParSize.emplace_back(uparvals.size());
553  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
554  }
555 
556  // No. of anonymous parameters per chamber type should be read from cscSpecs file...
557  // Only required for ME11 splitting into ME1a and ME1b values,
558  // If it isn't seen may as well try to get further but this value will depend
559  // on structure of the file so may not even match!
560  const int kNoOfAnonParams = 35;
561  if (noOfAnonParams == 0) {
562  noOfAnonParams = kNoOfAnonParams;
563  } // in case it wasn't seen
564 
565  // copy ME1a params from back to the front
566  std::copy(
567  uparvals.begin() + noOfAnonParams + 1, uparvals.begin() + (2 * noOfAnonParams) + 2, uparvals.begin() + 1);
568 
569  CSCDetId detid1a = CSCDetId(jendcap, 1, 4, jchamber, 0); // reset to ME1A
570 
571  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
573  });
574 
575  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
577  });
578 
580  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
581 
582  rig.insert(detid1a.rawId(), gtran, grmat, fpar);
583  int chtypeA = CSCChamberSpecs::whatChamberType(1, 4);
584  ct = 0;
585  for (; ct < rdp.pChamberType.size(); ++ct) {
586  if (chtypeA == rdp.pChamberType[ct]) {
587  break;
588  }
589  }
590  if (ct < rdp.pChamberType.size() && rdp.pChamberType[ct] == chtypeA) {
591  // then its in already, don't put it
592  LogTrace(myName) << myName << " ct < rdp.pChamberType.size() && rdp.pChamberType[ct] == chtypeA ";
593  } else {
594  rdp.pChamberType.emplace_back(chtypeA);
595  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
596  rdp.pUserParSize.emplace_back(uparvals.size());
597  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
598  }
599 
600  } else {
601  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
603  });
604 
605  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
607  });
608 
610  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
611 
612  rig.insert(id, gtran, grmat, fpar);
613  if (!chSpecsAlreadyExist) {
614  rdp.pChamberType.emplace_back(chamberType);
615  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
616  rdp.pUserParSize.emplace_back(uparvals.size());
617  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
618  }
619  }
620 
621  } // filtering chambers.
622  }
623 
624  return true;
625 }

References CSCWireGroupPackage::alignmentPinToFirstWire, cms::CSCNumberingScheme::baseNumberToUnitNumber(), CSCDetId::chamber(), CSCWireGroupPackage::consecutiveGroups, filterCSVwithJSON::copy, cms::DDCompactView::detector(), CSCDetId::endcap(), cms::DDSpecParRegistry::filter(), newFWLiteAna::found, cms::MuonNumbering::geoHistoryToBaseNumber(), mps_fire::i, RecoIdealGeometry::insert(), CSCDetId::layer(), CSCWireGroupPackage::lengthOfWirePlane, LogTrace, myName, cms::DDSpecParRegistry::names(), CSCWireGroupPackage::narrowWidthOfWirePlane, CSCWireGroupPackage::numberOfGroups, CSCRecoDigiParameters::pChamberType, CSCRecoDigiParameters::pfupars, CSCRecoDigiParameters::pUserParOffset, CSCRecoDigiParameters::pUserParSize, CSCDetId::ring(), cms_rounding::roundIfNear0(), cms::DDSolid::solidA(), cms::DDCompactView::specpars(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, HcalDetIdTransform::transform(), cms::MuonNumbering::values(), CSCChamberSpecs::whatChamberType(), CSCWireGroupPackage::wideWidthOfWirePlane, CSCWireGroupPackage::wiresInEachGroup, CSCWireGroupPackage::wireSpacing, and cms::DDDetector::worldVolume().

◆ build() [2/2]

bool CSCGeometryParsFromDD::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig,
CSCRecoDigiParameters rdp 
)

Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects.

stuff: using a constructed wg to deconstruct it and put it in db... alternative? use temporary (not wg!) storage.

format as inserted is best documented by the actualy emplace_back statements below.

fupar size now becomes origSize+6+wg.wiresInEachGroup.size()+wg.consecutiveGroups.size()

end stuff

Definition at line 48 of file CSCGeometryParsFromDD.cc.

51  {
52  std::string attribute = "MuStructure"; // could come from outside
53  std::string value = "MuonEndcapCSC"; // could come from outside
54 
55  // Asking for a specific section of the MuStructure
56 
58 
59  DDFilteredView fv(*cview, filter);
60 
61  bool doSubDets = fv.firstChild();
62 
63  if (!doSubDets) {
64  edm::LogError("CSCGeometryParsFromDD")
65  << "Can not proceed, no CSC parts found with the filter. The current node is: " << fv.logicalPart().toString();
66  return false;
67  }
68  int noOfAnonParams = 0;
69  std::vector<const DDsvalues_type*> spec = fv.specifics();
70  std::vector<const DDsvalues_type*>::const_iterator spit = spec.begin();
71  std::vector<double> uparvals;
72  std::vector<double> fpar;
73  std::vector<double> dpar;
74  std::vector<double> gtran(3);
75  std::vector<double> grmat(9);
76  std::vector<double> trm(9);
77  while (doSubDets) {
78  spec = fv.specifics();
79  spit = spec.begin();
80 
81  // get numbering information early for possible speed up of code.
82 
83  LogTrace(myName) << myName << ": create numbering scheme...";
84 
85  MuonDDDNumbering mdn(muonConstants);
86  MuonBaseNumber mbn = mdn.geoHistoryToBaseNumber(fv.geoHistory());
87  CSCNumberingScheme mens(muonConstants);
88 
89  LogTrace(myName) << myName << ": find detid...";
90 
91  int id = mens.baseNumberToUnitNumber(mbn); //@@ FIXME perhaps should return CSCDetId itself?
92 
93  LogTrace(myName) << myName << ": raw id for this detector is " << id << ", octal " << std::oct << id << ", hex "
94  << std::hex << id << std::dec;
95 
96  CSCDetId detid = CSCDetId(id);
97  int jendcap = detid.endcap();
98  int jstation = detid.station();
99  int jring = detid.ring();
100  int jchamber = detid.chamber();
101  int jlayer = detid.layer();
102 
103  // Package up the wire group info as it's decoded
105  uparvals.clear();
106  LogDebug(myName) << "size of spec=" << spec.size();
107 
108  // if the specs are made no need to get all this stuff!
109  int chamberType = CSCChamberSpecs::whatChamberType(jstation, jring);
110 
111  LogDebug(myName) << "Chamber Type: " << chamberType;
112  size_t ct = 0;
113  bool chSpecsAlreadyExist = false;
114  for (; ct < rdp.pChamberType.size(); ++ct) {
115  if (chamberType == rdp.pChamberType[ct]) {
116  break;
117  }
118  }
119  if (ct < rdp.pChamberType.size() && rdp.pChamberType[ct] == chamberType) {
120  // it was found, therefore no need to load all the intermediate stuff from DD.
121  LogDebug(myName) << "already found a " << chamberType << " at index " << ct;
122 
123  chSpecsAlreadyExist = true;
124  } else {
125  for (; spit != spec.end(); spit++) {
126  DDsvalues_type::const_iterator it = (**spit).begin();
127  for (; it != (**spit).end(); it++) {
128  LogDebug(myName) << "it->second.name()=" << it->second.name();
129  if (it->second.name() == "upar") {
130  uparvals.emplace_back(it->second.doubles().size());
131  for (double i : it->second.doubles()) {
132  uparvals.emplace_back(i);
133  }
134 
135  LogDebug(myName) << "found upars ";
136  } else if (it->second.name() == "NoOfAnonParams") {
137  noOfAnonParams = static_cast<int>(it->second.doubles()[0]);
138  } else if (it->second.name() == "NumWiresPerGrp") {
139  for (double i : it->second.doubles()) {
140  wg.wiresInEachGroup.emplace_back(int(i));
141  }
142  LogDebug(myName) << "found upars " << std::endl;
143  } else if (it->second.name() == "NumGroups") {
144  for (double i : it->second.doubles()) {
145  wg.consecutiveGroups.emplace_back(int(i));
146  }
147  } else if (it->second.name() == "WireSpacing") {
148  wg.wireSpacing = it->second.doubles()[0];
149  } else if (it->second.name() == "AlignmentPinToFirstWire") {
150  wg.alignmentPinToFirstWire = it->second.doubles()[0];
151  } else if (it->second.name() == "TotNumWireGroups") {
152  wg.numberOfGroups = int(it->second.doubles()[0]);
153  } else if (it->second.name() == "LengthOfFirstWire") {
154  wg.narrowWidthOfWirePlane = it->second.doubles()[0];
155  } else if (it->second.name() == "LengthOfLastWire") {
156  wg.wideWidthOfWirePlane = it->second.doubles()[0];
157  } else if (it->second.name() == "RadialExtentOfWirePlane") {
158  wg.lengthOfWirePlane = it->second.doubles()[0];
159  }
160  }
161  }
162 
170  uparvals.emplace_back(wg.wireSpacing);
171 
172  uparvals.emplace_back(wg.alignmentPinToFirstWire);
173  uparvals.emplace_back(wg.numberOfGroups);
174  uparvals.emplace_back(wg.narrowWidthOfWirePlane);
175  uparvals.emplace_back(wg.wideWidthOfWirePlane);
176  uparvals.emplace_back(wg.lengthOfWirePlane);
177  uparvals.emplace_back(wg.wiresInEachGroup.size());
178  for (CSCWireGroupPackage::Container::const_iterator it = wg.wiresInEachGroup.begin();
179  it != wg.wiresInEachGroup.end();
180  ++it) {
181  uparvals.emplace_back(*it);
182  }
183  for (CSCWireGroupPackage::Container::const_iterator it = wg.consecutiveGroups.begin();
184  it != wg.consecutiveGroups.end();
185  ++it) {
186  uparvals.emplace_back(*it);
187  }
188 
190  }
191 
192  fpar.clear();
193 
194  if (fv.logicalPart().solid().shape() == DDSolidShape::ddsubtraction) {
195  const DDSubtraction& first = fv.logicalPart().solid();
196  const DDSubtraction& second = first.solidA();
197  const DDSolid& third = second.solidA();
198  dpar = third.parameters();
200  dpar.begin(), dpar.end(), dpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
201 
202  } else {
203  dpar = fv.logicalPart().solid().parameters();
205  dpar.begin(), dpar.end(), dpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
206  }
207 
208  LogTrace(myName) << myName << ": noOfAnonParams=" << noOfAnonParams;
209  LogTrace(myName) << myName << ": fill fpar...";
210  LogTrace(myName) << myName << ": dpars are... " << dpar[4] / cm << ", " << dpar[8] / cm << ", " << dpar[3] / cm
211  << ", " << dpar[0] / cm;
212 
213  fpar.emplace_back((dpar[4] / cm));
214  fpar.emplace_back((dpar[8] / cm));
215  fpar.emplace_back((dpar[3] / cm));
216  fpar.emplace_back((dpar[0] / cm));
217 
218  LogTrace(myName) << myName << ": fill gtran...";
219 
220  gtran[0] = (float)1.0 * (fv.translation().X() / cm);
221  gtran[1] = (float)1.0 * (fv.translation().Y() / cm);
222  gtran[2] = (float)1.0 * (fv.translation().Z() / cm);
223 
224  LogTrace(myName) << myName << ": gtran[0]=" << gtran[0] << ", gtran[1]=" << gtran[1] << ", gtran[2]=" << gtran[2];
225 
226  LogTrace(myName) << myName << ": fill grmat...";
227 
228  fv.rotation().GetComponents(trm.begin(), trm.end());
229  size_t rotindex = 0;
230  for (size_t i = 0; i < 9; ++i) {
231  grmat[i] = (float)1.0 * trm[rotindex];
232  rotindex = rotindex + 3;
233  if ((i + 1) % 3 == 0) {
234  rotindex = (i + 1) / 3;
235  }
236  }
237  LogTrace(myName) << myName << ": looking for wire group info for layer "
238  << "E" << CSCDetId::endcap(id) << " S" << CSCDetId::station(id) << " R" << CSCDetId::ring(id)
239  << " C" << CSCDetId::chamber(id) << " L" << CSCDetId::layer(id);
240 
241  if (wg.numberOfGroups != 0) {
242  LogTrace(myName) << myName << ": fv.geoHistory: = " << fv.geoHistory();
243  LogTrace(myName) << myName << ": TotNumWireGroups = " << wg.numberOfGroups;
244  LogTrace(myName) << myName << ": WireSpacing = " << wg.wireSpacing;
245  LogTrace(myName) << myName << ": AlignmentPinToFirstWire = " << wg.alignmentPinToFirstWire;
246  LogTrace(myName) << myName << ": Narrow width of wire plane = " << wg.narrowWidthOfWirePlane;
247  LogTrace(myName) << myName << ": Wide width of wire plane = " << wg.wideWidthOfWirePlane;
248  LogTrace(myName) << myName << ": Length in y of wire plane = " << wg.lengthOfWirePlane;
249  LogTrace(myName) << myName << ": wg.consecutiveGroups.size() = " << wg.consecutiveGroups.size();
250  LogTrace(myName) << myName << ": wg.wiresInEachGroup.size() = " << wg.wiresInEachGroup.size();
251  LogTrace(myName) << myName << ": \tNumGroups\tWiresInGroup";
252  for (size_t i = 0; i < wg.consecutiveGroups.size(); i++) {
253  LogTrace(myName) << myName << " \t" << wg.consecutiveGroups[i] << "\t\t" << wg.wiresInEachGroup[i];
254  }
255  } else {
256  LogTrace(myName) << myName << ": DDD is MISSING SpecPars for wire groups";
257  }
258  LogTrace(myName) << myName << ": end of wire group info. ";
259 
260  LogTrace(myName) << myName << ":_z_ E" << jendcap << " S" << jstation << " R" << jring << " C" << jchamber << " L"
261  << jlayer << " gx=" << gtran[0] << ", gy=" << gtran[1] << ", gz=" << gtran[2]
262  << " thickness=" << fpar[2] * 2.;
263 
264  if (jlayer == 0) { // Can only build chambers if we're filtering them
265 
266  LogTrace(myName) << myName << ":_z_ frame=" << uparvals[31] / 10. << " gap=" << uparvals[32] / 10.
267  << " panel=" << uparvals[33] / 10. << " offset=" << uparvals[34] / 10.;
268 
269  if (jstation == 1 && jring == 1) {
270  // set up params for ME1a and ME1b and call buildChamber *for each*
271  // Both get the full ME11 dimensions
272 
273  // detid is for ME11 and that's what we're using for ME1b in the software
274 
275  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
277  });
278  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
280  });
282  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
283 
284  rig.insert(id, gtran, grmat, fpar);
285  if (!chSpecsAlreadyExist) {
286  LogDebug(myName) << " inserting chamber type " << chamberType << std::endl;
287  rdp.pChamberType.emplace_back(chamberType);
288  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
289  rdp.pUserParSize.emplace_back(uparvals.size());
290  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
291  }
292 
293  // No. of anonymous parameters per chamber type should be read from cscSpecs file...
294  // Only required for ME11 splitting into ME1a and ME1b values,
295  // If it isn't seen may as well try to get further but this value will depend
296  // on structure of the file so may not even match!
297  const int kNoOfAnonParams = 35;
298  if (noOfAnonParams == 0) {
299  noOfAnonParams = kNoOfAnonParams;
300  } // in case it wasn't seen
301 
302  // copy ME1a params from back to the front
303  std::copy(
304  uparvals.begin() + noOfAnonParams + 1, uparvals.begin() + (2 * noOfAnonParams) + 2, uparvals.begin() + 1);
305 
306  CSCDetId detid1a = CSCDetId(jendcap, 1, 4, jchamber, 0); // reset to ME1A
307 
308  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
310  });
311  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
313  });
315  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
316 
317  rig.insert(detid1a.rawId(), gtran, grmat, fpar);
318  int chtypeA = CSCChamberSpecs::whatChamberType(1, 4);
319  ct = 0;
320  for (; ct < rdp.pChamberType.size(); ++ct) {
321  if (chtypeA == rdp.pChamberType[ct]) {
322  break;
323  }
324  }
325  if (ct < rdp.pChamberType.size() && rdp.pChamberType[ct] == chtypeA) {
326  // then its in already, don't put it
327  LogDebug(myName) << "found chamber type " << chtypeA << " so don't put it in! ";
328  } else {
329  LogDebug(myName) << " inserting chamber type " << chtypeA;
330  rdp.pChamberType.emplace_back(chtypeA);
331  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
332  rdp.pUserParSize.emplace_back(uparvals.size());
333  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
334  }
335 
336  } else {
337  std::transform(gtran.begin(), gtran.end(), gtran.begin(), [](double i) -> double {
339  });
340  std::transform(grmat.begin(), grmat.end(), grmat.begin(), [](double i) -> double {
342  });
344  fpar.begin(), fpar.end(), fpar.begin(), [](double i) -> double { return cms_rounding::roundIfNear0(i); });
345  rig.insert(id, gtran, grmat, fpar);
346  if (!chSpecsAlreadyExist) {
347  LogDebug(myName) << " inserting chamber type " << chamberType;
348  rdp.pChamberType.emplace_back(chamberType);
349  rdp.pUserParOffset.emplace_back(rdp.pfupars.size());
350  rdp.pUserParSize.emplace_back(uparvals.size());
351  std::copy(uparvals.begin(), uparvals.end(), std::back_inserter(rdp.pfupars));
352  }
353  }
354 
355  } // filtering chambers.
356 
357  doSubDets = fv.next();
358  }
359  return true;
360 }

References CSCWireGroupPackage::alignmentPinToFirstWire, CSCNumberingScheme::baseNumberToUnitNumber(), CSCDetId::chamber(), CSCWireGroupPackage::consecutiveGroups, filterCSVwithJSON::copy, ddsubtraction, TauDecayModes::dec, CSCDetId::endcap(), ALCARECOTkAlBeamHalo_cff::filter, dqmdumpme::first, DDFilteredView::firstChild(), dqmMemoryStats::float, DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), mps_fire::i, RecoIdealGeometry::insert(), createfilelist::int, CSCDetId::layer(), CSCWireGroupPackage::lengthOfWirePlane, LogDebug, DDFilteredView::logicalPart(), LogTrace, myName, CSCWireGroupPackage::narrowWidthOfWirePlane, DDFilteredView::next(), CSCWireGroupPackage::numberOfGroups, DDSolid::parameters(), CSCRecoDigiParameters::pChamberType, CSCRecoDigiParameters::pfupars, CSCRecoDigiParameters::pUserParOffset, CSCRecoDigiParameters::pUserParSize, CSCDetId::ring(), DDFilteredView::rotation(), cms_rounding::roundIfNear0(), edm::second(), DDSolid::shape(), DDLogicalPart::solid(), DDFilteredView::specifics(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, DDBase< N, C >::toString(), HcalDetIdTransform::transform(), DDFilteredView::translation(), CSCChamberSpecs::whatChamberType(), CSCWireGroupPackage::wideWidthOfWirePlane, CSCWireGroupPackage::wiresInEachGroup, and CSCWireGroupPackage::wireSpacing.

Referenced by CSCRecoIdealDBLoader::beginRun(), and CSCGeometryBuilderFromDDD::build().

Member Data Documentation

◆ myName

std::string CSCGeometryParsFromDD::myName
private

Definition at line 53 of file CSCGeometryParsFromDD.h.

Referenced by build().

cms::DDSolid
Definition: DDFilteredView.h:31
MuonDDDNumbering
Definition: MuonDDDNumbering.h:24
cms::MuonNumbering::geoHistoryToBaseNumber
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
Definition: DD4hep_MuonNumbering.cc:8
mps_fire.i
i
Definition: mps_fire.py:355
CSCWireGroupPackage::lengthOfWirePlane
double lengthOfWirePlane
Definition: CSCWireGroupPackage.h:37
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
cms::CSCNumberingScheme::baseNumberToUnitNumber
void baseNumberToUnitNumber(const MuonBaseNumber &)
Definition: DD4hep_CSCNumberingScheme.cc:34
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
CSCWireGroupPackage::consecutiveGroups
Container consecutiveGroups
Definition: CSCWireGroupPackage.h:28
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
cms::CSCNumberingScheme
Definition: DD4hep_CSCNumberingScheme.h:20
cms::DDSpecParRegistry
Definition: DDSpecParRegistry.h:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
cms::DDFilteredView
Definition: DDFilteredView.h:65
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
dqmdumpme.first
first
Definition: dqmdumpme.py:55
cms::DDSolid::solidA
dd4hep::Solid solidA() const
Definition: DDFilteredView.cc:17
CSCRecoDigiParameters::pfupars
std::vector< float > pfupars
Definition: CSCRecoDigiParameters.h:26
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
cms::MuonNumbering::values
const MuonConstants & values() const
Definition: DD4hep_MuonNumbering.h:42
CSCDetId::layer
int layer() const
Definition: CSCDetId.h:56
CSCWireGroupPackage::narrowWidthOfWirePlane
double narrowWidthOfWirePlane
Definition: CSCWireGroupPackage.h:35
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
CSCWireGroupPackage::wideWidthOfWirePlane
double wideWidthOfWirePlane
Definition: CSCWireGroupPackage.h:36
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
cms::DDSpecParRefs
std::vector< const DDSpecPar * > DDSpecParRefs
Definition: DDSpecParRegistry.h:30
CSCRecoDigiParameters::pUserParSize
std::vector< int > pUserParSize
Definition: CSCRecoDigiParameters.h:24
CSCRecoDigiParameters::pUserParOffset
std::vector< int > pUserParOffset
Definition: CSCRecoDigiParameters.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CSCWireGroupPackage::wireSpacing
double wireSpacing
Definition: CSCWireGroupPackage.h:33
edm::LogError
Definition: MessageLogger.h:183
CSCWireGroupPackage::wiresInEachGroup
Container wiresInEachGroup
Definition: CSCWireGroupPackage.h:31
CSCDetId
Definition: CSCDetId.h:26
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
cms_rounding::roundIfNear0
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
CSCDetId::chamber
int chamber() const
Definition: CSCDetId.h:62
CSCRecoDigiParameters::pChamberType
std::vector< int > pChamberType
Definition: CSCRecoDigiParameters.h:25
CSCWireGroupPackage
Definition: CSCWireGroupPackage.h:18
cms::DDCompactView::specpars
DDSpecParRegistry const & specpars() const
Definition: DDCompactView.h:33
CSCChamberSpecs::whatChamberType
static int whatChamberType(int istation, int iring)
Definition: CSCChamberSpecs.cc:164
MuonBaseNumber
Definition: MuonBaseNumber.h:21
CSCWireGroupPackage::numberOfGroups
int numberOfGroups
Definition: CSCWireGroupPackage.h:32
DDValue
Definition: DDValue.h:21
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
cms::DDSpecParRegistry::filter
void filter(DDSpecParRefs &, const std::string &, const std::string &="") const
Definition: DDSpecparRegistry.cc:98
CSCWireGroupPackage::alignmentPinToFirstWire
double alignmentPinToFirstWire
Definition: CSCWireGroupPackage.h:34
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
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
DDFilteredView
Definition: DDFilteredView.h:20
CSCNumberingScheme
Definition: CSCNumberingScheme.h:18
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
cms::DDSpecParRegistry::names
std::vector< std::string_view > names() const
Definition: DDSpecparRegistry.cc:130
DDSubtraction
Definition: DDSolid.h:325
DDSolidShape::ddsubtraction
RecoIdealGeometry::insert
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
Definition: RecoIdealGeometry.h:33
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
cms::DDDetector::worldVolume
Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:41
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32
CSCGeometryParsFromDD::myName
std::string myName
Definition: CSCGeometryParsFromDD.h:53