CMS 3D CMS Logo

ShallowTools.cc
Go to the documentation of this file.
2 
8 
9 
10 namespace shallow {
11 
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()),
22  clusterindex++));
23  return clustermap;
24 }
25 
26 int
29  it = tracks->begin(),
30  end = tracks->end();
31  //Compare addresses
32  for(; it!=end; it++) { if (&(*it)==track) { return it - tracks->begin(); } }
33  return -2;
34 }
35 
37 drift( const StripGeomDetUnit* stripDet, const MagneticField& magfield, const SiStripLorentzAngle& lorentzAngle ) {
38  LocalVector lbfield=( stripDet->surface()).toLocal( magfield.inTesla(stripDet->surface().position()));
39  float tanLorentzAnglePerTesla = lorentzAngle.getLorentzAngle(stripDet->geographicalId());
40  float driftz = stripDet->specificSurface().bounds().thickness();
41  float driftx =-tanLorentzAnglePerTesla * lbfield.y() * driftz;
42  float drifty = tanLorentzAnglePerTesla * lbfield.x() * driftz;
43  return LocalVector(driftx,drifty,driftz);
44 }
45 
46 }
Local3DVector LocalVector
Definition: LocalVector.h:12
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
Definition: ShallowTools.cc:27
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:37
T y() const
Definition: PV3DBase.h:63
const Bounds & bounds() const
Definition: Surface.h:120
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
int iEvent
Definition: GenABIO.cc:224
float getLorentzAngle(const uint32_t &) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:39
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
virtual float thickness() const =0
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
Definition: ShallowTools.cc:13
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:19
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:45