54{
55 G4double edep = aStep->GetTotalEnergyDeposit();
56 if(edep==0.){
57 if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() &&
58 aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition())
59 return false;
60 }
61 edep *= CLHEP::MeV;
62
63
64
65
66 const G4TouchableHistory* myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
67 if (not myTouch) {
68 G4cout << "SctSensor_CTB::ProcessHits bad dynamic_cast" << G4endl;
69 return false;
70 }
71
72
73
74 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
75 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
76
77
78
79
80
81 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
82 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
83 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
84
85 HepGeom::Point3D<double> lP1,lP2;
89
93
94
95
96
97
98
99
100
101
102
103
104
105 int BrlEcap = 0;
106 int LayerDisk = 0;
108 int phiMod = 0;
110
111
112
113
114
115 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
116
117#ifdef SCTSD_CTB_DEBUG
118 for (
int i=0;
i<myTouch->GetHistoryDepth();
i++){
119 std::string detname=myTouch->GetVolume(i)->GetLogicalVolume()->GetName();
120 int copyno=myTouch->GetVolume(i)->GetCopyNo();
121 if (verboseLevel>1) G4cout << "Volume "<<detname <<" Copy Nr. "<<copyno << G4endl;
122 }
123#endif
124
125
126
127 int BEcopyNoTest = BEcopyNo/100;
128 if(BEcopyNoTest == 5 || BEcopyNoTest == 6 || BEcopyNo == 1000 || BEcopyNo == 2000) {
129 BrlEcap=0;
131
132 if(BEcopyNoTest == 5 || BEcopyNoTest == 6 ) {
133 side = myTouch->GetVolume(0)->GetCopyNo()%2;
134 phiMod=myTouch->GetVolume(1)->GetCopyNo()%2;
135 LayerDisk = myTouch->GetVolume(1)->GetCopyNo()/2;
136 } else if ( BEcopyNo == 1000) {
137 side = myTouch->GetVolume(1)->GetCopyNo();
138 phiMod=myTouch->GetVolume(2)->GetCopyNo()%2;
139 LayerDisk = myTouch->GetVolume(2)->GetCopyNo()/2;
140 }
141
142#ifdef SCTSD_CTB_DEBUG
143 if (verboseLevel>1) G4cout << "In the SCT TestBeam" << G4endl;
144 if (verboseLevel>1) G4cout <<
" * Module Number: " << LayerDisk <<
"," << phiMod <<
" Side: " <<
side << G4endl;
145 if (verboseLevel>5) G4cout << " Identifier will be [2.2."
146 << BrlEcap << "."
147 << LayerDisk << "."
148 << phiMod << "."
150 <<
side <<
"]" << G4endl;
151#endif
152 } else {
154 description <<
"ProcessHits: Unexpected copy number for sensor";
155 G4Exception(
"SctSensor_CTB",
"UnexpectedCopyNumberForSctSensor", FatalException,
description);
156 abort();
157 }
158 TrackHelper trHelp(aStep->GetTrack());
160 lP2,
161 edep,
162 aStep->GetPreStepPoint()->GetGlobalTime(),
164 1,BrlEcap,LayerDisk,etaMod,phiMod,side);
165 return true;
166}
std::string description
glabal timer - how long have I taken so far?