32 <<
"--------------------------------------------------------------------\n"
33 <<
"dRPhiMax = " << dRPhiMax <<
'\n'
34 <<
"dPhiMax = " << dPhiMax <<
'\n'
35 <<
"dRPhiFineMax = " << dRPhiFineMax <<
'\n'
36 <<
"dPhiFineMax = " << dPhiFineMax <<
'\n'
37 <<
"chi2Max = " << chi2Max <<
'\n'
38 <<
"wideSeg = " << wideSeg <<
'\n'
39 <<
"minLayersApart = " << minLayersApart << std::endl;
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());
65 reverse(rechits.begin(), rechits.end());
69 reverse(layerIndex.begin(), layerIndex.end());
70 reverse(rechits.begin(), rechits.end());
76 if (rechits.size() < 2) {
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)
215 if (
i == i1 ||
i == i2 || used[
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";
317 for (it = rechits.begin(); it != rechits.end(); it++) {
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();
void dumpHits(const ChamberHitContainer &rechits) const
Log< level::Info, true > LogVerbatim
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
T getUntrackedParameter(std::string const &, T const &) const
CSCSetOfHits hits(void) const
CSCDetId cscDetId() const
LocalPoint localPosition() const override
LocalVector localdir() const
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.
Geom::Phi< T > phi() const
bool addHit(const CSCRecHit2D *hit, int layer)
Utility functions.
double chi2() const override
Chi2 of the segment fit.
constexpr std::array< uint8_t, layerIndexSize > layer
void dumpSegment(const CSCSegment &seg) const
bool isHitNearSegment(const CSCRecHit2D *h) const
std::string chamberTypeName() const
LocalVector localDirection() const override
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
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
const std::vector< CSCRecHit2D > & specificRecHits() const
void updateParameters(void)
CSCSegAlgoSK(const edm::ParameterSet &ps)
Constructor.
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
LocalPoint localPosition() const override
LocalError localDirectionError() const override
Error on the local direction.
Log< level::Info, false > LogInfo
bool hasHitOnLayer(int layer) const
AlgebraicSymMatrix covarianceMatrix(void)
T getParameter(std::string const &) const
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
LocalPoint intercept() const
std::vector< int > LayerIndex
Typedefs.
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)
LocalError localPositionError() const override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool areHitsCloseInGlobalPhi(const CSCRecHit2D *h1, const CSCRecHit2D *h2) const
std::deque< bool > BoolContainer
void compareProtoSegment(const CSCRecHit2D *h, int layer)
const CSCChamber * theChamber