GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » How to abort secondaries
How to abort secondaries [message #13432] Sun, 06 May 2012 21:34 Go to next message
Maria Patsyuk is currently offline  Maria Patsyuk
Messages: 58
Registered: April 2010
continuous participant
From: *pools.arcor-ip.net
Hi pandarooters,

I'd like to prevent all the secondaries from being created. I was looking for some hint in the config files for Geant4, but didn't find anything useful.

The thing is that I'd like not to have any Cherenkov light from secondaries, so if I'll kill them on the first step, they might already have produced some Cherenkov photons, don't they?

Could you give me any hint how to do so?

Best regards,
Maria

Re: How to abort secondaries [message #13433 is a reply to message #13432] Mon, 07 May 2012 10:19 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hi Maria,
I think that if you kill them when they are entering they do not have the "computing time" to interact and produce Cherenkov light. Have you already tried this?
Re: How to abort secondaries [message #13434 is a reply to message #13433] Mon, 07 May 2012 12:39 Go to previous messageGo to next message
Maria Patsyuk is currently offline  Maria Patsyuk
Messages: 58
Registered: April 2010
continuous participant
From: *pools.arcor-ip.net
Hi Stefano,

no, I didn't try it, but I'd like to. )
What do you mean with entering? If my secondary is born while mother particle was inside a volume, does this secondary nevertheless first enter this volume?

So I should first check if a track is a secondary (trackID?) than check if it is entering and then kill?

Best regards,
Maria
Re: How to abort secondaries [message #13435 is a reply to message #13434] Mon, 07 May 2012 12:52 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 31.188.55*
I mean, in processhits, if (gMC->IsTrackEntering()) ...
Once a particle is created, first it is "entering" inside the volume, and there you can kill it once you check that the mother particle track id is different from -1.
Re: How to abort secondaries [message #13438 is a reply to message #13435] Mon, 07 May 2012 16:32 Go to previous messageGo to next message
Maria Patsyuk is currently offline  Maria Patsyuk
Messages: 58
Registered: April 2010
continuous participant
From: *pools.arcor-ip.net
Thank you, Stefano!

How can I check the mother particle track id in the ProcessHits function of my detector class (PndDrc)?

Best regards,
Maria
Re: How to abort secondaries [message #13439 is a reply to message #13438] Mon, 07 May 2012 16:40 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
In processhits:

gMC->GetStack()->GetCurrentParentTrackNumber(),
Re: How to abort secondaries [message #13443 is a reply to message #13439] Tue, 08 May 2012 10:50 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *kph.uni-mainz.de
Dear Maria and Stefano,
Probably you can use the same thing I use to kill secondaries.

Add the function PreTrack() to your detector class before ProcessHits

void PndDrc::PreTrack(){

// Begin of the event

fTrackKillSecondary=kFALSE;

//member function, it should be before declared in the detector header file.

// cout << " PndDrc::PreTrack() "<< endl;

}



In the beginning of ProcessHits,
then stop the track of being tracked by doing gMC->StopTrack();
if FTrackKillSecondary is true.

if(fTrackKillSecondary) {
gMC->StopTrack();
return kTRUE;
}

Inside ProcessHits after you have stored your primaries,
do fTrackKillSecondary=KTRUE, if you have a secondary or CurrentParentTrack is not -1.

I hope it helps, Wink

cheers
Alicia.
Re: How to abort secondaries [message #13449 is a reply to message #13443] Tue, 08 May 2012 21:13 Go to previous message
Maria Patsyuk is currently offline  Maria Patsyuk
Messages: 58
Registered: April 2010
continuous participant
From: *pools.arcor-ip.net
Thank you, Alicia!

Nice method ) I'll try.

Best regards,
Maria
Previous Topic: License ?
Next Topic: photos and custom event generator
Goto Forum:
  


Current Time: Fri Apr 19 02:27:53 CEST 2024

Total time taken to generate the page: 0.00805 seconds