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, bool tiltedBarrel, unsigned int tiltedRingId, unsigned int endcapRingId, unsigned int detId, double x, double y, double z, double bend, double strip, std::vector< int > tpstt)
 
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 20 of file SLHCEvent.h.

Constructor & Destructor Documentation

◆ SLHCEvent() [1/2]

trklet::SLHCEvent::SLHCEvent ( )
inline

Definition at line 22 of file SLHCEvent.h.

References eventnum_.

22  {
23  //empty constructor to be used with 'filler' functions
24  eventnum_ = 0;
25  }

◆ 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.

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

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:74
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:68

◆ addStub()

bool SLHCEvent::addStub ( std::string  DTClink,
int  region,
int  layerdisk,
std::string  stubword,
int  isPSmodule,
int  isFlipped,
bool  tiltedBarrel,
unsigned int  tiltedRingId,
unsigned int  endcapRingId,
unsigned int  detId,
double  x,
double  y,
double  z,
double  bend,
double  strip,
std::vector< int >  tpstt 
)

Definition at line 13 of file SLHCEvent.cc.

References HLT_2023v12_cff::region, digitizers_cfi::strip, and x.

28  {
29  L1TStub stub(DTClink,
30  region,
31  layerdisk,
32  stubword,
33  isPSmodule,
34  isFlipped,
35  tiltedBarrel,
36  tiltedRingId,
37  endcapRingId,
38  detId,
39  x,
40  y,
41  z,
42  bend,
43  strip,
44  tps);
45 
46  stubs_.push_back(stub);
47  return true;
48 }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:64

◆ eventnum()

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

Definition at line 70 of file SLHCEvent.h.

References eventnum_.

Referenced by setEventNum().

70 { return eventnum_; }

◆ lastStub()

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

Definition at line 51 of file SLHCEvent.h.

References stubs_.

51 { return stubs_.back(); }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75

◆ layersHit()

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

Definition at line 168 of file SLHCEvent.cc.

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

168  {
169  int l1 = 0;
170  int l2 = 0;
171  int l3 = 0;
172  int l4 = 0;
173  int l5 = 0;
174  int l6 = 0;
175 
176  int d1 = 0;
177  int d2 = 0;
178  int d3 = 0;
179  int d4 = 0;
180  int d5 = 0;
181 
182  for (auto& stub : stubs_) {
183  if (stub.tpmatch(tpid)) {
184  if (stub.layer() == 0)
185  l1 = 1;
186  if (stub.layer() == 1)
187  l2 = 1;
188  if (stub.layer() == 2)
189  l3 = 1;
190  if (stub.layer() == 3)
191  l4 = 1;
192  if (stub.layer() == 4)
193  l5 = 1;
194  if (stub.layer() == 5)
195  l6 = 1;
196 
197  if (abs(stub.disk()) == 1)
198  d1 = 1;
199  if (abs(stub.disk()) == 2)
200  d2 = 1;
201  if (abs(stub.disk()) == 3)
202  d3 = 1;
203  if (abs(stub.disk()) == 4)
204  d4 = 1;
205  if (abs(stub.disk()) == 5)
206  d5 = 1;
207  }
208  }
209 
210  nlayers = l1 + l2 + l3 + l4 + l5 + l6;
211  ndisks = d1 + d2 + d3 + d4 + d5;
212 
213  return l1 + 2 * l2 + 4 * l3 + 8 * l4 + 16 * l5 + 32 * l6 + 64 * d1 + 128 * d2 + 256 * d3 + 512 * d4 + 1024 * d5;
214 }
unsigned int layer() const
Definition: L1TStub.h:45
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int disk() const
Definition: L1TStub.h:46
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:64
static constexpr float d1
bool tpmatch(int tp) const
Definition: L1TStub.cc:107

◆ nsimtracks()

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

Definition at line 66 of file SLHCEvent.h.

References simtracks_.

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

66 { return simtracks_.size(); }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:74

◆ nstubs()

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

Definition at line 62 of file SLHCEvent.h.

References stubs_.

62 { return stubs_.size(); }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75

◆ setEventNum()

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

Definition at line 29 of file SLHCEvent.h.

References eventnum(), and eventnum_.

29 { eventnum_ = eventnum; }
int eventnum() const
Definition: SLHCEvent.h:70

◆ setIP()

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

Definition at line 53 of file SLHCEvent.h.

References ipx_, ipy_, and x.

53  {
54  ipx_ = x;
55  ipy_ = y;
56  }

◆ simtrack()

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

Definition at line 68 of file SLHCEvent.h.

References mps_fire::i, and simtracks_.

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

68 { return simtracks_[i]; }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:74

◆ stub()

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

Definition at line 64 of file SLHCEvent.h.

References mps_fire::i, and stubs_.

64 { return stubs_[i]; }
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75

◆ write()

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

Definition at line 154 of file SLHCEvent.cc.

References MillePedeFileConverter_cfg::out.

154  {
155  out << "Event: " << eventnum_ << endl;
156 
157  for (auto& simtrack : simtracks_) {
158  simtrack.write(out);
159  }
160  out << "SimTrackEnd" << endl;
161 
162  for (auto& stub : stubs_) {
163  stub.write(out);
164  }
165  out << "Stubend" << endl;
166 }
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:74
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75
void write(std::ofstream &out)
Definition: L1TStub.cc:57
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:68
void write(std::ofstream &out)
Definition: L1SimTrack.cc:25
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:64

Member Data Documentation

◆ eventnum_

int trklet::SLHCEvent::eventnum_
private

Definition at line 73 of file SLHCEvent.h.

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

◆ ipx_

double trklet::SLHCEvent::ipx_
private

Definition at line 76 of file SLHCEvent.h.

Referenced by setIP().

◆ ipy_

double trklet::SLHCEvent::ipy_
private

Definition at line 76 of file SLHCEvent.h.

Referenced by setIP().

◆ simtracks_

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

Definition at line 74 of file SLHCEvent.h.

Referenced by nsimtracks(), and simtrack().

◆ stubs_

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

Definition at line 75 of file SLHCEvent.h.

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