EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SensitiveVolume.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SensitiveVolume.cxx
1 //
2 // AYK (ayk@bnl.gov), 2014/09/19
3 //
4 // Re-mastered RegisteringPlane class;
5 //
6 
7 // Looks stupid to redefine this stuff; but I really don't want to include
8 // htcvtx.h with all the ADAMO stuff in;
9 #define _SX_ 2
10 #define _SY_ 3
11 
12 #include <htclib.h>
13 #include <SensitiveVolume.h>
14 #include <MediaBank.h>
15 
16 // Yes, per default energy losses are accounted; as well as multiple scattering;
17 //int dE_dx_flag = 1;
18 
19 // Steps for taking numerical derivatives; tune later!; NB: drv_steps_qp will be
20 // calculated in Runge-Kutta code for each track new (depending on momentum)!;
21 double _drv_steps[4] = {0.001, 0.001, 0.001, 0.001};
22 
23 /* ========================================================================== */
24 
26  double qdist[])
27 {
28  KalmanNodeWrapper *kfwrapper = &mKfNodeWrappers[hit->GetKfNodeID()];
29 
30  double xgarr[3] = {line->x [0], line->x [1], line->x [2]}, xnarr[3];
31  double ngarr[3] = {line->nx[0], line->nx[1], line->nx[2]}, nnarr[3];
32 
33  // Move 'line' to the node coordinate system (this includes MARS->SV & SV->ND
34  // transformations);
35  kfwrapper->GetNodeToMasterMtx()->MasterToLocal (xgarr, xnarr);
36  kfwrapper->GetNodeToMasterMtx()->MasterToLocalVect(ngarr, nnarr);
37 
38  t_3d_line local_line(TVector3(xnarr[0], xnarr[1], xnarr[2]),
39  TVector3(nnarr[0], nnarr[1], nnarr[2]));
40 
41  TVector3 vtx;
42  t_3d_plane local_plane(TVector3(0,0,0), TVector3(0,0,1));
43  if (cross_p_l(&local_plane, &local_line, vtx)) return -1;
44 
45  unsigned dim = kfwrapper->GetKfNode(0)->GetMdim();
46  double coord[dim];
47  EicKfNodeTemplate *kftmpl = kfwrapper->GetKfNodeTemplate();
48 
49  kftmpl->ThreeDeeToTemplate(vtx, coord);
50 
51  for(unsigned ipp=0; ipp<dim; ipp++)
52  qdist[ipp] = coord[ipp] - hit->_GetCoord(ipp);
53 
54  return 0;
55 } // SensitiveVolume::TrackToHitDistance()
56 
57 /* ========================================================================== */
58