#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 |
AlgebraicSymMatrix | calculateError () const |
void | compareProtoSegment (const CSCRecHit2D *h, int layer) |
CLHEP::HepMatrix | derivativeMatrix () const |
void | dumpHits (const ChamberHitContainer &rechits) const |
void | fillChiSquared () |
void | fillLocalDirection () |
void | fitSlopes () |
void | flagHitsAsUsed (std::vector< ChamberHitContainer >::iterator is, const ChamberHitContainer &rechitsInChamber, BoolContainer &used) const |
void | flipErrors (AlgebraicSymMatrix &) const |
bool | hasHitOnLayer (int layer) const |
void | increaseProtoSegment (const CSCRecHit2D *h, int layer) |
bool | isHitNearSegment (const CSCRecHit2D *h) const |
bool | isSegmentGood (std::vector< ChamberHitContainer >::iterator is, std::vector< double >::iterator ichi, 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 | tryAddingHitsToSegment (const ChamberHitContainer &rechits, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2) |
void | updateParameters () |
AlgebraicSymMatrix | weightMatrix () const |
Private Attributes | |
std::vector< ChamberHitContainer > | candidates |
float | chi2Max |
float | chi2ndfProbMin |
std::vector< double > | chi2s |
bool | debugInfo |
std::vector< LocalVector > | directions |
float | dPhiFineMax |
float | dPhiMax |
float | dRPhiFineMax |
float | dRPhiMax |
std::vector< AlgebraicSymMatrix > | errors |
int | minLayersApart |
const std::string | myName |
std::vector< LocalPoint > | origins |
ChamberHitContainer | proto_segment |
int | SegmentSorting |
const CSCChamber * | theChamber |
Member variables. More... | |
double | theChi2 |
LocalVector | theDirection |
LocalPoint | theOrigin |
float | uz |
float | vz |
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
Definition at line 33 of file CSCSegAlgoTC.h.
typedef std::deque<bool> CSCSegAlgoTC::BoolContainer |
Definition at line 57 of file CSCSegAlgoTC.h.
typedef std::vector<const CSCRecHit2D*> CSCSegAlgoTC::ChamberHitContainer |
Definition at line 49 of file CSCSegAlgoTC.h.
typedef ChamberHitContainer::const_iterator CSCSegAlgoTC::ChamberHitContainerCIt |
Definition at line 50 of file CSCSegAlgoTC.h.
typedef std::vector<int> CSCSegAlgoTC::LayerIndex |
Typedefs.
Definition at line 48 of file CSCSegAlgoTC.h.
|
explicit |
Constructor.
Definition at line 27 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 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 639 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 630 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(), calculateError(), candidates, CSCChamberSpecs::chamberTypeName(), chi2s, CSCRecHit2D::cscDetId(), debugInfo, dumpHits(), errors, flipErrors(), i, cuy::ib, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), LogDebug, minLayersApart, myName, origins, GeomDet::position(), proto_segment, pruneTheSegments(), HI_PhotonSkim_cff::rechits, CSCChamber::specs(), groupFilesInBlocks::temp, theChamber, theChi2, theDirection, theOrigin, GeomDet::toGlobal(), tryAddingHitsToSegment(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
|
private |
Definition at line 922 of file CSCSegAlgoTC.cc.
References HLT_25ns14e33_v1_cff::A, derivativeMatrix(), query::result, weightMatrix(), and create_public_pileup_plots::weights.
Referenced by buildSegments().
|
private |
Definition at line 577 of file CSCSegAlgoTC.cc.
References LogDebug, convertSQLiteXML::ok, proto_segment, replaceHit(), theChi2, theDirection, and theOrigin.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 937 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), makeMuonMisalignmentScenario::matrix, proto_segment, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by calculateError().
|
private |
Dump global and local coordinate of each rechit in chamber after sort in z
Definition at line 702 of file CSCSegAlgoTC.cc.
References CSCChamber::layer(), LogDebug, Geom::Phi< T >::phi(), PV3DBase< T, PVType, FrameType >::phi(), theChamber, and GeomDet::toGlobal().
Referenced by buildSegments().
|
private |
Definition at line 493 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), AnalysisDataFormats_SUSYBSMObjects::hv, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), CSCRecHit2D::localPositionError(), LogDebug, proto_segment, theChamber, theChi2, theOrigin, GeomDet::toGlobal(), GeomDet::toLocal(), uz, vz, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by updateParameters().
|
private |
Definition at line 538 of file CSCSegAlgoTC.cc.
References mathSSE::sqrt(), theChamber, theDirection, theOrigin, GeomDet::toGlobal(), csvLumiCalc::unit, uz, vz, and detailsBasic3DVector::z.
Referenced by updateParameters().
|
private |
Definition at line 343 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), CSCRecHit2D::localPositionError(), LogDebug, AlCaHLTBitMon_ParallelJobs::p, proto_segment, theChamber, theOrigin, GeomDet::toGlobal(), GeomDet::toLocal(), uz, findQualityFiles::v, vz, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by updateParameters().
|
private |
Flag hits on segment as used
Definition at line 765 of file CSCSegAlgoTC.cc.
References cuy::ib.
Referenced by pruneTheSegments().
|
private |
|
private |
Definition at line 690 of file CSCSegAlgoTC.cc.
References proto_segment.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 603 of file CSCSegAlgoTC.cc.
References addHit(), chi2Max, LogDebug, convertSQLiteXML::ok, proto_segment, theChi2, theDirection, and theOrigin.
Referenced by tryAddingHitsToSegment().
|
private |
Return true if hit is near segment. 'Near' means deltaphi and rxy*deltaphi are within ranges specified by orcarc parameters dPhiFineMax and dRPhiFineMax, where rxy = sqrt(x**2+y**2) of the hit in global coordinates.
Definition at line 660 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 720 of file CSCSegAlgoTC.cc.
References chi2ndfProbMin, ChiSquaredProbability(), cuy::ib, and SegmentSorting.
Referenced by pruneTheSegments().
|
private |
Definition at line 561 of file CSCSegAlgoTC.cc.
References f, CSCChamber::layer(), M_PI, phi, theChamber, theDirection, theOrigin, GeomDet::toGlobal(), x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::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 780 of file CSCSegAlgoTC.cc.
References candidates, chi2s, errors, flagHitsAsUsed(), isSegmentGood(), LogDebug, origins, and segmentSort().
Referenced by buildSegments().
|
private |
Definition at line 267 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 53 of file CSCSegAlgoTC.cc.
References buildSegments(), and theChamber.
|
private |
Sort criterion for segment quality, for use in pruneTheSegments.
Definition at line 829 of file CSCSegAlgoTC.cc.
References candidates, chi2s, ChiSquaredProbability(), errors, i, j, LogDebug, origins, indexGen::s2, SegmentSorting, and groupFilesInBlocks::temp.
Referenced by pruneTheSegments().
|
private |
Try adding non-used hits to segment
Definition at line 203 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 281 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::cscDetId(), fillChiSquared(), fillLocalDirection(), fitSlopes(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), proto_segment, theChamber, theChi2, theOrigin, GeomDet::toGlobal(), GeomDet::toLocal(), uz, vz, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by addHit().
|
private |
Definition at line 962 of file CSCSegAlgoTC.cc.
References CSCRecHit2D::localPositionError(), makeMuonMisalignmentScenario::matrix, proto_segment, LocalError::xx(), LocalError::xy(), and LocalError::yy().
Referenced by calculateError().
|
private |
Definition at line 156 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
max segment chi squared
Definition at line 170 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 175 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isSegmentGood().
|
private |
Definition at line 160 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
Definition at line 211 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Definition at line 158 of file CSCSegAlgoTC.h.
|
private |
max hit deviation in global phi from the segment axis. Function hitNearSegment requires abs(deltaphi) < dPhiFineMax.
Definition at line 185 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), and isHitNearSegment().
|
private |
max distance in global phi between hits in one segment
Definition at line 194 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 180 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 190 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInLocalX(), and CSCSegAlgoTC().
|
private |
Definition at line 159 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
Require end-points of segment are at least minLayersApart
Definition at line 198 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Name of this class
Definition at line 210 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), and CSCSegAlgoTC().
|
private |
Definition at line 157 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), pruneTheSegments(), and segmentSort().
|
private |
Definition at line 162 of file CSCSegAlgoTC.h.
Referenced by addHit(), buildSegments(), compareProtoSegment(), derivativeMatrix(), fillChiSquared(), fitSlopes(), hasHitOnLayer(), increaseProtoSegment(), replaceHit(), tryAddingHitsToSegment(), updateParameters(), and weightMatrix().
|
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 206 of file CSCSegAlgoTC.h.
Referenced by CSCSegAlgoTC(), isSegmentGood(), and segmentSort().
|
private |
Member variables.
Definition at line 155 of file CSCSegAlgoTC.h.
Referenced by areHitsCloseInGlobalPhi(), buildSegments(), derivativeMatrix(), dumpHits(), fillChiSquared(), fillLocalDirection(), fitSlopes(), isHitNearSegment(), phiAtZ(), run(), tryAddingHitsToSegment(), and updateParameters().
|
private |
Definition at line 163 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), compareProtoSegment(), fillChiSquared(), increaseProtoSegment(), and updateParameters().
|
private |
Definition at line 165 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), compareProtoSegment(), fillLocalDirection(), increaseProtoSegment(), and phiAtZ().
|
private |
Definition at line 164 of file CSCSegAlgoTC.h.
Referenced by buildSegments(), compareProtoSegment(), fillChiSquared(), fillLocalDirection(), fitSlopes(), increaseProtoSegment(), phiAtZ(), and updateParameters().
|
private |
Definition at line 166 of file CSCSegAlgoTC.h.
Referenced by fillChiSquared(), fillLocalDirection(), fitSlopes(), and updateParameters().
|
private |
Definition at line 166 of file CSCSegAlgoTC.h.
Referenced by fillChiSquared(), fillLocalDirection(), fitSlopes(), and updateParameters().