CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CrossingFrame.cc
Go to the documentation of this file.
4 
5 using namespace edm;
6 
7 template <>
8 void CrossingFrame<SimTrack>::addPileups(const int bcr, std::vector<SimTrack> *simtracks, unsigned int evtNr, int vertexoffset) {
9 
10  EncodedEventId id(bcr,evtNr);
11  for (unsigned int i=0;i<simtracks->size();++i){
12  (*simtracks)[i].setEventId(id);
13  if (!(*simtracks)[i].noVertex())
14  (*simtracks)[i].setVertexIndex((*simtracks)[i].vertIndex()+vertexoffset);
15  pileups_.push_back(&((*simtracks)[i]));
16  }
17 }
18 
19 template <>
20 void CrossingFrame<SimVertex>::addPileups(const int bcr, std::vector<SimVertex> *simvertices, unsigned int evtNr, int vertexoffset) {
21 
22  EncodedEventId id(bcr,evtNr);
23  for (unsigned int i=0;i<simvertices->size();++i) {
24  (*simvertices)[i].setEventId(id);
25  (*simvertices)[i].setTof((*simvertices)[i].position().t()+bcr*bunchSpace_);
26  pileups_.push_back(&((*simvertices)[i]));
27  }
28 }
29 
30 template <>
31 void CrossingFrame<PSimHit>::addPileups(const int bcr, std::vector<PSimHit> *simhits, unsigned int evtNr, int vertexoffset) {
32 
33  EncodedEventId id(bcr,evtNr);
34 
35  for (unsigned int i=0;i<simhits->size();++i) {
36  (*simhits)[i].setEventId(id);
37  (*simhits)[i].setTof((*simhits)[i].timeOfFlight() + bcr*bunchSpace_);
38  pileups_.push_back(&((*simhits)[i]));
39  }
40 }
41 
42 template <>
43 void CrossingFrame<PCaloHit>::addPileups(const int bcr, std::vector<PCaloHit> *calohits, unsigned int evtNr, int vertexoffset) {
44 
45  EncodedEventId id(bcr,evtNr);
46  for (unsigned int i=0;i<calohits->size();++i) {
47  PCaloHit hit((*calohits)[i].id(),(*calohits)[i].energyEM(),(*calohits)[i].energyHad(),(*calohits)[i].time()+bcr*bunchSpace_,(*calohits)[i].geantTrackId());
48  (*calohits)[i].setEventId(id);
49  (*calohits)[i].setTime((*calohits)[i].time()+bcr*bunchSpace_);
50  pileups_.push_back(&((*calohits)[i]));
51  }
52 }
int i
Definition: DBlmapReader.cc:9
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
void addPileups(const int bcr, std::vector< T > *vec, unsigned int evtId, int vertexoffset=0)
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:12