File indexing completed on 2024-04-06 12:29:43
0001 #ifndef PixelSimHitExtraInfo_h
0002 #define PixelSimHitExtraInfo_h
0003
0004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0005 #include <vector>
0006 #include <cstdint>
0007
0008 class PixelSimHitExtraInfo {
0009 public:
0010 PixelSimHitExtraInfo(size_t Hindex, const Local3DPoint& entryP, const Local3DPoint& exitP, unsigned int ch) {
0011 index_ = Hindex;
0012 theEntryPoint_ = entryP;
0013 theExitPoint_ = exitP;
0014 chan_.push_back(ch);
0015 };
0016 PixelSimHitExtraInfo() = default;
0017 ~PixelSimHitExtraInfo() = default;
0018 size_t hitIndex() const { return index_; };
0019 const Local3DPoint& entryPoint() const { return theEntryPoint_; };
0020 const Local3DPoint& exitPoint() const { return theExitPoint_; }
0021 const std::vector<unsigned int>& channel() const { return chan_; };
0022
0023 inline bool operator<(const PixelSimHitExtraInfo& other) const { return hitIndex() < other.hitIndex(); }
0024
0025 void addDigiInfo(unsigned int theDigiChannel) { chan_.push_back(theDigiChannel); }
0026 bool isInTheList(unsigned int channelToCheck) {
0027 bool result_in_the_list = false;
0028 for (unsigned int icheck = 0; icheck < chan_.size(); icheck++) {
0029 if (channelToCheck == chan_[icheck]) {
0030 result_in_the_list = true;
0031 break;
0032 }
0033 }
0034 return result_in_the_list;
0035 }
0036
0037 private:
0038 size_t index_;
0039 Local3DPoint theEntryPoint_;
0040 Local3DPoint theExitPoint_;
0041 std::vector<unsigned int> chan_;
0042 };
0043 #endif