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

◆ 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,
int  stubindex 
)

Definition at line 13 of file SLHCEvent.cc.

References hcalRecHitTable_cff::detId, nano_mu_digi_cff::region, trklet::L1TStub::setUniqueIndex(), nano_mu_digi_cff::strip, and x.

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

◆ eventnum()

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

Definition at line 71 of file SLHCEvent.h.

References eventnum_.

Referenced by setEventNum().

71 { return eventnum_; }

◆ lastStub()

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

Definition at line 52 of file SLHCEvent.h.

References stubs_.

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

◆ layersHit()

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

Definition at line 170 of file SLHCEvent.cc.

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

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

◆ nsimtracks()

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

Definition at line 67 of file SLHCEvent.h.

References simtracks_.

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

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

◆ nstubs()

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

Definition at line 63 of file SLHCEvent.h.

References stubs_.

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

◆ 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:71

◆ setIP()

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

Definition at line 54 of file SLHCEvent.h.

References ipx_, ipy_, and x.

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

◆ simtrack()

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

Definition at line 69 of file SLHCEvent.h.

References mps_fire::i, and simtracks_.

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

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

◆ stub()

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

Definition at line 65 of file SLHCEvent.h.

References mps_fire::i, and stubs_.

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

◆ write()

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

Definition at line 156 of file SLHCEvent.cc.

References MillePedeFileConverter_cfg::out.

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

Member Data Documentation

◆ eventnum_

int trklet::SLHCEvent::eventnum_
private

Definition at line 74 of file SLHCEvent.h.

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

◆ ipx_

double trklet::SLHCEvent::ipx_
private

Definition at line 77 of file SLHCEvent.h.

Referenced by setIP().

◆ ipy_

double trklet::SLHCEvent::ipy_
private

Definition at line 77 of file SLHCEvent.h.

Referenced by setIP().

◆ simtracks_

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

Definition at line 75 of file SLHCEvent.h.

Referenced by nsimtracks(), and simtrack().

◆ stubs_

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

Definition at line 76 of file SLHCEvent.h.

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