|
|
Go to the documentation of this file.
32 <<
"--------------------------------------------------------------------\n"
34 <<
"dPhiMax = " <<
dPhiMax <<
'\n'
37 <<
"chi2Max = " <<
chi2Max <<
'\n'
38 <<
"wideSeg = " <<
wideSeg <<
'\n'
48 LogDebug(
"CSC") <<
"*********************************************";
50 LogDebug(
"CSC") <<
"*********************************************";
55 for (
unsigned int i = 0;
i <
rechits.size();
i++) {
56 layerIndex[
i] =
rechits[
i]->cscDetId().layer();
64 reverse(layerIndex.begin(), layerIndex.end());
69 reverse(layerIndex.begin(), layerIndex.end());
77 LogDebug(
"CSC") <<
myName <<
": " <<
rechits.size() <<
" hit(s) in chamber is not enough to build a segment.\n";
78 return std::vector<CSCSegment>();
98 std::vector<CSCSegment> segments;
109 int npass = (
wideSeg > 1.) ? 2 : 1;
111 for (
int ipass = 0; ipass < npass; ++ipass) {
117 int layer1 = layerIndex[
i1 -
ib];
124 int layer2 = layerIndex[
i2 -
ib];
137 LogDebug(
"CSC") <<
"start new segment from hits "
138 <<
"h1: " << gp1 <<
" - h2: " << gp2 <<
"\n";
141 if (!
addHit(h1, layer1)) {
142 LogDebug(
"CSC") <<
" failed to add hit h1\n";
146 if (!
addHit(h2, layer2)) {
147 LogDebug(
"CSC") <<
" failed to add hit h2\n";
164 LogDebug(
"CSC") <<
"No segment has been found !!!\n";
171 LogDebug(
"CSC") <<
"Found a segment !!!\n";
174 segments.push_back(
temp);
184 if (segments.size() > 1)
218 int layer = layerIndex[
i -
ib];
222 LogDebug(
"CSC") <<
" hit at global " << gp1 <<
" is near segment\n.";
240 <<
" have separation= " << deltaX;
250 float h1p = gp1.
phi();
251 float h2p = gp2.
phi();
252 float dphi12 = h1p - h2p;
259 LogDebug(
"CSC") <<
" Hits at global phi= " << h1p <<
", " << h2p <<
" have separation= " << dphi12;
273 float hphi =
hp.phi();
277 float phidif = sphi - hphi;
283 float dRPhi = fabs(phidif) *
hp.perp();
284 LogDebug(
"CSC") <<
" is hit at phi_h= " << hphi <<
" near segment phi_seg= " << sphi <<
"? is " << dRPhi <<
"<"
293 edm::LogVerbatim(
"CSCSegment") <<
"[CSCSegAlgoSK::phiAtZ] Segment fit undefined";
302 LogTrace(
"CSCSegment") <<
"[CSCSegAlgoSK::phiAtZ] Global intercept = " <<
gp <<
", direction = " << gv;
304 float x =
gp.x() + (gv.x() / gv.z()) * (
z -
gp.z());
305 float y =
gp.y() + (gv.y() / gv.z()) * (
z -
gp.z());
306 float phi = atan2(
y,
x);
316 edm::LogInfo(
"CSCSegment") <<
"CSCChamber rechit dump.\n";
321 edm::LogInfo(
"CSCSegment") <<
"Global pos.: " << gp1 <<
", phi: " << gp1.
phi()
322 <<
". Local position: " << (*it)->localPosition()
323 <<
", phi: " << (*it)->localPosition().
phi() <<
". Layer: " << (*it)->cscDetId().layer()
334 unsigned int iadd = (rechitsInChamber.size() > 20) ? 1 : 0;
351 for (iu =
ib; iu != rechitsInChamber.end(); ++iu) {
353 used[iu -
ib] =
true;
363 ChamberHitContainer::const_iterator it;
366 if (((*it)->cscDetId().layer() == layer) && (aHit != (*it)))
388 if ((*it)->cscDetId().layer() == layer)
396 ChamberHitContainer::iterator it;
398 if ((*it)->cscDetId().layer() == layer)
415 LogDebug(
"CSCSegment") <<
" hit in same layer as a hit on segment; try replacing old one..."
416 <<
" chi2 new: " <<
sfit_->
chi2() <<
" old: " << oldfit->
chi2() <<
"\n";
420 LogDebug(
"CSC") <<
" segment with replaced hit is better.\n";
437 LogDebug(
"CSCSegment") <<
" hit in new layer: added to segment, new chi2: " <<
sfit_->
chi2() <<
"\n";
444 LogDebug(
"CSCSegment") <<
" segment with added hit is good.\n";
460 <<
"\ntime = " << seg.
time();
const std::vector< CSCRecHit2D > & specificRecHits() const
const Surface::PositionType & position() const
The position (origin of the R.F.)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
CSCSetOfHits hits(void) const
AlgebraicSymMatrix covarianceMatrix(void)
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
LocalVector localdir() const
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo
CSCDetId cscDetId() const
std::vector< const CSCRecHit2D * > ChamberHitContainer
bool isHitNearSegment(const CSCRecHit2D *h) const
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
const CSCChamber * theChamber
void dumpHits(const ChamberHitContainer &rechits) const
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
void dumpSegment(const CSCSegment &seg) const
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
void compareProtoSegment(const CSCRecHit2D *h, int layer)
std::deque< bool > BoolContainer
std::vector< int > LayerIndex
Typedefs.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalPoint localPosition() const override
std::string chamberTypeName() const
LocalVector localDirection() const override
Local direction.
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
LocalError localDirectionError() const override
Error on the local direction.
const CSCChamberSpecs * specs() const
void updateParameters(void)
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const BoolContainer &used, const LayerIndex &layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
bool replaceHit(const CSCRecHit2D *h, int layer)
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
Log< level::Info, true > LogVerbatim
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
T getParameter(std::string const &) const
double chi2() const override
Chi2 of the segment fit.
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
Abs< T >::type abs(const T &t)
CSCDetId id() const
Get the (concrete) DetId.
ChamberHitContainer proto_segment
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
LocalPoint localPosition() const override
float phiAtZ(float z) const
bool hasHitOnLayer(int layer) const
Geom::Phi< T > phi() const
LocalError localPositionError() const override
LocalPoint intercept() const