#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) override |
~CSCSegAlgoTC () override | |
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 46 of file CSCSegAlgoTC.h.
typedef std::vector<const CSCRecHit2D*> CSCSegAlgoTC::ChamberHitContainer |
Definition at line 38 of file CSCSegAlgoTC.h.
typedef ChamberHitContainer::const_iterator CSCSegAlgoTC::ChamberHitContainerCIt |
Definition at line 39 of file CSCSegAlgoTC.h.
typedef std::vector<int> CSCSegAlgoTC::LayerIndex |
Typedefs.
Definition at line 37 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.
|
inlineoverride |
|
private |
Utility functions.
Definition at line 248 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 350 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), dPhiMax, CSCDetId::layer(), CSCChamber::layer(), CSCRecHit2D::localPosition(), LogDebug, M_PI, PV3DBase< T, PVType, FrameType >::phi(), theChamber, GeomDet::toGlobal(), and funct::true.
Referenced by buildSegments().
|
private |
Return true if the difference in (local) x of two hits is < dRPhiMax
Definition at line 343 of file CSCSegAlgoTC.cc.
References dRPhiMax, CSCRecHit2D::localPosition(), LogDebug, funct::true, 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 57 of file CSCSegAlgoTC.cc.
References funct::abs(), addHit(), areHitsCloseInGlobalPhi(), areHitsCloseInLocalX(), candidates, CSCSegFit::chi2(), CSCSegFit::covarianceMatrix(), CSCRecHit2D::cscDetId(), debugInfo, dumpSegment(), CSCSegFit::hits(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ib, CSCSegFit::intercept(), CSCDetId::layer(), CSCChamber::layer(), CSCSegFit::localdir(), CSCRecHit2D::localPosition(), LogDebug, minLayersApart, myName, GeomDet::position(), proto_segment, pruneTheSegments(), HI_PhotonSkim_cff::rechits, groupFilesInBlocks::reverse, sfit_, groupFilesInBlocks::temp, theChamber, GeomDet::toGlobal(), tryAddingHitsToSegment(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
|
private |
Definition at line 302 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 408 of file CSCSegAlgoTC.cc.
References CSCChamber::layer(), LogDebug, PV3DBase< T, PVType, FrameType >::phi(), Geom::Phi< T1, Range >::phi(), HI_PhotonSkim_cff::rechits, theChamber, and GeomDet::toGlobal().
|
private |
Definition at line 558 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 471 of file CSCSegAlgoTC.cc.
References hfClusterShapes_cfi::hits, and cuy::ib.
Referenced by pruneTheSegments().
|
private |
Definition at line 397 of file CSCSegAlgoTC.cc.
References proto_segment.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 322 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 369 of file CSCSegAlgoTC.cc.
References dPhiFineMax, dRPhiFineMax, trackingPlots::hp, CSCChamber::layer(), LogDebug, M_PI, phiAtZ(), theChamber, GeomDet::toGlobal(), and funct::true.
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 422 of file CSCSegAlgoTC.cc.
References chi2ndfProbMin, ChiSquaredProbability(), cuy::ib, nhits, and SegmentSorting.
Referenced by pruneTheSegments().
|
private |
Definition at line 287 of file CSCSegAlgoTC.cc.
References f, runTauDisplay::gp, 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(), z, 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 486 of file CSCSegAlgoTC.cc.
References candidates, flagHitsAsUsed(), isSegmentGood(), LogDebug, and segmentSort().
Referenced by buildSegments().
|
private |
Definition at line 267 of file CSCSegAlgoTC.cc.
References addHit(), and proto_segment.
Referenced by compareProtoSegment().
|
override |
Here we must implement the algorithm
Definition at line 51 of file CSCSegAlgoTC.cc.
References buildSegments(), HI_PhotonSkim_cff::rechits, and theChamber.
|
private |
Sort criterion for segment quality, for use in pruneTheSegments.
Definition at line 520 of file CSCSegAlgoTC.cc.
References candidates, hltPixelTracks_cff::chi2, ChiSquaredProbability(), mps_fire::i, dqmiolumiharvest::j, LogDebug, ndof, SegmentSorting, findQualityFiles::size, and groupFilesInBlocks::temp.
Referenced by pruneTheSegments().
|
private |
Try adding non-used hits to segment
Definition at line 207 of file CSCSegAlgoTC.cc.
References compareProtoSegment(), hasHitOnLayer(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, cuy::ib, increaseProtoSegment(), isHitNearSegment(), CSCChamber::layer(), LogDebug, proto_segment, HI_PhotonSkim_cff::rechits, theChamber, and GeomDet::toGlobal().
Referenced by buildSegments().
|
private |
Definition at line 280 of file CSCSegAlgoTC.cc.
References CSCSegFit::fit(), proto_segment, sfit_, and theChamber.
Referenced by addHit().
|
private |
Definition at line 147 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
max segment chi squared
Definition at line 151 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 156 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isSegmentGood().
|
private |
Definition at line 192 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 166 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isHitNearSegment().
|
private |
max distance in global phi between hits in one segment
Definition at line 175 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 161 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 171 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInLocalX(), and CSCSegAlgoTC().
|
private |
Require end-points of segment are at least minLayersApart
Definition at line 179 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Name of this class
Definition at line 191 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Definition at line 141 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 187 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), isSegmentGood(), and segmentSort().
|
private |
Definition at line 144 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), compareProtoSegment(), increaseProtoSegment(), phiAtZ(), and updateParameters().
|
private |
Member variables.
Definition at line 139 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInGlobalPhi(), buildSegments(), dumpHits(), dumpSegment(), isHitNearSegment(), phiAtZ(), run(), tryAddingHitsToSegment(), and updateParameters().