Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:28

0001 // This holds two classes: L1SimTrack (truth level simulated track), and SLHCEvent (support for maintaining standalone running)
0002 #ifndef L1Trigger_TrackFindingTracklet_interface_SLHCEvent_h
0003 #define L1Trigger_TrackFindingTracklet_interface_SLHCEvent_h
0004 
0005 #include <iostream>
0006 #include <fstream>
0007 #include <cstdlib>
0008 #include <vector>
0009 #include <cmath>
0010 #include <cassert>
0011 
0012 #include "L1Trigger/TrackFindingTracklet/interface/L1TStub.h"
0013 #include "L1Trigger/TrackFindingTracklet/interface/L1SimTrack.h"
0014 
0015 namespace trklet {
0016 
0017   class SLHCEvent {
0018   public:
0019     SLHCEvent() {
0020       //empty constructor to be used with 'filler' functions
0021       eventnum_ = 0;
0022     }
0023     SLHCEvent(std::istream& in);
0024     ~SLHCEvent() = default;
0025 
0026     void setEventNum(int eventnum) { eventnum_ = eventnum; }
0027 
0028     void addL1SimTrack(
0029         int eventid, int trackid, int type, double pt, double eta, double phi, double vx, double vy, double vz);
0030 
0031     bool addStub(std::string DTClink,
0032                  int region,
0033                  int layerdisk,
0034                  std::string stubword,
0035                  int isPSmodule,
0036                  int isFlipped,
0037                  double x,
0038                  double y,
0039                  double z,
0040                  double bend,
0041                  double strip,
0042                  std::vector<int> tps);
0043 
0044     const L1TStub& lastStub() const { return stubs_.back(); }
0045 
0046     void setIP(double x, double y) {
0047       ipx_ = x;
0048       ipy_ = y;
0049     }
0050 
0051     void write(std::ofstream& out);
0052 
0053     unsigned int layersHit(int tpid, int& nlayers, int& ndisks);
0054 
0055     int nstubs() const { return stubs_.size(); }
0056 
0057     const L1TStub& stub(int i) const { return stubs_[i]; }
0058 
0059     unsigned int nsimtracks() const { return simtracks_.size(); }
0060 
0061     const L1SimTrack& simtrack(int i) const { return simtracks_[i]; }
0062 
0063     int eventnum() const { return eventnum_; }
0064 
0065   private:
0066     int eventnum_;
0067     std::vector<L1SimTrack> simtracks_;
0068     std::vector<L1TStub> stubs_;
0069     double ipx_, ipy_;
0070   };
0071 
0072 };  // namespace trklet
0073 #endif