Message: Stacking Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Stacking 

Forum: Event and Track Management
Date: 14 Jun, 2004
From: Christian Bongardo <Christian Bongardo>

Hi. I'm trying to kill generic ions with energy > 10 GeV/nucleon, since I'm using the G4BinaryLightIonReaction. What's wrong in the following? Thanks, Chris

CCalStackingAction::CCalStackingAction(): isInitialized(false) {}

CCalStackingAction::~CCalStackingAction(){}

void CCalStackingAction::PrepareNewEvent(){

  if(!isInitialized)   initialize();
  stage = firstStage;
  nurgent = 0;
  acceptSecondaries = 1;

}

G4ClassificationOfNewTrack CCalStackingAction::ClassifyNewTrack(const G4Track* aTrack){

  G4ClassificationOfNewTrack classification=fKill;
  int parentID = aTrack->GetParentID();
#ifdef ddebug
  /*G4TrackStatus status = aTrack->GetTrackStatus();
  G4cout << "Classifying track " << aTrack->GetTrackID()
	 << " with status " << aTrack->GetTrackStatus() << G4endl;*/  
#endif

  if (parentID < 0) {
#ifdef debug     
    /*G4cout << "Killing track " << aTrack->GetTrackID() 
	   << " from previous event. Should not happen" << G4endl;
    G4cout << "returning classification= " << classification << G4endl;*/
#endif
    return classification= fKill;
  }

  G4double nucleon=aTrack->GetDefinition()->GetBaryonNumber(); 

  if (aTrack->GetDefinition()->GetParticleName() != "alpha" ||
  	aTrack->GetDefinition()->GetParticleName() != "triton" ||
	aTrack->GetDefinition()->GetParticleName() != "deuteron" && 
        aTrack->GetKineticEnergy()/GeV > 10.*nucleon) {
#ifdef debug
    /*G4cout << "Kills particle " << aTrack->GetDefinition()->GetParticleName() 
	   << " of energy " << aTrack->GetKineticEnergy()/MeV << " MeV" 
	   << G4endl;*/
#endif
    return classification= fKill;
  }

  if (stage<end) {
    /////////////////
    /// PRIMARIES ///
    /////////////////
    if (parentID == 0 ) {
      if ( nurgent == 0) {
	nurgent++;
	classification = fUrgent;
	setPrimaryID(aTrack->GetTrackID());
      }
      else  classification = fWaiting;   
    }

    ///////////////////
    /// SECONDARIES ///
    ///////////////////

    if (parentID > 0) {
      if (acceptSecondaries == 1) {
	if (trackStartsInCalo(const_cast<G4Track *>(aTrack))!=0 )
	  classification = fUrgent;
	else
	  classification = fWaiting; 
      } else {
	if(nurgent == 0){                     
	  nurgent++;
	  classification = fUrgent;
	  setPrimaryID(aTrack->GetTrackID());
	} else
	  classification = fWaiting;	
      }       
    }

  } else 
    classification = G4UserStackingAction::ClassifyNewTrack(aTrack);

#ifdef ddebug
  /*G4cout << " returning classification= " << classification
	 << " for track "<< aTrack->GetTrackID() << G4endl;*/
#endif
  return classification;

}

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

1 None: Re: Stacking   (Makoto Asai - 14 Jun, 2004)
(_ Sad: Re: Stacking   (Christian Bongardo - 15 Jun, 2004)
 Add Message Add Message
to: "Stacking"

 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 ]