CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:55
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
float timeOfFlight() const
Definition: PSimHit.h:73
EncodedEventId eventId() const
Definition: PSimHit.h:108
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
unsigned short processType() const
Definition: PSimHit.h:120
tuple config
parse the configuration file
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
int particleType() const
Definition: PSimHit.h:89
unsigned int trackId() const
Definition: PSimHit.h:106
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
unsigned int detUnitId() const
Definition: PSimHit.h:97