CMS 3D CMS Logo

SLHCEvent.h
Go to the documentation of this file.
1 // This class stores all the L1SimTracks (truth-level simulated track)
2 // & reconstructed stubs using CMSSW independent containers,
3 // to support standalone running.
4 
5 #ifndef L1Trigger_TrackFindingTracklet_interface_SLHCEvent_h
6 #define L1Trigger_TrackFindingTracklet_interface_SLHCEvent_h
7 
8 #include <iostream>
9 #include <fstream>
10 #include <cstdlib>
11 #include <vector>
12 #include <cmath>
13 #include <cassert>
14 
17 
18 namespace trklet {
19 
20  class SLHCEvent {
21  public:
23  //empty constructor to be used with 'filler' functions
24  eventnum_ = 0;
25  }
26  SLHCEvent(std::istream& in);
27  ~SLHCEvent() = default;
28 
30 
31  void addL1SimTrack(
32  int eventid, int trackid, int type, double pt, double eta, double phi, double vx, double vy, double vz);
33 
34  bool addStub(std::string DTClink,
35  int region,
36  int layerdisk,
37  std::string stubword,
38  int isPSmodule,
39  int isFlipped,
40  bool tiltedBarrel,
41  unsigned int tiltedRingId,
42  unsigned int endcapRingId,
43  unsigned int detId,
44  double x,
45  double y,
46  double z,
47  double bend,
48  double strip,
49  std::vector<int> tpstt,
50  int stubindex);
51 
52  const L1TStub& lastStub() const { return stubs_.back(); }
53 
54  void setIP(double x, double y) {
55  ipx_ = x;
56  ipy_ = y;
57  }
58 
59  void write(std::ofstream& out);
60 
61  unsigned int layersHit(int tpid, int& nlayers, int& ndisks);
62 
63  int nstubs() const { return stubs_.size(); }
64 
65  const L1TStub& stub(int i) const { return stubs_[i]; }
66 
67  unsigned int nsimtracks() const { return simtracks_.size(); }
68 
69  const L1SimTrack& simtrack(int i) const { return simtracks_[i]; }
70 
71  int eventnum() const { return eventnum_; }
72 
73  private:
74  int eventnum_;
75  std::vector<L1SimTrack> simtracks_;
76  std::vector<L1TStub> stubs_;
77  double ipx_, ipy_;
78  };
79 
80 }; // namespace trklet
81 #endif
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:75
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:76
~SLHCEvent()=default
void write(std::ofstream &out)
Definition: SLHCEvent.cc:156
int nstubs() const
Definition: SLHCEvent.h:63
void setIP(double x, double y)
Definition: SLHCEvent.h:54
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:69
int eventnum() const
Definition: SLHCEvent.h:71
void setEventNum(int eventnum)
Definition: SLHCEvent.h:29
const L1TStub & lastStub() const
Definition: SLHCEvent.h:52
unsigned int nsimtracks() const
Definition: SLHCEvent.h:67
unsigned int layersHit(int tpid, int &nlayers, int &ndisks)
Definition: SLHCEvent.cc:170
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)
Definition: SLHCEvent.cc:13
void addL1SimTrack(int eventid, int trackid, int type, double pt, double eta, double phi, double vx, double vy, double vz)
Definition: SLHCEvent.cc:7
float x
const L1TStub & stub(int i) const
Definition: SLHCEvent.h:65