CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ShallowTools.cc
Go to the documentation of this file.
1 
3 
9 #include "boost/foreach.hpp"
10 
11 
12 namespace shallow {
13 
16  CLUSTERMAP clustermap;
18  iEvent.getByLabel(clusterLabel, clusters);
19 
20  unsigned int clusterindex = 0;
21  BOOST_FOREACH(const edmNew::DetSet<SiStripCluster>& ds, *clusters)
22  BOOST_FOREACH(const SiStripCluster& cluster, ds)
23  clustermap.insert( std::make_pair( std::make_pair(ds.detId(),cluster.firstStrip()),
24  clusterindex++));
25  return clustermap;
26 }
27 
28 int
31  it = tracks->begin(),
32  end = tracks->end();
33  //Compare addresses
34  for(; it!=end; it++) { if (&(*it)==track) { return it - tracks->begin(); } }
35  return -2;
36 }
37 
39 drift( const StripGeomDetUnit* stripDet, const MagneticField& magfield, const SiStripLorentzAngle& lorentzAngle ) {
40  LocalVector lbfield=( stripDet->surface()).toLocal( magfield.inTesla(stripDet->surface().position()));
41  float tanLorentzAnglePerTesla = lorentzAngle.getLorentzAngle(stripDet->geographicalId());
42  float driftz = stripDet->specificSurface().bounds().thickness();
43  float driftx =-tanLorentzAnglePerTesla * lbfield.y() * driftz;
44  float drifty = tanLorentzAnglePerTesla * lbfield.x() * driftz;
45  return LocalVector(driftx,drifty,driftz);
46 }
47 
48 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
Local3DVector LocalVector
Definition: LocalVector.h:12
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
Definition: ShallowTools.cc:29
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
tuple magfield
Definition: HLT_ES_cff.py:2311
T y() const
Definition: PV3DBase.h:63
const Bounds & bounds() const
Definition: Surface.h:128
uint16_t firstStrip() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
virtual float thickness() const =0
int iEvent
Definition: GenABIO.cc:243
float getLorentzAngle(const uint32_t &) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
#define end
Definition: vmac.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
CLUSTERMAP make_cluster_map(const edm::Event &, edm::InputTag &)
Definition: ShallowTools.cc:15
tuple tracks
Definition: testEve_cfg.py:39
id_type detId() const
Definition: DetSetNew.h:83
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
Definition: ShallowTools.h:16
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:38