Message: Re: Incorrect Hit position Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Incorrect Hit position 

Forum: Hits, Digitization and Pileup
Re: None Incorrect Hit position (Victor Meldrew)
Re: None Re: Incorrect Hit position (Victor Meldrew)
Re: None Re: Incorrect Hit position (Artem Zontikov)
Date: 10 Sep, 2016
From: Victor Meldrew <Victor Meldrew>

Thanks Artem.

Could you please comment on how I check that the step limited with "phot" is actually starting on the boundary.

The strange thing is that the same code on another computer works fine (by fine, I mean the first interaction position is exactly where the beam hits the detector).

My code for ProcessHits is as follow (the full version is available at this URL : goo.gl/3wUjFB):

G4bool detASD::ProcessHits(G4Step* step, G4TouchableHistory*) {

	G4double edep = step->GetTotalEnergyDeposit();
	if (edep==0.) return true;

	CrystalHit* aHit = new CrystalHit();

	G4Track* aTrack   = step->GetTrack();
	G4int    parentID = aTrack->GetParentID();
	G4StepPoint  *oldStepPoint = step->GetPreStepPoint();
	G4StepPoint	 *newStepPoint = step->GetPostStepPoint();
	G4ThreeVector position = newStepPoint->GetPosition();
	G4double aTime = newStepPoint->GetGlobalTime();
	const G4VProcess* process = newStepPoint->GetProcessDefinedStep();
	G4String  interactiontype = ( (process != NULL) ? process->GetProcessName() : G4String() ) ;

	G4int inttype=-1;

	if (interactiontype=="eIoni") {inttype=0;} else {
		if (interactiontype=="phot") {inttype=1;} else {
			if (interactiontype=="msc") {inttype=2;} else {
				if (interactiontype=="eBrem") {inttype=3;} else {
					if (interactiontype=="Transportation") {inttype=4;} else {
						if (interactiontype=="compt") {inttype=5;}
					}
				}
			}
		}
	}

	aHit->SetEdep(edep);
	aHit->SetLocalPos(position);
	aHit->SetTime(aTime);
	aHit->SetParentId(parentID);
	aHit->SetInteractionType(inttype);

	fHitsCollection->insert(aHit);
	return true;
}

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

1 None: Re: Incorrect Hit position   (Artem Zontikov - 11 Sep, 2016)
(_ None: [SOLVED] Re: Incorrect Hit position   (Victor Meldrew - 12 Sep, 2016)
 Add Message Add Message
to: "Re: Incorrect Hit position"

 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 ]