Message: Re: Secondaries from LCapture Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Secondaries from LCapture 

Keywords: Problems with gammas
Forum: Event and Track Management
Re: None Secondaries from LCapture (Shirin Abbasinejad Enger)
Date: 08 Nov, 2002
From: Makoto Asai <Makoto Asai>

I found out that the Web page had a problem. The sample code
of T01TrackingAction::PostUserTrackingAction shown in my
original page 

void T01TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
  // Check if the track already has track information
  T01TrackInformation* info
    = (T01TrackInformation*)(aTrack->GetUserInformation());
  if(info==0) return;

  // Copy parent's track information to its daughters
  G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
  if(secondaries)
  {
    size_t nSeco = secondaries->size();
    for(size_t i=0;iSetUserInformation(infoNew);
    }
  }
}

should read as follows.

void T01TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
  // Check if the track already has track information
  T01TrackInformation* info
    = (T01TrackInformation*)(aTrack->GetUserInformation());
  if(info==0) return;

  // Copy parent's track information to its daughters
  G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries();
  if(secondaries)
  {
    size_t nSeco = secondaries->size();
    for(size_t i=0;i<nSeco;i++)
    { 
      T01TrackInformation* infoNew = new T01TrackInformation(info);
      (*secondaries)[i]->SetUserInformation(infoNew);
    }
  }
}

I just forgot to convert "<" to "&lt;" to let browser display
"<" properly. I fixed it. Sorry for inconvinience.

If you still have the same problem with this fixed code, I would 
suggest to check the particle you defined in T01Calorimeter.
The perticle should be neutron in your case. 

T01Calorimeter::T01Calorimeter(G4String name)
:G4VSensitiveDetector(name)
{
  G4String HCname;
  collectionName.insert(HCname="calorimeterColl");
  HCID = -1;
  processName = "process_name_you_are_interested_in"; 
  interestedParticle = particle_definition_you_are_interested_in;
}

Also you should check the process name you defined in 
both T01Calorimeter and T01TrackingAction. I confirmed
this sample code works on most recent release.

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

 Add Message Add Message
to: "Re: Secondaries from LCapture"

 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 ]