test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
Py8toJetInputHEPEVT Class Reference

#include <Py8toJetInput.h>

Inheritance diagram for Py8toJetInputHEPEVT:
Py8toJetInput

Public Member Functions

const std::vector
< fastjet::PseudoJet > 
fillJetAlgoInput (const Event &, const Event &, const lhef::LHEEvent *, const std::vector< int > *partonList=0)
 
 Py8toJetInputHEPEVT ()
 
 ~Py8toJetInputHEPEVT ()
 
- Public Member Functions inherited from Py8toJetInput
 Py8toJetInput ()
 
void setJetEtaMax (double max)
 
 ~Py8toJetInput ()
 

Additional Inherited Members

- Public Types inherited from Py8toJetInput
typedef Pythia8::Event Event
 
typedef Pythia8::Particle Particle
 
- Protected Types inherited from Py8toJetInput
enum  partonTypes { ID_TOP =6, ID_GLUON =21, ID_PHOTON =22 }
 
- Protected Member Functions inherited from Py8toJetInput
int getAncestor (int, const Event &, const Event &)
 
- Protected Attributes inherited from Py8toJetInput
double fJetEtaMax
 
std::vector< fastjet::PseudoJet > fJetInput
 

Detailed Description

Definition at line 38 of file Py8toJetInput.h.

Constructor & Destructor Documentation

Py8toJetInputHEPEVT::Py8toJetInputHEPEVT ( )
inline

Definition at line 43 of file Py8toJetInput.h.

43 {}
Py8toJetInputHEPEVT::~Py8toJetInputHEPEVT ( )
inline

Definition at line 44 of file Py8toJetInput.h.

44 {}

Member Function Documentation

const std::vector< fastjet::PseudoJet > Py8toJetInputHEPEVT::fillJetAlgoInput ( const Event event,
const Event workEvent,
const lhef::LHEEvent lhee,
const std::vector< int > *  partonList = 0 
)
virtual

Reimplemented from Py8toJetInput.

Definition at line 253 of file Py8toJetInput.cc.

References funct::abs(), event(), Py8toJetInput::fJetInput, Py8toJetInput::getAncestor(), lhef::LHEEvent::getHEPEUP(), lhef::HEPEUP::IDUP, customizeTrackingMonitorSeedNumber::idx, cmsHarvester::index, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, and lhef::HEPEUP::PUP.

