#include <CSCSegAlgoTC.h>
Public Types | |
typedef std::deque< bool > | BoolContainer |
typedef std::vector< const CSCRecHit2D * > | ChamberHitContainer |
typedef ChamberHitContainer::const_iterator | ChamberHitContainerCIt |
typedef std::vector< int > | LayerIndex |
Typedefs. More... | |
Public Member Functions | |
std::vector< CSCSegment > | buildSegments (const ChamberHitContainer &rechits) |
CSCSegAlgoTC (const edm::ParameterSet &ps) | |
Constructor. More... | |
std::vector< CSCSegment > | run (const CSCChamber *aChamber, const ChamberHitContainer &rechits) |
virtual | ~CSCSegAlgoTC () |
Destructor. More... | |
Public Member Functions inherited from CSCSegmentAlgorithm | |
CSCSegmentAlgorithm (const edm::ParameterSet &) | |
Constructor. More... | |
virtual std::vector< CSCSegment > | run (const CSCChamber *chamber, const std::vector< const CSCRecHit2D * > &rechits)=0 |
virtual | ~CSCSegmentAlgorithm () |
Destructor. More... | |
Private Member Functions | |
bool | addHit (const CSCRecHit2D *aHit, int layer) |
Utility functions. More... | |
bool | areHitsCloseInGlobalPhi (const CSCRecHit2D *h1, const CSCRecHit2D *h2) const |
bool | areHitsCloseInLocalX (const CSCRecHit2D *h1, const CSCRecHit2D *h2) const |
void | compareProtoSegment (const CSCRecHit2D *h, int layer) |
void | dumpHits (const ChamberHitContainer &rechits) const |
void | dumpSegment (const CSCSegment &seg) const |
void | flagHitsAsUsed (std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const |
bool | hasHitOnLayer (int layer) const |
void | increaseProtoSegment (const CSCRecHit2D *h, int layer) |
bool | isHitNearSegment (const CSCRecHit2D *h) const |
bool | isSegmentGood (std::vector< CSCSegFit * >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const |
float | phiAtZ (float z) const |
void | pruneTheSegments (const ChamberHitContainer &rechitsInChamber) |
bool | replaceHit (const CSCRecHit2D *h, int layer) |
void | segmentSort (void) |
void | tryAddingHitsToSegment (const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2) |
void | updateParameters (void) |
Private Attributes | |
std::vector< CSCSegFit * > | candidates |
float | chi2Max |
float | chi2ndfProbMin |
bool | debugInfo |
float | dPhiFineMax |
float | dPhiMax |
float | dRPhiFineMax |
float | dRPhiMax |
int | minLayersApart |
const std::string | myName |
ChamberHitContainer | proto_segment |
int | SegmentSorting |
CSCSegFit * | sfit_ |
const CSCChamber * | theChamber |
Member variables. More... | |
This is an alternative algorithm for building endcap muon track segments out of the rechit's in a CSCChamber. cf. CSCSegmentizerSK.
'TC' = 'Tim Cox' = Try (all) Combinations
A CSCSegment isa BasicRecHit4D, and is built from CSCRhit objects, each of which isa BasicRecHit2D.
This class is used by the CSCSegmentRecDet.
Alternative algorithms can be used for the segment building by writing classes like this, and then selecting which one is actually used via the CSCSegmentizerBuilder in CSCDetector.
Ported to CMSSW 2006-04-03: Matte o.Sa ni@ce rn.c h
Replaced least-squares fit by CSCSegFit - Feb 2015
Definition at line 34 of file CSCSegAlgoTC.h.
typedef std::deque<bool> CSCSegAlgoTC::BoolContainer |
Definition at line 47 of file CSCSegAlgoTC.h.
typedef std::vector<const CSCRecHit2D*> CSCSegAlgoTC::ChamberHitContainer |
Definition at line 39 of file CSCSegAlgoTC.h.
typedef ChamberHitContainer::const_iterator CSCSegAlgoTC::ChamberHitContainerCIt |
Definition at line 40 of file CSCSegAlgoTC.h.
typedef std::vector<int> CSCSegAlgoTC::LayerIndex |
Typedefs.
Definition at line 38 of file CSCSegAlgoTC.h.
|
explicit |
Constructor.
Definition at line 26 of file CSCSegAlgoTC.cc.
References chi2Max, chi2ndfProbMin, debugInfo, dPhiFineMax, dPhiMax, dRPhiFineMax, dRPhiMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, minLayersApart, myName, and SegmentSorting.
|
inlinevirtual |
|
private |
Utility functions.
Definition at line 259 of file CSCSegAlgoTC.cc.
References convertSQLiteXML::ok, proto_segment, and updateParameters().
Referenced by buildSegments(), increaseProtoSegment(), and replaceHit().
|
private |
Return true if the difference in (global) phi of two hits is < dPhiMax
Definition at line 372 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), dPhiMax, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), LogDebug, M_PI, PV3DBase< T, PVType, FrameType >::phi(), theChamber, and GeomDet::toGlobal().
Referenced by buildSegments().
|
private |
Return true if the difference in (local) x of two hits is < dRPhiMax
Definition at line 365 of file CSCSegAlgoTC.cc.
References dRPhiMax, CSCRecHit2D::localPosition(), LogDebug, and x.
Referenced by buildSegments().
std::vector< CSCSegment > CSCSegAlgoTC::buildSegments | ( | const ChamberHitContainer & | rechits | ) |
Build track segments in this chamber (this is where the actual segment-building algorithm hides.)
Definition at line 58 of file CSCSegAlgoTC.cc.
References funct::abs(), addHit(), areHitsCloseInGlobalPhi(), areHitsCloseInLocalX(), candidates, CSCSegFit::chi2(), CSCSegFit::covarianceMatrix(), CSCRecHit2D::cscDetId(), debugInfo, dumpSegment(), CSCSegFit::hits(), i, cuy::ib, CSCSegFit::intercept(), CSCChamber::layer(), CSCDetId::layer(), CSCSegFit::localdir(), CSCRecHit2D::localPosition(), LogDebug, minLayersApart, myName, GeomDet::position(), proto_segment, pruneTheSegments(), HI_PhotonSkim_cff::rechits, sfit_, groupFilesInBlocks::temp, theChamber, GeomDet::toGlobal(), tryAddingHitsToSegment(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
|
private |
Definition at line 319 of file CSCSegAlgoTC.cc.
References CSCSegFit::chi2(), LogDebug, convertSQLiteXML::ok, replaceHit(), and sfit_.
Referenced by tryAddingHitsToSegment().
|
private |
Dump global and local coordinate of each rechit in chamber after sort in z
Definition at line 435 of file CSCSegAlgoTC.cc.
References CSCChamber::layer(), LogDebug, Geom::Phi< T >::phi(), PV3DBase< T, PVType, FrameType >::phi(), theChamber, and GeomDet::toGlobal().
|
private |
Definition at line 602 of file CSCSegAlgoTC.cc.
References CSCSegment::chi2(), CSCSegment::degreesOfFreedom(), CSCChamber::id(), CSCSegment::localDirection(), CSCSegment::localDirectionError(), CSCSegment::localPosition(), CSCSegment::localPositionError(), CSCSegment::parametersError(), CSCSegment::specificRecHits(), theChamber, and CSCSegment::time().
Referenced by buildSegments().
|
private |
Flag hits on segment as used
Definition at line 506 of file CSCSegAlgoTC.cc.
References cuy::ib.
Referenced by pruneTheSegments().
|
private |
Definition at line 423 of file CSCSegAlgoTC.cc.
References proto_segment.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 341 of file CSCSegAlgoTC.cc.
References addHit(), CSCSegFit::chi2(), chi2Max, LogDebug, CSCSegFit::ndof(), convertSQLiteXML::ok, and sfit_.
Referenced by tryAddingHitsToSegment().
|
private |
Return true if hit is near segment. 'Near' means deltaphi and rxy*deltaphi are within ranges specified by config parameters dPhiFineMax and dRPhiFineMax, where rxy = sqrt(x**2+y**2) of the hit in global coordinates.
Definition at line 393 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), dPhiFineMax, dRPhiFineMax, AnalysisDataFormats_SUSYBSMObjects::hp, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), LogDebug, M_PI, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phiAtZ(), theChamber, GeomDet::toGlobal(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by tryAddingHitsToSegment().
|
private |
Return true if segment is good. In this algorithm, this means it shares no hits with any other segment. If "SegmentSort=2" also require a minimal chi2 probability of "chi2ndfProbMin".
Definition at line 454 of file CSCSegAlgoTC.cc.
References chi2ndfProbMin, ChiSquaredProbability(), cuy::ib, nhits, and SegmentSorting.
Referenced by pruneTheSegments().
|
private |
Definition at line 303 of file CSCSegAlgoTC.cc.
References f, CSCSegFit::intercept(), CSCChamber::layer(), CSCSegFit::localdir(), M_PI, phi, sfit_, theChamber, GeomDet::toGlobal(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by isHitNearSegment().
|
private |
Order segments by quality (chi2/#hits) and select the best, requiring that they have unique hits.
Definition at line 521 of file CSCSegAlgoTC.cc.
References candidates, flagHitsAsUsed(), isSegmentGood(), LogDebug, and segmentSort().
Referenced by buildSegments().
|
private |
Definition at line 279 of file CSCSegAlgoTC.cc.
References addHit(), and proto_segment.
Referenced by compareProtoSegment().
std::vector< CSCSegment > CSCSegAlgoTC::run | ( | const CSCChamber * | aChamber, |
const ChamberHitContainer & | rechits | ||
) |
Here we must implement the algorithm
Definition at line 52 of file CSCSegAlgoTC.cc.
References buildSegments(), and theChamber.
|
private |
Sort criterion for segment quality, for use in pruneTheSegments.
Definition at line 558 of file CSCSegAlgoTC.cc.
References candidates, ChiSquaredProbability(), i, j, LogDebug, ndof, SegmentSorting, findQualityFiles::size, and groupFilesInBlocks::temp.
Referenced by pruneTheSegments().
|
private |
Try adding non-used hits to segment
Definition at line 214 of file CSCSegAlgoTC.cc.
References compareProtoSegment(), CSCRecHit2D::cscDetId(), h, hasHitOnLayer(), i, cuy::ib, increaseProtoSegment(), isHitNearSegment(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), LogDebug, proto_segment, theChamber, and GeomDet::toGlobal().
Referenced by buildSegments().
|
private |
Definition at line 294 of file CSCSegAlgoTC.cc.
References CSCSegFit::fit(), proto_segment, sfit_, and theChamber.
Referenced by addHit().
|
private |
Definition at line 148 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
max segment chi squared
Definition at line 152 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and increaseProtoSegment().
|
private |
min segment chi squared probability. Used ONLY if SegmentSorting is chosen to be 2
Definition at line 157 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isSegmentGood().
|
private |
Definition at line 193 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
max hit deviation in global phi from the segment axis. Function hitNearSegment requires abs(deltaphi) < dPhiFineMax.
Definition at line 167 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isHitNearSegment().
|
private |
max distance in global phi between hits in one segment
Definition at line 176 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInGlobalPhi(), and CSCSegAlgoTC().
|
private |
max hit deviation in r-phi from the segment axis. Function hitNearSegment requires rxy*abs(deltaphi) < dRPhiFineMax.
Definition at line 162 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isHitNearSegment().
|
private |
max distance in local x between hits in one segment @ The name is historical!
Definition at line 172 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInLocalX(), and CSCSegAlgoTC().
|
private |
Require end-points of segment are at least minLayersApart
Definition at line 180 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Name of this class
Definition at line 192 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Definition at line 142 of file CSCSegAlgoTC.h.
Referenced by addHit(), buildSegments(), hasHitOnLayer(), replaceHit(), tryAddingHitsToSegment(), and updateParameters().
|
private |
Select which segment sorting to use (the higher the segment is in the list, the better the segment is supposed to be): if value is ==1: Sort segments by Chi2/(#hits on segment) if value is ==2: Sort segments first by #hits on segment, then by Chi2Probability(Chi2/ndf)
Definition at line 188 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), isSegmentGood(), and segmentSort().
|
private |
Definition at line 145 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), compareProtoSegment(), increaseProtoSegment(), phiAtZ(), and updateParameters().
|
private |
Member variables.
Definition at line 140 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInGlobalPhi(), buildSegments(), dumpHits(), dumpSegment(), isHitNearSegment(), phiAtZ(), run(), tryAddingHitsToSegment(), and updateParameters().