CMS 3D CMS Logo

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