CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

trklet::SLHCEvent::SLHCEvent ( )
inline

Definition at line 19 of file SLHCEvent.h.

References eventnum_.

19  {
20  //empty constructor to be used with 'filler' functions
21  eventnum_ = 0;
22  }
trklet::SLHCEvent::SLHCEvent ( std::istream &  in)
trklet::SLHCEvent::~SLHCEvent ( )
default

Member Function Documentation

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.

Referenced by L1FPGATrackProducer::produce().

8  {
9  L1SimTrack simtrack(eventid, trackid, type, pt, eta, phi, vx, vy, vz);
10  simtracks_.push_back(simtrack);
11 }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:67
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:61
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.

Referenced by L1FPGATrackProducer::produce().

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 }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:57
int trklet::SLHCEvent::eventnum ( ) const
inline

Definition at line 63 of file SLHCEvent.h.

References eventnum_.

Referenced by setEventNum().

63 { return eventnum_; }
const L1TStub& trklet::SLHCEvent::lastStub ( ) const
inline

Definition at line 44 of file SLHCEvent.h.

References stubs_.

Referenced by L1FPGATrackProducer::produce().

44 { return stubs_.back(); }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
unsigned int SLHCEvent::layersHit ( int  tpid,
int &  nlayers,
int &  ndisks 
)

Definition at line 128 of file SLHCEvent.cc.

References funct::abs(), and d1.

Referenced by trklet::TrackletEventProcessor::event().

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 }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
int disk() const
Definition: L1TStub.h:42
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:57
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool tpmatch(int tp) const
Definition: L1TStub.cc:102
unsigned int layer() const
Definition: L1TStub.h:41
static constexpr float d1
unsigned int trklet::SLHCEvent::nsimtracks ( ) const
inline

Definition at line 59 of file SLHCEvent.h.

References simtracks_.

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

59 { return simtracks_.size(); }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:67
int trklet::SLHCEvent::nstubs ( ) const
inline

Definition at line 55 of file SLHCEvent.h.

References stubs_.

Referenced by trklet::TrackletEventProcessor::event().

55 { return stubs_.size(); }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
void trklet::SLHCEvent::setEventNum ( int  eventnum)
inline

Definition at line 26 of file SLHCEvent.h.

References eventnum(), and eventnum_.

Referenced by L1FPGATrackProducer::produce().

26 { eventnum_ = eventnum; }
int eventnum() const
Definition: SLHCEvent.h:63
void trklet::SLHCEvent::setIP ( double  x,
double  y 
)
inline

Definition at line 46 of file SLHCEvent.h.

References ipx_, and ipy_.

Referenced by L1FPGATrackProducer::produce().

46  {
47  ipx_ = x;
48  ipy_ = y;
49  }
const L1SimTrack& trklet::SLHCEvent::simtrack ( int  i) const
inline

Definition at line 61 of file SLHCEvent.h.

References mps_fire::i, and simtracks_.

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

61 { return simtracks_[i]; }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:67
const L1TStub& trklet::SLHCEvent::stub ( int  i) const
inline

Definition at line 57 of file SLHCEvent.h.

References mps_fire::i, and stubs_.

Referenced by trklet::TrackletEventProcessor::event().

57 { return stubs_[i]; }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
void SLHCEvent::write ( std::ofstream &  out)

Definition at line 114 of file SLHCEvent.cc.

Referenced by L1FPGATrackProducer::produce().

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 }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:67
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:68
void write(std::ofstream &out)
Definition: L1TStub.cc:51
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:57
void write(std::ofstream &out)
Definition: L1SimTrack.cc:25
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:61

Member Data Documentation

int trklet::SLHCEvent::eventnum_
private

Definition at line 66 of file SLHCEvent.h.

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

double trklet::SLHCEvent::ipx_
private

Definition at line 69 of file SLHCEvent.h.

Referenced by setIP().

double trklet::SLHCEvent::ipy_
private

Definition at line 69 of file SLHCEvent.h.

Referenced by setIP().

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

Definition at line 67 of file SLHCEvent.h.

Referenced by nsimtracks(), and simtrack().

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

Definition at line 68 of file SLHCEvent.h.

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