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 (std::string DTClink, int region, int layerdisk, std::string stubword, int isPSmodule, int isFlipped, double x, double y, double z, double bend, double strip, std::vector< int > tps)
 
int eventnum () 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 setIP (double x, double y)
 
const L1SimTracksimtrack (int i) const
 
 SLHCEvent ()
 
 SLHCEvent (std::istream &in)
 
const L1TStubstub (int i) const
 
void write (std::ofstream &out)
 
 ~SLHCEvent ()=default
 

Private Attributes

int eventnum_
 
double ipx_
 
double ipy_
 
std::vector< L1SimTracksimtracks_
 
std::vector< L1TStubstubs_
 

Detailed Description

Definition at line 17 of file SLHCEvent.h.

Constructor & Destructor Documentation

◆ SLHCEvent() [1/2]

trklet::SLHCEvent::SLHCEvent ( )
inline

Definition at line 19 of file SLHCEvent.h.

19  {
20  //empty constructor to be used with 'filler' functions
21  eventnum_ = 0;
22  }

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 7 of file SLHCEvent.cc.

8  {
9  L1SimTrack simtrack(eventid, trackid, type, pt, eta, phi, vx, vy, vz);
10  simtracks_.push_back(simtrack);
11 }

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

◆ addStub()

bool SLHCEvent::addStub ( std::string  DTClink,
int  region,
int  layerdisk,
std::string  stubword,
int  isPSmodule,
int  isFlipped,
double  x,
double  y,
double  z,
double  bend,
double  strip,
std::vector< int >  tps 
)

Definition at line 13 of file SLHCEvent.cc.

24  {
25  L1TStub stub(DTClink, region, layerdisk, stubword, isPSmodule, isFlipped, x, y, z, bend, strip, tps);
26 
27  stubs_.push_back(stub);
28  return true;
29 }

References HLT_FULL_cff::region, and digitizers_cfi::strip.

◆ eventnum()

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

Definition at line 63 of file SLHCEvent.h.

63 { return eventnum_; }

References eventnum_.

Referenced by setEventNum().

◆ lastStub()

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

Definition at line 44 of file SLHCEvent.h.

44 { return stubs_.back(); }

References stubs_.

◆ layersHit()

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

Definition at line 128 of file SLHCEvent.cc.

128  {
129  int l1 = 0;
130  int l2 = 0;
131  int l3 = 0;
132  int l4 = 0;
133  int l5 = 0;
134  int l6 = 0;
135 
136  int d1 = 0;
137  int d2 = 0;
138  int d3 = 0;
139  int d4 = 0;
140  int d5 = 0;
141 
142  for (auto& stub : stubs_) {
143  if (stub.tpmatch(tpid)) {
144  if (stub.layer() == 0)
145  l1 = 1;
146  if (stub.layer() == 1)
147  l2 = 1;
148  if (stub.layer() == 2)
149  l3 = 1;
150  if (stub.layer() == 3)
151  l4 = 1;
152  if (stub.layer() == 4)
153  l5 = 1;
154  if (stub.layer() == 5)
155  l6 = 1;
156 
157  if (abs(stub.disk()) == 1)
158  d1 = 1;
159  if (abs(stub.disk()) == 2)
160  d2 = 1;
161  if (abs(stub.disk()) == 3)
162  d3 = 1;
163  if (abs(stub.disk()) == 4)
164  d4 = 1;
165  if (abs(stub.disk()) == 5)
166  d5 = 1;
167  }
168  }
169 
170  nlayers = l1 + l2 + l3 + l4 + l5 + l6;
171  ndisks = d1 + d2 + d3 + d4 + d5;
172 
173  return l1 + 2 * l2 + 4 * l3 + 8 * l4 + 16 * l5 + 32 * l6 + 64 * d1 + 128 * d2 + 256 * d3 + 512 * d4 + 1024 * d5;
174 }

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

◆ nsimtracks()

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

Definition at line 59 of file SLHCEvent.h.

59 { return simtracks_.size(); }

References simtracks_.

Referenced by trklet::Stub::Stub().

◆ nstubs()

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

Definition at line 55 of file SLHCEvent.h.

55 { return stubs_.size(); }

References stubs_.

◆ setEventNum()

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

Definition at line 26 of file SLHCEvent.h.

26 { eventnum_ = eventnum; }

References eventnum(), and eventnum_.

◆ setIP()

void trklet::SLHCEvent::setIP ( double  x,
double  y 
)
inline

Definition at line 46 of file SLHCEvent.h.

46  {
47  ipx_ = x;
48  ipy_ = y;
49  }

References ipx_, and ipy_.

◆ simtrack()

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

Definition at line 61 of file SLHCEvent.h.

61 { return simtracks_[i]; }

References mps_fire::i, and simtracks_.

Referenced by trklet::Stub::Stub().

◆ stub()

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

Definition at line 57 of file SLHCEvent.h.

57 { return stubs_[i]; }

References mps_fire::i, and stubs_.

◆ write()

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

Definition at line 114 of file SLHCEvent.cc.

114  {
115  out << "Event: " << eventnum_ << endl;
116 
117  for (auto& simtrack : simtracks_) {
118  simtrack.write(out);
119  }
120  out << "SimTrackEnd" << endl;
121 
122  for (auto& stub : stubs_) {
123  stub.write(out);
124  }
125  out << "Stubend" << endl;
126 }

References MillePedeFileConverter_cfg::out.

Member Data Documentation

◆ eventnum_

int trklet::SLHCEvent::eventnum_
private

Definition at line 66 of file SLHCEvent.h.

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

◆ ipx_

double trklet::SLHCEvent::ipx_
private

Definition at line 69 of file SLHCEvent.h.

Referenced by setIP().

◆ ipy_

double trklet::SLHCEvent::ipy_
private

Definition at line 69 of file SLHCEvent.h.

Referenced by setIP().

◆ simtracks_

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

Definition at line 67 of file SLHCEvent.h.

Referenced by nsimtracks(), and simtrack().

◆ stubs_

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

Definition at line 68 of file SLHCEvent.h.

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

trklet::SLHCEvent::stub
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:57
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
trklet::L1TStub::layer
unsigned int layer() const
Definition: L1TStub.h:41
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
trklet::L1TStub
Definition: L1TStub.h:14
trklet::L1SimTrack
Definition: L1SimTrack.h:14
DDAxes::x
trklet::L1TStub::write
void write(std::ofstream &out)
Definition: L1TStub.cc:51
PVValHelper::eta
Definition: PVValidationHelpers.h:70
DDAxes::z
trklet::L1SimTrack::write
void write(std::ofstream &out)
Definition: L1SimTrack.cc:25
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
trklet::SLHCEvent::eventnum
int eventnum() const
Definition: SLHCEvent.h:63
trklet::L1TStub::disk
int disk() const
Definition: L1TStub.h:42
trklet::SLHCEvent::ipx_
double ipx_
Definition: SLHCEvent.h:69
trklet::SLHCEvent::ipy_
double ipy_
Definition: SLHCEvent.h:69
DDAxes::phi
trklet::SLHCEvent::eventnum_
int eventnum_
Definition: SLHCEvent.h:66
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
trklet::L1TStub::tpmatch
bool tpmatch(int tp) const
Definition: L1TStub.cc:102
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:61
trklet::SLHCEvent::simtracks_
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:67
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
trklet::SLHCEvent::stubs_
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
nlayers
Definition: HIMultiTrackSelector.h:48