CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Adjuster.cc
Go to the documentation of this file.
1 #include "Adjuster.h"
3 
4 namespace edm {
5 namespace detail {
6 void doTheOffset(int bunchSpace, int bcr, std::vector<SimTrack>& simtracks, unsigned int evtNr, int vertexOffset) {
7 
8  EncodedEventId id(bcr,evtNr);
9  for (auto& item : simtracks) {
10  item.setEventId(id);
11  if (!item.noVertex()) {
12  item.setVertexIndex(item.vertIndex() + vertexOffset);
13  }
14  }
15 }
16 
17 void doTheOffset(int bunchSpace, int bcr, std::vector<SimVertex>& simvertices, unsigned int evtNr, int vertexOffset) {
18 
19  int timeOffset = bcr * bunchSpace;
20  EncodedEventId id(bcr,evtNr);
21  for (auto& item : simvertices) {
22  item.setEventId(id);
23  item.setTof(item.position().t() + timeOffset);
24  }
25 }
26 
27 void doTheOffset(int bunchSpace, int bcr, std::vector<PSimHit>& simhits, unsigned int evtNr, int vertexOffset) {
28 
29  int timeOffset = bcr * bunchSpace;
30  EncodedEventId id(bcr,evtNr);
31  for (auto& item : simhits) {
32  item.setEventId(id);
33  item.setTof(item.timeOfFlight() + timeOffset);
34  }
35 }
36 
37 void doTheOffset(int bunchSpace, int bcr, std::vector<PCaloHit>& calohits, unsigned int evtNr, int vertexOffset) {
38 
39  int timeOffset = bcr * bunchSpace;
40  EncodedEventId id(bcr,evtNr);
41  for (auto& item : calohits) {
42  item.setEventId(id);
43  item.setTime(item.time() + timeOffset);
44  }
45 }
46 
47 void doTheOffset(int bunchSpace, int bcr, TrackingRecHitCollection & trackingrechits, unsigned int evtNr, int vertexOffset) {
48 
49  EncodedEventId id(bcr,evtNr);
50  for (auto it = trackingrechits.begin();it!=trackingrechits.end();++it) {
51  {
52  SiTrackerGSMatchedRecHit2D * rechit = dynamic_cast<SiTrackerGSMatchedRecHit2D*>(&(*it));
53  if(rechit){
54  rechit->setEeId(id.rawId());
55  continue;
56  }
57  }
58  {
59  SiTrackerGSRecHit2D * rechit = dynamic_cast<SiTrackerGSRecHit2D*>(&(*it));
60  if(rechit){
61  rechit->setEeId(id.rawId());
62  continue;
63  }
64  }
65  }
66 }
67 
68 } // end namespace detail
69 } // end namespace edm
void doTheOffset(int bunchSpace, int bcr, std::vector< SimTrack > &simtracks, unsigned int evtNr, int vertexOffset)
Definition: Adjuster.cc:6
iterator begin()
Definition: OwnVector.h:234
void setEeId(uint32_t eeId)
iterator end()
Definition: OwnVector.h:239