CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
lheh5::Events2 Struct Reference

#include <lheh5.h>

Public Member Functions

std::vector< ParticlemkEvent (size_t ievent) const
 
EventHeader mkEventHeader (int ievent) const
 
Particle mkParticle (size_t idx) const
 

Public Attributes

size_t _particle_offset
 
std::vector< double > _vaqcd
 
std::vector< double > _vaqed
 
std::vector< int > _vcolor1
 
std::vector< int > _vcolor2
 
std::vector< double > _ve
 
std::vector< double > _vfscale
 
std::vector< int > _vid
 
std::vector< double > _vlifetime
 
std::vector< double > _vm
 
std::vector< int > _vmother1
 
std::vector< int > _vmother2
 
std::vector< int > _vnparticles
 
std::vector< int > _vpid
 
std::vector< double > _vpx
 
std::vector< double > _vpy
 
std::vector< double > _vpz
 
std::vector< double > _vrscale
 
std::vector< double > _vscale
 
std::vector< double > _vspin
 
std::vector< size_t > _vstart
 
std::vector< int > _vstatus
 
std::vector< size_t > _vtrials
 
std::vector< double > _vweight
 
int npLO
 
int npNLO
 

Detailed Description

Definition at line 80 of file lheh5.h.

Member Function Documentation

◆ mkEvent()

std::vector< Particle > lheh5::Events2::mkEvent ( size_t  ievent) const

Definition at line 213 of file lheh5.cc.

References _particle_offset, _vnparticles, _vstart, EcalPhiSymFlatTableProducers_cfi::id, and mkParticle().

213  {
214  std::vector<Particle> _E;
215  // NOTE we need to subtract the particle offset here as the
216  // particle properties run from 0 and not the global index when using batches
217  size_t partno = _vstart[ievent] - _particle_offset;
218  for (int id = 0; id < _vnparticles[ievent]; ++id) {
219  _E.push_back(mkParticle(partno));
220  partno++;
221  }
222 
223  // Make sure beam particles are ordered according to convention i.e. first particle has positive z-momentum
224  if (_E[0].pz < 0) {
225  std::swap<Particle>(_E[0], _E[1]);
226  }
227 
228  return _E;
229  }
std::vector< int > _vnparticles
Definition: lheh5.h:98
std::vector< size_t > _vstart
Definition: lheh5.h:82
size_t _particle_offset
Definition: lheh5.h:109
Particle mkParticle(size_t idx) const
Definition: lheh5.cc:197

◆ mkEventHeader()

EventHeader lheh5::Events2::mkEventHeader ( int  ievent) const

Definition at line 231 of file lheh5.cc.

References _vaqcd, _vaqed, _vfscale, _vnparticles, _vpid, _vrscale, _vscale, _vtrials, _vweight, caHitNtupletGeneratorKernels::iev, npLO, and npNLO.

231  {
232  return {
233  _vnparticles[iev],
234  _vpid[iev],
235  _vweight[iev],
236  _vtrials[iev],
237  _vscale[iev],
238  _vrscale[iev],
239  _vfscale[iev],
240  _vaqed[iev],
241  _vaqcd[iev],
242  npLO,
243  npNLO,
244  };
245  }
std::vector< int > _vnparticles
Definition: lheh5.h:98
std::vector< size_t > _vtrials
Definition: lheh5.h:101
std::vector< double > _vaqcd
Definition: lheh5.h:106
std::vector< double > _vrscale
Definition: lheh5.h:103
std::vector< double > _vscale
Definition: lheh5.h:102
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
std::vector< double > _vfscale
Definition: lheh5.h:104
std::vector< double > _vaqed
Definition: lheh5.h:105
std::vector< int > _vpid
Definition: lheh5.h:99
std::vector< double > _vweight
Definition: lheh5.h:100

◆ mkParticle()

Particle lheh5::Events2::mkParticle ( size_t  idx) const

Definition at line 197 of file lheh5.cc.

References _vcolor1, _vcolor2, _ve, _vid, _vlifetime, _vm, _vmother1, _vmother2, _vpx, _vpy, _vpz, _vspin, _vstatus, and heavyIonCSV_trainingSettings::idx.

Referenced by mkEvent().

