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 MuonGeometryConstants &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 29 of file CSCGeometryParsFromDD.h.

Constructor & Destructor Documentation

◆ CSCGeometryParsFromDD()

CSCGeometryParsFromDD::CSCGeometryParsFromDD ( )

Constructor.

Definition at line 35 of file CSCGeometryParsFromDD.cc.

35 : myName("CSCGeometryParsFromDD") {}

◆ ~CSCGeometryParsFromDD()

CSCGeometryParsFromDD::~CSCGeometryParsFromDD ( )
virtual

Destructor.

Definition at line 37 of file CSCGeometryParsFromDD.cc.

37 {}

Member Function Documentation

◆ build() [1/2]

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

end stuff

Definition at line 354 of file CSCGeometryParsFromDD.cc.

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

References CSCWireGroupPackage::alignmentPinToFirstWire, CSCNumberingScheme::baseNumberToUnitNumber(), CSCDetId::chamber(), CSCWireGroupPackage::consecutiveGroups, filterCSVwithJSON::copy, CSCDetId::endcap(), ALCARECOTkAlBeamHalo_cff::filter, cms::DDFilteredView::firstChild(), newFWLiteAna::found, MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::get(), cms::DDFilteredView::history(), mps_fire::i, RecoIdealGeometry::insert(), CSCDetId::layer(), CSCWireGroupPackage::lengthOfWirePlane, LogTrace, myName, cms::DDFilteredView::name(), CSCWireGroupPackage::narrowWidthOfWirePlane, CSCWireGroupPackage::numberOfGroups, cms::DDFilteredView::parameters(), CSCRecoDigiParameters::pChamberType, CSCRecoDigiParameters::pfupars, CSCRecoDigiParameters::pUserParOffset, CSCRecoDigiParameters::pUserParSize, CSCDetId::ring(), cms::DDFilteredView::rotation(), cms_rounding::roundIfNear0(), cms::DDFilteredView::solid(), cms::DDSolid::solidA(), cms::DDCompactView::specpars(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, HcalDetIdTransform::transform(), cms::DDFilteredView::translation(), CSCChamberSpecs::whatChamberType(), CSCWireGroupPackage::wideWidthOfWirePlane, CSCWireGroupPackage::wiresInEachGroup, and CSCWireGroupPackage::wireSpacing.

◆ 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 39 of file CSCGeometryParsFromDD.cc.

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

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(), MuonGeometryNumbering::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 50 of file CSCGeometryParsFromDD.h.

Referenced by build().

cms::DDSolid
Definition: DDFilteredView.h:33
mps_fire.i
i
Definition: mps_fire.py:428
CSCWireGroupPackage::lengthOfWirePlane
double lengthOfWirePlane
Definition: CSCWireGroupPackage.h:37
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
CSCWireGroupPackage::consecutiveGroups
Container consecutiveGroups
Definition: CSCWireGroupPackage.h:28
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
cms::DDFilteredView
Definition: DDFilteredView.h:70
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
cms::DDSpecParRegistry
dd4hep::SpecParRegistry DDSpecParRegistry
Definition: DDCompactView.h:28
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
cms::DDFilter
Definition: DDFilteredView.h:59
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
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:223
CSCWireGroupPackage::wireSpacing
double wireSpacing
Definition: CSCWireGroupPackage.h:33
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCWireGroupPackage
Definition: CSCWireGroupPackage.h:18
cms::DDCompactView::specpars
DDSpecParRegistry const & specpars() const
Definition: DDCompactView.h:35
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
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
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
DDFilteredView
Definition: DDFilteredView.h:20
CSCNumberingScheme
Definition: CSCNumberingScheme.h:18
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
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
CSCGeometryParsFromDD::myName
std::string myName
Definition: CSCGeometryParsFromDD.h:50