282 {
283
284
285 ISvcLocator* svcLocator = Gaudi::svcLocator();
287 StatusCode sc = svcLocator->service("G4Svc", tmpSvc);
288 G4Svc* m_G4Svc =
dynamic_cast<G4Svc *
>(tmpSvc);
289
290 const double m_beamTime = m_TMcHitEvent->
getBeamTime();
292
293
294 G4int THCID = -1;
295 THCID = m_DigiMan->GetHitsCollectionID("BesTofHitsCollection");
296 if (THCID>=0) {
298 if(tofDC){
299 int nHit = tofDC->entries();
300 if(nHit > 0){
301 for(int i = 0; i < nHit; i++){
302 delete (*tofDC)[i];
303 }
304 tofDC->GetVector()->clear();
305 }
306 }
307
309
310 for(int i = 0; i < nHits; i++){
312
314
325
326 TVector3 tTemp = m_TMcHitTof->
GetPos();
327 G4ThreeVector gTemp(tTemp.X(), tTemp.Y(), tTemp.Z());
329
331 gTemp = G4ThreeVector(tTemp.X(), tTemp.Y(), tTemp.Z());
333
335 gTemp = G4ThreeVector(tTemp.X(), tTemp.Y(), tTemp.Z());
337
338
339
340 tofDC->insert(tofHit);
341 delete m_TMcHitTof;
342
343 }
344
345
346
347 }
348
349}
G4THitsCollection< BesTofHit > BesTofHitsCollection
void SetPos(G4ThreeVector pos)
void SetDeltaT(G4double deltaT)
void SetCharge(G4double charge)
void SetTrackIndex(G4int trackIndex)
void SetPDirection(G4ThreeVector pDirection)
void SetPartId(G4int partId)
void SetScinNb(G4int scinNb)
void SetStepL(G4double stepL)
void SetTrackL(G4double length)
void SetTime(G4double time)
void SetEdep(G4double edep)
void SetMomentum(G4ThreeVector momentum)
void SetG4Index(G4int index)
void SetBeamTime(double value)
const TObjArray * getMcHitTofCol() const
retrieve the whole TObjArray of McHitTof Data
const TMcHitTof * getMcHitTof(Int_t i) const
retrieve a McHitTof From the collection, using the index into the array
Double_t getBeamTime() const
Int_t GetTrackIndex() const
TVector3 GetPDirection() const
TVector3 GetMomentum() const
Double_t GetStepL() const
Double_t GetTrackL() const
Double_t GetDeltaT() const