CMS 3D CMS Logo

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

#include <StripCPEfromTemplate.h>

Inheritance diagram for StripCPEfromTemplate:
StripCPE StripClusterParameterEstimator

Public Member Functions

StripClusterParameterEstimator::LocalValues localParameters (const SiStripCluster &, const GeomDetUnit &, const LocalTrajectoryParameters &) const
 
 StripCPEfromTemplate (edm::ParameterSet &conf, const MagneticField &mag, const TrackerGeometry &geom, const SiStripLorentzAngle &lorentz, const SiStripBackPlaneCorrection &backplaneCorrections, const SiStripConfObject &confObj, const SiStripLatency &latency)
 
- Public Member Functions inherited from StripCPE
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 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 ()
 

Private Attributes

int template_reco_speed
 
std::vector< SiStripTemplateStoretheStripTemp_
 
bool use_strip_split_cluster_errors
 
bool use_template_reco
 

Additional Inherited Members

- Public Types inherited from StripClusterParameterEstimator
typedef std::pair< LocalPoint,
LocalError
LocalValues
 
typedef std::vector< LocalValuesVLocalValues
 
- Protected Member Functions inherited from StripCPE
Param const & param (const GeomDetUnit &det) const
 
- Protected Attributes inherited from StripCPE
const SiStripBackPlaneCorrectionBackPlaneCorrectionMap_
 
const TrackerGeometrygeom_
 
const SiStripLorentzAngleLorentzAngleMap_
 
const MagneticFieldmagfield_
 
const bool peakMode_
 
std::vector< float > xtalk1
 
std::vector< float > xtalk2
 

Detailed Description

Definition at line 10 of file StripCPEfromTemplate.h.

Constructor & Destructor Documentation

StripCPEfromTemplate::StripCPEfromTemplate ( edm::ParameterSet conf,
const MagneticField mag,
const TrackerGeometry geom,
const SiStripLorentzAngle lorentz,
const SiStripBackPlaneCorrection backplaneCorrections,
const SiStripConfObject confObj,
const SiStripLatency latency 
)
inline

Definition at line 19 of file StripCPEfromTemplate.h.

References SiStripTemplate::pushfile(), and theStripTemp_.

26  : StripCPE(conf, mag, geom, lorentz, backplaneCorrections, confObj, latency ),
27  use_template_reco( conf.getParameter<bool>("UseTemplateReco") ),
28  template_reco_speed( conf.getParameter<int>("TemplateRecoSpeed") ),
29  use_strip_split_cluster_errors( conf.getParameter<bool>("UseStripSplitClusterErrors") )
30  {
37 
38  //cout << "STRIPS: (int)use_template_reco = " << (int)use_template_reco << endl;
39  //cout << "template_reco_speed = " << template_reco_speed << endl;
40  //cout << "(int)use_strip_split_cluster_errors = " << (int)use_strip_split_cluster_errors << endl;
41  }
T getParameter(std::string const &) const
StripCPE(edm::ParameterSet &conf, const MagneticField &, const TrackerGeometry &, const SiStripLorentzAngle &, const SiStripBackPlaneCorrection &, const SiStripConfObject &, const SiStripLatency &)
Definition: StripCPE.cc:11
std::vector< SiStripTemplateStore > theStripTemp_
static bool pushfile(int filenum, std::vector< SiStripTemplateStore > &theStripTemp_)

Member Function Documentation

StripClusterParameterEstimator::LocalValues StripCPEfromTemplate::localParameters ( const SiStripCluster cluster,
const GeomDetUnit det,
const LocalTrajectoryParameters ltp 
) const
virtual

Reimplemented from StripClusterParameterEstimator.

Definition at line 23 of file StripCPEfromTemplate.cc.

