GEAR  1.6.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
testVTXgear.cc
1 
2 #include "gearimpl/Util.h"
3 #include "gearxml/GearXML.h"
4 #include "gear/GearMgr.h"
5 #include "gear/GEAR.h"
6 #include "gear/VXDParameters.h"
7 
8 #ifdef CGA
9 #include "gearcga/CGAGearDistanceProperties.h"
10 #include "gearcga/CGAGearPointProperties.h"
11 #endif
12 
13 #include <iostream>
14 #include <assert.h>
15 
16 #include <exception>
17 #include <cstdlib>
18 
19 #include <sstream>
20 #include <fstream>
21 
22 #include <math.h>
23 
24 #ifdef GEAR_USE_AIDA
25 #include "AIDA/AIDA.h"
26 using namespace AIDA ;
27 #endif
28 
29 
30 
31 using namespace gear ;
32 
33 void testVXD( const VXDParameters& vxdParams ) ;
34 
35 void createCheckPlots( const VXDParameters& vxdParams ) ;
36 
37 void testVXDPoint( const Vector3D p , const VXDParameters& vxdParams ) ;
38 
39 void testVXDDist( const Vector3D p , const VXDParameters& vxdParams ) ;
40 
41 void testAllVXDPoint( const VXDParameters& vxdParams ) ;
42 
43 void testAllVXDDist( const VXDParameters& vxdParams ) ;
44 
45 void testVXDIntersection( const VXDParameters& vxdParams ) ;
46 
47 void gear_unexpected(){
48 
49  try {
50 
51  throw ;
52 
53  } catch( std::exception& e) {
54 
55  std::cout << " A runtime error has occured : "
56  << e.what()
57  << std::endl
58  << " the program will have to be terminated - sorry." << std::endl ;
59  exit(1) ;
60  }
61 }
62 
63 
64 #ifdef GEAR_USE_AIDA
65 // global variables for AIDA histograms and tuples
66 
67  IAnalysisFactory * myaida ;
68  ITreeFactory * mytreefactory ;
69  ITree * mytree ;
70  IHistogramFactory * myhistofactory ;
71  ITupleFactory * mytuplefactory ;
72 
73 #endif
74 
75 
76 
77 
78 
83 int main(int argc, char**argv){
84 
85 
86  std::set_unexpected( gear_unexpected ) ;
87  std::set_terminate( gear_unexpected ) ;
88 
89  if( argc < 2 ) {
90  std::cout << " testgear: Testprogram for vertex detecto in gear. " << std::endl
91  << " usage: testgear input.xml " << std::endl ;
92  exit(1) ;
93  }
94 
95  std::string fileName( argv[1] ) ;
96 
97  GearXML gearXML( fileName ) ;
98 
99  GearMgr* gearMgr = gearXML.createGearMgr() ;
100 
101 
102  std::cout << " testVTXgear - instantiated GearMgr from file " << fileName
103  << std::endl ;
104 
105  const VXDParameters& vp =
106  dynamic_cast<const VXDParameters&>( gearMgr->getVXDParameters() ) ;
107 
108 
109  std::cout << " VXD parameters : " << std::endl
110  << vp
111  << std::endl ;
112 
113 
114 
115 #ifdef GEAR_USE_AIDA
116 
117  std::string storeName("vxdCheckPlot.root");
118 
119  myaida = AIDA_createAnalysisFactory() ;
120 
121  mytreefactory = myaida->createTreeFactory() ;
122 
123  mytree = mytreefactory->create(storeName,"root",false,true,"none") ;
124  // mytreefactory->create(storeName,storeType,readOnly,createNew,options)
125 
126  myhistofactory = myaida->createHistogramFactory( *mytree ) ;
127  mytuplefactory = myaida->createTupleFactory( *mytree ) ;
128 
129 // const VXDParameters& vp =
130 // dynamic_cast<const VXDParameters&>( gearMgr->getVXDParameters() ) ;
131 
132  //testVXDIntersection( vp ) ;
133 
134  createCheckPlots( vp ) ;
135 
136 #else
137 
138  std::cout << " Compile with GEAR_USE_AIDA==1 to get some histograms ! "
139  << std::endl;
140 
141 #endif
142 
143 
144  testVXD( vp ) ;
145 
146 }
147 
148 void testVXD( const VXDParameters& vxdParams ) {
149 
150  // Methods for special debugging
151 
152  Vector3D p0 ( 0, 0 , 0 ) ;
153  Vector3D p1 ( 12 , 2 , 0 ) ;
154 // Vector3D p1 ( -36.8 , 7 , 10 ) ;
155  Vector3D p2 ( -15 ,-8, .5 ) ;
156  Vector3D p3 ( -30 , -2 , .5 ) ;
157  Vector3D p4 ( -25 ,-25.0 , 0 ) ;
158 
159 // testVXDPoint( p0 , vxdParams ) ;
160 // testVXDPoint( p1 , vxdParams ) ;
161 // testVXDPoint( p2 , vxdParams ) ;
162 // testVXDPoint( p3 , vxdParams ) ;
163 // testVXDPoint( p4 , vxdParams ) ;
164 
165 
166  testVXDDist( p0, vxdParams ) ;
167  testVXDDist( p1, vxdParams ) ;
168  testVXDDist( p2, vxdParams ) ;
169  testVXDDist( p3, vxdParams ) ;
170  testVXDDist( p4, vxdParams ) ;
171 
172  // testAllVXDDist( vxdParams ) ;
173  testAllVXDPoint( vxdParams ) ;
174 }
175 
176 #ifdef GEAR_USE_AIDA
177 
178 void createCheckPlots( const VXDParameters& vxdParams ) {
179 
180  // creates sophisticated checkplots
181 
182  // values for LoRes Overview
183  double testStart = -65 ;
184  double testEnd = 65 ;
185  double testStep = .05 ;
186  double zStart = 10 ;
187  double zEnd = 11 ;
188  double zStep = 1 ;
189 
190  // Every _skipDist_ Step the distance test is performed
191  int skipDist = 1000 ;
192 
193  // values for HiRes Part
194  double testDetailStart = 2 ;
195  double testDetailEnd = 18 ;
196  double testDetailStep = 0.005 ;
197 
198  float myStatusP = 0, myStatusL = 0;
199  int nLadder = 0 , nSensitive = 0 ;
200 
201  // ladder and sensitive Map
202  std::string mapName = "vxdMap" ;
203  std::string mapTitle = "Map of the VTX" ;
204  std::vector<std::string> columnNames ;
205  std::vector<std::string> columnTypes ;
206 
207  columnNames.push_back( "x" ) ; columnTypes.push_back( "double" ) ;
208  columnNames.push_back( "y" ) ; columnTypes.push_back( "double" ) ;
209  columnNames.push_back( "z" ) ; columnTypes.push_back( "double" ) ;
210  columnNames.push_back( "sensitive" ) ; columnTypes.push_back( "bool" ) ;
211 
212  ITuple *vxdMap = mytuplefactory->create( mapName , mapTitle , columnNames , columnTypes ) ;
213 
214  // ladder and sensitive Detail
215  mapName = "vxdDetailMap" ;
216  mapTitle = "Detailed Map of part of the VTX" ;
217 
218  ITuple *vxdDetailMap = mytuplefactory->create( mapName , mapTitle , columnNames , columnTypes ) ;
219 
220  // map of points pointed on by VXDParametes::distanceToLadder()
221  mapName = "vxdPointsOnSurface" ;
222  mapTitle = "Map of Points On Surface" ;
223 
224  ITuple *vxdSurfaceMap = mytuplefactory->create( mapName , mapTitle , columnNames , columnTypes ) ;
225 
226  // map of point returned from intersection function between line and vxd
227  mapName = "vxdIntersectionPoints" ;
228  mapTitle = "Map of Intersection Points" ;
229 
230  ITuple *vxdIntersectionMap = mytuplefactory->create( mapName , mapTitle , columnNames , columnTypes ) ;
231 
232  // Histogram of Distances Surface to Ladder
233  IHistogram1D *distanceHisto = myhistofactory->createHistogram1D("distance",
234  100, 0, 0.00000000000001 ) ;
235 
236  // number of point to be tested
237  int nPoints = int( (testEnd-testStart)*(testEnd-testStart)*(zEnd-zStart)
238  / ( testStep * testStep * zStep )
239  + (testDetailEnd-testDetailStart)*(testDetailEnd-testDetailStart)*(zEnd-zStart)
240  / (testDetailStep * testDetailStep * zStep ) ) ;
241 
242  std::cout << "Testing " << nPoints << " Points to AIDA" << std::endl ;
243 
244  //counter for skipping
245  int skipped = 0 ;
246 
247  // first run over normal map
248  // x
249  for ( double x = testStart ; x < testEnd ; x += testStep ) {
250 
251  // Status
252  float curStatus = (x - testStart) / (testEnd - testStart) * 50 ;
253  if ( curStatus > ( myStatusP + 0.25 ) ) {
254  myStatusP = curStatus ;
255  std::cout << "." << std::flush ;
256  }
257  if ( curStatus > ( myStatusL + 10 ) ) {
258  myStatusL = curStatus ;
259  std::cout << floor(myStatusL) << "% finished" << std::endl ;
260  }
261 
262 
263  // y
264  for ( double y=testStart ; y < testEnd ; y += testStep ) {
265 
266  // z
267  for ( double z = zStart ; z < zEnd ; z += zStep ) {
268 
269  Vector3D p ( x , y , z ) ;
270  bool isPoint = vxdParams.isPointInLadder( p ) ;
271  bool isSensitive = vxdParams.isPointInSensitive( p ) ;
272 
273  if( isPoint ) nLadder ++;
274  if( isSensitive ) nSensitive ++;
275 
276  if( isPoint || isSensitive ) {
277 
278  // regular map
279  vxdMap->fill( 0 , p[0] ) ;
280  vxdMap->fill( 1 , p[1] ) ;
281  vxdMap->fill( 2 , p[2] ) ;
282  vxdMap->fill( 3 , isSensitive ) ;
283  vxdMap->addRow() ;
284 
285  }
286 
287  if( skipped >= skipDist ) {
288  // points pointed on
289  // ladder
290  Vector3D v = vxdParams.distanceToNearestLadder( p ) ;
291  Vector3D np ( p[0] + v[0] , p[1] + v[1] , p[2] + v[2] ) ;
292  // sensitive
293  v = vxdParams.distanceToNearestSensitive( p ) ;
294  Vector3D nps ( p[0] + v[0] , p[1] + v[1] , p[2] + v[2] ) ;
295 
296  vxdSurfaceMap->fill( 0 , np[0] ) ;
297  vxdSurfaceMap->fill( 1 , np[1] ) ;
298  vxdSurfaceMap->fill( 2 , np[2] ) ;
299  vxdSurfaceMap->fill( 3 , false ) ;
300  vxdSurfaceMap->addRow() ;
301 
302  vxdSurfaceMap->fill( 0 , nps[0] ) ;
303  vxdSurfaceMap->fill( 1 , nps[1] ) ;
304  vxdSurfaceMap->fill( 2 , nps[2] ) ;
305  vxdSurfaceMap->fill( 3 , true ) ;
306  vxdSurfaceMap->addRow() ;
307 
308  // distance histogram
309  v = vxdParams.distanceToNearestLadder( np ) ;
310  distanceHisto->fill( sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ) ) ;
311 
312  // reset counter
313  skipped = 0 ;
314  }
315  else {
316  skipped ++ ;
317  }
318 
319  } // z
320  } // y
321  } //x
322 
323 
324  // second run over detailed map
325 
326  // x
327  for ( double x = testDetailStart ; x < testDetailEnd ; x += testDetailStep ) {
328 
329  // Status
330  float curStatus = (x - testDetailStart) / (testDetailEnd - testDetailStart) * 50 + 50 ;
331  if ( curStatus > ( myStatusP + 0.25 ) ) {
332  myStatusP = curStatus ;
333  std::cout << "." << std::flush ;
334  }
335  if ( curStatus > ( myStatusL + 10 ) ) {
336  myStatusL = curStatus ;
337  std::cout << floor(myStatusL) << "% finished" << std::endl ;
338  }
339 
340 
341  // y
342  for ( double y=testDetailStart ; y < testDetailEnd ; y += testDetailStep ) {
343 
344  // z
345  for ( double z = zStart ; z < zEnd ; z += zStep ) {
346 
347  Vector3D p ( x , y , z ) ;
348  bool isPoint = vxdParams.isPointInLadder( p ) ;
349  bool isSensitive = vxdParams.isPointInSensitive( p ) ;
350 
351  if( isPoint ) nLadder ++;
352  if( isSensitive ) nSensitive ++;
353 
354  if( isPoint || isSensitive ) {
355 
356  // regular map
357  vxdDetailMap->fill( 0 , p[0] ) ;
358  vxdDetailMap->fill( 1 , p[1] ) ;
359  vxdDetailMap->fill( 2 , p[2] ) ;
360  vxdDetailMap->fill( 3 , isSensitive ) ;
361  vxdDetailMap->addRow() ;
362 
363  }
364 
365  } // z
366  } // y
367  } //x
368 
369 
370  // testing intersectionVXD
371 
372  std::cout << "Testing intersection " << std::flush ;
373 
374  Vector3D p0 (0. , 0. , 10. ) ;
375  Vector3D p1 (75. , 75. , 10. ) ;
376 
377  Vector3D lineVec ;
378 
379  for( double phi=-M_PI ; phi < M_PI ; phi += (M_PI/180) ) {
380  lineVec = Vector3D ( sin(phi) , cos(phi) , 0 ) ;
381  Vector3D iPoint0 = vxdParams.intersectionLadder( p0 , lineVec ) ;
382  Vector3D iPoint1 = vxdParams.intersectionLadder( p1 , lineVec ) ;
383  vxdIntersectionMap->fill( 0, iPoint0[0] ) ;
384  vxdIntersectionMap->fill( 1, iPoint0[1] ) ;
385  vxdIntersectionMap->fill( 2, iPoint0[2] ) ;
386  vxdIntersectionMap->fill( 3, false ) ;
387  vxdIntersectionMap->addRow() ;
388  vxdIntersectionMap->fill( 0, iPoint1[0] ) ;
389  vxdIntersectionMap->fill( 1, iPoint1[1] ) ;
390  vxdIntersectionMap->fill( 2, iPoint1[2] ) ;
391  vxdIntersectionMap->fill( 3, false ) ;
392  vxdIntersectionMap->addRow() ;
393  }
394 
395  mytree->commit() ;
396 
397  std::cout << "\ntotal tested points: " << nPoints << "\n"
398  << " in ladder: " << nLadder << " (" << nLadder/nPoints*100 << ") \n"
399  << " in sensitive: " << nSensitive << " (" << nSensitive/nPoints*100 << ")\n"
400  << "Points finished " << std::endl ;
401 
402 
403  // start visualizing
404 
405 
406 
407 }
408 
409 #endif
410 
411 
412 void testVXDPoint( const Vector3D p , const VXDParameters& vxdParams ) {
413 
414  std::cout << p[0] <<" " << p[1] <<" "<< p[2] ;
415  bool isPoint = vxdParams.isPointInLadder( p ) ;
416 
417  if( isPoint ) {
418  std::cout << p[0] <<" " << p[1] <<" "<< p[2] << " inside";
419  }
420 
421  std::cout << std::endl ;
422 
423 }
424 
425 void testVXDDist( const Vector3D p , const VXDParameters& vxdParams ) {
426 
427  Vector3D v = vxdParams.distanceToNearestLadder( p ) ;
428 
429  std::cout << "\nPoint (" << p[0] << "," << p[1] << "," << p[2] << ") "
430  << "\ndistance Vector " << v << std::endl;
431 // << "\ndistance Vector (" << v[0] << "," << v[1] << "," << v[2] << ") " << std::endl;
432 
433 
434  Vector3D paL = p + v ;
435 
436 // //FG: test the point found:
437 // std::cout << " is point in ladder : " << vxdParams.isPointInLadder( paL ) << std::endl ;
438 
439  // how far are we still from the ladder ?
440  Vector3D v2 = vxdParams.distanceToNearestLadder( paL ) ;
441 
442  std::cout << " distance to ladder : " << v2.r() << std::endl ;
443 
444 
445 
446 
447 // bool isFound = false ;
448 
449 // double myStep =1 ;
450 // double lBound = 1 ;
451 // double uBound = 1 ;
452 
453 // for(double r1 = lBound ; r1 <= uBound ; r1+= myStep ) {
454 // for(double r2 = lBound ; r2 <= uBound ; r2+= myStep ) {
455 // for(double r3 = lBound ; r3 <= uBound ; r3+= myStep ) {
456 
457 // Vector3D iP ( p[0] + r1* v[0] , p[1] + r2* v[1] , p[2] + r3*v[2] ) ;
458 
459 // bool isPoint = vxdParams.isPointInLadder( iP ) ;
460 // if( isPoint ) {
461 // std::cout << "Vector point withhin Ladder at r =" << r1 <<" , " << r2 <<" , " << r3 << std::endl ;
462 // std::cout << " " << iP[0] << " , " << iP[1] << " , " << iP[2] << std::endl ;
463 // isFound = true ;
464 // break ;
465 // }
466 // else{
467 // std::cout << "ERROR Vector NOT pointin in Ladder." << std::endl ;
468 // }
469 // }
470 // if (isFound ) break ;
471 // }
472 // if (isFound ) break ;
473 // }
474 
475 
476 }
477 
478 void testAllVXDPoint( const VXDParameters& vxdParams ) {
479 
480  double testStart = -65 ;
481  double testEnd = 65 ;
482  double testStep = 0.05 ;
483  double zStart = 10 ;
484  double zEnd = 11 ;
485  double zStep = 1 ;
486 
487  float myStatusP = 0, myStatusL = 0;
488  int nLadder = 0 , nSensitive = 0 ;
489 
490  std::ofstream myfile;
491  const char *fileName = "./gearVXDTest.txt" ;
492  myfile.open (fileName, std::ios::out | std::ios::trunc );
493 
494 
495 #ifdef GEAR_USE_AIDA
496 // IHistogram2D *ladderMap = myhistofactory->createHistogram2D("ladderMap",
497 // 500, testStart, testEnd,
498 // 500, testStart, testEnd );
499  std::string mapName = "vxdMap" ;
500  std::string mapTitle = "Map of the VTX" ;
501  std::vector<std::string> columnNames ;
502  std::vector<std::string> columnTypes ;
503 
504  columnNames.push_back( "x" ) ; columnTypes.push_back( "double" ) ;
505  columnNames.push_back( "y" ) ; columnTypes.push_back( "double" ) ;
506  columnNames.push_back( "z" ) ; columnTypes.push_back( "double" ) ;
507  columnNames.push_back( "sensitive" ) ; columnTypes.push_back( "bool" ) ;
508 
509  ITuple *ladderMap = mytuplefactory->create( mapName , mapTitle , columnNames , columnTypes ) ;
510 
511 
512 #endif
513 
514  int nPoints = int( (testEnd-testStart)*(testEnd-testStart)*(zEnd-zStart)
515  / ( testStep * testStep * zStep ) ) ;
516  std::cout << "Testing " << nPoints << " Points to AIDA" << std::endl ;
517 
518  // x
519  for ( double x=testStart ; x < testEnd ; x += testStep ) {
520 
521  // Status
522  float curStatus = (x - testStart) / (testEnd - testStart) * 100 ;
523  if ( curStatus > ( myStatusP + 0.25 ) ) {
524  myStatusP = curStatus ;
525  std::cout << "." << std::flush ;
526  }
527  if ( curStatus > ( myStatusL + 10 ) ) {
528  myStatusL = curStatus ;
529  std::cout << floor(myStatusL) << "% finished" << std::endl ;
530  }
531 
532  // y
533  for ( double y=testStart ; y < testEnd ; y += testStep ) {
534 
535  // z
536  for ( double z = zStart ; z < zEnd ; z += zStep ) {
537 
538  Vector3D p ( x , y , z ) ;
539  bool isPoint = vxdParams.isPointInLadder( p ) ;
540  bool isSensitive = vxdParams.isPointInSensitive( p ) ;
541 
542  if( isPoint ) nLadder ++;
543  if( isSensitive ) nSensitive ++;
544 
545  if( isPoint || isSensitive ) {
546  myfile << p[0] <<" " << p[1] <<" "<< p[2] << " " << isSensitive << "\n" ;
547 
548 #ifdef GEAR_USE_AIDA
549  ladderMap->fill( 0 , p[0] ) ;
550  ladderMap->fill( 1 , p[1] ) ;
551  ladderMap->fill( 2 , p[2] ) ;
552  ladderMap->fill( 3 , isSensitive ) ;
553  ladderMap->addRow() ;
554 #endif
555  }
556 
557  } // z
558  } // y
559  } //x
560 
561  myfile.close() ;
562 
563  std::cout << "\ntotal tested points: " << nPoints << "\n"
564  << " in ladder: " << nLadder << " (" << nLadder/nPoints*100 << ") \n"
565  << " in sensitive: " << nSensitive << " (" << nSensitive/nPoints*100 << ")\n"
566  << "Points finished " << std::endl ;
567 
568 }
569 
570 
571 void testAllVXDDist( const VXDParameters& vxdParams ) {
572 
573  double testStart = -65 ;
574  double testEnd = 65 ;
575  double testStep = 1 ;
576  double zStart = -120 ;
577  double zEnd = 120 ;
578  double zStep = 10 ;
579 
580  float myStatusP = 0, myStatusL = 0;
581 
582  std::ofstream myfile, myHisto;
583  const char *fileName = "./gearVXDTest_out.txt" ;
584  const char *histoName = "./gearVXDTest_Histogram.txt" ;
585  myfile.open (fileName, std::ios::out | std::ios::trunc );
586  myHisto.open( histoName, std::ios::out | std::ios::trunc ) ;
587 
588  int nPoints = int ( (testEnd-testStart)*(testEnd-testStart)*(zEnd-zStart)
589  / ( testStep * testStep * zStep ) ) ;
590  std::cout << "Testing " << nPoints << " Points to file : " << fileName <<std::endl ;
591 
592  // x
593  for ( double x=testStart ; x < testEnd ; x += testStep ) {
594 
595  // Status
596  float curStatus = (x - testStart) / (testEnd - testStart) * 100 ;
597  if ( curStatus > ( myStatusP + 0.25 ) ) {
598  myStatusP = curStatus ;
599  std::cout << "." << std::flush ;
600  }
601  if ( curStatus > ( myStatusL + 10 ) ) {
602  myStatusL = curStatus ;
603  std::cout << floor(myStatusL) << "% finished" << std::endl ;
604  }
605 
606  // y
607  for ( double y=testStart ; y < testEnd ; y += testStep ) {
608 
609  // z
610  for ( double z = zStart ; z < zEnd ; z += zStep ) {
611 
612  Vector3D p ( x , y , z ) ;
613  Vector3D nv = vxdParams.distanceToNearestLadder( p ) ;
614  Vector3D np ( p[0] + nv[0] , p[1] + nv[1] , p[2] + nv[2] ) ;
615 
616  //bool isPoint = vxdParams.isPointInLadder( np ) ;
617 
618  //if( !isPoint ) {
619  Vector3D nv2 = vxdParams.distanceToNearestLadder( np ) ;
620  myHisto << sqrt( nv2[0]*nv2[0] + nv2[1]*nv2[1] + nv2[2]*nv2[2] ) << "\n" ;
621  myfile << np[0] <<" " << np[1] <<" "<< np[2] << 0 << "\n" ;
622  //}
623 
624  } // z
625  } // y
626  } //x
627 
628  myfile.close() ;
629  myHisto.close() ;
630 
631  std::cout << "Points finished " << std::endl ;
632 }
virtual bool isPointInSensitive(Vector3D p, SensorID *sensorID=0) const =0
returns wheter a point is inside a sensitive volume- if sensorID != 0 the sensorID is returned in cas...
Geometry properties of a vertex detector needed for reconstruction code.
virtual const ZPlanarParameters & getVXDParameters() const =0
Get the VXD parameters.
virtual bool isPointInLadder(Vector3D p) const =0
returns whether a point is inside a ladder
Implementation of GEAR using XML.
Definition: GearXML.h:18
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
Definition: Vector3D.h:18
virtual Vector3D distanceToNearestLadder(Vector3D p) const =0
returns vector from point to nearest ladder
virtual Vector3D intersectionLadder(Vector3D p, Vector3D v) const =0
returns the first point where a given straight line (parameters point p and direction v) crosses a la...
double r() const
Spherical r/magnitude.
Definition: Vector3D.h:119
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
Definition: GearMgr.h:36
virtual Vector3D distanceToNearestSensitive(Vector3D p) const =0
returns vector from point to nearest sensitive volume