|
|
Go to the documentation of this file.
40 <<
"--------------------------------------------------------------------\n"
42 <<
"dPhiMax = " <<
dPhiMax <<
'\n'
45 <<
"chi2Max = " <<
chi2Max <<
'\n'
65 LogDebug(
"CSC") <<
myName <<
": " <<
rechits.size() <<
" hit(s) in chamber is not enough to build a segment.\n";
66 return std::vector<CSCSegment>();
72 short ilay =
rechits[
i]->cscDetId().layer();
83 reverse(layerIndex.begin(), layerIndex.end());
88 reverse(layerIndex.begin(), layerIndex.end());
118 std::vector<CSCSegment> segments;
126 int layer1 = layerIndex[
i1 -
ib];
131 int layer2 = layerIndex[
i2 -
ib];
145 LogDebug(
"CSCSegment") <<
"start new segment from hits "
146 <<
"h1: " << gp1 <<
" - h2: " << gp2 <<
"\n";
150 if (!
addHit(h1, layer1)) {
151 LogDebug(
"CSCSegment") <<
" failed to add hit h1\n";
155 if (!
addHit(h2, layer2)) {
156 LogDebug(
"CSCSegment") <<
" failed to add hit h2\n";
165 LogDebug(
"CSCSegment") <<
"No segment found.\n";
171 LogDebug(
"CSCSegment") <<
"Found a segment.\n";
193 segments.push_back(
temp);
227 int layer = (*i)->cscDetId().layer();
233 LogDebug(
"CSC") <<
" hit at global " << gp1 <<
" is near segment\n.";
254 ChamberHitContainer::const_iterator it;
257 if (((*it)->cscDetId().layer() == layer) && (aHit != *it))
269 ChamberHitContainer::iterator it;
271 if ((*it)->cscDetId().layer() == layer)
293 float x =
gp.x() + (gv.
x() / gv.
z()) * (
z -
gp.z());
294 float y =
gp.y() + (gv.
y() / gv.
z()) * (
z -
gp.z());
295 float phi = atan2(
y,
x);
309 LogDebug(
"CSC") <<
" hit in same layer as a hit on segment; try replacing old one..."
310 <<
" chi2 new: " <<
sfit_->
chi2() <<
" old: " << oldfit->
chi2() <<
"\n";
314 LogDebug(
"CSC") <<
" segment with replaced hit is better.\n";
329 LogDebug(
"CSC") <<
" hit in new layer: added to segment, new chi2: " <<
sfit_->
chi2() <<
"\n";
335 LogDebug(
"CSC") <<
" segment with added hit is good.\n";
346 <<
" have separation= " << deltaX;
356 float h1p = gp1.
phi();
357 float h2p = gp2.
phi();
358 float dphi12 = h1p - h2p;
365 LogDebug(
"CSC") <<
" Hits at global phi= " << h1p <<
", " << h2p <<
" have separation= " << dphi12;
379 float hphi =
hp.phi();
383 float phidif = sphi - hphi;
389 float dRPhi = fabs(phidif) *
hp.perp();
390 LogDebug(
"CSC") <<
" is hit at phi_h= " << hphi <<
" near segment phi_seg= " << sphi <<
"? is " << dRPhi <<
"<"
392 <<
" and is |" << phidif <<
"|<" <<
dPhiFineMax <<
" ?";
402 if ((*it)->cscDetId().layer() == layer)
416 LogDebug(
"CSC") <<
"Global pos.: " << gp1 <<
", phi: " << gp1.
phi()
417 <<
". Local position: " << (*it)->localPosition() <<
", phi: " << (*it)->localPosition().
phi()
418 <<
". Layer: " << (*it)->cscDetId().layer() <<
"\n";
433 size_t iadd = (rechitsInChamber.size() > 20) ? 1 : 0;
435 size_t nhits = (*seg)->nhits();
437 if (
nhits < 3 + iadd)
446 double chi2t = (*seg)->chi2();
447 double ndoft = 2 *
nhits - 4;
448 if (chi2t > 0 && ndoft > 0) {
459 for (
size_t ish = 0; ish <
nhits; ++ish) {
463 if ((hits_[ish] == (*ic)) && used[ic -
ib])
479 for (
size_t ish = 0; ish <
hits.size(); ++ish) {
481 if (
hits[ish] == (*iu))
482 used[iu -
ib] =
true;
503 std::vector<CSCSegFit*>::iterator is;
506 bool goodSegment =
isSegmentGood(is, rechitsInChamber, used);
509 LogDebug(
"CSC") <<
"Accepting segment: ";
513 LogDebug(
"CSC") <<
"Rejecting segment: ";
552 LogDebug(
"CSC") <<
"No valid segment sorting specified. Algorithm misconfigured! \n";
565 <<
"\ntime = " << seg.
time();
const std::vector< CSCRecHit2D > & specificRecHits() const
const Surface::PositionType & position() const
The position (origin of the R.F.)
bool isHitNearSegment(const CSCRecHit2D *h) const
std::vector< int > LayerIndex
Typedefs.
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
CSCSetOfHits hits(void) const
CSCSegAlgoTC(const edm::ParameterSet &ps)
Constructor.
AlgebraicSymMatrix covarianceMatrix(void)
float ChiSquaredProbability(double chiSquared, double nrDOF)
bool addHit(const CSCRecHit2D *aHit, int layer)
Utility functions.
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
ChamberHitContainer proto_segment
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
LocalVector localdir() const
T getUntrackedParameter(std::string const &, T const &) const
CSCDetId cscDetId() const
std::vector< const CSCRecHit2D * > ChamberHitContainer
const CSCChamber * theChamber
Member variables.
void compareProtoSegment(const CSCRecHit2D *h, int layer)
float phiAtZ(float z) const
void pruneTheSegments(const ChamberHitContainer &rechitsInChamber)
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
std::deque< bool > BoolContainer
void dumpHits(const ChamberHitContainer &rechits) const
ChamberHitContainer::const_iterator ChamberHitContainerCIt
bool replaceHit(const CSCRecHit2D *h, int layer)
bool isSegmentGood(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalPoint localPosition() const override
LocalVector localDirection() const override
Local direction.
LocalError localDirectionError() const override
Error on the local direction.
bool hasHitOnLayer(int layer) const
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
void dumpSegment(const CSCSegment &seg) const
Log< level::Info, true > LogVerbatim
std::vector< CSCSegFit * > candidates
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
T getParameter(std::string const &) const
void tryAddingHitsToSegment(const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
double chi2() const override
Chi2 of the segment fit.
void updateParameters(void)
Abs< T >::type abs(const T &t)
CSCDetId id() const
Get the (concrete) DetId.
LocalPoint localPosition() const override
void flagHitsAsUsed(std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
Geom::Phi< T > phi() const
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
LocalError localPositionError() const override
LocalPoint intercept() const