References SiStripCluster::amplitudes(), StripCPE::Param::backplanecorrection, SiStripCluster::barycenter(), StripCPE::Param::coveredStrips(), StripCPE::Param::drift, f, SiStripCluster::firstStrip(), GeomDet::geographicalId(), SiStripCluster::getSplitClusterError(), i, MagneticField::inTesla(), StripTopology::localError(), StripTopology::localPitch(), StripTopology::localPosition(), PV3DBase< T, PVType, FrameType >::mag(), StripCPE::magfield_, StripCPE::Param::maxLength, StripCPE::Param::moduleGeom, LocalTrajectoryParameters::momentum(), AlCaHLTBitMon_ParallelJobs::p, StripCPE::param(), GloballyPositioned< T >::position(), LocalTrajectoryParameters::position(), findQualityFiles::size, SiStripDetId::stereo(), SiStripTemplateReco::StripTempReco1D(), GeomDet::surface(), template_reco_speed, theStripTemp_, StripCPE::Param::thickness, toLocal(), StripCPE::Param::topology, use_strip_split_cluster_errors, use_template_reco, LocalTrajectoryParameters::vector(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

26 {
28 
29  LocalPoint final_lp;
30  LocalError final_le;
31 
32  // Default reconstruction (needed if template reco fails)
33 
34  StripCPE::Param const& p = param( det );
35 
36  LocalVector track = ltp.momentum();
37  track *=
38  ( track.z()<0 ) ? fabs( p.thickness/track.z() ) :
39  ( track.z()>0 ) ? -fabs( p.thickness/track.z() ) :
40  p.maxLength/track.mag() ;
41 
42  const unsigned N = cluster.amplitudes().size();
43 
44  const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
45 
46  const float strip = cluster.barycenter() - 0.5f*(1.f-p.backplanecorrection) * fullProjection
47  + 0.5f*p.coveredStrips(track, ltp.position());
48 
49  LocalPoint default_lp = p.topology->localPosition( strip, ltp.vector() );
50 
51 
52 
53 
54 
55  // Get the error of the split cluster.
56  // If the cluster is not split, then the error is -99999.9.
57  // The split cluster error is in microns and it has to be transformed into centimeteres and then in measurement units
58 
59  float uerr2 = -99999.9;
60  float split_cluster_error = cluster.getSplitClusterError();
61 
62  float local_pitch = p.topology->localPitch( default_lp );
63 
64  if ( split_cluster_error > 0.0 && use_strip_split_cluster_errors )
65  {
66  //cout << endl;
67  //cout << "Assign split rechit errors" << endl;
68  // go from microns to cm and then to strip units...
69 
70  uerr2 =
71  (split_cluster_error/10000.0 / local_pitch ) *
72  (split_cluster_error/10000.0 / local_pitch );
73  }
74  else
75  {
76  //cout << endl;
77  //cout << "Assign default rechit errors" << endl;
78  uerr2 = stripErrorSquared( N, fabs(fullProjection) );
79  }
80 
81 
82  LocalError default_le = p.topology->localError( strip, uerr2, ltp.vector() );
83 
84 
85 
86  // Template reconstruction
87 
88  int ierr = 9999999; // failed template reco ( if ierr = 0, then, template reco was successful )
89  float template_x_pos = -9999999.9;
90  float template_x_err = -9999999.9;
91 
92  // int cluster_size = (int)cluster.amplitudes().size();
93 
94  // do not use template reco for huge clusters
95  if ( use_template_reco )
96  {
97 
98  int id = -9999999;
99 
100  SiStripDetId ssdid = SiStripDetId( det.geographicalId() );
101 
102  int is_stereo = (int)( ssdid.stereo() );
103 
104  if ( p.moduleGeom == 1 ) // IB1
105  {
106  if ( !is_stereo )
107  id = 11;
108  else
109  id = 12;
110  }
111  else if ( p.moduleGeom == 2 ) // IB2
112  {
113  id = 13;
114  }
115  else if ( p.moduleGeom == 3 ) // OB1
116  {
117  id = 16;
118  }
119  else if ( p.moduleGeom == 4 ) // OB2
120  {
121  if ( !is_stereo )
122  id = 14;
123  else
124  id = 15;
125  }
126  //else
127  //cout << "Do not use templates for strip modules other than IB1, IB2, OB1 and OB2" << endl;
128 
129  const StripGeomDetUnit* stripdet = (const StripGeomDetUnit*)(&det);
130 
131  if ( (id > -9999999) && !(stripdet == 0) )
132  {
133  // Variables needed by template reco
134  float cotalpha = -9999999.9;
135  float cotbeta = -9999999.9;
136  float locBy = -9999999.9;
137  std::vector<float> vec_cluster_charge;
138 
139  // Variables returned by template reco
140  float xrec = -9999999.9;
141  float sigmax = -9999999.9;
142  float probx = -9999999.9;
143  int qbin = -9999999 ;
144  int speed = template_reco_speed ;
145  float probQ = -9999999.9;
146 
147 
148  LocalVector lbfield = ( stripdet->surface() ).toLocal( magfield_.inTesla( stripdet->surface().position() ) );
149  locBy = lbfield.y();
150 
151 
152  LocalVector localDir = ltp.momentum()/ltp.momentum().mag();
153  float locx = localDir.x();
154  float locy = localDir.y();
155  float locz = localDir.z();
156  cotalpha = locx/locz;
157  cotbeta = locy/locz;
158 
159 
160  int cluster_size = (int)( (cluster.amplitudes()).size() );
161  for (int i=0; i<cluster_size; ++i)
162  {
163  vec_cluster_charge.push_back( (float)( (cluster.amplitudes())[i] ) );
164  }
165 
166 
167  float measurement_position_first_strip_center = (float)(cluster.firstStrip()) + 0.5;
168 
169  LocalPoint local_position_first_strip_center
170  = p.topology->localPosition( measurement_position_first_strip_center, ltp.vector() );
171 
172 
175  cotalpha,
176  cotbeta,
177  locBy,
178  vec_cluster_charge,
179  templ,
180  xrec,
181  sigmax,
182  probx,
183  qbin,
184  speed,
185  probQ );
186 
187 
188 
189  // stripCPEtemplateProbability_ = probQ;
190  // stripCPEtemplateQbin_ = qbin;
191 
192 
193  template_x_pos = xrec / 10000.0 + local_position_first_strip_center.x();
194 
195  if ( split_cluster_error > 0.0 && use_strip_split_cluster_errors )
196  {
197  template_x_err = split_cluster_error/10000.0;
198  }
199  else
200  {
201  template_x_err = sigmax/10000.0;
202  }
203 
204 
205  } // if ( id > -9999999 && !stripdet == 0 )
206 
207  } // if ( use_template_reco )
208 
209 
210  if ( use_template_reco && ierr == 0 )
211  {
212  //cout << "Use template reco " << ierr << endl;
213 
214  LocalPoint template_lp( template_x_pos , default_lp.y() , default_lp.z() );
215  LocalError template_le( template_x_err*template_x_err, default_le.xy(), default_le.yy() );
216 
217 
218  final_lv = std::make_pair( template_lp, template_le );
219 
220  }
221  else
222  {
223  //cout << "Use default reco " << ierr << endl;
224 
225  final_lv = std::make_pair( default_lp, default_le );
226  }
227 
228  return final_lv;
229 
230 
231 }
int i
Definition: DBlmapReader.cc:9
uint32_t stereo() const
Definition: SiStripDetId.h:176
LocalPoint position() const
Local x and y position coordinates.
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
float thickness
Definition: StripCPE.h:45
StripTopology const * topology
Definition: StripCPE.h:43
T y() const
Definition: PV3DBase.h:63
uint16_t firstStrip() const
std::vector< SiStripTemplateStore > theStripTemp_
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
float backplanecorrection
Definition: StripCPE.h:47
float getSplitClusterError() const
AlgebraicVector5 vector() const
virtual float localPitch(const LocalPoint &) const =0
float xy() const
Definition: LocalError.h:25
T mag() const
Definition: PV3DBase.h:67
SiStripDetId::ModuleGeometry moduleGeom
Definition: StripCPE.h:48
float yy() const
Definition: LocalError.h:26
T z() const
Definition: PV3DBase.h:64
int StripTempReco1D(int id, float cotalpha, float cotbeta, float locBy, std::vector< float > &cluster, SiStripTemplate &templ, float &xrec, float &sigmax, float &probx, int &qbin, int speed, float &probQ)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
double f[11][100]
float barycenter() const
const MagneticField & magfield_
Definition: StripCPE.h:35
LocalVector momentum() const
Momentum vector in the local frame.
float coveredStrips(const LocalVector &, const LocalPoint &) const
Definition: StripCPE.cc:76
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
#define N
Definition: blowfish.cc:9
std::pair< LocalPoint, LocalError > LocalValues
virtual LocalError localError(float strip, float stripErr2) const =0
float maxLength
Definition: StripCPE.h:45
Param const & param(const GeomDetUnit &det) const
Definition: StripCPE.h:51
LocalVector drift
Definition: StripCPE.h:44
virtual LocalPoint localPosition(float strip) const =0
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
tuple size
Write out results.
const std::vector< uint8_t > & amplitudes() const

Member Data Documentation

int StripCPEfromTemplate::template_reco_speed
private

Definition at line 48 of file StripCPEfromTemplate.h.

Referenced by localParameters().

std::vector< SiStripTemplateStore > StripCPEfromTemplate::theStripTemp_
private

Definition at line 45 of file StripCPEfromTemplate.h.

Referenced by localParameters(), and StripCPEfromTemplate().

bool StripCPEfromTemplate::use_strip_split_cluster_errors
private

Definition at line 49 of file StripCPEfromTemplate.h.

Referenced by localParameters().

bool StripCPEfromTemplate::use_template_reco
private

Definition at line 47 of file StripCPEfromTemplate.h.

Referenced by localParameters().