CMS 3D CMS Logo

RPCSim.cc
Go to the documentation of this file.
1 #include "RPCSim.h"
4 
6 {
7 
8 }
9 
10 void
11 RPCSim::fillDigis(int rollDetId, RPCDigiCollection& digis)
12 {
13  // theRpcDigiSimLinks.clear();
14 
15 // std::vector<std::pair<int,int> > vdigi;
16 // vdigi.clear();
17 
18  for (std::set< std::pair<int,int> >::iterator i=strips.begin();
19  i!=strips.end(); i++){
20  if(i->second != -999){
21  RPCDigi rpcDigi(i->first,i->second);
22 
23  //NCA
24  digis.insertDigi(RPCDetId(rollDetId),rpcDigi);
25  this->addLinks(i->first,i->second);
26  }
27  }
28  strips.clear();
29 
30  for (auto it: irpc_digis){
31  if(it.bx() != -999){
32  digis.insertDigi(RPCDetId(rollDetId),it);
33  this->addLinks(it.strip(),it.bx());
34  }
35  }
36  irpc_digis.clear();
37 }
38 
39 void RPCSim::addLinks(unsigned int strip, int bx) {
40 
41  std::pair<unsigned int, int > digi(strip, bx);
42  std::pair<DetectorHitMap::iterator, DetectorHitMap::iterator> channelHitItr
43  = theDetectorHitMap.equal_range(digi);
44 
45  for( DetectorHitMap::iterator hitItr = channelHitItr.first;
46  hitItr != channelHitItr.second; ++hitItr){
47  const PSimHit * hit = (hitItr->second);
48 
49  if(hit != nullptr) {
51  hit->timeOfFlight(),hit->energyLoss(),hit->particleType(),
52  hit->detUnitId(), hit->trackId(), hit->eventId(), hit->processType() ) );
53 
54  }
55  }
56 }
57 
58 
59 
60 
void push_back(const T &t)
Definition: DetSet.h:68
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:72
Definition: config.py:1
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:60
float timeOfFlight() const
Definition: PSimHit.h:69
EncodedEventId eventId() const
Definition: PSimHit.h:105
virtual void fillDigis(int rollDetId, RPCDigiCollection &digis)
Definition: RPCSim.cc:11
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
std::set< RPCDigi > irpc_digis
Definition: RPCSim.h:61
virtual void addLinks(unsigned int strip, int bx)
Definition: RPCSim.cc:39
unsigned short processType() const
Definition: PSimHit.h:118
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
int particleType() const
Definition: PSimHit.h:85
unsigned int trackId() const
Definition: PSimHit.h:102
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:74
unsigned int detUnitId() const
Definition: PSimHit.h:93