CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1SimTrack.h
Go to the documentation of this file.
1 // Stores MC truth information, pt, eta, phi, vx, vy, vz, as well as particle type and track id
2 #ifndef L1Trigger_TrackFindingTracklet_interface_L1SimTrack_h
3 #define L1Trigger_TrackFindingTracklet_interface_L1SimTrack_h
4 
5 #include <iostream>
6 #include <fstream>
7 #include <cstdlib>
8 #include <vector>
9 #include <cmath>
10 #include <cassert>
11 
12 namespace trklet {
13 
14  class L1SimTrack {
15  public:
16  L1SimTrack();
17  L1SimTrack(int eventid, int trackid, int type, double pt, double eta, double phi, double vx, double vy, double vz);
18  ~L1SimTrack() = default;
19 
20  void write(std::ofstream& out);
21  void write(std::ostream& out);
22 
23  int eventid() const { return eventid_; }
24  int trackid() const { return trackid_; }
25  int type() const { return type_; }
26  double pt() const { return pt_; }
27  double eta() const { return eta_; }
28  double phi() const { return phi_; }
29  double vx() const { return vx_; }
30  double vy() const { return vy_; }
31  double vz() const { return vz_; }
32  double dxy() const { return -vx() * sin(phi()) + vy() * cos(phi()); }
33  double d0() const { return -dxy(); }
34  int charge() const {
35  if (type_ == 11 || type_ == 13 || type_ == -211 || type_ == -321 || type_ == -2212)
36  return -1;
37  return 1;
38  }
39 
40  private:
41  int eventid_;
42  int trackid_;
43  int type_;
44  double pt_;
45  double eta_;
46  double phi_;
47  double vx_;
48  double vy_;
49  double vz_;
50  };
51 
52 }; // namespace trklet
53 #endif
int trackid() const
Definition: L1SimTrack.h:24
double pt() const
Definition: L1SimTrack.h:26
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double eta() const
Definition: L1SimTrack.h:27
double dxy() const
Definition: L1SimTrack.h:32
double d0() const
Definition: L1SimTrack.h:33
double vy() const
Definition: L1SimTrack.h:30
double vx() const
Definition: L1SimTrack.h:29
double vz() const
Definition: L1SimTrack.h:31
int eventid() const
Definition: L1SimTrack.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void write(std::ofstream &out)
Definition: L1SimTrack.cc:25
int type() const
Definition: L1SimTrack.h:25
int charge() const
Definition: L1SimTrack.h:34
double phi() const
Definition: L1SimTrack.h:28
~L1SimTrack()=default