CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trklet::SLHCEvent Class Reference

#include <SLHCEvent.h>

Public Member Functions

void addL1SimTrack (int eventid, int trackid, int type, double pt, double eta, double phi, double vx, double vy, double vz)
 
bool addStub (int layer, int ladder, int module, int strip, int eventid, std::vector< int > tps, double pt, double bend, double x, double y, double z, int isPSmodule, int isFlipped)
 
int eventnum () const
 
int getSimtrackFromSimtrackid (int simtrackid, int eventid=0) const
 
const L1TStublastStub () const
 
unsigned int layersHit (int tpid, int &nlayers, int &ndisks)
 
unsigned int nsimtracks () const
 
int nstubs () const
 
void setEventNum (int eventnum)
 
void setIPx (double x)
 
void setIPy (double y)
 
const L1SimTracksimtrack (int i) const
 
 SLHCEvent ()
 
 SLHCEvent (std::istream &in)
 
const L1TStubstub (int i) const
 
void write (std::ofstream &out)
 
void write (std::ostream &out)
 
 ~SLHCEvent ()=default
 

Private Attributes

int eventnum_
 
std::vector< L1SimTracksimtracks_
 
std::vector< L1TStubstubs_
 
double x_offset_ {0.0}
 
double y_offset_ {0.0}
 

Detailed Description

Definition at line 54 of file SLHCEvent.h.

Constructor & Destructor Documentation

◆ SLHCEvent() [1/2]

trklet::SLHCEvent::SLHCEvent ( )
inline

Definition at line 56 of file SLHCEvent.h.

56  {
57  //empty constructor to be used with 'filler' functions
58  eventnum_ = 0;
59  }

References eventnum_.

◆ SLHCEvent() [2/2]

trklet::SLHCEvent::SLHCEvent ( std::istream &  in)

◆ ~SLHCEvent()

trklet::SLHCEvent::~SLHCEvent ( )
default

Member Function Documentation

◆ addL1SimTrack()

void SLHCEvent::addL1SimTrack ( int  eventid,
int  trackid,
int  type,
double  pt,
double  eta,
double  phi,
double  vx,
double  vy,
double  vz 
)

Definition at line 40 of file SLHCEvent.cc.

41  {
42  vx -= x_offset_;
43  vy -= y_offset_;
44  L1SimTrack simtrack(eventid, trackid, type, pt, eta, phi, vx, vy, vz);
45  simtracks_.push_back(simtrack);
46 }

References PVValHelper::eta, and DiDispStaMuonMonitor_cfi::pt.

◆ addStub()

bool SLHCEvent::addStub ( int  layer,
int  ladder,
int  module,
int  strip,
int  eventid,
std::vector< int >  tps,
double  pt,
double  bend,
double  x,
double  y,
double  z,
int  isPSmodule,
int  isFlipped 
)

Definition at line 48 of file SLHCEvent.cc.

60  {
61  if (layer > 999 && layer < 1999 && z < 0.0) {
62  layer += 1000;
63  }
64 
65  layer--;
66  x -= x_offset_;
67  y -= y_offset_;
68 
69  L1TStub stub(
70  eventid, tps, -1, -1, layer, ladder, module, strip, x, y, z, -1.0, -1.0, pt, bend, isPSmodule, isFlipped);
71 
72  stubs_.push_back(stub);
73  return true;
74 }

References trklet::bend(), PVValHelper::ladder, DiDispStaMuonMonitor_cfi::pt, and digitizers_cfi::strip.

◆ eventnum()

int trklet::SLHCEvent::eventnum ( ) const
inline

Definition at line 100 of file SLHCEvent.h.

100 { return eventnum_; }

References eventnum_.

Referenced by setEventNum().

◆ getSimtrackFromSimtrackid()

int SLHCEvent::getSimtrackFromSimtrackid ( int  simtrackid,
int  eventid = 0 
) const

Definition at line 287 of file SLHCEvent.cc.

287  {
288  for (unsigned int i = 0; i < simtracks_.size(); i++) {
289  if (simtracks_[i].trackid() == simtrackid && simtracks_[i].eventid() == eventid)
290  return i;
291  }
292  return -1;
293 }

References mps_fire::i.

◆ lastStub()

const L1TStub& trklet::SLHCEvent::lastStub ( ) const
inline

Definition at line 85 of file SLHCEvent.h.

85 { return stubs_.back(); }

References stubs_.

◆ layersHit()

unsigned int SLHCEvent::layersHit ( int  tpid,
int &  nlayers,
int &  ndisks 
)

Definition at line 239 of file SLHCEvent.cc.

239  {
240  int l1 = 0;
241  int l2 = 0;
242  int l3 = 0;
243  int l4 = 0;
244  int l5 = 0;
245  int l6 = 0;
246 
247  int d1 = 0;
248  int d2 = 0;
249  int d3 = 0;
250  int d4 = 0;
251  int d5 = 0;
252 
253  for (auto& stub : stubs_) {
254  if (stub.tpmatch(tpid)) {
255  if (stub.layer() == 0)
256  l1 = 1;
257  if (stub.layer() == 1)
258  l2 = 1;
259  if (stub.layer() == 2)
260  l3 = 1;
261  if (stub.layer() == 3)
262  l4 = 1;
263  if (stub.layer() == 4)
264  l5 = 1;
265  if (stub.layer() == 5)
266  l6 = 1;
267 
268  if (abs(stub.disk()) == 1)
269  d1 = 1;
270  if (abs(stub.disk()) == 2)
271  d2 = 1;
272  if (abs(stub.disk()) == 3)
273  d3 = 1;
274  if (abs(stub.disk()) == 4)
275  d4 = 1;
276  if (abs(stub.disk()) == 5)
277  d5 = 1;
278  }
279  }
280 
281  nlayers = l1 + l2 + l3 + l4 + l5 + l6;
282  ndisks = d1 + d2 + d3 + d4 + d5;
283 
284  return l1 + 2 * l2 + 4 * l3 + 8 * l4 + 16 * l5 + 32 * l6 + 64 * d1 + 128 * d2 + 256 * d3 + 512 * d4 + 1024 * d5;
285 }

