Fork me on GitHub

Changeset 6934875 in git for readers/DelphesPythia8.cpp


Ignore:
Timestamp:
Sep 23, 2016, 1:36:24 PM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
56562d0
Parents:
6387aea
Message:

changed into flat generation in E, included neutron, charged pions, c-jets in particle gun

File:
1 edited

Legend:

Unmodified
Added
Removed
  • readers/DelphesPythia8.cpp

    r6387aea r6934875  
    153153// from pythia8 example 21
    154154
    155 void fillParticle(int id, double pt_max, double eta_max,
     155void fillParticle(int id, double p_max, double eta_max,
    156156  Pythia8::Event &event, Pythia8::ParticleData &pdt, Pythia8::Rndm &rndm)
    157157{
     
    161161  // Generate uniform pt and eta.
    162162  double pt, eta, phi, pp, ee, mm;
    163   pt = pow(10, 1.0 + (log10(pt_max) - 1.0) * rndm.flat());
     163 
     164  //pmin = 0.1 GeV for single particles
     165  pp = pow(10, - 1.0 + (log10(p_max) + 1.0) * rndm.flat());
    164166  eta = (2.0 * rndm.flat() - 1.0) * eta_max;
    165167  phi = 2.0 * M_PI * rndm.flat();
    166   pp = pt * cosh(eta);
    167168  mm = pdt.mSel(id);
    168169  ee = Pythia8::sqrtpos(pp*pp + mm*mm);
     170  pt = pp / cosh(eta);
    169171
    170172  // Store the particle in the event record.
     
    172174}
    173175
    174 void fillPartons(int id, double pt_max, double eta_max,
     176void fillPartons(int id, double p_max, double eta_max,
    175177  Pythia8::Event &event, Pythia8::ParticleData &pdt, Pythia8::Rndm &rndm)
    176178{
     
    179181  event.reset();
    180182
    181   // Information on a q qbar system, to be hadronized.
    182 
    183183  // Generate uniform pt and eta.
    184184  double pt, eta, phi, pp, ee, mm;
    185   pt = pow(10, 1.0 + (log10(pt_max) - 1.0) * rndm.flat());
     185
     186  //pmin = 1 GeV for jets
     187  pp = pow(10, log10(p_max) * rndm.flat()); 
    186188  eta = (2.0 * rndm.flat() - 1.0) * eta_max;
    187189  phi = 2.0 * M_PI * rndm.flat();
    188   pp = pt * cosh(eta);
    189   mm = pdt.m0(id);
     190  mm = pdt.mSel(id);
    190191  ee = Pythia8::sqrtpos(pp*pp + mm*mm);
    191 
     192  pt = pp / cosh(eta);
     193
     194  if( (id == 4 || id == 5) && pt < 10.0) return;
     195 
    192196  if(id == 21)
    193197  {
     
    338342      if (pythia->flag("Main:spareFlag1"))
    339343      {
    340         if (pythia->mode("Main:spareMode1") == 11 || pythia->mode("Main:spareMode1") == 13 || pythia->mode("Main:spareMode1") == 15 || pythia->mode("Main:spareMode1") == 22)
     344        if (pythia->mode("Main:spareMode1") == 11 || pythia->mode("Main:spareMode1") == 13 || pythia->mode("Main:spareMode1") == 15 || pythia->mode("Main:spareMode1") == 22 || pythia->mode("Main:spareMode1") == 211 || pythia->mode("Main:spareMode1") == 2112)
    341345        {
    342346          fillParticle(pythia->mode("Main:spareMode1"), pythia->parm("Main:spareParm1"), pythia->parm("Main:spareParm2"), pythia->event, pythia->particleData, pythia->rndm);
Note: See TracChangeset for help on using the changeset viewer.