256 {
257 
258  fJetInput.clear();
259 
260  HepMC::HEPEVT_Wrapper::zero_everything();
261 
262  // service container for further mother-daughters links
263  //
264  std::vector<int> Py8PartonIdx; // position of original (LHE) partons in Py8::Event
265  Py8PartonIdx.clear();
266  std::vector<int> HEPEVTPartonIdx; // position of LHE partons in HEPEVT (incl. ME-generated decays)
267  HEPEVTPartonIdx.clear();
268 
269  // general counter
270  //
271  int index = 0;
272 
273  int Py8PartonCounter = 0;
274  int HEPEVTPartonCounter = 0;
275 
276  // find the fisrt parton that comes from LHE (ME-generated)
277  // skip the incoming particles/partons
278  for ( int iprt=1; iprt<event.size(); iprt++ )
279  {
280  const Particle& part = event[iprt];
281  if ( abs(part.status()) < 22 ) continue; // below 10 is "service"
282  // 11-19 are beam particles; below 10 is "service"
283  // 21 is incoming partons
284  Py8PartonCounter = iprt;
285  break;
286  }
287 
288  const lhef::HEPEUP& hepeup = *lhee->getHEPEUP();
289  // start the counter from 2, because we don't want the incoming particles/oartons !
290  for ( int iprt=2; iprt<hepeup.NUP; iprt++ )
291  {
292  index++;
293  HepMC::HEPEVT_Wrapper::set_id( index, hepeup.IDUP[iprt] );
294  HepMC::HEPEVT_Wrapper::set_status( index, 2 );
295  HepMC::HEPEVT_Wrapper::set_momentum( index, hepeup.PUP[iprt][0], hepeup.PUP[iprt][1], hepeup.PUP[iprt][2], hepeup.PUP[iprt][4] );
296  HepMC::HEPEVT_Wrapper::set_mass( index, hepeup.PUP[iprt][4] );
297  // --> FIXME HepMC::HEPEVT_Wrapper::set_position( index, part.xProd(), part.yProd(), part.zProd(), part.tProd() );
298  HepMC::HEPEVT_Wrapper::set_parents( index, 0, 0 ); // NO, not anymore to the "system particle"
299  HepMC::HEPEVT_Wrapper::set_children( index, 0, 0 );
300  if ( hepeup.MOTHUP[iprt].first > 2 && hepeup.MOTHUP[iprt].second > 2 ) // decay from LHE, will NOT show at the start of Py8 event !!!
301  {
302  HEPEVTPartonCounter++;
303  continue;
304  }
305  Py8PartonIdx.push_back( Py8PartonCounter );
306  Py8PartonCounter++;
307  HEPEVTPartonIdx.push_back( HEPEVTPartonCounter);
308  HEPEVTPartonCounter++;
309  }
310 
311  HepMC::HEPEVT_Wrapper::set_number_entries( index );
312 
313  // now that the initial partons are in, attach parton-level from Pythia8
314  // do NOT reset index as we need to *add* more particles sequentially
315  //
316  for ( int iprt=1; iprt<workEvent.size(); iprt++ ) // from 0-entry (system) or from 1st entry ???
317  {
318 
319  const Particle& part = workEvent[iprt];
320 
321 
322 // if ( part.status() != 62 ) continue;
323  if ( part.status() < 51 ) continue;
324  index++;
325  HepMC::HEPEVT_Wrapper::set_id( index, part.id() );
326 
327  // HepMC::HEPEVT_Wrapper::set_status( index, event.statusHepMC(iprt) );
328  HepMC::HEPEVT_Wrapper::set_status( index, 1 );
329  HepMC::HEPEVT_Wrapper::set_momentum( index, part.px(), part.py(), part.pz(), part.e() );
330  HepMC::HEPEVT_Wrapper::set_mass( index, part.m() );
331  HepMC::HEPEVT_Wrapper::set_position( index, part.xProd(), part.yProd(), part.zProd(), part.tProd() );
332  HepMC::HEPEVT_Wrapper::set_parents( index, 0, 0 ); // just set to 0 like in Py6...
333  // although for some, mother will need to be re-set properly !
334  HepMC::HEPEVT_Wrapper::set_children( index, 0, 0 );
335 
336  // now refine mother-daughters links, where applicable
337 
338  int parentId = getAncestor( part.daughter1(), event, workEvent );
339 
340  if ( parentId <= 0 ) continue;
341 
342  for ( int idx=0; idx<(int)Py8PartonIdx.size(); idx++ )
343  {
344  if ( parentId == Py8PartonIdx[idx] )
345  {
346  int idx1 = HEPEVTPartonIdx[idx];
347  HepMC::HEPEVT_Wrapper::set_parents( index, idx1+1, idx1+1 );
348  break;
349  }
350  }
351 
352  }
353 
354  HepMC::HEPEVT_Wrapper::set_number_entries( index );
355 
356 // --> FIXME HepMC::HEPEVT_Wrapper::set_event_number( fEventNumber ); // well, if you know it... well, it's one of the counters...
357 
358 // HepMC::HEPEVT_Wrapper::print_hepevt();
359 
360  return fJetInput;
361 
362 }
int getAncestor(int, const Event &, const Event &)
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:43
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:236
std::vector< FiveVector > PUP
Definition: LesHouches.h:248
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< int > IDUP
Definition: LesHouches.h:225
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
part
Definition: HCALResponse.h:20
std::vector< fastjet::PseudoJet > fJetInput
Definition: Py8toJetInput.h:34