GEMC  2.3
Geant4 Monte-Carlo Framework
SVT_hitprocess.cc
Go to the documentation of this file.
1 // %%%%%%%%%%%%
2 // gemc headers
3 // %%%%%%%%%%%%
4 #include "SVT_hitprocess.h"
5 
6 map<string, double> SVT_HitProcess :: integrateDgt(MHit* aHit, int hitn)
7 {
8  map<string, double> dgtz;
9  vector<identifier> identity = aHit->GetId();
10 
11  // STR ID:
12  // layer, type, sector, module, strip
13  // class str_strip strs;
14  // strs.fill_infos();
15 
16  // double checking dimensions
17  // double CardLength = 2.0*aHit->GetDetector().dimensions[2]/mm; // length of 1 card
18  // double CardWidth = 2.0*aHit->GetDetector().dimensions[0]/mm; // width 1 card
19  //if(CardLength != strs.CardLength || CardWidth != strs.CardWidth)
20  //cout << hd_msg << " Warning: dimensions mismatch between card reconstruction dimensions and gemc card dimensions." << endl << endl;
21 
22  int slayer = identity[0].id;
23  int stype = identity[1].id;
24  int segment = identity[2].id;
25  int module = identity[3].id;
26  int strip = identity[4].id;
27  //
28  if(verbosity>4)
29  {
30  trueInfos tInfos(aHit);
31 
32  cout << log_msg << " layer: " << slayer << " type: " << stype << " segment: " << segment << " module: "<< module
33  << " Strip: " << strip << " x=" << tInfos.x << " y=" << tInfos.y << " z=" << tInfos.z << endl;
34  }
35  dgtz["hitn"] = hitn;
36  dgtz["slayer"] = slayer;
37  dgtz["stype"] = stype;
38  dgtz["segment"] = segment;
39  dgtz["module"] = module;
40  dgtz["strip"] = strip;
41 
42  return dgtz;
43 }
44 
45 #define ABS_(x) (x < 0 ? -x : x)
46 
47 vector<identifier> SVT_HitProcess :: processID(vector<identifier> id, G4Step* aStep, detector Detector)
48 {
49  vector<identifier> yid = id;
50 
51  enum STR_identifiers {layer=0,type=1,segment=2,module=3,strip=4};
52 
53  //int slayer = yid[0].id;
54  //int stype = yid[1].id;
55  //int segment = yid[2].id;
56  //int module = yid[3].id;
57  //int strip = yid[4].id;
58 
59 
60 
61  double active_width = 38.34; // mm X-direction
62  double active_height = 98.33; // mm Y-direction
63  double readout_pitch = 0.06; // mm, = 60 micron
64 
65  G4ThreeVector xyz = aStep->GetPostStepPoint()->GetPosition();
66  G4ThreeVector Lxyz = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(xyz); // Local coordinates
67 
68  double x = Lxyz.x();
69  double y = Lxyz.y();
70 
71  if( x < -active_width/2) yid[strip].id = -10;
72  else if ( x > active_width/2) yid[strip].id = -9;
73  else if( y < -active_height/2)yid[strip].id = -8;
74  else if( y > active_height/2) yid[strip].id = -7;
75  else
76  {
77  int nstrip = (int)((x + active_width/2 )/readout_pitch);
78  yid[strip].id = nstrip;
79  }
80  yid[id.size()-1].id_sharing = 1;
81  return yid;
82 }
83 
84 
85 
86 map< string, vector <int> > SVT_HitProcess :: multiDgt(MHit* aHit, int hitn)
87 {
88  map< string, vector <int> > MH;
89 
90  return MH;
91 }
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
double verbosity
Definition: HitProcess.h:120
vector< identifier > GetId()
Definition: Hit.h:103
vector< identifier > processID(vector< identifier >, G4Step *, detector)
double z
Definition: HitProcess.h:41
double x
Definition: HitProcess.h:41
string log_msg
Definition: HitProcess.h:121
map< string, vector< int > > multiDgt(MHit *, int)
Definition: Hit.h:22
double y
Definition: HitProcess.h:41
map< string, double > integrateDgt(MHit *, int)