Fork me on GitHub

Opened 8 years ago

Closed 8 years ago

#973 closed How to (fixed)

How to create custom collection of GenJets and exclude certain particles

Reported by: Alexis Kalogeropoulos Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hello

Is it possible while running Pythia @ Delphes, to ask NOT to include all particles that are traced back to a given mother in the final collection ? I mean, I would like to have a the GenJet collection cleaned from whatever can be traced back to a top quark from a p p > t t~ process in a sequence . Is this possible ? I guess this should be done after the hepmc and before fastjet (ie exclude certain particles from the jet clustering routine) but I dont know how...

Thanks for your help!

Change History (8)

comment:1 by Michele Selvaggi, 8 years ago

It is possible, you would have to create a module that filters those particles for you.

You could start from the StatusPidFilter and change it by looking at mothers and daughter pdg codes.
You can access mother and daughters of candidates by looking at M1, M2, D1, D2.

If you want to know how to write a module from scratch, have a look at this tutorial (part IV):

https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/TutorialBologna

All this said, I am not sure that what you want to do makes sense, since final state stable hadrons can often be linked back to both tops (assuming you are producing ttbar) due to colour reconnection, but I might be wrong ...

comment:2 by Alexis Kalogeropoulos, 8 years ago

Hi

Ok - so in principle I think this can do the trick for me - I am trying to add a simple cout inside i.e. like

cout<<" Hello there --------------------------------- >"<< pdgCode<<" "<<endl;

just here (and recompile of course)

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/StatusPidFilter.cc#L103

so, I was expecting when calling the NeutrinoFilter to see this, as the module NeutrinoFilter is in my card, but I am not seeing any relevant "cout" on screen..What am I missing ?

Thank again

On 28 Jun 2016, at 19:00, Michele Selvaggi <Michele.Selvaggi@…> wrote:

The input and output collections are defined in the card.
You’ll have to do something like:

https://github.com/delphes/delphes/blob/master/cards/delphes_card_CMS.tcl#l459

where NeutrinoFilter/filteredParticles

is replaced by MyFilter/filteredParticles.

and you’ll have to configure MyFilter by doing something like in NuetrinoFilter just above.

Michele

On 28 Jun 2016, at 18:57, Alexis Kalogeropoulos <Alexis.Kalogeropoulos@…> wrote:

Hello

Indeed, looking here

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/StatusPidFilter.cc#L113

looks like this is what I need . So, what I am missing is how to interface it so to filter the tops just after pythia and right before running fast jet - I guess the proper reader is to call it from inside the reader/FastJetFinder.cc ? If yes, at which point , because I cannot see any call of the filteredParticles for instance...

Thanks and sorry for my naive questions...

Regards

Alexis

comment:3 by Michele Selvaggi, 8 years ago

this is because the !Neutrinofilter is actually an instance of the module PdgCodeFilter and not of StatusPidFilter.

comment:4 by Alexis Kalogeropoulos, 8 years ago

so changing the module in the card in something like

module StatusPidFilter NeutrinoFilter {

}

should work? because still does not (obviously I am doing it wrong, unless if the "cout" is directed somewhere else during running ?)

thanks!

Last edited 8 years ago by Alexis Kalogeropoulos (previous) (diff)

comment:5 by Michele Selvaggi, 8 years ago

I don't what you are doing exactly but just put your cout in PdgCodeFilter, recompile and it will work ... and call

module PdgCodeFilter NeutrinoFilter 

comment:6 by Alexis Kalogeropoulos, 8 years ago

Hi

So this is my snippet

#
module PdgCodeFilter NeutrinoFilter {

  set InputArray Delphes/stableParticles
  set OutputArray filteredParticles

  set PTMin 50.0

  add PdgCode {-6}
  add PdgCode {6}


}

and I ve also included

  if(find(fPdgCodes.begin(), fPdgCodes.end(), pdgCode) != fPdgCodes.end()){ pass = kFALSE;

    cout<<"  Found  one--------------------------------- >"<< pdgCode<<"  "<<candidate->M1<<"  "<<candidate->M2<<"  "<<pt<<"  "<<fPTMin<<endl;
    }

but the output I get returns PID of electrons:

Found one--------------------------------- >11 509 -1 44.478 0.000

Found one--------------------------------- >-11 495 -1 58.187 0.000
Found one--------------------------------- >-11 579 -1 74.839 0.000
Found one--------------------------------- >11 1009 -1 19.590 0.000
Found one--------------------------------- >-11 344 -1 12.921 0.000
Found one--------------------------------- >11 710 -1 40.606 0.000
Found one--------------------------------- >-11 724 -1 22.639 0.000
Found one--------------------------------- >-11 400 -1 66.360 0.000

Please also note that except the fact that I am not getting 6/-6 PID, the min pT cuts seems to have no effect.. Any ideas why ?

thanks

in reply to:  6 comment:7 by Alexis Kalogeropoulos, 8 years ago

Last edited 8 years ago by Alexis Kalogeropoulos (previous) (diff)

comment:8 by Alexis Kalogeropoulos, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.