#include <CSCSegAlgoDF.h>
Public Types | |
typedef std::deque< bool > | BoolContainer |
typedef std::vector< const CSCRecHit2D * > | ChamberHitContainer |
typedef std::vector< const CSCRecHit2D * > ::const_iterator | ChamberHitContainerCIt |
typedef std::vector< int > | LayerIndex |
Typedefs. More... | |
Public Member Functions | |
std::vector< CSCSegment > | buildSegments (ChamberHitContainer rechits) |
CSCSegAlgoDF (const edm::ParameterSet &ps) | |
Constructor. More... | |
std::vector< CSCSegment > | run (const CSCChamber *aChamber, ChamberHitContainer rechits) |
virtual | ~CSCSegAlgoDF () |
Destructor. More... | |
Public Member Functions inherited from CSCSegmentAlgorithm | |
CSCSegmentAlgorithm (const edm::ParameterSet &) | |
Constructor. More... | |
virtual std::vector< CSCSegment > | run (const CSCChamber *chamber, std::vector< const CSCRecHit2D * > rechits)=0 |
virtual | ~CSCSegmentAlgorithm () |
Destructor. More... | |
Private Member Functions | |
bool | addHit (const CSCRecHit2D *hit, int layer) |
AlgebraicSymMatrix | calculateError (void) const |
void | compareProtoSegment (const CSCRecHit2D *h, int layer) |
CLHEP::HepMatrix | derivativeMatrix (void) const |
void | flagHitsAsUsed (const ChamberHitContainer &rechitsInChamber) |
void | flipErrors (AlgebraicSymMatrix &) const |
bool | hasHitOnLayer (int layer) const |
bool | isHitNearSegment (const CSCRecHit2D *h) const |
void | orderSecondSeed (GlobalPoint gp1, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2, const ChamberHitContainer &rechits, LayerIndex layerIndex) |
void | pruneFromResidual () |
void | tryAddingHitsToSegment (const ChamberHitContainer &rechitsInChamber, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2, LayerIndex layerIndex) |
Utility functions. More... | |
void | updateParameters (void) |
AlgebraicSymMatrix | weightMatrix (void) const |
Private Attributes | |
float | chi2Max |
ChamberHitContainer | closeHits |
bool | debug |
double | dPhiFineMax |
double | dRPhiFineMax |
float | maxRatioResidual |
int | minHitsForPreClustering |
int | minHitsPerSegment |
int | minLayersApart |
int | muonsPerChamberMax |
const std::string | myName |
int | nHitsPerClusterIsShower |
float | nSigmaFromSegment |
CSCSegAlgoPreClustering * | preCluster_ |
bool | preClustering |
double | protoChi2 |
LocalVector | protoDirection |
LocalPoint | protoIntercept |
ChamberHitContainer | protoSegment |
float | protoSlope_u |
float | protoSlope_v |
bool | Pruning |
ChamberHitContainer | secondSeedHits |
CSCSegAlgoShowering * | showering_ |
float | tanPhiMax |
float | tanThetaMax |
bool | testSeg |
const CSCChamber * | theChamber |
BoolContainer | usedHits |
This is a modified version of the SK algorithm for building endcap muon track segments out of the rechit's in a CSCChamber.
A CSCSegment is a RecSegment4D, and is built from CSCRecHit2D objects, each of which is a RecHit2DLocalPos.
This builds segments by first creating proto-segments from at least 3 hits. We intend to try all possible pairs of hits to start segment building. 'All possible' means each hit lies on different layers in the chamber. Once a hit has been assigned to a segment, we don't consider it again, THAT IS, FOR THE FIRST PASS ONLY ! In fact, this is one of the possible flaw with the SK algorithms as it sometimes manages to build segments with the wrong starting points. In the DF algorithm, the endpoints are tested as the best starting points in a 2nd and 3rd loop.
Another difference with the from the SK algorithm is that rechits can be added to proto segments if they fall within n sigmas of the projected track within a given layer. Hence, a cylinder isn't used as in the SK algorimthm, which allows for pseudo 2D hits built from wire or strip only hits to be used in segment reconstruction.
Also, only a certain muonsPerChamberMax maximum number of segments can be produced in the chamber.
Alternative algorithms can be used for the segment building by writing classes like this, and then selecting which one is actually used via the CSCSegmentBuilder.
Definition at line 47 of file CSCSegAlgoDF.h.
typedef std::deque<bool> CSCSegAlgoDF::BoolContainer |
Definition at line 57 of file CSCSegAlgoDF.h.
typedef std::vector<const CSCRecHit2D*> CSCSegAlgoDF::ChamberHitContainer |
Definition at line 55 of file CSCSegAlgoDF.h.
typedef std::vector<const CSCRecHit2D*>::const_iterator CSCSegAlgoDF::ChamberHitContainerCIt |
Definition at line 56 of file CSCSegAlgoDF.h.
typedef std::vector<int> CSCSegAlgoDF::LayerIndex |
Typedefs.
Definition at line 54 of file CSCSegAlgoDF.h.
|
explicit |
Constructor.
Definition at line 32 of file CSCSegAlgoDF.cc.
References chi2Max, debug, dPhiFineMax, dRPhiFineMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), maxRatioResidual, minHitsForPreClustering, minHitsPerSegment, minLayersApart, nHitsPerClusterIsShower, preCluster_, preClustering, Pruning, showering_, tanPhiMax, and tanThetaMax.
|
virtual |
|
private |
Definition at line 372 of file CSCSegAlgoDF.cc.
References convertSQLiteXML::ok, and protoSegment.
Referenced by compareProtoSegment(), and tryAddingHitsToSegment().
std::vector< CSCSegment > CSCSegAlgoDF::buildSegments | ( | ChamberHitContainer | rechits | ) |
Build track segments in this chamber (this is where the actual segment-building algorithm hides.)
Definition at line 106 of file CSCSegAlgoDF.cc.
References calculateError(), chi2Max, flagHitsAsUsed(), flipErrors(), i, CSCChamber::layer(), CSCRecHit2D::localPosition(), minHitsPerSegment, minLayersApart, nHitsPerClusterIsShower, CSCSegment::nRecHits(), GeomDet::position(), preClustering, protoChi2, protoDirection, protoIntercept, protoSegment, protoSlope_u, protoSlope_v, pruneFromResidual(), Pruning, showering_, CSCSegAlgoShowering::showerSeg(), mathSSE::sqrt(), tanPhiMax, tanThetaMax, groupFilesInBlocks::temp, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), tryAddingHitsToSegment(), csvLumiCalc::unit, usedHits, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
|
private |
Definition at line 632 of file CSCSegAlgoDF.cc.
References funct::A, derivativeMatrix(), query::result, weightMatrix(), and create_public_pileup_plots::weights.
Referenced by buildSegments().
|
private |
Definition at line 518 of file CSCSegAlgoDF.cc.
References addHit(), convertSQLiteXML::ok, protoChi2, protoDirection, protoIntercept, protoSegment, protoSlope_u, protoSlope_v, and updateParameters().
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 605 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), makeMuonMisalignmentScenario::matrix, protoSegment, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by calculateError().
|
private |
Flag hits on segment as used
Definition at line 558 of file CSCSegAlgoDF.cc.
References closeHits, protoSegment, and usedHits.
Referenced by buildSegments().
|
private |
|
private |
Definition at line 502 of file CSCSegAlgoDF.cc.
References protoSegment.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 335 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), SiPixelRawToDigiRegional_cfi::deltaPhi, dPhiFineMax, dRPhiFineMax, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), M_PI, PV3DBase< T, PVType, FrameType >::phi(), protoIntercept, protoSlope_u, protoSlope_v, dttmaxenums::R, mathSSE::sqrt(), theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by tryAddingHitsToSegment().
|
private |
Order the hits on the 2nd layer for seed building
Definition at line 743 of file CSCSegAlgoDF.cc.
References secondSeedHits.
|
private |
Prune bad segment from the worse hit based on residuals
Definition at line 671 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), j, CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), maxRatioResidual, protoIntercept, protoSegment, protoSlope_u, protoSlope_v, mathSSE::sqrt(), theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), updateParameters(), v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by buildSegments().
std::vector< CSCSegment > CSCSegAlgoDF::run | ( | const CSCChamber * | aChamber, |
ChamberHitContainer | rechits | ||
) |
Here we must implement the algorithm
Definition at line 65 of file CSCSegAlgoDF.cc.
References buildSegments(), CSCSegAlgoPreClustering::clusterHits(), minHitsForPreClustering, preCluster_, preClustering, and theChamber.
|
private |
Utility functions.
Try adding non-used hits to segment
Skip the layers containing the segment endpoints on first 2 passes, but then
try hits on layer containing the segment starting points on 2nd and/or 3rd pass
if segment has >2 hits. Test each hit on the other layers to see if it is near
the segment using rechit error matrix.
If it is, see whether there is already a hit on the segment from the same layer
Definition at line 265 of file CSCSegAlgoDF.cc.
References addHit(), closeHits, compareProtoSegment(), h, hasHitOnLayer(), i, isHitNearSegment(), protoSegment, updateParameters(), and usedHits.
Referenced by buildSegments().
|
private |
Definition at line 394 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), CSCChamber::layer(), CSCDetId::layer(), CSCRecHit2D::localPosition(), CSCRecHit2D::localPositionError(), LogDebug, AlCaHLTBitMon_ParallelJobs::p, protoChi2, protoIntercept, protoSegment, protoSlope_u, protoSlope_v, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), v, 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 compareProtoSegment(), pruneFromResidual(), and tryAddingHitsToSegment().
|
private |
Definition at line 582 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::localPositionError(), makeMuonMisalignmentScenario::matrix, protoSegment, LocalError::xx(), LocalError::xy(), and LocalError::yy().
Referenced by calculateError().
|
private |
Definition at line 158 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 133 of file CSCSegAlgoDF.h.
Referenced by flagHitsAsUsed(), and tryAddingHitsToSegment().
|
private |
Definition at line 144 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF().
|
private |
Definition at line 155 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and isHitNearSegment().
|
private |
Definition at line 154 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and isHitNearSegment().
|
private |
Definition at line 159 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and pruneFromResidual().
|
private |
Definition at line 146 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and run().
|
private |
Definition at line 152 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 149 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 153 of file CSCSegAlgoDF.h.
|
private |
Definition at line 129 of file CSCSegAlgoDF.h.
|
private |
Definition at line 150 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 151 of file CSCSegAlgoDF.h.
|
private |
Definition at line 161 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), run(), and ~CSCSegAlgoDF().
|
private |
Definition at line 145 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), CSCSegAlgoDF(), and run().
|
private |
Definition at line 140 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), and updateParameters().
|
private |
Definition at line 141 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and compareProtoSegment().
|
private |
Definition at line 139 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), isHitNearSegment(), pruneFromResidual(), and updateParameters().
|
private |
Definition at line 135 of file CSCSegAlgoDF.h.
Referenced by addHit(), buildSegments(), compareProtoSegment(), derivativeMatrix(), flagHitsAsUsed(), hasHitOnLayer(), pruneFromResidual(), tryAddingHitsToSegment(), updateParameters(), and weightMatrix().
|
private |
Definition at line 137 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), isHitNearSegment(), pruneFromResidual(), and updateParameters().
|
private |
Definition at line 138 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), isHitNearSegment(), pruneFromResidual(), and updateParameters().
|
private |
Definition at line 148 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 136 of file CSCSegAlgoDF.h.
Referenced by orderSecondSeed().
|
private |
Definition at line 162 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), CSCSegAlgoDF(), and ~CSCSegAlgoDF().
|
private |
Definition at line 156 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 157 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 147 of file CSCSegAlgoDF.h.
|
private |
Definition at line 130 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), derivativeMatrix(), isHitNearSegment(), pruneFromResidual(), run(), and updateParameters().
|
private |
Definition at line 131 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), flagHitsAsUsed(), and tryAddingHitsToSegment().