GEMC  1.8
Geant4 Monte-Carlo Framework
LTCC_hitprocess.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 #include "G4UnitsTable.hh"
5 
6 
7 // %%%%%%%%%%%%%
8 // gemc headers
9 // %%%%%%%%%%%%%
10 #include "LTCC_hitprocess.h"
11 
12 #include <set>
13 
15 {
16  string hd_msg = Opt.args["LOG_MSG"].args + " LTCC Hit Process " ;
17  double HIT_VERBOSITY = Opt.args["HIT_VERBOSITY"].arg;
18  PH_output out;
19  out.identity = aHit->GetId();
20  HCname = "LTCC Hit Process";
21 
22  // if the particle is not an opticalphoton
23  // assuming it will create one photo-electron anyway
24  // if(aHit->GetPID() != 0) return out;
25 
26 
27  // removing all hits that do not correspond to optical
28 
29  // %%%%%%%%%%%%%%%%%%%
30  // Raw hit information
31  // %%%%%%%%%%%%%%%%%%%
32  int nsteps = aHit->GetPos().size();
33 
34  vector<int> tids = aHit->GetTIds();
35  vector<int> pids = aHit->GetPIDs();
36  set<int> TIDS;
37 
38 
39  // average global, local positions of the hit
40  double x, y, z;
41  double lx, ly, lz;
42  x = y = z = lx = ly = lz = 0;
43  vector<G4ThreeVector> pos = aHit->GetPos();
44  vector<G4ThreeVector> Lpos = aHit->GetLPos();
45 
46  for(int s=0; s<nsteps; s++)
47  {
48  // no conditions to count it as one photo-electron
49  // a particle hitting on of the anodes directly
50  // may produce in average one photo-electron?
51  // if(pids[s] == 0)
52  TIDS.insert(tids[s]);
53  x = x + pos[s].x();
54  y = y + pos[s].y();
55  z = z + pos[s].z();
56  lx = lx + Lpos[s].x();
57  ly = ly + Lpos[s].y();
58  lz = lz + Lpos[s].z();
59  }
60 
61  x = x / nsteps;
62  y = y / nsteps;
63  z = z / nsteps;
64  lx = lx / nsteps;
65  ly = ly / nsteps;
66  lz = lz / nsteps;
67 
68 
69 
70 
71  // average time
72  double time = 0;
73  vector<G4double> times = aHit->GetTime();
74  for(int s=0; s<nsteps; s++) time = time + times[s]/nsteps;
75 
76  // Energy of the track
77  double Ene = aHit->GetE();
78 
79  out.raws.push_back(x);
80  out.raws.push_back(y);
81  out.raws.push_back(z);
82  out.raws.push_back(lx);
83  out.raws.push_back(ly);
84  out.raws.push_back(lz);
85  out.raws.push_back(time);
86  out.raws.push_back(aHit->GetVert().getX());
87  out.raws.push_back(aHit->GetVert().getY());
88  out.raws.push_back(aHit->GetVert().getZ());
89  out.raws.push_back(Ene);
90  out.raws.push_back((double) aHit->GetmPID());
91  out.raws.push_back(aHit->GetmVert().getX());
92  out.raws.push_back(aHit->GetmVert().getY());
93  out.raws.push_back(aHit->GetmVert().getZ());
94 
95 
96  // %%%%%%%%%%%%
97  // Digitization
98  // %%%%%%%%%%%%
99 
100  int sector = out.identity[0].id;
101  int side = out.identity[1].id;
102  int pmt = out.identity[2].id;
103 
104  if(HIT_VERBOSITY>4)
105  cout << hd_msg << " pmt: " << pmt << " x=" << x/cm << " y=" << y/cm << " z=" << z/cm << endl;
106 
107  out.dgtz.push_back(sector);
108  out.dgtz.push_back(side);
109  out.dgtz.push_back(pmt);
110  out.dgtz.push_back(TIDS.size());
111 
112  return out;
113 }
114 
115 
116 vector<identifier> LTCC_HitProcess :: ProcessID(vector<identifier> id, G4Step *step, detector Detector, gemc_opts Opt)
117 {
118  id[id.size()-1].id_sharing = 1;
119  return id;
120 }
121 
122 
123 
124 
125 
126 
G4ThreeVector GetVert()
Definition: MHit.h:72
vector< double > raws
Raw information.
Definition: MPHBaseClass.h:26
int GetmPID()
Definition: MHit.h:122
vector< identifier > GetId()
Definition: MHit.h:96
string HCname
Hit Collection name.
Definition: MPHBaseClass.h:41
G4ThreeVector GetmVert()
Definition: MHit.h:127
vector< identifier > identity
Identifier.
Definition: MPHBaseClass.h:28
vector< G4ThreeVector > GetLPos()
Definition: MHit.h:69
double GetE()
Definition: MHit.h:89
vector< G4ThreeVector > GetPos()
Definition: MHit.h:65
Definition: MHit.h:29
vector< double > GetTime()
Definition: MHit.h:82
map< string, opts > args
Options map.
Definition: usage.h:68
vector< int > GetTIds()
Definition: MHit.h:94
vector< int > GetPIDs()
Definition: MHit.h:108
vector< identifier > ProcessID(vector< identifier >, G4Step *, detector, gemc_opts)
Method to calculate new identifier.
vector< int > dgtz
Digitized information.
Definition: MPHBaseClass.h:27
PH_output ProcessHit(MHit *, gemc_opts)
Method to process the hit.