GEMC  2.3
Geant4 Monte-Carlo Framework
bonus_hitprocess.cc
Go to the documentation of this file.
1 // gemc headers
2 #include "bonus_hitprocess.h"
3 
4 // CLHEP units
5 #include "CLHEP/Units/PhysicalConstants.h"
6 using namespace CLHEP;
7 
8 map<string, double> bonus_HitProcess :: integrateDgt(MHit* aHit, int hitn)
9 {
10  map<string, double> dgtz;
11  vector<identifier> identity = aHit->GetId();
12 
13  // true information
14  // for example tInfos.eTot is total energy deposited
15  trueInfos tInfos(aHit);
16 
17  // local variable for each step
18  vector<G4ThreeVector> Lpos = aHit->GetLPos();
19 
20  // energy at each step
21  // so tInfos.eTot is the sum of all steps s of Edep[s]
22  vector<double> Edep = aHit->GetEdep();
23 
24 
25  // Distances from left, right
26  double dLeft = tInfos.ly;
27  double dRight = tInfos.ly;
28 
29  // dummy formulas for now, parameters could come from DB
30  int ADCL = (int) (100*tInfos.eTot*exp(-dLeft/2 ));
31  int ADCR = (int) (100*tInfos.eTot*exp(-dRight/2 ));
32 
33  // speed of light is 30 cm/s
34  int TDCL = (int) (100*(tInfos.time/ns + dLeft/cm/30.0));
35  int TDCR = (int) (100*(tInfos.time/ns + dRight/cm/30.0));
36 
37  dgtz["hitn"] = hitn;
38  dgtz["ADCL"] = ADCL;
39  dgtz["ADCR"] = ADCR;
40  dgtz["TDCL"] = TDCL;
41  dgtz["TDCR"] = TDCR;
42 
43  return dgtz;
44 }
45 
46 vector<identifier> bonus_HitProcess :: processID(vector<identifier> id, G4Step* aStep, detector Detector)
47 {
48  id[id.size()-1].id_sharing = 1;
49  return id;
50 }
51 
52 
53 map< string, vector <int> > bonus_HitProcess :: multiDgt(MHit* aHit, int hitn)
54 {
55  map< string, vector <int> > MH;
56 
57  return MH;
58 }
59 
map< string, vector< int > > multiDgt(MHit *, int)
double ly
Definition: HitProcess.h:42
map< string, double > integrateDgt(MHit *, int)
vector< identifier > GetId()
Definition: Hit.h:103
double time
Definition: HitProcess.h:43
vector< G4ThreeVector > GetLPos()
Definition: Hit.h:76
double eTot
Definition: HitProcess.h:40
vector< identifier > processID(vector< identifier >, G4Step *, detector)
Definition: Hit.h:22
vector< double > GetEdep()
Definition: Hit.h:83