CMS 3D CMS Logo

StripCPE Class Reference

#include <RecoLocalTracker/SiStripRecHitConverter/interface/StripCPE.h>

Inheritance diagram for StripCPE:

StripClusterParameterEstimator ClusterParameterEstimator< SiStripCluster > StripCPEfromTrackAngle StripCPEfromTrackAngle2

List of all members.

Public Member Functions

void clearCache ()
LocalVector driftDirection (const StripGeomDetUnit *det) const
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl) const
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &det) const
Param const & param (DetId detId) const
 StripCPE (edm::ParameterSet &conf, const MagneticField *mag, const TrackerGeometry *geom, const SiStripLorentzAngle *LorentzAngle)

Protected Attributes

edm::ParameterSet conf_
const TrackerGeometrygeom_
const SiStripLorentzAngleLorentzAngleMap_
const MagneticFieldmagfield_

Private Types

typedef __gnu_cxx::hash_map
< unsigned int, Param
Params

Private Member Functions

ParamfillParam (Param &p, const GeomDetUnit *det)

Private Attributes

Params m_Params

Classes

struct  Param


Detailed Description

Definition at line 17 of file StripCPE.h.


Member Typedef Documentation

typedef __gnu_cxx::hash_map< unsigned int, Param> StripCPE::Params [private]

Definition at line 60 of file StripCPE.h.


Constructor & Destructor Documentation

StripCPE::StripCPE ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle LorentzAngle 
)

Definition at line 43 of file StripCPE.cc.

References geom_, LorentzAngleMap_, and magfield_.

00044 {
00045   magfield_  = mag;
00046   geom_ = geom;
00047   LorentzAngleMap_=LorentzAngle;
00048 }


Member Function Documentation

void StripCPE::clearCache ( void   )  [inline]

Definition at line 42 of file StripCPE.h.

References m_Params.

00042                     {
00043     m_Params.clear();
00044   }

LocalVector StripCPE::driftDirection ( const StripGeomDetUnit det  )  const [virtual]

Implements StripClusterParameterEstimator.

Definition at line 66 of file StripCPE.cc.

References StripGeomDetUnit::geographicalId(), SiStripLorentzAngle::getLorentzAngle(), MagneticField::inTesla(), LorentzAngleMap_, magfield_, GloballyPositioned< T >::position(), DetId::rawId(), GeomDet::surface(), toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by fillParam().

00066                                                                     {
00067  
00068   LocalVector lbfield=(det->surface()).toLocal(magfield_->inTesla(det->surface().position()));
00069   
00070   float tanLorentzAnglePerTesla=LorentzAngleMap_->getLorentzAngle(det->geographicalId().rawId());
00071   
00072   
00073   float dir_x =-tanLorentzAnglePerTesla * lbfield.y();
00074   float dir_y =tanLorentzAnglePerTesla * lbfield.x();
00075   float dir_z = 1.; // E field always in z direction
00076   
00077   LocalVector theDrift = LocalVector(dir_x,dir_y,dir_z);
00078  
00079   return theDrift;
00080   
00081 }

StripCPE::Param & StripCPE::fillParam ( StripCPE::Param p,
const GeomDetUnit det 
) [private]

Definition at line 8 of file StripCPE.cc.

References BoundSurface::bounds(), StripCPE::Param::drift, driftDirection(), Bounds::length(), StripCPE::Param::maxLength, StripTopology::nstrips(), StripCPE::Param::nstrips, funct::pow(), GeomDet::specificSurface(), funct::sqrt(), GeomDet::surface(), StripCPE::Param::thickness, Bounds::thickness(), StripGeomDetUnit::topology(), StripCPE::Param::topology, and Bounds::width().

Referenced by param().

00008                                                                                {
00009   
00010   const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
00011   p.topology=(StripTopology*)(&stripdet->topology());
00012   
00013   p.drift = driftDirection(stripdet);
00014 
00015   p.thickness=stripdet->specificSurface().bounds().thickness();
00016   p.drift*=p.thickness;
00017 
00018   
00019   //p.drift = driftDirection(stripdet);
00020   //p.thickness=stripdet->surface().bounds().thickness();
00021   
00022   const Bounds& bounds = stripdet->surface().bounds();
00023   
00024   p.maxLength = std::sqrt( std::pow(bounds.length(),2)+std::pow(bounds.width(),2) );
00025 
00026   //  p.maxLength = sqrt( bounds.length()*bounds.length()+bounds.width()*bounds.width());
00027   // p.drift *= fabs(p.thickness/p.drift.z());       
00028   
00029   p.nstrips = p.topology->nstrips(); 
00030   return p;
00031 }

StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl  )  const

Definition at line 50 of file StripCPE.cc.

References SiStripCluster::barycenter(), StripCPE::Param::drift, SiStripCluster::geographicalId(), StripTopology::localError(), StripTopology::localPosition(), p, param(), HLT_VtxMuL3::result, StripCPE::Param::topology, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

00050                                                                                                    {
00051   //
00052   // get the det from the geometry
00053   //
00054 
00055   StripCPE::Param const & p = param(DetId(cl.geographicalId()));
00056 
00057   const StripTopology &topol= *(p.topology);
00058 
00059   LocalPoint position = topol.localPosition(cl.barycenter());
00060   LocalError eresult = topol.localError(cl.barycenter(),1/12.);
00061 
00062   LocalPoint  result=LocalPoint(position.x()-0.5*p.drift.x(),position.y()-0.5*p.drift.y(),0);
00063   return std::make_pair(result,eresult);
00064 }

StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit det 
) const [inline, virtual]

Implements ClusterParameterEstimator< SiStripCluster >.

Definition at line 25 of file StripCPE.h.

00025                                                                                                                      {
00026     return localParameters(cl);
00027   }; 

StripCPE::Param const & StripCPE::param ( DetId  detId  )  const

Definition at line 35 of file StripCPE.cc.

References fillParam(), geom_, TrackerGeometry::idToDetUnit(), m_Params, p, DetId::rawId(), and StripCPE::Param::topology.

Referenced by StripCPEfromTrackAngle2::localParameters(), localParameters(), and StripCPEfromTrackAngle::localParameters().

00035                                                        {
00036   Param & p = const_cast<StripCPE*>(this)->m_Params[detId.rawId()];
00037   if (p.topology) return p;
00038   else return const_cast<StripCPE*>(this)->fillParam(p, geom_->idToDetUnit(detId));
00039 }


Member Data Documentation

edm::ParameterSet StripCPE::conf_ [protected]

Definition at line 35 of file StripCPE.h.

const TrackerGeometry* StripCPE::geom_ [protected]

Definition at line 36 of file StripCPE.h.

Referenced by param(), and StripCPE().

const SiStripLorentzAngle* StripCPE::LorentzAngleMap_ [protected]

Definition at line 38 of file StripCPE.h.

Referenced by driftDirection(), and StripCPE().

Params StripCPE::m_Params [private]

Definition at line 62 of file StripCPE.h.

Referenced by clearCache(), and param().

const MagneticField* StripCPE::magfield_ [protected]

Definition at line 37 of file StripCPE.h.

Referenced by driftDirection(), and StripCPE().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:56 2009 for CMSSW by  doxygen 1.5.4