Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:24

0001 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0002 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h"
0003 #include "SimMuon/RPCDigitizer/src/RPCSimTriv.h"
0004 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
0005 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
0006 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0007 #include "SimMuon/RPCDigitizer/src/RPCSimSetUp.h"
0008 
0009 #include <cmath>
0010 #include <utility>
0011 #include <map>
0012 
0013 RPCSimTriv::RPCSimTriv(const edm::ParameterSet& config) : RPCSim(config) {
0014   rate = config.getParameter<double>("Rate");
0015   nbxing = config.getParameter<int>("Nbxing");
0016   gate = config.getParameter<double>("Gate");
0017 
0018   _rpcSync = new RPCSynchronizer(config);
0019 }
0020 
0021 RPCSimTriv::~RPCSimTriv() { delete _rpcSync; }
0022 
0023 void RPCSimTriv::simulate(const RPCRoll* roll, const edm::PSimHitContainer& rpcHits, CLHEP::HepRandomEngine*) {
0024   //_rpcSync->setRPCSimSetUp(getRPCSimSetUp());
0025   theRpcDigiSimLinks.clear();
0026   theDetectorHitMap.clear();
0027   theRpcDigiSimLinks = RPCDigiSimLinks(roll->id().rawId());
0028 
0029   const Topology& topology = roll->specs()->topology();
0030   for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
0031     int type = _hit->particleType();
0032     if (type == 13 || type == -13) {
0033       // Here I hould check if the RPC are up side down;
0034       const LocalPoint& entr = _hit->entryPoint();
0035       //int time_hit = _rpcSync->getSimHitBx(&(*_hit));
0036       // please keep hit time always 0 for this model
0037       int time_hit = 0;
0038       std::pair<int, int> digi(topology.channel(entr) + 1, time_hit);
0039 
0040       theDetectorHitMap.insert(DetectorHitMap::value_type(digi, &(*_hit)));
0041       strips.insert(digi);
0042     }
0043   }
0044 }
0045 
0046 void RPCSimTriv::simulateNoise(const RPCRoll* roll, CLHEP::HepRandomEngine*) {
0047   // plase keep it empty for this model
0048   return;
0049 }