References funct::abs(), d1, and nlayers.

◆ nsimtracks()

unsigned int trklet::SLHCEvent::nsimtracks ( ) const
inline

Definition at line 96 of file SLHCEvent.h.

96 { return simtracks_.size(); }

References simtracks_.

◆ nstubs()

int trklet::SLHCEvent::nstubs ( ) const
inline

Definition at line 92 of file SLHCEvent.h.

92 { return stubs_.size(); }

References stubs_.

◆ setEventNum()

void trklet::SLHCEvent::setEventNum ( int  eventnum)
inline

Definition at line 66 of file SLHCEvent.h.

66 { eventnum_ = eventnum; }

References eventnum(), and eventnum_.

◆ setIPx()

void trklet::SLHCEvent::setIPx ( double  x)
inline

Definition at line 63 of file SLHCEvent.h.

63 { x_offset_ = x; }

References x_offset_.

◆ setIPy()

void trklet::SLHCEvent::setIPy ( double  y)
inline

Definition at line 64 of file SLHCEvent.h.

64 { y_offset_ = y; }

References y_offset_.

◆ simtrack()

const L1SimTrack& trklet::SLHCEvent::simtrack ( int  i) const
inline

Definition at line 98 of file SLHCEvent.h.

98 { return simtracks_[i]; }

References mps_fire::i, and simtracks_.

◆ stub()

const L1TStub& trklet::SLHCEvent::stub ( int  i) const
inline

Definition at line 94 of file SLHCEvent.h.

94 { return stubs_[i]; }

References mps_fire::i, and stubs_.

◆ write() [1/2]

void SLHCEvent::write ( std::ofstream &  out)

Definition at line 211 of file SLHCEvent.cc.

211  {
212  out << "Event: " << eventnum_ << endl;
213 
214  for (auto& simtrack : simtracks_) {
215  simtrack.write(out);
216  }
217  out << "SimTrackEnd" << endl;
218 
219  for (auto& stub : stubs_) {
220  stub.write(out);
221  }
222  out << "StubEnd" << endl;
223 }

References MillePedeFileConverter_cfg::out.

◆ write() [2/2]

void trklet::SLHCEvent::write ( std::ostream &  out)

Member Data Documentation

◆ eventnum_

int trklet::SLHCEvent::eventnum_
private

Definition at line 105 of file SLHCEvent.h.

Referenced by eventnum(), setEventNum(), and SLHCEvent().

◆ simtracks_

std::vector<L1SimTrack> trklet::SLHCEvent::simtracks_
private

Definition at line 106 of file SLHCEvent.h.

Referenced by nsimtracks(), and simtrack().

◆ stubs_

std::vector<L1TStub> trklet::SLHCEvent::stubs_
private

Definition at line 107 of file SLHCEvent.h.

Referenced by lastStub(), nstubs(), and stub().

◆ x_offset_

double trklet::SLHCEvent::x_offset_ {0.0}
private

Definition at line 109 of file SLHCEvent.h.

Referenced by setIPx().

◆ y_offset_

double trklet::SLHCEvent::y_offset_ {0.0}
private

Definition at line 110 of file SLHCEvent.h.

Referenced by setIPy().

trklet::SLHCEvent::stub
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:94
mps_fire.i
i
Definition: mps_fire.py:428
trklet::L1TStub::layer
unsigned int layer() const
Definition: L1TStub.h:44
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
trklet::SLHCEvent::x_offset_
double x_offset_
Definition: SLHCEvent.h:109
trklet::L1TStub
Definition: L1TStub.h:12
trklet::L1SimTrack
Definition: SLHCEvent.h:16
trklet::L1TStub::write
void write(std::ofstream &out)
Definition: L1TStub.cc:47
PVValHelper::eta
Definition: PVValidationHelpers.h:69
trklet::SLHCEvent::y_offset_
double y_offset_
Definition: SLHCEvent.h:110
trklet::L1SimTrack::write
void write(std::ofstream &out)
Definition: SLHCEvent.cc:26
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
trklet::SLHCEvent::eventnum
int eventnum() const
Definition: SLHCEvent.h:100
trklet::L1TStub::disk
int disk() const
Definition: L1TStub.h:45
trklet::SLHCEvent::eventnum_
int eventnum_
Definition: SLHCEvent.h:105
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
genVertex_cff.x
x
Definition: genVertex_cff.py:12
PVValHelper::ladder
Definition: PVValidationHelpers.h:72
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
trklet::L1TStub::tpmatch
bool tpmatch(int tp) const
Definition: L1TStub.cc:108
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trklet::SLHCEvent::simtrack
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:98
trklet::SLHCEvent::simtracks_
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:106
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
trklet::SLHCEvent::stubs_
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:107
nlayers
Definition: HIMultiTrackSelector.h:48