Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-14 01:44:00

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