CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
StripCPE Class Reference

#include <StripCPE.h>

Inheritance diagram for StripCPE:
StripClusterParameterEstimator ClusterParameterEstimator< SiStripCluster > StripCPEfromTrackAngle StripCPEgeometric

Classes

struct  Param
 

Public Member Functions

void clearCache ()
 
LocalVector driftDirection (const StripGeomDetUnit *det) const
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &) const
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const
 
 StripCPE (edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripConfObject &, const SiStripLatency &)
 
- Public Member Functions inherited from StripClusterParameterEstimator
virtual MeasurementValues measurementParameters (const SiStripCluster &, const GeomDetUnit &) const
 
virtual MeasurementValues measurementParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
 
- Public Member Functions inherited from ClusterParameterEstimator< SiStripCluster >
virtual void clearParameters () const
 
virtual void enterLocalParameters (unsigned int id, std::pair< int, int > &row_col, LocalValues pos_err_info) const
 
virtual void enterLocalParameters (uint32_t id, uint16_t firstStrip, LocalValues pos_err_info) const
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const LocalTrajectoryParameters &) const
 
virtual LocalValues localParameters (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual VLocalValues localParametersV (const SiStripCluster &cluster, const GeomDetUnit &gd) const
 
virtual VLocalValues localParametersV (const SiStripCluster &cluster, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
 
virtual VLocalValues localParametersV (const SiStripCluster &cluster, const GeomDetUnit &gd, const TrajectoryStateOnSurface &tsos) const
 
virtual ~ClusterParameterEstimator ()
 

Protected Member Functions

Param const & param (const uint32_t detid) const
 

Protected Attributes

const TrackerGeometrygeom_
 
const SiStripLorentzAngleLorentzAngleMap_
 
const MagneticFieldmagfield_
 
const bool peakMode_
 
std::vector< double > shift
 
std::vector< double > xtalk1
 
std::vector< double > xtalk2
 

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
 

Additional Inherited Members

- Public Types inherited from StripClusterParameterEstimator
typedef std::pair
< MeasurementPoint,
MeasurementError
MeasurementValues
 
- Public Types inherited from ClusterParameterEstimator< SiStripCluster >
typedef std::pair< LocalPoint,
LocalError
LocalValues
 
typedef std::vector< LocalValuesVLocalValues
 

Detailed Description

Definition at line 15 of file StripCPE.h.

Member Typedef Documentation

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

Definition at line 55 of file StripCPE.h.

Constructor & Destructor Documentation

StripCPE::StripCPE ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle LorentzAngle,
const SiStripConfObject confObj,
const SiStripLatency latency 
)

Definition at line 10 of file StripCPE.cc.

References SiStripConfObject::get(), SiStripDetId::IB1, SiStripDetId::IB2, SiStripConfObject::isParameter(), SiStripDetId::OB1, SiStripDetId::OB2, peakMode_, edm::second(), shift, findQualityFiles::size, SiStripDetId::W1A, SiStripDetId::W1B, SiStripDetId::W2A, SiStripDetId::W2B, SiStripDetId::W3A, SiStripDetId::W3B, SiStripDetId::W4, SiStripDetId::W5, SiStripDetId::W6, SiStripDetId::W7, xtalk1, and xtalk2.

16  : peakMode_(latency.singleReadOutMode() == 1),
17  geom_(geom),
18  magfield_(mag),
19  LorentzAngleMap_(LorentzAngle)
20 {
21  typedef std::map<std::string,SiStripDetId::ModuleGeometry> map_t;
22  map_t modules;
23  modules["IB1"]=SiStripDetId::IB1;
24  modules["IB2"]=SiStripDetId::IB2;
25  modules["OB1"]=SiStripDetId::OB1;
26  modules["OB2"]=SiStripDetId::OB2;
27  modules["W1A"]=SiStripDetId::W1A;
28  modules["W2A"]=SiStripDetId::W2A;
29  modules["W3A"]=SiStripDetId::W3A;
30  modules["W1B"]=SiStripDetId::W1B;
31  modules["W2B"]=SiStripDetId::W2B;
32  modules["W3B"]=SiStripDetId::W3B;
33  modules["W4"] =SiStripDetId::W4;
34  modules["W5"] =SiStripDetId::W5;
35  modules["W6"] =SiStripDetId::W6;
36  modules["W7"] =SiStripDetId::W7;
37 
38  const unsigned size = max_element( modules.begin(),modules.end(),
39  boost::bind(&map_t::value_type::second,boost::lambda::_1) <
40  boost::bind(&map_t::value_type::second,boost::lambda::_2) )->second + 1;
41  shift.resize(size);
42  xtalk1.resize(size);
43  xtalk2.resize(size);
44 
45  for(map_t::const_iterator it=modules.begin(); it!=modules.end(); it++) {
46  const std::string
47  modeS(peakMode_?"Peak":"Deco"),
48  shiftS( "shift_" + it->first + modeS ),
49  xtalk1S("xtalk1_" + it->first + modeS ),
50  xtalk2S("xtalk2_" + it->first + modeS );
51 
52  if(!confObj.isParameter(shiftS)) throw cms::Exception("SiStripConfObject does not contain: ") << shiftS;
53  if(!confObj.isParameter(xtalk1S)) throw cms::Exception("SiStripConfObject does not contain: ") << xtalk1S;
54  if(!confObj.isParameter(xtalk2S)) throw cms::Exception("SiStripConfObject does not contain: ") << xtalk2S;
55 
56  shift[it->second] = confObj.get<double>(shiftS);
57  xtalk1[it->second] = confObj.get<double>(xtalk1S);
58  xtalk2[it->second] = confObj.get<double>(xtalk2S);
59  }
60 }
const bool peakMode_
Definition: StripCPE.h:33
std::vector< double > xtalk2
Definition: StripCPE.h:39
int16_t singleReadOutMode() const
const TrackerGeometry & geom_
Definition: StripCPE.h:34
U second(std::pair< T, U > const &p)
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:36
std::vector< double > xtalk1
Definition: StripCPE.h:38
const MagneticField & magfield_
Definition: StripCPE.h:35
std::vector< double > shift
Definition: StripCPE.h:37
valueType get(const std::string &name) const
bool isParameter(const std::string &name) const
tuple size
Write out results.

Member Function Documentation

void StripCPE::clearCache ( )
inline

Definition at line 29 of file StripCPE.h.

References m_Params.

29 {m_Params.clear();}
Params m_Params
Definition: StripCPE.h:56
LocalVector StripCPE::driftDirection ( const StripGeomDetUnit det) const
virtual

Implements StripClusterParameterEstimator.

Definition at line 81 of file StripCPE.cc.

References GeomDet::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().

81  {
82  LocalVector lbfield = (det->surface()).toLocal(magfield_.inTesla(det->surface().position()));
83 
84  float tanLorentzAnglePerTesla = LorentzAngleMap_.getLorentzAngle(det->geographicalId().rawId());
85 
86  float dir_x = -tanLorentzAnglePerTesla * lbfield.y();
87  float dir_y = tanLorentzAnglePerTesla * lbfield.x();
88  float dir_z = 1.f; // E field always in z direction
89 
90  return LocalVector(dir_x,dir_y,dir_z);
91 }
Local3DVector LocalVector
Definition: LocalVector.h:12
const float & getLorentzAngle(const uint32_t &) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T y() const
Definition: PV3DBase.h:57
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:36
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
const MagneticField & magfield_
Definition: StripCPE.h:35
T x() const
Definition: PV3DBase.h:56
const PositionType & position() const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
StripCPE::Param & StripCPE::fillParam ( StripCPE::Param p,
const GeomDetUnit det 
)
private

Definition at line 101 of file StripCPE.cc.

References RadialStripTopology::angularWidth(), BoundSurface::bounds(), StripCPE::Param::drift, driftDirection(), f, GeomDet::geographicalId(), Bounds::length(), RadialStripTopology::localPitch(), StripCPE::Param::maxLength, StripCPE::Param::moduleGeom, StripCPE::Param::nstrips, StripTopology::nstrips(), L1TEmulatorMonitor_cff::p, StripCPE::Param::pitch_rel_err2, funct::pow(), GeomDet::specificSurface(), StripGeomDetType::specificTopology(), StripGeomDetUnit::specificType(), mathSSE::sqrt(), RadialStripTopology::stripLength(), Bounds::thickness(), StripCPE::Param::thickness, StripGeomDetUnit::topology(), StripCPE::Param::topology, and Bounds::width().

Referenced by param().

101  {
102  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
103  const Bounds& bounds = stripdet->specificSurface().bounds();
104 
105  p.maxLength = std::sqrt( std::pow(bounds.length(),2.f)+std::pow(bounds.width(),2.f) );
106  p.thickness = bounds.thickness();
107  p.drift = driftDirection(stripdet) * p.thickness;
108  p.topology=(StripTopology*)(&stripdet->topology());
109  p.nstrips = p.topology->nstrips();
110  p.moduleGeom = SiStripDetId(stripdet->geographicalId()).moduleGeometry();
111 
112  const RadialStripTopology* rtop = dynamic_cast<const RadialStripTopology*>(&stripdet->specificType().specificTopology());
113  p.pitch_rel_err2 = (rtop)
114  ? pow( 0.5f * rtop->angularWidth() * rtop->stripLength()/rtop->localPitch(LocalPoint(0,0,0)), 2.f) / 12.f
115  : 0.f;
116 
117  return p;
118 }
virtual int nstrips() const =0
virtual float length() const =0
float pitch_rel_err2
Definition: StripCPE.h:45
float thickness
Definition: StripCPE.h:45
StripTopology const * topology
Definition: StripCPE.h:43
virtual float thickness() const =0
virtual const BoundPlane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
SiStripDetId::ModuleGeometry moduleGeom
Definition: StripCPE.h:47
T sqrt(T t)
Definition: SSEVec.h:28
virtual const TopologyType & specificTopology() const
virtual const Topology & topology() const
Returns a reference to the strip proxy topology.
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
double f[11][100]
virtual StripGeomDetType & specificType() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
const Bounds & bounds() const
Definition: BoundSurface.h:89
virtual float localPitch(const LocalPoint &) const
LocalVector driftDirection(const StripGeomDetUnit *det) const
Definition: StripCPE.cc:81
virtual float stripLength() const
float maxLength
Definition: StripCPE.h:45
LocalVector drift
Definition: StripCPE.h:44
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
float angularWidth() const
Definition: Bounds.h:18
virtual float width() const =0
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cluster) const

