StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gl3Hit.cxx
1 #include "Stl3Util/gl3/gl3Hit.h"
2 
3 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // Print a gl3Hit
5 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 void gl3Hit::print ( ){
7  printf ( "%d %7.2f %7.2f %7.2f\n", rowSector, x, y, z );
8 }
9 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 // Set a gl3Hit from a l3_cluster structure
11 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 int gl3Hit::set ( St_l3_Coordinate_Transformer* transformer,
13  int sector, l3_cluster* cluster ){
14 
15  St_l3_xyz_Coordinate XYZ(0,0,0) ;
16  St_l3_ptrs_Coordinate PTRS(0,0,0,0) ;
17 
18  double pad = double(cluster->pad)/64.;
19  double time = double(cluster->time)/64.;
20 
21  readoutBoard = cluster->RB_MZ / 16 ;
22  if ( readoutBoard > 5 && sector%2==1) sector++ ; // when two sectors in one crate
23  // last 3 readout boards belong to next sector
24  mezzanninneCard = cluster->RB_MZ%16 ;
25 
26  rowSector = sector * 100 + cluster->padrow ;
27 
28 // rawToGlobal(sector, (int)cluster->padrow, pad, time, &xx, &yy, &zz);
29 
30  PTRS.Setptrs((double)pad, (double)time,(double)(cluster->padrow), (double) sector) ;
31  transformer->raw_to_global(PTRS,XYZ) ;
32 
33  x = XYZ.Getx();
34  y = XYZ.Gety();
35  z = XYZ.Getz();
36 
37  trackId = cluster->trackId ;
38  flags = cluster->flags ;
39 
40  nextHit = 0 ; // needed for the linked hit list
41 
42  charge = cluster->charge ;
43 
44  return 0 ;
45 }