33 <<
"--------------------------------------------------------------------\n"
34 <<
"dRPhiMax = " << dRPhiMax <<
'\n'
35 <<
"dPhiMax = " << dPhiMax <<
'\n'
36 <<
"dRPhiFineMax = " << dRPhiFineMax <<
'\n'
37 <<
"dPhiFineMax = " << dPhiFineMax <<
'\n'
38 <<
"chi2Max = " << chi2Max <<
'\n'
39 <<
"wideSeg = " << wideSeg <<
'\n'
40 <<
"minLayersApart = " << minLayersApart << std::endl;
50 LogDebug(
"CSC") <<
"*********************************************";
52 LogDebug(
"CSC") <<
"*********************************************";
57 for(
unsigned int i = 0;
i < rechits.size();
i++) {
59 layerIndex[
i] = rechits[
i]->cscDetId().layer();
67 reverse(layerIndex.begin(), layerIndex.end());
68 reverse(rechits.begin(), rechits.end());
73 reverse(layerIndex.begin(), layerIndex.end());
74 reverse(rechits.begin(), rechits.end());
80 if (rechits.size() < 2) {
82 " hit(s) in chamber is not enough to build a segment.\n";
83 return std::vector<CSCSegment>();
103 std::vector<CSCSegment> segments;
114 int npass = (
wideSeg > 1.)? 2 : 1;
116 for (
int ipass = 0; ipass < npass; ++ipass) {
122 int layer1 = layerIndex[i1-
ib];
129 int layer2 = layerIndex[i2-
ib];
143 LogDebug(
"CSC") <<
"start new segment from hits " <<
"h1: "
144 << gp1 <<
" - h2: " << gp2 <<
"\n";
147 if (!
addHit(h1, layer1)) {
148 LogDebug(
"CSC") <<
" failed to add hit h1\n";
152 if (!
addHit(h2, layer2)) {
153 LogDebug(
"CSC") <<
" failed to add hit h2\n";
169 LogDebug(
"CSC") <<
"No segment has been found !!!\n";
177 LogDebug(
"CSC") <<
"Found a segment !!!\n";
179 segments.push_back(
temp);
189 if (segments.size() > 1)
219 if (
i == i1 ||
i == i2 || used[
i-ib])
222 int layer = layerIndex[
i-
ib];
227 LogDebug(
"CSC") <<
" hit at global " << gp1 <<
" is near segment\n.";
233 <<
" hits on segment...skip hit on same layer.\n";
247 << h2->
localPosition().x() <<
" have separation= " << deltaX;
258 float h1p = gp1.
phi();
259 float h2p = gp2.
phi();
260 float dphi12 = h1p - h2p;
267 LogDebug(
"CSC") <<
" Hits at global phi= " << h1p <<
", "
268 << h2p <<
" have separation= " << dphi12;
283 float hphi = hp.
phi();
287 float phidif = sphi-hphi;
293 float dRPhi = fabs(phidif)*hp.
perp();
294 LogDebug(
"CSC") <<
" is hit at phi_h= " << hphi <<
" near segment phi_seg= " << sphi
299 (fabs(phidif) <
dPhiFineMax*windowScale))?
true:
false;
305 edm::LogVerbatim(
"CSCSegment") <<
"[CSCSegAlgoSK::phiAtZ] Segment fit undefined";
314 LogTrace(
"CSCSegment") <<
"[CSCSegAlgoSK::phiAtZ] Global intercept = " << gp <<
", direction = " << gv;
316 float x = gp.
x() + (gv.x()/gv.z())*(z - gp.
z());
317 float y = gp.
y() + (gv.y()/gv.z())*(z - gp.
z());
318 float phi = atan2(y, x);
329 edm::LogInfo(
"CSCSegment") <<
"CSCChamber rechit dump.\n";
330 for(it=rechits.begin(); it!=rechits.end(); it++) {
335 edm::LogInfo(
"CSCSegment") <<
"Global pos.: " << gp1 <<
", phi: " << gp1.
phi() <<
". Local position: "
336 << (*it)->localPosition() <<
", phi: "
337 << (*it)->localPosition().
phi() <<
". Layer: "
338 << (*it)->cscDetId().layer() <<
"\n";
349 unsigned int iadd = ( rechitsInChamber.size() > 20 )? 1 : 0;
368 for(iu = ib; iu != rechitsInChamber.end(); ++iu) {
381 ChamberHitContainer::const_iterator it;
384 if (((*it)->cscDetId().layer() == layer) && (aHit != (*it)))
408 if ((*it)->cscDetId().layer() == layer)
417 ChamberHitContainer::iterator it;
419 if ((*it)->cscDetId().layer() == layer)
437 LogDebug(
"CSCSegment") <<
" hit in same layer as a hit on segment; try replacing old one..."
438 <<
" chi2 new: " <<
sfit_->
chi2() <<
" old: " << oldfit->
chi2() <<
"\n";
442 LogDebug(
"CSC") <<
" segment with replaced hit is better.\n";
461 LogDebug(
"CSCSegment") <<
" hit in new layer: added to segment, new chi2: "
469 LogDebug(
"CSCSegment") <<
" segment with added hit is good.\n" ;
486 <<
"\ncovariance matrix"
490 <<
"\ntime = " << seg.
time();
void dumpHits(const ChamberHitContainer &rechits) const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CSCSetOfHits hits(void) const
CSCDetId cscDetId() const
LocalVector localdir() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool areHitsCloseInLocalX(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
Utility functions.
ChamberHitContainer proto_segment
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const
CSCDetId id() const
Get the (concrete) DetId.
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
bool replaceHit(const CSCRecHit2D *h, int layer)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalError localPositionError() const
Geom::Phi< T > phi() const
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
virtual int degreesOfFreedom() const
Degrees of freedom of the segment fit.
void dumpSegment(const CSCSegment &seg) const
bool isHitNearSegment(const CSCRecHit2D *h) const
std::string chamberTypeName() const
LocalPoint localPosition() const
LocalVector localDirection() const
Local direction.
const Surface::PositionType & position() const
The position (origin of the R.F.)
const CSCChamberSpecs * specs() const
void increaseProtoSegment(const CSCRecHit2D *h, int layer)
Abs< T >::type abs(const T &t)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
float phiAtZ(float z) const
const std::vector< CSCRecHit2D > & specificRecHits() const
void updateParameters(void)
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
AlgebraicSymMatrix parametersError() const
Covariance matrix of parameters()
bool hasHitOnLayer(int layer) const
AlgebraicSymMatrix covarianceMatrix(void)
LocalPoint intercept() const
std::vector< int > LayerIndex
Typedefs.
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
double chi2() const
Chi2 of the segment fit.
bool isSegmentGood(const ChamberHitContainer &rechitsInChamber) const
std::vector< const CSCRecHit2D * > ChamberHitContainer
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const BoolContainer &used, const LayerIndex &layerIndex, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2)
LocalPoint localPosition() const
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
std::deque< bool > BoolContainer
LocalError localDirectionError() const
Error on the local direction.
void compareProtoSegment(const CSCRecHit2D *h, int layer)
const CSCChamber * theChamber