CMS 3D CMS Logo

RPCSim.cc
Go to the documentation of this file.
1 #include "RPCSim.h"
4 
6 
7 void RPCSim::fillDigis(int rollDetId, RPCDigiCollection& digis) {
8  // theRpcDigiSimLinks.clear();
9 
10  // std::vector<std::pair<int,int> > vdigi;
11  // vdigi.clear();
12 
13  for (std::set<std::pair<int, int> >::iterator i = strips.begin(); i != strips.end(); i++) {
14  if (i->second != -999) {
15  RPCDigi rpcDigi(i->first, i->second);
16 
17  //NCA
18  digis.insertDigi(RPCDetId(rollDetId), rpcDigi);
19  this->addLinks(i->first, i->second);
20  }
21  }
22  strips.clear();
23 
24  for (auto it : irpc_digis) {
25  if (it.bx() != -999) {
26  digis.insertDigi(RPCDetId(rollDetId), it);
27  this->addLinks(it.strip(), it.bx());
28  }
29  }
30  irpc_digis.clear();
31 }
32 
33 void RPCSim::addLinks(unsigned int strip, int bx) {
34  std::pair<unsigned int, int> digi(strip, bx);
35  std::pair<DetectorHitMap::iterator, DetectorHitMap::iterator> channelHitItr = theDetectorHitMap.equal_range(digi);
36 
37  for (DetectorHitMap::iterator hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr) {
38  const PSimHit* hit = (hitItr->second);
39 
40  if (hit != nullptr) {
42  hit->entryPoint(),
43  hit->momentumAtEntry(),
44  hit->timeOfFlight(),
45  hit->energyLoss(),
46  hit->particleType(),
47  hit->detUnitId(),
48  hit->trackId(),
49  hit->eventId(),
50  hit->processType()));
51  }
52  }
53 }
edm::DetSet::push_back
void push_back(const T &t)
Definition: DetSet.h:66
mps_fire.i
i
Definition: mps_fire.py:428
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
RPCSim::RPCSim
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
RPCDetId
Definition: RPCDetId.h:16
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
RPCSim.h
RPCSim::addLinks
virtual void addLinks(unsigned int strip, int bx)
Definition: RPCSim.cc:33
RPCSim::strips
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
RPCSim::irpc_digis
std::set< RPCDigi > irpc_digis
Definition: RPCSim.h:56
RPCDigiCollection
config
Definition: config.py:1
RPCSim::theDetectorHitMap
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
RPCSim::fillDigis
virtual void fillDigis(int rollDetId, RPCDigiCollection &digis)
Definition: RPCSim.cc:7
RPCSim::theRpcDigiSimLinks
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
edm::ParameterSet
Definition: ParameterSet.h:47
RPCDigi
Definition: RPCDigi.h:19
RPCSimSetUp.h
PSimHit
Definition: PSimHit.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
EncodedEventId.h