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 
51  const L1TStub& lastStub() const { return stubs_.back(); }
52 
53  void setIP(double x, double y) {
54  ipx_ = x;
55  ipy_ = y;
56  }
57 
58  void write(std::ofstream& out);
59 
60  unsigned int layersHit(int tpid, int& nlayers, int& ndisks);
61 
62  int nstubs() const { return stubs_.size(); }
63 
64  const L1TStub& stub(int i) const { return stubs_[i]; }
65 
66  unsigned int nsimtracks() const { return simtracks_.size(); }
67 
68  const L1SimTrack& simtrack(int i) const { return simtracks_[i]; }
69 
70  int eventnum() const { return eventnum_; }
71 
72  private:
73  int eventnum_;
74  std::vector<L1SimTrack> simtracks_;
75  std::vector<L1TStub> stubs_;
76  double ipx_, ipy_;
77  };
78 
79 }; // namespace trklet
80 #endif
std::vector< L1SimTrack > simtracks_
Definition: SLHCEvent.h:74
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)
Definition: SLHCEvent.cc:13
std::vector< L1TStub > stubs_
Definition: SLHCEvent.h:75
~SLHCEvent()=default
void write(std::ofstream &out)
Definition: SLHCEvent.cc:154
int nstubs() const
Definition: SLHCEvent.h:62
void setIP(double x, double y)
Definition: SLHCEvent.h:53
const L1SimTrack & simtrack(int i) const
Definition: SLHCEvent.h:68
int eventnum() const
Definition: SLHCEvent.h:70
void setEventNum(int eventnum)
Definition: SLHCEvent.h:29
const L1TStub & lastStub() const
Definition: SLHCEvent.h:51
unsigned int nsimtracks() const
Definition: SLHCEvent.h:66
unsigned int layersHit(int tpid, int &nlayers, int &ndisks)
Definition: SLHCEvent.cc:168
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:64