CMS 3D CMS Logo

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