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"
4 
5 namespace edm {
6 namespace detail {
7 void doTheOffset(int bunchSpace, int bcr, std::vector<SimTrack>& simtracks, unsigned int evtNr, int vertexOffset) {
8 
9  EncodedEventId id(bcr,evtNr);
10  for (auto& item : simtracks) {
11  item.setEventId(id);
12  if (!item.noVertex()) {
13  item.setVertexIndex(item.vertIndex() + vertexOffset);
14  }
15  }
16 }
17 
18 void doTheOffset(int bunchSpace, int bcr, std::vector<SimVertex>& simvertices, unsigned int evtNr, int vertexOffset) {
19 
20  int timeOffset = bcr * bunchSpace;
21  EncodedEventId id(bcr,evtNr);
22  for (auto& item : simvertices) {
23  item.setEventId(id);
24  item.setTof(item.position().t() + timeOffset);
25  }
26 }
27 
28 void doTheOffset(int bunchSpace, int bcr, std::vector<PSimHit>& simhits, unsigned int evtNr, int vertexOffset) {
29 
30  int timeOffset = bcr * bunchSpace;
31  EncodedEventId id(bcr,evtNr);
32  for (auto& item : simhits) {
33  item.setEventId(id);
34  item.setTof(item.timeOfFlight() + timeOffset);
35  }
36 }
37 
38 void doTheOffset(int bunchSpace, int bcr, std::vector<PCaloHit>& calohits, unsigned int evtNr, int vertexOffset) {
39 
40  int timeOffset = bcr * bunchSpace;
41  EncodedEventId id(bcr,evtNr);
42  for (auto& item : calohits) {
43  item.setEventId(id);
44  item.setTime(item.time() + timeOffset);
45  }
46 }
47 
48 void doTheOffset(int bunchSpace, int bcr, TrackingRecHitCollection & trackingrechits, unsigned int evtNr, int vertexOffset) {
49 
50  EncodedEventId id(bcr,evtNr);
51  for (auto it = trackingrechits.begin();it!=trackingrechits.end();++it) {
52  if(trackerHitRTTI::isFast(*it)){
53  FastTrackerRecHit * rechit = static_cast<FastTrackerRecHit*>(&(*it));
54  rechit->setEventId(id.rawId());
55  }
56  }
57 }
58 
59 } // end namespace detail
60 } // end namespace edm
virtual void setEventId(int32_t eventId)
void doTheOffset(int bunchSpace, int bcr, std::vector< SimTrack > &simtracks, unsigned int evtNr, int vertexOffset)
Definition: Adjuster.cc:7
iterator begin()
Definition: OwnVector.h:244
bool isFast(TrackingRecHit const &hit)
iterator end()
Definition: OwnVector.h:249