CMS 3D CMS Logo

ShallowTools.cc
Go to the documentation of this file.
2 
8 
9 namespace shallow {
10 
14  CLUSTERMAP clustermap;
16  iEvent.getByToken(cluster_token, clusters);
17 
18  unsigned int clusterindex = 0;
19  for (auto const& ds : *clusters)
20  for (auto const& cluster : ds)
21  clustermap.insert(std::make_pair(std::make_pair(ds.detId(), cluster.firstStrip()), clusterindex++));
22  return clustermap;
23  }
24 
26  edm::View<reco::Track>::const_iterator it = tracks->begin(), end = tracks->end();
27  //Compare addresses
28  for (; it != end; it++) {
29  if (&(*it) == track) {
30  return it - tracks->begin();
31  }
32  }
33  return -2;
34  }
35 
37  const MagneticField& magfield,
38  const SiStripLorentzAngle& lorentzAngle) {
39  LocalVector lbfield = (stripDet->surface()).toLocal(magfield.inTesla(stripDet->surface().position()));
40  float tanLorentzAnglePerTesla = lorentzAngle.getLorentzAngle(stripDet->geographicalId());
41  float driftz = stripDet->specificSurface().bounds().thickness();
42  float driftx = -tanLorentzAnglePerTesla * lbfield.y() * driftz;
43  float drifty = tanLorentzAnglePerTesla * lbfield.x() * driftz;
44  return LocalVector(driftx, drifty, driftz);
45  }
46 
47 } // namespace shallow
Local3DVector LocalVector
Definition: LocalVector.h:12
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
Definition: ShallowTools.cc:25
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
virtual float thickness() const =0
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
float getLorentzAngle(const uint32_t &) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() const
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
Definition: ShallowTools.cc:12
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
Definition: ShallowTools.h:21
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
const Bounds & bounds() const
Definition: Surface.h:87