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 }
void push_back(const T &t)
Definition: DetSet.h:66
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
Definition: config.py:1
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
virtual void fillDigis(int rollDetId, RPCDigiCollection &digis)
Definition: RPCSim.cc:7
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
std::set< RPCDigi > irpc_digis
Definition: RPCSim.h:56
virtual void addLinks(unsigned int strip, int bx)
Definition: RPCSim.cc:33
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70