Back to home page

Project CMSSW displayed by LXR

 
 

    


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   // Detector is in the negative side, but DetectorPosition is a positive number
0009   // if (detID >0);
0010   if (x > 0)
0011     return;  // The detector is on the negative side
0012   if (fabs(x) > ppsDetectorWidth_ + ppsDetectorPosition_)
0013     return;  // hit beyond detector area (W)
0014   if (fabs(x) < ppsDetectorPosition_)
0015     return;  // hit falls below detector area
0016   if (fabs(y) > ppsDetectorHeight_ * 0.5)
0017     return;  // hit falls beyond detector area (H)
0018   ppsDetId_.push_back(detID);
0019   ppsX_.push_back(x);
0020   ppsY_.push_back(y);
0021   ppsZ_.push_back(z);
0022   ppsNHits_++;
0023 }