CMS 3D CMS Logo

MagGeoBuilderFromDDD.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author N. Amapane - INFN Torino
5  */
6 
7 #include "MagGeoBuilderFromDDD.h"
8 #include "volumeHandle.h"
9 #include "bSlab.h"
10 #include "bRod.h"
11 #include "bSector.h"
12 #include "bLayer.h"
13 #include "eSector.h"
14 #include "eLayer.h"
15 #include "FakeInterpolator.h"
16 
19 
21 
25 
27 
31 
34 
37 
40 
41 #include <string>
42 #include <vector>
43 #include <iostream>
44 #include <sstream>
45 #include <algorithm>
46 #include <iterator>
47 #include <map>
48 #include <set>
49 #include <iomanip>
50 #include <boost/algorithm/string/replace.hpp>
52 
53 using namespace std;
54 using namespace magneticfield;
55 
56 MagGeoBuilderFromDDD::MagGeoBuilderFromDDD(string tableSet_, int geometryVersion_, bool debug_)
57  : tableSet(tableSet_), geometryVersion(geometryVersion_), theGridFiles(nullptr), debug(debug_) {
58  if (debug)
59  cout << "Constructing a MagGeoBuilderFromDDD" << endl;
60 }
61 
63  for (handles::const_iterator i = bVolumes.begin(); i != bVolumes.end(); ++i) {
64  delete (*i);
65  }
66 
67  for (handles::const_iterator i = eVolumes.begin(); i != eVolumes.end(); ++i) {
68  delete (*i);
69  }
70 }
71 
73  // The final countdown.
74  int ivolumes = volumes.size(); // number of volumes
75  int isurfaces = ivolumes * 6; // number of individual surfaces
76  int iassigned = 0; // How many have been assigned
77  int iunique = 0; // number of unique surfaces
78  int iref_ass = 0;
79  int iref_nass = 0;
80 
81  set<const void*> ptrs;
82 
83  handles::const_iterator first = volumes.begin();
84  handles::const_iterator last = volumes.end();
85 
86  for (handles::const_iterator i = first; i != last; ++i) {
87  if (int((*i)->shape()) > 4)
88  continue; // FIXME: implement test for missing shapes...
89  for (int side = 0; side < 6; ++side) {
90  int references = (*i)->references(side);
91  if ((*i)->isPlaneMatched(side)) {
92  ++iassigned;
93  bool firstOcc = (ptrs.insert(&((*i)->surface(side)))).second;
94  if (firstOcc)
95  iref_ass += references;
96  if (references < 2) {
97  cout << "*** Only 1 ref, vol: " << (*i)->volumeno << " # " << (*i)->copyno << " side: " << side << endl;
98  }
99  } else {
100  iref_nass += references;
101  if (references > 1) {
102  cout << "*** Ref_nass >1 " << endl;
103  }
104  }
105  }
106  }
107  iunique = ptrs.size();
108 
109  cout << " volumes " << ivolumes << endl
110  << " surfaces " << isurfaces << endl
111  << " assigned " << iassigned << endl
112  << " unique " << iunique << endl
113  << " iref_ass " << iref_ass << endl
114  << " iref_nass " << iref_nass << endl;
115 }
116 
118  // DDCompactView cpv;
119  DDExpandedView fv(cpva);
120 
121  if (debug)
122  cout << "**********************************************************" << endl;
123 
124  // The actual field interpolators
125  map<string, MagProviderInterpol*> bInterpolators;
126  map<string, MagProviderInterpol*> eInterpolators;
127 
128  // Counter of different volumes
129  int bVolCount = 0;
130  int eVolCount = 0;
131 
132  if (fv.logicalPart().name().name() != "MAGF") {
133  std::string topNodeName(fv.logicalPart().name().name());
134 
135  //see if one of the children is MAGF
136  bool doSubDets = fv.firstChild();
137 
138  bool go = true;
139  while (go && doSubDets) {
140  if (fv.logicalPart().name().name() == "MAGF")
141  break;
142  else
143  go = fv.nextSibling();
144  }
145  if (!go) {
146  throw cms::Exception("NoMAGFinDDD")
147  << " Neither the top node, nor any child node of the DDCompactView is \"MAGF\" but the top node is instead \""
148  << topNodeName << "\"";
149  }
150  }
151  // Loop over MAGF volumes and create volumeHandles.
152  if (debug) {
153  cout << endl
154  << "*** MAGF: " << fv.geoHistory() << endl
155  << "translation: " << fv.translation() << endl
156  << " rotation: " << fv.rotation() << endl;
157  }
158 
159  bool doSubDets = fv.firstChild();
160  while (doSubDets) {
161  string name = fv.logicalPart().name().name();
162  if (debug)
163  cout << endl << "Name: " << name << endl << " " << fv.geoHistory() << endl;
164 
165  // FIXME: single-volyme cylinders - this is feature has been removed
166  // and should be revisited.
167  // bool mergeCylinders=false;
168 
169  // If true, In the barrel, cylinders sectors will be skipped to build full
170  // cylinders out of sector copyno #1.
171  bool expand = false;
172 
173  // if (mergeCylinders) {
174  // if (name == "V_ZN_1"
175  // || name == "V_ZN_2") {
176  // if (debug && fv.logicalPart().solid().shape()!=ddtubs) {
177  // cout << "ERROR: MagGeoBuilderFromDDD::build: volume " << name
178  // << " should be a cylinder" << endl;
179  // }
180  // if(fv.copyno()==1) {
181  // expand = true;
182  // } else {
183  // //cout << "... to be skipped: "
184  // // << name << " " << fv.copyno() << endl;
185  // }
186  // }
187  // }
188 
189  volumeHandle* v = new volumeHandle(fv, expand, debug);
190 
191  if (theGridFiles != nullptr) {
192  int key = (v->volumeno) * 100 + v->copyno;
193  TableFileMap::const_iterator itable = theGridFiles->find(key);
194  if (itable == theGridFiles->end()) {
195  key = (v->volumeno) * 100;
196  itable = theGridFiles->find(key);
197  }
198 
199  if (itable != theGridFiles->end()) {
200  string magFile = (*itable).second.first;
201  stringstream conv;
202  string svol, ssec;
203  conv << setfill('0') << setw(3) << v->volumeno << " " << setw(2)
204  << v->copyno; // volume assumed to have 0s padding to 3 digits; sector assumed to have 0s padding to 2 digits
205  conv >> svol >> ssec;
206  boost::replace_all(magFile, "[v]", svol);
207  boost::replace_all(magFile, "[s]", ssec);
208  int masterSector = (*itable).second.second;
209  if (masterSector == 0)
210  masterSector = v->copyno;
211  v->magFile = magFile;
212  v->masterSector = masterSector;
213  } else {
214  edm::LogError("MagGeoBuilderFromDDDbuild")
215  << "ERROR: no table spec found for V " << v->volumeno << ":" << v->copyno;
216  }
217  }
218 
219  // Select volumes, build volume handles.
220  float Z = v->center().z();
221  float R = v->center().perp();
222 
223  // v 85l: Barrel is everything up to |Z| = 661.0, excluding
224  // volume #7, centered at 6477.5
225  // v 1103l: same numbers work fine. #16 instead of #7, same coords;
226  // see comment below for V6,7
227  //ASSUMPTION: no misalignment is applied to mag volumes.
228  //FIXME: implement barrel/endcap flags as DDD SpecPars.
229  if ((fabs(Z) < 647. || (R > 350. && fabs(Z) < 662.)) &&
230  !(fabs(Z) > 480 && R < 172) // in 1103l we place V_6 and V_7 in the
231  // endcaps to preserve nice layer structure
232  // in the barrel. This does not hurt in v85l
233  // where there is a single V1
234  ) { // Barrel
235  if (debug)
236  cout << " (Barrel)" << endl;
237  bVolumes.push_back(v);
238 
239  // Build the interpolator of the "master" volume (the one which is
240  // not replicated in phi)
241  // ASSUMPTION: copyno == sector.
242  if (v->copyno == v->masterSector) {
243  buildInterpolator(v, bInterpolators);
244  ++bVolCount;
245  }
246  } else { // Endcaps
247  if (debug)
248  cout << " (Endcaps)" << endl;
249  eVolumes.push_back(v);
250  if (v->copyno == v->masterSector) {
251  buildInterpolator(v, eInterpolators);
252  ++eVolCount;
253  }
254  }
255 
256  doSubDets = fv.nextSibling(); // end of loop over MAGF
257  }
258 
259  if (debug) {
260  cout << "Number of volumes (barrel): " << bVolumes.size() << endl
261  << "Number of volumes (endcap): " << eVolumes.size() << endl;
262  cout << "**********************************************************" << endl;
263  }
264 
265  // Now all volumeHandles are there, and parameters for each of the planes
266  // are calculated.
267 
268  //----------------------------------------------------------------------
269  // Print summary information
270 
271  if (debug) {
272  cout << "-----------------------" << endl;
273  cout << "SUMMARY: Barrel " << endl;
274  summary(bVolumes);
275 
276  cout << endl << "SUMMARY: Endcaps " << endl;
277  summary(eVolumes);
278  cout << "-----------------------" << endl;
279  }
280 
281  //----------------------------------------------------------------------
282  // Find barrel layers.
283 
284  vector<bLayer> layers; // the barrel layers
286 
287  // Find the layers (in R)
288  const float resolution = 1.; // cm
289  float rmin = bVolumes.front()->RN() - resolution;
290  float rmax = bVolumes.back()->RN() + resolution;
291  ClusterizingHistogram hisR(int((rmax - rmin) / resolution) + 1, rmin, rmax);
292 
293  if (debug)
294  cout << " R layers: " << rmin << " " << rmax << endl;
295 
296  handles::const_iterator first = bVolumes.begin();
297  handles::const_iterator last = bVolumes.end();
298 
299  for (handles::const_iterator i = first; i != last; ++i) {
300  hisR.fill((*i)->RN());
301  }
302  vector<float> rClust = hisR.clusterize(resolution);
303 
304  handles::const_iterator ringStart = first;
305  handles::const_iterator separ = first;
306 
307  for (unsigned int i = 0; i < rClust.size() - 1; ++i) {
308  if (debug)
309  cout << " Layer at RN = " << rClust[i];
310  float rSepar = (rClust[i] + rClust[i + 1]) / 2.f;
311  while ((*separ)->RN() < rSepar)
312  ++separ;
313 
314  bLayer thislayer(ringStart, separ, debug);
315  layers.push_back(thislayer);
316  ringStart = separ;
317  }
318  {
319  if (debug)
320  cout << " Layer at RN = " << rClust.back();
321  bLayer thislayer(separ, last, debug);
322  layers.push_back(thislayer);
323  }
324 
325  if (debug)
326  cout << "Barrel: Found " << rClust.size() << " clusters in R, " << layers.size() << " layers " << endl << endl;
327 
328  //----------------------------------------------------------------------
329  // Find endcap sectors
330  vector<eSector> sectors; // the endcap sectors
331 
332  // Find the number of sectors (should be 12 or 24 depending on the geometry model)
333  float phireso = 0.05; // rad
334  ClusterizingHistogram hisPhi(int((Geom::ftwoPi()) / phireso) + 1, -Geom::fpi(), Geom::fpi());
335 
336  for (handles::const_iterator i = eVolumes.begin(); i != eVolumes.end(); ++i) {
337  hisPhi.fill((*i)->minPhi());
338  }
339  vector<float> phiClust = hisPhi.clusterize(phireso);
340  int nESectors = phiClust.size();
341  if (debug && (nESectors % 12) != 0)
342  cout << "ERROR: unexpected # of sectors: " << nESectors << endl;
343 
344  //Sort in phi
346 
347  // Handle the -pi/pi boundary: volumes crossing it could be half at the begin and half at end of the sorted list.
348  // So, check if any of the volumes that should belong to the first bin (at -phi) are at the end of the list:
349  float lastBinPhi = phiClust.back();
350  handles::reverse_iterator ri = eVolumes.rbegin();
351  while ((*ri)->center().phi() > lastBinPhi) {
352  ++ri;
353  }
354  if (ri != eVolumes.rbegin()) {
355  // ri points to the first element that is within the last bin.
356  // We need to move the following element (ie ri.base()) to the beginning of the list,
357  handles::iterator newbeg = ri.base();
358  rotate(eVolumes.begin(), newbeg, eVolumes.end());
359  }
360 
361  //Group volumes in sectors
362  int offset = eVolumes.size() / nESectors;
363  for (int i = 0; i < nESectors; ++i) {
364  if (debug) {
365  cout << " Sector at phi = " << (*(eVolumes.begin() + ((i)*offset)))->center().phi() << endl;
366  // Additional x-check: sectors are expected to be made by volumes with the same copyno
367  int secCopyNo = -1;
368  for (handles::const_iterator iv = eVolumes.begin() + ((i)*offset); iv != eVolumes.begin() + ((i + 1) * offset);
369  ++iv) {
370  if (secCopyNo >= 0 && (*iv)->copyno != secCopyNo)
371  cout << "ERROR: volume copyno" << (*iv)->name << ":" << (*iv)->copyno
372  << " differs from others in same sectors " << secCopyNo << endl;
373  secCopyNo = (*iv)->copyno;
374  }
375  }
376 
377  sectors.push_back(eSector(eVolumes.begin() + ((i)*offset), eVolumes.begin() + ((i + 1) * offset), debug));
378  }
379 
380  if (debug)
381  cout << "Endcap: Found " << sectors.size() << " sectors " << endl;
382 
383  //----------------------------------------------------------------------
384  // Match surfaces.
385 
386  // cout << "------------------" << endl << "Now associating planes..." << endl;
387 
388  // // Loop on layers
389  // for (vector<bLayer>::const_iterator ilay = layers.begin();
390  // ilay!= layers.end(); ++ilay) {
391  // cout << "On Layer: " << ilay-layers.begin() << " RN: " << (*ilay).RN()
392  // <<endl;
393 
394  // // Loop on wheels
395  // for (vector<bWheel>::const_iterator iwheel = (*ilay).wheels.begin();
396  // iwheel != (*ilay).wheels.end(); ++iwheel) {
397  // cout << " On Wheel: " << iwheel- (*ilay).wheels.begin()<< " Z: "
398  // << (*iwheel).minZ() << " " << (*iwheel).maxZ() << " "
399  // << ((*iwheel).minZ()+(*iwheel).maxZ())/2. <<endl;
400 
401  // // Loop on sectors.
402  // for (int isector = 0; isector<12; ++isector) {
403  // // FIXME: create new constructor...
404  // bSectorNavigator navy(layers,
405  // ilay-layers.begin(),
406  // iwheel-(*ilay).wheels.begin(),isector);
407 
408  // const bSector & isect = (*iwheel).sector(isector);
409 
410  // isect.matchPlanes(navy); //FIXME refcount
411  // }
412  // }
413  // }
414 
415  //----------------------------------------------------------------------
416  // Build MagVolumes and the MagGeometry hierarchy.
417 
418  //--- Barrel
419 
420  // Build MagVolumes and associate interpolators to them
421  buildMagVolumes(bVolumes, bInterpolators);
422 
423  // Build MagBLayers
424  for (vector<bLayer>::const_iterator ilay = layers.begin(); ilay != layers.end(); ++ilay) {
425  mBLayers.push_back((*ilay).buildMagBLayer());
426  }
427 
428  if (debug) {
429  cout << "*** BARREL ********************************************" << endl
430  << "Number of different volumes = " << bVolCount << endl
431  << "Number of interpolators built = " << bInterpolators.size() << endl
432  << "Number of MagBLayers built = " << mBLayers.size() << endl;
433 
434  testInside(bVolumes); // FIXME: all volumes should be checked in one go.
435  }
436 
437  //--- Endcap
438  // Build MagVolumes and associate interpolators to them
439  buildMagVolumes(eVolumes, eInterpolators);
440 
441  // Build the MagESectors
442  for (vector<eSector>::const_iterator isec = sectors.begin(); isec != sectors.end(); ++isec) {
443  mESectors.push_back((*isec).buildMagESector());
444  }
445 
446  if (debug) {
447  cout << "*** ENDCAP ********************************************" << endl
448  << "Number of different volumes = " << eVolCount << endl
449  << "Number of interpolators built = " << eInterpolators.size() << endl
450  << "Number of MagESector built = " << mESectors.size() << endl;
451 
452  testInside(eVolumes); // FIXME: all volumes should be checked in one go.
453  }
454 }
455 
456 void MagGeoBuilderFromDDD::buildMagVolumes(const handles& volumes, map<string, MagProviderInterpol*>& interpolators) {
457  // Build all MagVolumes setting the MagProviderInterpol
458  for (handles::const_iterator vol = volumes.begin(); vol != volumes.end(); ++vol) {
459  const MagProviderInterpol* mp = nullptr;
460  if (interpolators.find((*vol)->magFile) != interpolators.end()) {
461  mp = interpolators[(*vol)->magFile];
462  } else {
463  edm::LogError("MagGeoBuilder") << "No interpolator found for file " << (*vol)->magFile
464  << " vol: " << (*vol)->volumeno << "\n"
465  << interpolators.size() << endl;
466  }
467 
468  // Search for [volume,sector] in the list of scaling factors; sector = 0 handled as wildcard
469  // ASSUMPTION: copyno == sector.
470  int key = ((*vol)->volumeno) * 100 + (*vol)->copyno;
471  map<int, double>::const_iterator isf = theScalingFactors.find(key);
472  if (isf == theScalingFactors.end()) {
473  key = ((*vol)->volumeno) * 100;
474  isf = theScalingFactors.find(key);
475  }
476 
477  double sf = 1.;
478  if (isf != theScalingFactors.end()) {
479  sf = (*isf).second;
480 
481  edm::LogInfo("MagGeoBuilder") << "Applying scaling factor " << sf << " to " << (*vol)->volumeno << "["
482  << (*vol)->copyno << "] (key:" << key << ")" << endl;
483  }
484 
485  const GloballyPositioned<float>* gpos = (*vol)->placement();
486  (*vol)->magVolume = new MagVolume6Faces(gpos->position(), gpos->rotation(), (*vol)->sides(), mp, sf);
487 
488  if ((*vol)->copyno == (*vol)->masterSector) {
489  (*vol)->magVolume->ownsFieldProvider(true);
490  }
491 
492  (*vol)->magVolume->setIsIron((*vol)->isIron());
493 
494  // The name and sector of the volume are saved for debug purposes only. They may be removed at some point...
495  (*vol)->magVolume->volumeNo = (*vol)->volumeno;
496  (*vol)->magVolume->copyno = (*vol)->copyno;
497  }
498 }
499 
501  map<string, MagProviderInterpol*>& interpolators) {
502  // Phi of the master sector
503  double masterSectorPhi = (vol->masterSector - 1) * Geom::pi() / 6.;
504 
505  if (debug) {
506  cout << "Building interpolator from " << vol->volumeno << " copyno " << vol->copyno << " at " << vol->center()
507  << " phi: " << vol->center().phi() << " file: " << vol->magFile << " master : " << vol->masterSector << endl;
508 
509  if (fabs(vol->center().phi() - masterSectorPhi) > Geom::pi() / 9.) {
510  cout << "***WARNING wrong sector? " << endl;
511  }
512  }
513 
514  if (tableSet == "fake" || vol->magFile == "fake") {
515  interpolators[vol->magFile] = new magneticfield::FakeInterpolator();
516  return;
517  }
518 
519  string fullPath;
520 
521  try {
522  edm::FileInPath mydata("MagneticField/Interpolation/data/" + tableSet + "/" + vol->magFile);
523  fullPath = mydata.fullPath();
524  } catch (edm::Exception& exc) {
525  cerr << "MagGeoBuilderFromDDD: exception in reading table; " << exc.what() << endl;
526  if (!debug)
527  throw;
528  return;
529  }
530 
531  try {
532  if (vol->toExpand()) {
533  //FIXME: see discussion on mergeCylinders above.
534  // interpolators[vol->magFile] =
535  // MFGridFactory::build( fullPath, *(vol->placement()), vol->minPhi(), vol->maxPhi());
536  } else {
537  // If the table is in "local" coordinates, must create a reference
538  // frame that is appropriately rotated along the CMS Z axis.
539 
541 
542  if (vol->masterSector != 1) {
544 
545  GloballyPositioned<float>::RotationType rot(Vector(0, 0, 1), -masterSectorPhi);
546  Vector vpos(vol->placement()->position());
547 
549  vol->placement()->rotation() * rot);
550  }
551 
552  interpolators[vol->magFile] = MFGridFactory::build(fullPath, rf);
553  }
554  } catch (MagException& exc) {
555  cout << exc.what() << endl;
556  interpolators.erase(vol->magFile);
557  if (!debug)
558  throw;
559  return;
560  }
561 
562  if (debug) {
563  // Check that all grid points of the interpolator are inside the volume.
564  const MagVolume6Faces tempVolume(
565  vol->placement()->position(), vol->placement()->rotation(), vol->sides(), interpolators[vol->magFile]);
566 
567  const MFGrid* grid = dynamic_cast<const MFGrid*>(interpolators[vol->magFile]);
568  if (grid != nullptr) {
569  Dimensions sizes = grid->dimensions();
570  cout << "Grid has 3 dimensions "
571  << " number of nodes is " << sizes.w << " " << sizes.h << " " << sizes.d << endl;
572 
573  const double tolerance = 0.03;
574 
575  size_t dumpCount = 0;
576  for (int j = 0; j < sizes.h; j++) {
577  for (int k = 0; k < sizes.d; k++) {
578  for (int i = 0; i < sizes.w; i++) {
579  MFGrid::LocalPoint lp = grid->nodePosition(i, j, k);
580  if (!tempVolume.inside(lp, tolerance)) {
581  if (++dumpCount < 2) {
582  MFGrid::GlobalPoint gp = tempVolume.toGlobal(lp);
583  cout << "GRID ERROR: " << i << " " << j << " " << k << " local: " << lp << " global: " << gp
584  << " R= " << gp.perp() << " phi=" << gp.phi() << endl;
585  }
586  }
587  }
588  }
589  }
590 
591  cout << "Volume:" << vol->volumeno << " : Number of grid points outside the MagVolume: " << dumpCount << "/"
592  << sizes.w * sizes.h * sizes.d << endl;
593  }
594  }
595 }
596 
598  // test inside() for all volumes.
599  cout << "--------------------------------------------------" << endl;
600  cout << " inside(center) test" << endl;
601  for (handles::const_iterator vol = volumes.begin(); vol != volumes.end(); ++vol) {
602  for (handles::const_iterator i = volumes.begin(); i != volumes.end(); ++i) {
603  if ((*i) == (*vol))
604  continue;
605  //if ((*i)->magVolume == 0) continue;
606  if ((*i)->magVolume->inside((*vol)->center())) {
607  cout << "*** ERROR: center of V " << (*vol)->volumeno << ":" << (*vol)->copyno << " is inside V "
608  << (*i)->volumeno << ":" << (*i)->copyno << endl;
609  }
610  }
611 
612  if ((*vol)->magVolume->inside((*vol)->center())) {
613  cout << "V " << (*vol)->volumeno << " OK " << endl;
614  } else {
615  cout << "*** ERROR: center of volume is not inside it, " << (*vol)->volumeno << endl;
616  }
617  }
618  cout << "--------------------------------------------------" << endl;
619 }
620 
621 vector<MagBLayer*> MagGeoBuilderFromDDD::barrelLayers() const { return mBLayers; }
622 
623 vector<MagESector*> MagGeoBuilderFromDDD::endcapSectors() const { return mESectors; }
624 
625 vector<MagVolume6Faces*> MagGeoBuilderFromDDD::barrelVolumes() const {
626  vector<MagVolume6Faces*> v;
627  v.reserve(bVolumes.size());
628  for (handles::const_iterator i = bVolumes.begin(); i != bVolumes.end(); ++i) {
629  v.push_back((*i)->magVolume);
630  }
631  return v;
632 }
633 
634 vector<MagVolume6Faces*> MagGeoBuilderFromDDD::endcapVolumes() const {
635  vector<MagVolume6Faces*> v;
636  v.reserve(eVolumes.size());
637  for (handles::const_iterator i = eVolumes.begin(); i != eVolumes.end(); ++i) {
638  v.push_back((*i)->magVolume);
639  }
640  return v;
641 }
642 
644  //FIXME: should get it from the actual geometry
645  return 900.;
646 }
647 
649  //FIXME: should get it from the actual geometry
650  if (geometryVersion >= 160812)
651  return 2400.;
652  else if (geometryVersion >= 120812)
653  return 2000.;
654  else
655  return 1600.;
656 }
657 
658 void MagGeoBuilderFromDDD::setScaling(const std::vector<int>& keys, const std::vector<double>& values) {
659  if (keys.size() != values.size()) {
660  throw cms::Exception("InvalidParameter")
661  << "Invalid field scaling parameters 'scalingVolumes' and 'scalingFactors' ";
662  }
663  for (unsigned int i = 0; i < keys.size(); ++i) {
665  }
666 }
667 
MagProviderInterpol.h
GloballyPositioned< float >
MagException::what
const char * what() const override
Definition: MagExceptions.cc:5
magneticfield::BaseVolumeHandle::magFile
std::string magFile
Name of magnetic field table file.
Definition: BaseVolumeHandle.h:66
ClusterizingHistogram::clusterize
std::vector< float > clusterize(float resolution)
Definition: ClusterizingHistogram.cc:54
volumeBasedMagneticField_160812_cfi.geometryVersion
geometryVersion
Definition: volumeBasedMagneticField_160812_cfi.py:39
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
DDExpandedView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDExpandedView.cc:47
DDExpandedView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDExpandedView.cc:100
MagGeoBuilderFromDDD::mBLayers
std::vector< MagBLayer * > mBLayers
Definition: MagGeoBuilderFromDDD.h:90
MagGeoBuilderFromDDD::theScalingFactors
std::map< int, double > theScalingFactors
Definition: MagGeoBuilderFromDDD.h:96
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
MagVolume::ownsFieldProvider
void ownsFieldProvider(bool o)
Definition: MagVolume.h:47
volumeHandle
MagGeoBuilderFromDDD::volumeHandle volumeHandle
Definition: volumeHandle.cc:238
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
magneticfield::BaseVolumeHandle::toExpand
bool toExpand() const
Definition: BaseVolumeHandle.h:105
MFGrid
Definition: MFGrid.h:27
MagGeoBuilderFromDDD::volumeHandle::sides
std::vector< VolumeSide > sides() const override
The surfaces and they orientation, as required to build a MagVolume.
Definition: volumeHandle.cc:218
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
bLayer.h
eLayer.h
magneticfield::BaseVolumeHandle::center
const GlobalPoint & center() const
Return the center of the volume.
Definition: BaseVolumeHandle.cc:42
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
magneticfield
Definition: MagFieldConfig.h:22
getRunAppsInfo.grid
grid
Definition: getRunAppsInfo.py:92
MagneticFieldProvider< float >
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
MagExceptions.h
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
cms::Exception::what
char const * what() const noexcept override
Definition: Exception.cc:103
magneticfield::BaseVolumeHandle::volumeno
unsigned short volumeno
volume number
Definition: BaseVolumeHandle.h:69
findQualityFiles.v
v
Definition: findQualityFiles.py:179
magneticfield::eSector
Definition: eSector.h:16
precomputed_value_sort.h
dqmdumpme.first
first
Definition: dqmdumpme.py:55
bRod.h
MagGeoBuilderFromDDD::barrelLayers
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
Definition: MagGeoBuilderFromDDD.cc:621
DDCompactView.h
eSector.h
MagGeoBuilderFromDDD::debug
const bool debug
Definition: MagGeoBuilderFromDDD.h:99
svgfig.rotate
def rotate(angle, cx=0, cy=0)
Definition: svgfig.py:705
FileInPath.h
Vector
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
MFGridFactory::build
static MFGrid * build(const std::string &name, const GloballyPositioned< float > &vol)
Build interpolator for a binary grid file.
edm::Exception
Definition: EDMException.h:77
edm::FileInPath
Definition: FileInPath.h:64
MagGeoBuilderFromDDD::setScaling
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
Definition: MagGeoBuilderFromDDD.cc:658
dqmdumpme.last
last
Definition: dqmdumpme.py:56
debug
#define debug
Definition: HDRShower.cc:19
DDExpandedView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDExpandedView.cc:60
Dimensions::w
int w
Definition: MFGrid.h:16
DDFilteredView.h
MagGeoBuilderFromDDD::maxZ
float maxZ() const
Definition: MagGeoBuilderFromDDD.cc:648
volumeBasedMagneticField_160812_cfi.volumes
volumes
Definition: volumeBasedMagneticField_160812_cfi.py:57
MagGeoBuilderFromDDD::maxR
float maxR() const
Definition: MagGeoBuilderFromDDD.cc:643
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
MagBLayer.h
magneticfield::FakeInterpolator
Definition: FakeInterpolator.h:14
MagGeoBuilderFromDDD::geometryVersion
int geometryVersion
Definition: MagGeoBuilderFromDDD.h:94
MFGridFactory.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
MagGeoBuilderFromDDD::setGridFiles
void setGridFiles(const magneticfield::TableFileMap &gridFiles)
Definition: MagGeoBuilderFromDDD.cc:668
DDBase::name
const N & name() const
Definition: DDBase.h:59
MagGeoBuilderFromDDD::volumeHandle
Definition: volumeHandle.h:23
L1TObjectsTimingClient_cff.resolution
resolution
Definition: L1TObjectsTimingClient_cff.py:52
Geom::pi
constexpr double pi()
Definition: Pi.h:31
volumeBasedMagneticField_160812_cfi.gridFiles
gridFiles
Definition: volumeBasedMagneticField_160812_cfi.py:45
MagVolume6Faces
Definition: MagVolume6Faces.h:23
MFGrid::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31
bSector.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
magneticfield::BaseVolumeHandle::placement
const GloballyPositioned< float > * placement() const
Position and rotation.
Definition: BaseVolumeHandle.h:97
DDExpandedView
Provides an exploded view of the detector (tree-view)
Definition: DDExpandedView.h:41
magneticfield::BaseVolumeHandle::masterSector
int masterSector
The sector for which an interpolator for this class of volumes should be built.
Definition: BaseVolumeHandle.h:111
magneticfield::handles
std::vector< BaseVolumeHandle * > handles
Definition: BaseVolumeHandle.h:154
MagGeoBuilderFromDDD::theGridFiles
const magneticfield::TableFileMap * theGridFiles
Definition: MagGeoBuilderFromDDD.h:97
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MagGeoBuilderFromDDD::build
virtual void build(const DDCompactView &cpv)
Definition: MagGeoBuilderFromDDD.cc:117
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MagGeoBuilderFromDDD::endcapSectors
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
Definition: MagGeoBuilderFromDDD.cc:623
magneticfield::bLayer
Definition: bLayer.h:17
edm::LogError
Definition: MessageLogger.h:183
FakeInterpolator.h
bSlab.h
Pi.h
GeantUnits.h
MagESector.h
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
MagGeoBuilderFromDDD::bVolumes
magneticfield::handles bVolumes
Definition: MagGeoBuilderFromDDD.h:87
ClusterizingHistogram::fill
void fill(float x)
Definition: ClusterizingHistogram.cc:38
DDFilter.h
MagException
Definition: MagExceptions.h:7
MagGeoBuilderFromDDD.h
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
DOFs::Z
Definition: AlignPCLThresholdsWriter.cc:37
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:27
MagGeoBuilderFromDDD::endcapVolumes
std::vector< MagVolume6Faces * > endcapVolumes() const
Definition: MagGeoBuilderFromDDD.cc:634
magneticfield::ExtractPhi
Definition: BaseVolumeHandle.h:169
MagGeoBuilderFromDDD::summary
void summary(magneticfield::handles &volumes)
Definition: MagGeoBuilderFromDDD.cc:72
MagVolume6Faces.h
hcal_runs.rf
rf
Definition: hcal_runs.py:75
magneticfield::BaseVolumeHandle::copyno
unsigned short copyno
copy number
Definition: BaseVolumeHandle.h:72
DDExpandedView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDExpandedView.cc:49
MagGeoBuilderFromDDD::MagGeoBuilderFromDDD
MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false)
Constructor.
Definition: MagGeoBuilderFromDDD.cc:56
MagGeoBuilderFromDDD::buildInterpolator
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: MagGeoBuilderFromDDD.cc:500
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
std
Definition: JetResolutionObject.h:76
MagGeoBuilderFromDDD::testInside
void testInside(magneticfield::handles &volumes)
Definition: MagGeoBuilderFromDDD.cc:597
volumeHandle.h
magneticfield::ExtractRN
Definition: BaseVolumeHandle.h:192
Geom::ftwoPi
constexpr float ftwoPi()
Definition: Pi.h:36
ClusterizingHistogram.h
MFGrid.h
Exception
Definition: hltDiff.cc:246
Dimensions::h
int h
Definition: MFGrid.h:17
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
MagGeoBuilderFromDDD::buildMagVolumes
void buildMagVolumes(const magneticfield::handles &volumes, std::map< std::string, MagProviderInterpol * > &interpolators)
Definition: MagGeoBuilderFromDDD.cc:456
MagGeoBuilderFromDDD::~MagGeoBuilderFromDDD
virtual ~MagGeoBuilderFromDDD()
Destructor.
Definition: MagGeoBuilderFromDDD.cc:62
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDExpandedView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
Definition: DDExpandedView.cc:41
Exception.h
magneticfield::TableFileMap
std::map< int, std::pair< std::string, int > > TableFileMap
Definition: MagFieldConfig.h:23
MagGeoBuilderFromDDD::barrelVolumes
std::vector< MagVolume6Faces * > barrelVolumes() const
Definition: MagGeoBuilderFromDDD.cc:625
Dimensions::d
int d
Definition: MFGrid.h:18
DDExpandedView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDExpandedView.cc:45
MagGeoBuilderFromDDD::tableSet
std::string tableSet
Definition: MagGeoBuilderFromDDD.h:93
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
volumeBasedMagneticField_160812_cfi.sectors
sectors
Definition: volumeBasedMagneticField_160812_cfi.py:59
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
crabWrapper.key
key
Definition: crabWrapper.py:19
dttmaxenums::R
Definition: DTTMax.h:29
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
Geom::fpi
constexpr float fpi()
Definition: Pi.h:35
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Basic3DVector< float >
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
MagGeoBuilderFromDDD::mESectors
std::vector< MagESector * > mESectors
Definition: MagGeoBuilderFromDDD.h:91
MFGrid::GlobalPoint
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MFGrid.h:29
Dimensions
Definition: MFGrid.h:15
ClusterizingHistogram
Definition: ClusterizingHistogram.h:13
MagGeoBuilderFromDDD::eVolumes
magneticfield::handles eVolumes
Definition: MagGeoBuilderFromDDD.h:88