Definition at line 63 of file StripCPE.cc.

References SiStripCluster::barycenter(), StripCPE::Param::coveredStrips(), StripCPE::Param::drift, f, SiStripCluster::geographicalId(), StripTopology::localError(), StripTopology::localPosition(), StripCPE::Param::moduleGeom, L1TEmulatorMonitor_cff::p, param(), shift, strip(), StripCPE::Param::thickness, and StripCPE::Param::topology.

63  {
64  StripCPE::Param const & p = param(cluster.geographicalId());
65  const float barycenter = cluster.barycenter();
66  const float fullProjection = p.coveredStrips( p.drift + LocalVector(0,0,-p.thickness), LocalPoint(barycenter,0,0));
67  const float strip = barycenter - 0.5f * (1-shift[p.moduleGeom]) * fullProjection;
68 
69  return std::make_pair( p.topology->localPosition(strip),
70  p.topology->localError(strip, 1.f/12.f) );
71 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
float thickness
Definition: StripCPE.h:45
StripTopology const * topology
Definition: StripCPE.h:43
uint32_t geographicalId() const
SiStripDetId::ModuleGeometry moduleGeom
Definition: StripCPE.h:47
double f[11][100]
float barycenter() const
std::vector< double > shift
Definition: StripCPE.h:37
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:74
virtual LocalError localError(float strip, float stripErr2) const =0
LocalVector drift
Definition: StripCPE.h:44
virtual LocalPoint localPosition(float strip) const =0
Param const & param(const uint32_t detid) const
Definition: StripCPE.cc:94
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit  
) const
inlinevirtual

