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  * \author N. Amapane - INFN Torino
5  */
6 
16 
19 
21 
25 
27 #include "CLHEP/Units/GlobalSystemOfUnits.h"
28 
32 
36 
38 
41 
42 #include <string>
43 #include <vector>
44 #include <iostream>
45 #include <sstream>
46 #include <algorithm>
47 #include <iterator>
48 #include <map>
49 #include <set>
50 #include <iomanip>
51 #include <boost/algorithm/string/replace.hpp>
53 
54 
56 
57 using namespace std;
58 using namespace magneticfield;
59 
60 
61 MagGeoBuilderFromDDD::MagGeoBuilderFromDDD(string tableSet_,int geometryVersion_, bool debug_) :
62  tableSet (tableSet_),
63  geometryVersion(geometryVersion_),
64  theGridFiles(0)
65 {
66  debug = debug_;
67  if (debug) cout << "Constructing a MagGeoBuilderFromDDD" <<endl;
68 }
69 
71  for (handles::const_iterator i=bVolumes.begin();
72  i!=bVolumes.end(); ++i){
73  delete (*i);
74  }
75 
76  for (handles::const_iterator i=eVolumes.begin();
77  i!=eVolumes.end(); ++i){
78  delete (*i);
79  }
80 }
81 
82 
84  // The final countdown.
85  int ivolumes = volumes.size(); // number of volumes
86  int isurfaces = ivolumes*6; // number of individual surfaces
87  int iassigned = 0; // How many have been assigned
88  int iunique = 0; // number of unique surfaces
89  int iref_ass = 0;
90  int iref_nass = 0;
91 
92  set<const void *> ptrs;
93 
94  handles::const_iterator first = volumes.begin();
95  handles::const_iterator last = volumes.end();
96 
97  for (handles::const_iterator i=first; i!=last; ++i){
98  if (int((*i)->shape())>4) continue; // FIXME: implement test for missing shapes...
99  for (int side = 0; side < 6; ++side) {
100  int references = (*i)->references(side);
101  if ((*i)->isPlaneMatched(side)) {
102  ++iassigned;
103  bool firstOcc = (ptrs.insert(&((*i)->surface(side)))).second;
104  if (firstOcc) iref_ass+=references;
105  if (references<2){
106  cout << "*** Only 1 ref, vol: " << (*i)->volumeno << " # "
107  << (*i)->copyno << " side: " << side << endl;
108  }
109  } else {
110  iref_nass+=references;
111  if (references>1){
112  cout << "*** Ref_nass >1 " <<endl;
113  }
114  }
115  }
116  }
117  iunique = ptrs.size();
118 
119  cout << " volumes " << ivolumes << endl
120  << " surfaces " << isurfaces << endl
121  << " assigned " << iassigned << endl
122  << " unique " << iunique << endl
123  << " iref_ass " << iref_ass << endl
124  << " iref_nass " << iref_nass << endl;
125 }
126 
127 
129 {
130 // DDCompactView cpv;
131  DDExpandedView fv(cpva);
132 
133  if (debug) cout << "**********************************************************" <<endl;
134 
135  // The actual field interpolators
136  map<string, MagProviderInterpol*> bInterpolators;
137  map<string, MagProviderInterpol*> eInterpolators;
138 
139  // Counter of different volumes
140  int bVolCount = 0;
141  int eVolCount = 0;
142 
143  if (fv.logicalPart().name().name()!="MAGF") {
144  std::string topNodeName(fv.logicalPart().name().name());
145 
146  //see if one of the children is MAGF
147  bool doSubDets = fv.firstChild();
148 
149  bool go=true;
150  while(go&& doSubDets) {
151  if (fv.logicalPart().name().name()=="MAGF")
152  break;
153  else
154  go = fv.nextSibling();
155  }
156  if (!go) {
157  throw cms::Exception("NoMAGFinDDD")<<" Neither the top node, nor any child node of the DDCompactView is \"MAGF\" but the top node is instead \""<<topNodeName<<"\"";
158  }
159  }
160  // Loop over MAGF volumes and create volumeHandles.
161  if (debug) { cout << endl << "*** MAGF: " << fv.geoHistory() << endl
162  << "translation: " << fv.translation() << endl
163  << " rotation: " << fv.rotation() << endl;
164  }
165 
166  bool doSubDets = fv.firstChild();
167  while (doSubDets){
168 
169  string name = fv.logicalPart().name().name();
170  if (debug) cout << endl << "Name: " << name << endl
171  << " " << fv.geoHistory() <<endl;
172 
173  // FIXME: single-volyme cylinders - this is feature has been removed
174  // and should be revisited.
175  // bool mergeCylinders=false;
176 
177  // If true, In the barrel, cylinders sectors will be skipped to build full
178  // cylinders out of sector copyno #1.
179  bool expand = false;
180 
181 // if (mergeCylinders) {
182 // if (name == "V_ZN_1"
183 // || name == "V_ZN_2") {
184 // if (debug && fv.logicalPart().solid().shape()!=ddtubs) {
185 // cout << "ERROR: MagGeoBuilderFromDDD::build: volume " << name
186 // << " should be a cylinder" << endl;
187 // }
188 // if(fv.copyno()==1) {
189 // expand = true;
190 // } else {
191 // //cout << "... to be skipped: "
192 // // << name << " " << fv.copyno() << endl;
193 // }
194 // }
195 // }
196 
197  volumeHandle* v = new volumeHandle(fv, expand);
198 
199  if (theGridFiles!=0) {
200  int key = (v->volumeno)*100+v->copyno;
201  TableFileMap::const_iterator itable = theGridFiles->find(key);
202  if (itable == theGridFiles->end()) {
203  key = (v->volumeno)*100;
204  itable = theGridFiles->find(key);
205  }
206 
207  if (itable != theGridFiles->end()) {
208  string magFile = (*itable).second.first;
209  stringstream conv;
210  string svol, ssec;
211  conv << setfill('0') << setw(3) << v->volumeno << " " << setw(2) << v->copyno; // volume assumed to have 0s padding to 3 digits; sector assumed to have 0s padding to 2 digits
212  conv >> svol >> ssec;
213  boost::replace_all(magFile, "[v]",svol);
214  boost::replace_all(magFile, "[s]",ssec);
215  int masterSector = (*itable).second.second;
216  if (masterSector==0) masterSector=v->copyno;
217  v->magFile = magFile;
218  v->masterSector = masterSector;
219  } else {
220  edm::LogError("MagGeoBuilderFromDDDbuild") << "ERROR: no table spec found for V " << v->volumeno << ":" << v->copyno;
221  }
222  }
223 
224 
225  // Select volumes, build volume handles.
226  float Z = v->center().z();
227  float R = v->center().perp();
228 
229  // v 85l: Barrel is everything up to |Z| = 661.0, excluding
230  // volume #7, centered at 6477.5
231  // v 1103l: same numbers work fine. #16 instead of #7, same coords;
232  // see comment below for V6,7
233  //ASSUMPTION: no misalignment is applied to mag volumes.
234  //FIXME: implement barrel/endcap flags as DDD SpecPars.
235  if ((fabs(Z)<647. || (R>350. && fabs(Z)<662.)) &&
236  !(fabs(Z)>480 && R<172) // in 1103l we place V_6 and V_7 in the
237  // endcaps to preserve nice layer structure
238  // in the barrel. This does not hurt in v85l
239  // where there is a single V1
240  ) { // Barrel
241  if (debug) cout << " (Barrel)" <<endl;
242  bVolumes.push_back(v);
243 
244 
245  // Build the interpolator of the "master" volume (the one which is
246  // not replicated in phi)
247  // ASSUMPTION: copyno == sector.
248  if (v->copyno==v->masterSector) {
249  buildInterpolator(v, bInterpolators);
250  ++bVolCount;
251  }
252  } else { // Endcaps
253  if (debug) cout << " (Endcaps)" <<endl;
254  eVolumes.push_back(v);
255  if (v->copyno==v->masterSector) {
256  buildInterpolator(v, eInterpolators);
257  ++eVolCount;
258  }
259  }
260 
261  doSubDets = fv.nextSibling(); // end of loop over MAGF
262  }
263 
264  if (debug) {
265  cout << "Number of volumes (barrel): " << bVolumes.size() <<endl
266  << "Number of volumes (endcap): " << eVolumes.size() <<endl;
267  cout << "**********************************************************" <<endl;
268  }
269 
270  // Now all volumeHandles are there, and parameters for each of the planes
271  // are calculated.
272 
273  //----------------------------------------------------------------------
274  // Print summary information
275 
276  if (debug) {
277  cout << "-----------------------" << endl;
278  cout << "SUMMARY: Barrel " << endl;
279  summary(bVolumes);
280 
281  cout << endl << "SUMMARY: Endcaps " << endl;
282  summary(eVolumes);
283  cout << "-----------------------" << endl;
284  }
285 
286 
287  //----------------------------------------------------------------------
288  // Find barrel layers.
289 
290  vector<bLayer> layers; // the barrel layers
292 
293  // Find the layers (in R)
294  const float resolution = 1.; // cm
295  float rmin = bVolumes.front()->RN()-resolution;
296  float rmax = bVolumes.back()->RN()+resolution;
297  ClusterizingHistogram hisR( int((rmax-rmin)/resolution) + 1, rmin, rmax);
298 
299  if (debug) cout << " R layers: " << rmin << " " << rmax << endl;
300 
301  handles::const_iterator first = bVolumes.begin();
302  handles::const_iterator last = bVolumes.end();
303 
304  for (handles::const_iterator i=first; i!=last; ++i){
305  hisR.fill((*i)->RN());
306  }
307  vector<float> rClust = hisR.clusterize(resolution);
308 
309  handles::const_iterator ringStart = first;
310  handles::const_iterator separ = first;
311 
312  for (unsigned int i=0; i<rClust.size() - 1; ++i) {
313  if (debug) cout << " Layer at RN = " << rClust[i];
314  float rSepar = (rClust[i] + rClust[i+1])/2.f;
315  while ((*separ)->RN() < rSepar) ++separ;
316 
317  bLayer thislayer(ringStart, separ);
318  layers.push_back(thislayer);
319  ringStart = separ;
320  }
321  {
322  if (debug) cout << " Layer at RN = " << rClust.back();
323  bLayer thislayer(separ, last);
324  layers.push_back(thislayer);
325  }
326 
327  if (debug) cout << "Barrel: Found " << rClust.size() << " clusters in R, "
328  << layers.size() << " layers " << endl << endl;
329 
330 
331  //----------------------------------------------------------------------
332  // Find endcap sectors
333  vector<eSector> sectors; // the endcap sectors
334 
335  // Find the number of sectors (should be 12 or 24 depending on the geometry model)
336  float phireso = 0.05; // rad
337  ClusterizingHistogram hisPhi( int((Geom::ftwoPi())/phireso) + 1,
338  -Geom::fpi(), Geom::fpi());
339 
340  for (handles::const_iterator i=eVolumes.begin(); i!=eVolumes.end(); ++i){
341  hisPhi.fill((*i)->minPhi());
342  }
343  vector<float> phiClust = hisPhi.clusterize(phireso);
344  int nESectors = phiClust.size();
345  if (debug && (nESectors%12)!=0) cout << "ERROR: unexpected # of sectors: " << nESectors << endl;
346 
347  //Sort in phi
349 
350  //Group volumes in sectors
351  for (int i = 0; i<nESectors; ++i) {
352  int offset = eVolumes.size()/nESectors;
353  if (debug) cout << " Sector at phi = "
354  << (*(eVolumes.begin()+((i)*offset)))->center().phi()
355  << endl;
356  sectors.push_back(eSector(eVolumes.begin()+((i)*offset),
357  eVolumes.begin()+((i+1)*offset)));
358  }
359 
360  if (debug) cout << "Endcap: Found "
361  << sectors.size() << " sectors " << endl;
362 
363 
364  //----------------------------------------------------------------------
365  // Match surfaces.
366 
367 // cout << "------------------" << endl << "Now associating planes..." << endl;
368 
369 // // Loop on layers
370 // for (vector<bLayer>::const_iterator ilay = layers.begin();
371 // ilay!= layers.end(); ++ilay) {
372 // cout << "On Layer: " << ilay-layers.begin() << " RN: " << (*ilay).RN()
373 // <<endl;
374 
375 // // Loop on wheels
376 // for (vector<bWheel>::const_iterator iwheel = (*ilay).wheels.begin();
377 // iwheel != (*ilay).wheels.end(); ++iwheel) {
378 // cout << " On Wheel: " << iwheel- (*ilay).wheels.begin()<< " Z: "
379 // << (*iwheel).minZ() << " " << (*iwheel).maxZ() << " "
380 // << ((*iwheel).minZ()+(*iwheel).maxZ())/2. <<endl;
381 
382 // // Loop on sectors.
383 // for (int isector = 0; isector<12; ++isector) {
384 // // FIXME: create new constructor...
385 // bSectorNavigator navy(layers,
386 // ilay-layers.begin(),
387 // iwheel-(*ilay).wheels.begin(),isector);
388 
389 // const bSector & isect = (*iwheel).sector(isector);
390 
391 // isect.matchPlanes(navy); //FIXME refcount
392 // }
393 // }
394 // }
395 
396 
397  //----------------------------------------------------------------------
398  // Build MagVolumes and the MagGeometry hierarchy.
399 
400  //--- Barrel
401 
402  // Build MagVolumes and associate interpolators to them
403  buildMagVolumes(bVolumes, bInterpolators);
404 
405  // Build MagBLayers
406  for (vector<bLayer>::const_iterator ilay = layers.begin();
407  ilay!= layers.end(); ++ilay) {
408  mBLayers.push_back((*ilay).buildMagBLayer());
409  }
410 
411  if (debug) {
412  cout << "*** BARREL ********************************************" << endl
413  << "Number of different volumes = " << bVolCount << endl
414  << "Number of interpolators built = " << bInterpolators.size() << endl
415  << "Number of MagBLayers built = " << mBLayers.size() << endl;
416 
417  testInside(bVolumes); // FIXME: all volumes should be checked in one go.
418  }
419 
420  //--- Endcap
421  // Build MagVolumes and associate interpolators to them
422  buildMagVolumes(eVolumes, eInterpolators);
423 
424  // Build the MagESectors
425  for (vector<eSector>::const_iterator isec = sectors.begin();
426  isec!= sectors.end(); ++isec) {
427  mESectors.push_back((*isec).buildMagESector());
428  }
429 
430  if (debug) {
431  cout << "*** ENDCAP ********************************************" << endl
432  << "Number of different volumes = " << eVolCount << endl
433  << "Number of interpolators built = " << eInterpolators.size() << endl
434  << "Number of MagESector built = " << mESectors.size() << endl;
435 
436  testInside(eVolumes); // FIXME: all volumes should be checked in one go.
437  }
438 }
439 
440 
441 void MagGeoBuilderFromDDD::buildMagVolumes(const handles & volumes, map<string, MagProviderInterpol*> & interpolators) {
442  // Build all MagVolumes setting the MagProviderInterpol
443  for (handles::const_iterator vol=volumes.begin(); vol!=volumes.end();
444  ++vol){
445  const MagProviderInterpol* mp = 0;
446  if (interpolators.find((*vol)->magFile)!=interpolators.end()) {
447  mp = interpolators[(*vol)->magFile];
448  } else {
449  edm::LogError("MagGeoBuilderFromDDDbuildMagVolumes") << "No interpolator found for file " << (*vol)->magFile
450  << " vol: " << (*vol)->volumeno << "\n" << interpolators.size() <<endl;
451  }
452 
453  // Search for [volume,sector] in the list of scaling factors; sector = 0 handled as wildcard
454  // ASSUMPTION: copyno == sector.
455  int key = ((*vol)->volumeno)*100+(*vol)->copyno;
456  map<int, double>::const_iterator isf = theScalingFactors.find(key);
457  if (isf == theScalingFactors.end()) {
458  key = ((*vol)->volumeno)*100;
459  isf = theScalingFactors.find(key);
460  }
461 
462  double sf = 1.;
463  if (isf != theScalingFactors.end()) {
464  sf = (*isf).second;
465 
466  edm::LogInfo("MagneticField|VolumeBasedMagneticFieldESProducer") << "Applying scaling factor " << sf << " to "<< (*vol)->volumeno << "["<< (*vol)->copyno << "] (key:" << key << ")" << endl;
467  }
468 
469  const GloballyPositioned<float> * gpos = (*vol)->placement();
470  (*vol)->magVolume = new MagVolume6Faces(gpos->position(),
471  gpos->rotation(),
472  (*vol)->shape(),
473  (*vol)->sides(),
474  mp, sf);
475 
476  if ((*vol)->copyno==(*vol)->masterSector) {
477  (*vol)->magVolume->ownsFieldProvider(true);
478  }
479 
480  (*vol)->magVolume->setIsIron((*vol)->isIron());
481 
482  // The name and sector of the volume are saved for debug purposes only. They may be removed at some point...
483  (*vol)->magVolume->volumeNo = (*vol)->volumeno;
484  (*vol)->magVolume->copyno = (*vol)->copyno;
485  }
486 }
487 
488 
489 void MagGeoBuilderFromDDD::buildInterpolator(const volumeHandle * vol, map<string, MagProviderInterpol*> & interpolators){
490 
491  // Phi of the master sector
492  double masterSectorPhi = (vol->masterSector-1)*Geom::pi()/6.;
493 
494  if (debug) {
495  cout << "Building interpolator from "
496  << vol->volumeno << " copyno " << vol->copyno
497  << " at " << vol->center()
498  << " phi: " << vol->center().phi()
499  << " file: " << vol->magFile
500  << " master : " << vol->masterSector
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" || vol->magFile== "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 << "Volume:" << vol->volumeno << " : 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 V " << (*vol)->volumeno << ":" << (*vol)->copyno << " is inside V "
613  << (*i)->volumeno << ":" << (*i)->copyno << endl;
614  }
615  }
616 
617  if ((*vol)->magVolume->inside((*vol)->center())) {
618  cout << "V " << (*vol)->volumeno << " OK " << endl;
619  } else {
620  cout << "*** ERROR: center of volume is not inside it, "
621  << (*vol)->volumeno << 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
659  return 900.;
660 }
661 
663  //FIXME: should get it from the actual geometry
664  if (geometryVersion>=120812) return 2000.;
665  else return 1600.;
666 }
667 
668 
669 void MagGeoBuilderFromDDD::setScaling(const std::vector<int>& keys,
670  const std::vector<double>& values)
671 {
672  if (keys.size() != values.size()) {
673  throw cms::Exception("InvalidParameter") << "Invalid field scaling parameters 'scalingVolumes' and 'scalingFactors' ";
674  }
675  for (unsigned int i=0; i<keys.size(); ++i) {
676  theScalingFactors[keys[i]] = values[i];
677  }
678 }
679 
680 
682  theGridFiles=&gridFiles;
683 }
684 
685 
const double Z[kNumberCalorimeter]
virtual char const * what() const
Definition: Exception.cc:141
unsigned short copyno
copy number
Definition: volumeHandle.h:62
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.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
const N & name() const
Definition: DDBase.h:82
T perp() const
Definition: PV3DBase.h:72
static HepMC::IO_HEPEVT conv
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
std::vector< VolumeSide > sides() const
The surfaces and they orientation, as required to build a MagVolume.
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
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:34
float fpi()
Definition: Pi.h:35
type of data representation of DDCompactView
Definition: DDCompactView.h:77
DDSolidShape shape() const
Shape of the solid.
Definition: volumeHandle.h:97
void summary(handles &volumes)
int w
Definition: MFGrid.h:17
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:64
int j
Definition: DBlmapReader.cc:9
std::string magFile
Name of magnetic field table file.
Definition: volumeHandle.h:58
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:75
const DDTranslation & translation() const
The absolute translation of the current node.
MagGeoBuilderFromDDD(std::string tableSet_, int geometryVersion, bool debug=false)
Constructor.
unsigned short volumeno
volume number
Definition: volumeHandle.h:60
const magneticfield::TableFileMap * theGridFiles
bool firstChild()
set the current node to the first child ...
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MFGrid.h:32
void buildInterpolator(const volumeHandle *vol, std::map< std::string, MagProviderInterpol * > &interpolators)
bool nextSibling()
set the current node to the next sibling ...
Definition: MFGrid.h:29
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
int d
Definition: MFGrid.h:19
int h
Definition: MFGrid.h:18
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:165
std::vector< MagESector * > mESectors
std::map< int, std::pair< std::string, int > > TableFileMap
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
void ownsFieldProvider(bool o)
Definition: MagVolume.h:53
void setGridFiles(const magneticfield::TableFileMap &gridFiles)
float ftwoPi()
Definition: Pi.h:36