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 StripCPEfromTemplate StripCPEfromTrackAngle StripCPEgeometric

Classes

struct  Param
 

Public Member Functions

LocalVector driftDirection (const StripGeomDetUnit *det) const
 
StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &cl, const GeomDetUnit &) const
 
 StripCPE (edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripBackPlaneCorrection &, const SiStripConfObject &, const SiStripLatency &)
 
- Public Member Functions inherited from StripClusterParameterEstimator
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 TrajectoryStateOnSurface &tsos) const
 
virtual ~StripClusterParameterEstimator ()
 

Protected Member Functions

Param const & param (const GeomDetUnit &det) const
 

Protected Attributes

const SiStripBackPlaneCorrectionBackPlaneCorrectionMap_
 
const TrackerGeometrygeom_
 
const SiStripLorentzAngleLorentzAngleMap_
 
const MagneticFieldmagfield_
 
const bool peakMode_
 
std::vector< float > xtalk1
 
std::vector< float > xtalk2
 

Private Types

typedef std::vector< ParamParams
 

Private Member Functions

void fillParams ()
 

Private Attributes

unsigned int m_off
 
Params m_Params
 

Additional Inherited Members

- Public Types inherited from StripClusterParameterEstimator
typedef std::pair< LocalPoint,
LocalError
LocalValues
 
typedef std::vector< LocalValuesVLocalValues
 

Detailed Description

Definition at line 16 of file StripCPE.h.

Member Typedef Documentation

typedef std::vector<Param> StripCPE::Params
private

Definition at line 58 of file StripCPE.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file StripCPE.cc.

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

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

Member Function Documentation

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 fillParams().

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
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T y() const
Definition: PV3DBase.h:63
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const SiStripLorentzAngle & LorentzAngleMap_
Definition: StripCPE.h:36
float getLorentzAngle(const uint32_t &) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const MagneticField & magfield_
Definition: StripCPE.h:35
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
void StripCPE::fillParams ( )
private

Definition at line 95 of file StripCPE.cc.

References TkRadialStripTopology::angularWidth(), assert(), BackPlaneCorrectionMap_, Surface::bounds(), TrackerGeometry::detUnits(), driftDirection(), f, GeomDet::geographicalId(), geom_, SiStripBackPlaneCorrection::getBackPlaneCorrection(), i, GeomDet::index(), GeomDetType::isTrackerStrip(), TkRadialStripTopology::localPitch(), LogDebug, m_off, m_Params, TrackerGeometry::offsetDU(), AlCaHLTBitMon_ParallelJobs::p, funct::pow(), DetId::rawId(), GeomDet::specificSurface(), StripGeomDetType::specificTopology(), StripGeomDetUnit::specificType(), mathSSE::sqrt(), TkRadialStripTopology::stripLength(), GeomDetEnumerators::tkDetEnum, StripGeomDetUnit::topology(), and StripGeomDetUnit::type().

Referenced by StripCPE().

