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