20 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::fit] - cannot fit just 1 hit!!";
32 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::fit] - cannot fit more than 6 hits!!";
47 ME0SetOfHits::const_iterator ih =
hits_.begin();
59 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit:fit2] - 2 hits on same layer!!";
81 float dz = h2pos.
z()-h1pos.
z();
83 uslope_ = ( h2pos.
x() - h1pos.
x() ) / dz ;
84 vslope_ = ( h2pos.
y() - h1pos.
y() ) / dz ;
87 float uintercept = ( h1pos.
x()*h2pos.
z() - h2pos.
x()*h1pos.
z() ) / dz;
88 float vintercept = ( h1pos.
y()*h2pos.
z() - h2pos.
y()*h1pos.
z() ) / dz;
174 ME0SetOfHits::const_iterator ih =
hits_.begin();
177 for (ih =
hits_.begin(); ih !=
hits_.end(); ++ih)
179 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::fitlsq] - looping over ME0RecHits";
187 for (ih =
hits_.begin(); ih !=
hits_.end(); ++ih) {
195 #ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
196 std::stringstream lpss; lpss<<lp;
std::string lps = lpss.str();
197 std::stringstream gpss; gpss<<gp;
std::string gps = gpss.str();
198 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::fitlsq] - Tracking RecHit global position "<<std::setw(30)<<gps<<
" and local position "<<std::setw(30)<<lps
217 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::fit] 2x2 covariance matrix for this ME0RecHit :: [[" << IC(0,0) <<
", "<< IC(0,1) <<
"]["<< IC(1,0) <<
","<<IC(1,1)<<
"]]";
220 bool ok = IC.Invert();
222 edm::LogVerbatim(
"ME0Segment|ME0SegFit") <<
"[ME0SegFit::fit] Failed to invert covariance matrix: \n" << IC;
228 M(0,2) += IC(0,0) *
z;
229 M(0,3) += IC(0,1) *
z;
230 B(0) += u * IC(0,0) + v * IC(0,1);
234 M(1,2) += IC(1,0) *
z;
235 M(1,3) += IC(1,1) *
z;
236 B(1) += u * IC(1,0) + v * IC(1,1);
238 M(2,0) += IC(0,0) *
z;
239 M(2,1) += IC(0,1) *
z;
240 M(2,2) += IC(0,0) * z *
z;
241 M(2,3) += IC(0,1) * z *
z;
242 B(2) += ( u * IC(0,0) + v * IC(0,1) ) * z;
244 M(3,0) += IC(1,0) *
z;
245 M(3,1) += IC(1,1) *
z;
246 M(3,2) += IC(1,0) * z *
z;
247 M(3,3) += IC(1,1) * z *
z;
248 B(3) += ( u * IC(1,0) + v * IC(1,1) ) * z;
253 bool ok = M.Invert();
255 edm::LogVerbatim(
"ME0Segment|ME0SegFit") <<
"[ME0SegFit::fit] Failed to invert matrix: \n" << M;
262 LogTrace(
"ME0SegFit") <<
"[ME0SegFit::fit] p = "
263 <<
p(0) <<
", " <<
p(1) <<
", " <<
p(2) <<
", " <<
p(3);
288 ME0SetOfHits::const_iterator ih;
289 for (ih =
hits_.begin(); ih !=
hits_.end(); ++ih) {
304 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::setChi2] u, v, z = " << u <<
", " << v <<
", " <<
z;
314 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::setChi2] IC before = \n" << IC;
317 bool ok = IC.Invert();
319 edm::LogVerbatim(
"ME0Segment|ME0SegFit") <<
"[ME0SegFit::setChi2] Failed to invert covariance matrix: \n" << IC;
322 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::setChi2] IC after = \n" << IC;
323 chsq += du*du*IC(0,0) + 2.*du*dv*IC(0,1) + dv*dv*IC(1,1);
345 for (ME0SetOfHits::const_iterator it =
hits_.begin(); it !=
hits_.end(); ++it) {
359 ok = matrix.Invert();
375 for( ME0SetOfHits::const_iterator it =
hits_.begin(); it !=
hits_.end(); ++it) {
401 double dz = 1./
sqrt(1. + dxdz*dxdz + dydz*dydz);
412 double directionSign = globalZpos * globalZdir;
423 edm::LogVerbatim(
"ME0SegFit") <<
"[ME0SegFit::covarianceMatrix] derivatives matrix A: \n" <<
A;
431 ok = result.Invert();
433 edm::LogVerbatim(
"ME0Segment|ME0SegFit") <<
"[ME0SegFit::calculateError] Failed to invert matrix: \n" <<
result;
456 for (
short j=0;
j!=4; ++
j) {
457 for (
short i=0;
i!=4; ++
i) {
458 hold(
i+1,
j+1) =
a(
i,
j);
463 edm::LogVerbatim(
"ME0SegFit") <<
"(" << hold(1,1) <<
" " << hold(1,2) <<
" " << hold(1,3) <<
" " << hold(1,4);
464 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(2,1) <<
" " << hold(2,2) <<
" " << hold(2,3) <<
" " << hold(2,4);
465 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(3,1) <<
" " << hold(3,2) <<
" " << hold(3,3) <<
" " << hold(3,4);
466 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(4,1) <<
" " << hold(4,2) <<
" " << hold(4,3) <<
" " << hold(4,4) <<
")";
487 edm::LogVerbatim(
"ME0SegFit") <<
"(" << hold(1,1) <<
" " << hold(1,2) <<
" " << hold(1,3) <<
" " << hold(1,4);
488 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(2,1) <<
" " << hold(2,2) <<
" " << hold(2,3) <<
" " << hold(2,4);
489 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(3,1) <<
" " << hold(3,2) <<
" " << hold(3,3) <<
" " << hold(3,4);
490 edm::LogVerbatim(
"ME0SegFit") <<
" " << hold(4,1) <<
" " << hold(4,2) <<
" " << hold(4,3) <<
" " << hold(4,4) <<
")";
ROOT::Math::SVector< double, 4 > SVector4
float ydev(float y, float z) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SMatrixSym4
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
ROOT::Math::SMatrix< double, 4 > SMatrix4
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
ROOT::Math::SMatrix< double, 12, 12, ROOT::Math::MatRepSym< double, 12 > > SMatrixSym12
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SMatrixSym2
uint32_t rawId() const
get the raw id
T x() const
Cartesian x coordinate.
float Rdev(float x, float y, float z) const
AlgebraicSymMatrix flipErrors(const SMatrixSym4 &)
const ME0EtaPartition * me0etapartition(uint32_t id) const
AlgebraicSymMatrix covarianceMatrix(void)
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
const ME0EtaPartition * refme0etapart() const
ROOT::Math::SMatrix< double, 12, 4 > SMatrix12by4
SMatrix12by4 derivativeMatrix(void)
double scaleXError(void) const
float xfit(float z) const
SMatrixSym12 weightMatrix(void)
CLHEP::HepSymMatrix AlgebraicSymMatrix
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
float yfit(float z) const
float xdev(float x, float z) const