95  {
96  auto const & dus = geom_.detUnits();
97  m_off = dus.size();
98  for(unsigned int i=1;i<7;++i) {
99  LogDebug("LookingForFirstStrip") << "Subdetector " << i
100  << " GeomDetEnumerator " << GeomDetEnumerators::tkDetEnum[i]
101  << " offset " << geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])
102  << " is it strip? " << (geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() ? dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip() : false);
103  if(geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i]) != dus.size() &&
104  dus[geom_.offsetDU(GeomDetEnumerators::tkDetEnum[i])]->type().isTrackerStrip()) {
106  }
107  }
108  LogDebug("LookingForFirstStrip") << " Chosen offset: " << m_off;
109  m_Params.resize(dus.size()-m_off);
110  for (auto i=m_off; i!=dus.size();++i) {
111  auto & p= m_Params[i-m_off];
112  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(dus[i]);
113  assert(stripdet->index()==int(i));
114  // assert(stripdet->geographicalId().subdetId()>1); // not pixel..
115  assert(stripdet->type().isTrackerStrip()); // not pixel
116 
117  const Bounds& bounds = stripdet->specificSurface().bounds();
118  p.maxLength = std::sqrt( std::pow(bounds.length(),2.f)+std::pow(bounds.width(),2.f) );
119  p.thickness = bounds.thickness();
120  p.drift = driftDirection(stripdet) * p.thickness;
121  p.topology=(StripTopology*)(&stripdet->topology());
122  p.nstrips = p.topology->nstrips();
123  p.moduleGeom = SiStripDetId(stripdet->geographicalId()).moduleGeometry();
124  p.backplanecorrection = BackPlaneCorrectionMap_.getBackPlaneCorrection(stripdet->geographicalId().rawId());
125 
126  const TkRadialStripTopology* rtop = dynamic_cast<const TkRadialStripTopology*>(&stripdet->specificType().specificTopology());
127  p.pitch_rel_err2 = (rtop)
128  ? pow( 0.5f * rtop->angularWidth() * rtop->stripLength()/rtop->localPitch(LocalPoint(0,0,0)), 2.f) / 12.f
129  : 0.f;
130  }
131 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
Params m_Params
Definition: StripCPE.h:59
assert(m_qm.get())
const Bounds & bounds() const
Definition: Surface.h:128
const TrackerGeometry & geom_
Definition: StripCPE.h:34
unsigned int m_off
Definition: StripCPE.h:60
bool isTrackerStrip() const
Definition: GeomDetType.cc:24
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
virtual StripGeomDetType const & specificType() const
T sqrt(T t)
Definition: SSEVec.h:48
unsigned int offsetDU(SubDetector sid) const
virtual const TopologyType & specificTopology() const
float getBackPlaneCorrection(const uint32_t &) const
virtual const Topology & topology() const override
Returns a reference to the strip proxy topology.
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
double f[11][100]
int index() const
Definition: GeomDet.h:97
SubDetector tkDetEnum[8]
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
const SiStripBackPlaneCorrection & BackPlaneCorrectionMap_
Definition: StripCPE.h:37
float localPitch(const LocalPoint &) const
LocalVector driftDirection(const StripGeomDetUnit *det) const
Definition: StripCPE.cc:81
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
virtual const GeomDetType & type() const override
Definition: Bounds.h:22
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:43
StripClusterParameterEstimator::LocalValues StripCPE::localParameters ( const SiStripCluster cl,
const GeomDetUnit det 
) const
virtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 65 of file StripCPE.cc.

References StripCPE::Param::backplanecorrection, SiStripCluster::barycenter(), StripCPE::Param::coveredStrips(), StripCPE::Param::drift, f, StripTopology::localError(), StripTopology::localPosition(), AlCaHLTBitMon_ParallelJobs::p, param(), StripCPE::Param::thickness, and StripCPE::Param::topology.

65  {
66  StripCPE::Param const & p = param(det);
67  const float barycenter = cluster.barycenter();
68  const float fullProjection = p.coveredStrips( p.drift + LocalVector(0,0,-p.thickness), p.topology->localPosition(barycenter));
69  const float strip = barycenter - 0.5f * (1.f-p.backplanecorrection) * fullProjection;
70 
71  return std::make_pair( p.topology->localPosition(strip),
72  p.topology->localError(strip, 1.f/12.f) );
73 }
float thickness
Definition: StripCPE.h:45
StripTopology const * topology
Definition: StripCPE.h:43
float backplanecorrection
Definition: StripCPE.h:47
double f[11][100]
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:76
virtual LocalError localError(float strip, float stripErr2) const =0
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:51
LocalVector drift
Definition: StripCPE.h:44
virtual LocalPoint localPosition(float strip) const =0
Param const& StripCPE::param ( const GeomDetUnit det) const
inlineprotected

Definition at line 51 of file StripCPE.h.

References GeomDet::index(), m_off, and m_Params.

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

51  {
52  return m_Params[det.index()-m_off];
53  }
Params m_Params
Definition: StripCPE.h:59
unsigned int m_off
Definition: StripCPE.h:60
int index() const
Definition: GeomDet.h:97

Member Data Documentation

const SiStripBackPlaneCorrection& StripCPE::BackPlaneCorrectionMap_
protected

Definition at line 37 of file StripCPE.h.

Referenced by fillParams().

const TrackerGeometry& StripCPE::geom_
protected

Definition at line 34 of file StripCPE.h.

Referenced by fillParams().

const SiStripLorentzAngle& StripCPE::LorentzAngleMap_
protected

Definition at line 36 of file StripCPE.h.

Referenced by driftDirection().

unsigned int StripCPE::m_off
private

Definition at line 60 of file StripCPE.h.

Referenced by fillParams(), and param().

Params StripCPE::m_Params
private

Definition at line 59 of file StripCPE.h.

Referenced by fillParams(), and param().

const MagneticField& StripCPE::magfield_
protected

Definition at line 35 of file StripCPE.h.

Referenced by driftDirection(), and StripCPEfromTemplate::localParameters().

const bool StripCPE::peakMode_
protected

Definition at line 33 of file StripCPE.h.

Referenced by StripCPE().

std::vector<float> StripCPE::xtalk1
protected

Definition at line 38 of file StripCPE.h.

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

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

Definition at line 39 of file StripCPE.h.

Referenced by StripCPE().