GEMC  2.3
Geant4 Monte-Carlo Framework
muon_hodo_hitprocess.cc
Go to the documentation of this file.
1 // gemc headers
2 #include "muon_hodo_hitprocess.h"
3 
4 // CLHEP units
5 #include "CLHEP/Units/PhysicalConstants.h"
6 using namespace CLHEP;
7 
8 map<string, double> muon_hodo_HitProcess :: integrateDgt(MHit* aHit, int hitn)
9 {
10  map<string, double> dgtz;
11  vector<identifier> identity = aHit->GetId();
12 
13  int idx = identity[0].id;
14  int idy = identity[1].id;
15  int idz = identity[2].id;
16  trueInfos tInfos(aHit);
17 
18  // Get the paddle length: in HS paddles are boxes, it's the x
19  double length = aHit->GetDetector().dimensions[0];
20 
21  // Distances from left, right
22  double dLeft = length + tInfos.lx;
23  double dRight = length - tInfos.lx;
24 
25  // dummy formulas for now, parameters could come from DB
26  int adcl = (int) (100*tInfos.eTot*exp(-dLeft/length/2 ));
27  int adcr = (int) (100*tInfos.eTot*exp(-dRight/length/2 ));
28 
29  // speed of light is 30 cm/s
30  int tdcl = (int) (100*(tInfos.time/ns + dLeft/cm/30.0));
31  int tdcr = (int) (100*(tInfos.time/ns + dRight/cm/30.0));
32 
33  dgtz["hitn"] = hitn;
34  dgtz["idx"] = idx;
35  dgtz["idy"] = idy;
36  dgtz["idz"] = idz;
37  dgtz["adcl"] = adcl;
38  dgtz["adcr"] = adcr;
39  dgtz["tdcl"] = tdcl;
40  dgtz["tdcr"] = tdcr;
41 
42  return dgtz;
43 }
44 
45 vector<identifier> muon_hodo_HitProcess :: processID(vector<identifier> id, G4Step* aStep, detector Detector)
46 {
47  id[id.size()-1].id_sharing = 1;
48  return id;
49 }
50 
51 
52 
53 
54 map< string, vector <int> > muon_hodo_HitProcess :: multiDgt(MHit* aHit, int hitn)
55 {
56  map< string, vector <int> > MH;
57 
58  return MH;
59 }
60 
61 
62 
63 
64 
65 
66 
67 
68 
vector< identifier > GetId()
Definition: Hit.h:103
vector< identifier > processID(vector< identifier >, G4Step *, detector)
double time
Definition: HitProcess.h:43
double lx
Definition: HitProcess.h:42
double eTot
Definition: HitProcess.h:40
map< string, vector< int > > multiDgt(MHit *, int)
Definition: Hit.h:22
map< string, double > integrateDgt(MHit *, int)
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
Definition: detector.h:77
detector GetDetector()
Definition: Hit.h:108