CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCSim.cc
Go to the documentation of this file.
1 #include "RPCSim.h"
4 
6 {
7 }
8 
9 void
10 RPCSim::fillDigis(int rollDetId, RPCDigiCollection& digis)
11 {
12  // theRpcDigiSimLinks.clear();
13  std::vector<std::pair<int,int> > vdigi;
14  vdigi.clear();
15 
16  for (std::set< std::pair<int,int> >::iterator i=strips.begin();
17  i!=strips.end(); i++){
18  if(i->second != -999){
19  RPCDigi rpcDigi(i->first,i->second);
20  //NCA
21  digis.insertDigi(RPCDetId(rollDetId),rpcDigi);
22  this->addLinks(i->first,i->second);
23  }
24  }
25  strips.clear();
26 }
27 
28 void RPCSim::addLinks(unsigned int strip, int bx) {
29 
30  std::pair<unsigned int, int > digi(strip, bx);
31  std::pair<DetectorHitMap::iterator, DetectorHitMap::iterator> channelHitItr
32  = theDetectorHitMap.equal_range(digi);
33 
34  for( DetectorHitMap::iterator hitItr = channelHitItr.first;
35  hitItr != channelHitItr.second; ++hitItr){
36  const PSimHit * hit = (hitItr->second);
37 
38  if(hit != 0) {
40  hit->timeOfFlight(),hit->energyLoss(),hit->particleType(),
41  hit->detUnitId(), hit->trackId(), hit->eventId(), hit->processType() ) );
42 
43  }
44  }
45 }
46 
47 
48 
49 
int i
Definition: DBlmapReader.cc:9
void push_back(const T &t)
Definition: DetSet.h:69
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:57
float timeOfFlight() const
Definition: PSimHit.h:69
EncodedEventId eventId() const
Definition: PSimHit.h:105
virtual void fillDigis(int rollDetId, RPCDigiCollection &digis)
Definition: RPCSim.cc:10
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
virtual void addLinks(unsigned int strip, int bx)
Definition: RPCSim.cc:28
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:70
unsigned int detUnitId() const
Definition: PSimHit.h:93
void set(const std::string &name, int value)
set the flag, with a run-time name