File indexing completed on 2023-03-17 11:00:44
0001 #include "FastSimulation/CTPPSFastGeometry/interface/CTPPSTrkDetector.h"
0002 #include <cmath>
0003 CTPPSTrkDetector::CTPPSTrkDetector(double detw, double deth, double detin)
0004 : ppsDetectorWidth_(detw), ppsDetectorHeight_(deth), ppsDetectorPosition_(detin) {
0005 clear();
0006 }
0007 void CTPPSTrkDetector::AddHit(unsigned int detID, double x, double y, double z) {
0008
0009
0010 if (x > 0)
0011 return;
0012 if (fabs(x) > ppsDetectorWidth_ + ppsDetectorPosition_)
0013 return;
0014 if (fabs(x) < ppsDetectorPosition_)
0015 return;
0016 if (fabs(y) > ppsDetectorHeight_ * 0.5)
0017 return;
0018 ppsDetId_.push_back(detID);
0019 ppsX_.push_back(x);
0020 ppsY_.push_back(y);
0021 ppsZ_.push_back(z);
0022 ppsNHits_++;
0023 }