Implements ClusterParameterEstimator< SiStripCluster >.

Definition at line 20 of file StripCPE.h.

References localParameters().

Referenced by localParameters().

20 {return localParameters(cl);}
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &) const
Definition: StripCPE.cc:63
StripCPE::Param const & StripCPE::param ( const uint32_t  detid) const
protected

Definition at line 94 of file StripCPE.cc.

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

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

94  {
95  Param & p = const_cast<StripCPE*>(this)->m_Params[detid];
96  if (p.topology) return p;
97  else return const_cast<StripCPE*>(this)->fillParam(p, geom_.idToDetUnit(detid));
98 }
Params m_Params
Definition: StripCPE.h:56
const TrackerGeometry & geom_
Definition: StripCPE.h:34
Param & fillParam(Param &p, const GeomDetUnit *det)
Definition: StripCPE.cc:101
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.

Member Data Documentation

const TrackerGeometry& StripCPE::geom_
protected

Definition at line 34 of file StripCPE.h.

Referenced by param().

const SiStripLorentzAngle& StripCPE::LorentzAngleMap_
protected

Definition at line 36 of file StripCPE.h.

Referenced by driftDirection().

Params StripCPE::m_Params
private

Definition at line 56 of file StripCPE.h.

Referenced by clearCache(), and param().

const MagneticField& StripCPE::magfield_
protected

Definition at line 35 of file StripCPE.h.

Referenced by driftDirection().

const bool StripCPE::peakMode_
protected

Definition at line 33 of file StripCPE.h.

Referenced by StripCPE().

std::vector<double> StripCPE::shift
protected
std::vector<double> StripCPE::xtalk1
protected

Definition at line 38 of file StripCPE.h.

Referenced by StripCPEgeometric::localParameters(), and StripCPE().

std::vector<double> StripCPE::xtalk2
protected

Definition at line 39 of file StripCPE.h.

Referenced by StripCPE().