197  {
198  return {_vid[idx],
199  _vstatus[idx],
200  _vmother1[idx],
201  _vmother2[idx],
202  _vcolor1[idx],
203  _vcolor2[idx],
204  _vpx[idx],
205  _vpy[idx],
206  _vpz[idx],
207  _ve[idx],
208  _vm[idx],
209  _vlifetime[idx],
210  _vspin[idx]};
211  }
std::vector< double > _vlifetime
Definition: lheh5.h:95
std::vector< int > _vid
Definition: lheh5.h:84
std::vector< double > _vpx
Definition: lheh5.h:90
std::vector< double > _vspin
Definition: lheh5.h:96
std::vector< double > _vm
Definition: lheh5.h:94
std::vector< double > _vpy
Definition: lheh5.h:91
std::vector< int > _vstatus
Definition: lheh5.h:85
std::vector< int > _vmother2
Definition: lheh5.h:87
std::vector< double > _vpz
Definition: lheh5.h:92
std::vector< double > _ve
Definition: lheh5.h:93
std::vector< int > _vcolor2
Definition: lheh5.h:89
std::vector< int > _vmother1
Definition: lheh5.h:86
std::vector< int > _vcolor1
Definition: lheh5.h:88

Member Data Documentation

◆ _particle_offset

size_t lheh5::Events2::_particle_offset

Definition at line 109 of file lheh5.h.

Referenced by mkEvent().

◆ _vaqcd

std::vector<double> lheh5::Events2::_vaqcd

Definition at line 106 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vaqed

std::vector<double> lheh5::Events2::_vaqed

Definition at line 105 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vcolor1

std::vector<int> lheh5::Events2::_vcolor1

Definition at line 88 of file lheh5.h.

Referenced by mkParticle().

◆ _vcolor2

std::vector<int> lheh5::Events2::_vcolor2

Definition at line 89 of file lheh5.h.

Referenced by mkParticle().

◆ _ve

std::vector<double> lheh5::Events2::_ve

Definition at line 93 of file lheh5.h.

Referenced by mkParticle().

◆ _vfscale

std::vector<double> lheh5::Events2::_vfscale

Definition at line 104 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vid

std::vector<int> lheh5::Events2::_vid

Definition at line 84 of file lheh5.h.

Referenced by mkParticle().

◆ _vlifetime

std::vector<double> lheh5::Events2::_vlifetime

Definition at line 95 of file lheh5.h.

Referenced by mkParticle().

◆ _vm

std::vector<double> lheh5::Events2::_vm

Definition at line 94 of file lheh5.h.

Referenced by mkParticle().

◆ _vmother1

std::vector<int> lheh5::Events2::_vmother1

Definition at line 86 of file lheh5.h.

Referenced by mkParticle().

◆ _vmother2

std::vector<int> lheh5::Events2::_vmother2

Definition at line 87 of file lheh5.h.

Referenced by mkParticle().

◆ _vnparticles

std::vector<int> lheh5::Events2::_vnparticles

Definition at line 98 of file lheh5.h.

Referenced by mkEvent(), and mkEventHeader().

◆ _vpid

std::vector<int> lheh5::Events2::_vpid

Definition at line 99 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vpx

std::vector<double> lheh5::Events2::_vpx

Definition at line 90 of file lheh5.h.

Referenced by mkParticle().

◆ _vpy

std::vector<double> lheh5::Events2::_vpy

Definition at line 91 of file lheh5.h.

Referenced by mkParticle().

◆ _vpz

std::vector<double> lheh5::Events2::_vpz

Definition at line 92 of file lheh5.h.

Referenced by mkParticle().

◆ _vrscale

std::vector<double> lheh5::Events2::_vrscale

Definition at line 103 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vscale

std::vector<double> lheh5::Events2::_vscale

Definition at line 102 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vspin

std::vector<double> lheh5::Events2::_vspin

Definition at line 96 of file lheh5.h.

Referenced by mkParticle().

◆ _vstart

std::vector<size_t> lheh5::Events2::_vstart

Definition at line 82 of file lheh5.h.

Referenced by mkEvent().

◆ _vstatus

std::vector<int> lheh5::Events2::_vstatus

Definition at line 85 of file lheh5.h.

Referenced by mkParticle().

◆ _vtrials

std::vector<size_t> lheh5::Events2::_vtrials

Definition at line 101 of file lheh5.h.

Referenced by mkEventHeader().

◆ _vweight

std::vector<double> lheh5::Events2::_vweight

Definition at line 100 of file lheh5.h.

Referenced by mkEventHeader().

◆ npLO

int lheh5::Events2::npLO

Definition at line 107 of file lheh5.h.

Referenced by mkEventHeader().

◆ npNLO

int lheh5::Events2::npNLO

Definition at line 108 of file lheh5.h.

Referenced by mkEventHeader().