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