GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Event Generators » Event filter II
Re: Event filter II [message #17486 is a reply to message #17484] Mon, 10 November 2014 10:58 Go to previous messageGo to previous message
MartinJGaluska is currently offline  MartinJGaluska
Messages: 203
Registered: March 2010
Location: Germany
first-grade participant
From: *pool.mediaWays.net
Good morning Donghee,

thanks for reporting the crash. It occured in the code that finds the charge for a certain pdg code. I will have to look into the problem as this code was definitely working when I last tested the event filter code.

The first issue you reported is a misconception of what the following code does.
Quote:

FairEvtFilterOnSingleParticleCounts* fil= new FairEvtFilterOnSingleParticleCounts("fil");
fil->AndMinMaxPdgCodes(1,1,211,-211);
primGen->AndFilter(fil);


Please have a look at the tutorial (section "Pdg Codes") or the comments inside the source code.

//////////////////
71	        // User interfaces -- Pdg Code Min and Max
72	        //////////////////
73	        // Use this for grouping up to 8 pdgCodes into 1 groupId
74	        // all particles belonging to the groupId are regarded as being indistinguishable
75	        // min defines how many particles you want in your events AT LEAST
76	        // max defines how many particles you want in your events AT MOST
77	        // the min and max numbers are used for all particles with one of the above pdgCodes
78	        // returns kTRUE if the filter was added, otherwise returns kFALSE
79	        Bool_t AndMinMaxPdgCodes( Int_t min, Int_t max, Int_t pdgCode1, Int_t pdgCode2=kInvalidPdgCode, Int_t pdgCode3=kInvalidPdgCode, Int_t pdgCode4=kInvalidPdgCode, Int_t pdgCode5=kInvalidPdgCode, Int_t pdgCode6=kInvalidPdgCode, Int_t pdgCode7=kInvalidPdgCode, Int_t pdgCode8=kInvalidPdgCode );
80


In short your code is asking that exactly one (pi- OR pi+) is present in the events. Nothing else.

The second suggestion is a bit more correct as you also ask for exactly 2 particles to be present in the events, but it is still not what you want. Here is the code that should do what you ask for:

FairEvtFilterOnSingleParticleCounts* fil= new FairEvtFilterOnSingleParticleCounts("fil");
fil->AndMinMaxPdgCodes(1,1,211); // exactly one pi+ in primary particles
fil->AndMinMaxPdgCodes(1,1,-211); // exactly one pi- in primary particles
fil->AndMinMaxAllParticles(2,2); // exactly 2 primary particles in event
primGen->AndFilter(fil);


I assume that will also lead to a crash as long as I have not fixed the issue in FairEvtFilter::GetCharge.

Kind regards,
Martin

[Updated on: Mon, 10 November 2014 11:01]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: p barp -> pi0 eta
Next Topic: Ftf Direct Generator
Goto Forum:
  


Current Time: Fri Dec 02 06:20:08 CET 2022

Total time taken to generate the page: 0.01040 seconds