Message: Killing a track at a specific point of it's trajectory Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Killing a track at a specific point of it's trajectory 

Forum: Event and Track Management
Date: 21 Oct, 2005
From: <maryam@jlab.org>

Dear Geant4 experts,
  Following my question to the forum a while ago about killing tracks in 
specific point of it's trajectory, I tried the following:

 I created a TrackingAction code and put the following lines in my 
PreUserTrackingAction to kill any track hitting the detector, which hasn't 
passed through a certain logical volume in a certain z(beamline direction)
 range in it's past:

 if((track->GetPosition().z()>=7188.2)&&(track->GetPosition().z()<=7239.))
  {
   if(track->GetVolume()->GetName()!= "tag_iron_plate_log")
   {
     //    G4cout<< " killing track now" << G4endl;
    ((G4Track*)track)->SetTrackStatus(fStopAndKill);
    }
  }

But I suspected it wasn't working as it should, by checking the reversed situation where track->GetVolume()->GetName() == "tag_iron_plate_log" and noticing that they don't add up to the case without any restrictions. The case when I killed some tracks sometimes turned out to give me more hits on the detector than when I kept them all. So I figured it's not doing what it's supposed to be doing. I also tried using the trajectory information. I put the following in my SteppingAction:

point = ((G4TrajectoryPoint*)aTrajectoryPoint)->GetPosition().z();
if ((point>=7188.2)&&(point<=7239.)&&(track->GetVolume()->GetName()!= "tag_iron_plate_log"))
{
 ... create hit output
 }

But it gives me segmentation fault and the run stops at 6th event:

 *** Break *** segmentation violation
 Generating stack trace...
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
/usr/bin/addr2line: 'mytest1': No such file
 0x08151a8b in TPE_SteppingAction::UserSteppingAction(G4Step const*) + 0x27f from mytest1
 0x0867236a in G4SteppingManager::Stepping() + 0x40e from mytest1
 0x08666005 in G4TrackingManager::ProcessOneTrack(G4Track*) + 0x1ed from mytest1 0x0862efdc
 in G4EventManager::DoProcessing(G4Event*) + 0x26c from mytest1
 0x08566efd in G4RunManager::DoEventLoop(int, char const*, int) + 0xc5 from mytest1
 0x085669bc in G4RunManager::BeamOn(int, char const*, int) + 0x44 from mytest1
 0x0814d821 in main + 0x635 from mytest1
 0x02795e23 in __libc_start_main + 0xd3 from /lib/tls/libc.so.6
 0x0814d161 in QWidget::windowActivationChange(bool) + 0x81 from mytest1
Aborted

Can anyone please help me and suggest me a way to do this?

Many thanks in advance,

Best regards,

Maryam Moteabbed

 

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: Killing a track at a specific point of it's trajectory   (Peter Gumplinger - 26 Oct, 2005)
 Add Message Add Message
to: "Killing a track at a specific point of it's trajectory"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]