#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 (const ChamberHitContainer &rechits) |
CSCSegAlgoDF (const edm::ParameterSet &ps) | |
Constructor. More... | |
std::vector< CSCSegment > | run (const CSCChamber *aChamber, const ChamberHitContainer &rechits) override |
~CSCSegAlgoDF () 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 *hit, int layer) |
void | compareProtoSegment (const CSCRecHit2D *h, int layer) |
void | dumpSegment (const CSCSegment &seg) const |
void | flagHitsAsUsed (const ChamberHitContainer &rechitsInChamber) |
bool | hasHitOnLayer (int layer) const |
bool | isHitNearSegment (const CSCRecHit2D *h) const |
void | pruneFromResidual (void) |
void | tryAddingHitsToSegment (const ChamberHitContainer &rechitsInChamber, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2, const LayerIndex &layerIndex) |
Utility functions. More... | |
void | updateParameters (void) |
Private Attributes | |
float | chi2Max |
ChamberHitContainer | closeHits |
bool | debug |
double | dPhiFineMax |
double | dRPhiFineMax |
float | maxRatioResidual |
int | minHitsForPreClustering |
int | minHitsPerSegment |
int | minLayersApart |
const std::string | myName |
int | nHitsPerClusterIsShower |
CSCSegAlgoPreClustering * | preCluster_ |
bool | preClustering |
ChamberHitContainer | protoSegment |
bool | Pruning |
ChamberHitContainer | secondSeedHits |
CSCSegFit * | sfit_ |
CSCSegAlgoShowering * | showering_ |
float | tanPhiMax |
float | tanThetaMax |
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. [Seems to be hardwired rather than using this variable?]
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 48 of file CSCSegAlgoDF.h.
typedef std::deque<bool> CSCSegAlgoDF::BoolContainer |
Definition at line 55 of file CSCSegAlgoDF.h.
typedef std::vector<const CSCRecHit2D*> CSCSegAlgoDF::ChamberHitContainer |
Definition at line 53 of file CSCSegAlgoDF.h.
typedef std::vector<const CSCRecHit2D*>::const_iterator CSCSegAlgoDF::ChamberHitContainerCIt |
Definition at line 54 of file CSCSegAlgoDF.h.
typedef std::vector<int> CSCSegAlgoDF::LayerIndex |
Typedefs.
Definition at line 52 of file CSCSegAlgoDF.h.
|
explicit |
Constructor.
Definition at line 34 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.
|
override |
|
private |
Definition at line 423 of file CSCSegAlgoDF.cc.
References protoSegment.
Referenced by compareProtoSegment(), and tryAddingHitsToSegment().
std::vector< CSCSegment > CSCSegAlgoDF::buildSegments | ( | const ChamberHitContainer & | rechits | ) |
Build track segments in this chamber (this is where the actual segment-building algorithm hides.)
Definition at line 109 of file CSCSegAlgoDF.cc.
References CSCSegFit::chi2(), chi2Max, CSCSegFit::covarianceMatrix(), debug, dumpSegment(), PVValHelper::dz, flagHitsAsUsed(), CSCSegFit::hits(), mps_fire::i, cuy::ib, CSCSegFit::intercept(), CSCChamber::layer(), CSCSegFit::localdir(), CSCRecHit2D::localPosition(), minHitsPerSegment, minLayersApart, nHitsPerClusterIsShower, mkfit::Config::nLayers, CSCSegment::nRecHits(), GeomDet::position(), preClustering, protoSegment, pruneFromResidual(), Pruning, HI_PhotonSkim_cff::rechits, sfit_, showering_, CSCSegAlgoShowering::showerSeg(), tanPhiMax, tanThetaMax, groupFilesInBlocks::temp, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), tryAddingHitsToSegment(), updateParameters(), usedHits, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by run().
|
private |
Definition at line 483 of file CSCSegAlgoDF.cc.
References addHit(), CSCSegFit::chi2(), CSCSegFit::fit(), phase1PixelTopology::layer, convertSQLiteXML::ok, protoSegment, sfit_, and theChamber.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 608 of file CSCSegAlgoDF.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 524 of file CSCSegAlgoDF.cc.
References closeHits, cuy::ib, protoSegment, and usedHits.
Referenced by buildSegments().
|
private |
Definition at line 466 of file CSCSegAlgoDF.cc.
References phase1PixelTopology::layer, and protoSegment.
Referenced by tryAddingHitsToSegment().
|
private |
Definition at line 381 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), srCondWrite_cfg::deltaPhi, dPhiFineMax, dRPhiFineMax, CSCDetId::layer(), CSCChamber::layer(), phase1PixelTopology::layer, CSCRecHit2D::localPosition(), M_PI, PV3DBase< T, PVType, FrameType >::phi(), dttmaxenums::R, sfit_, mathSSE::sqrt(), theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), CSCSegFit::xfit(), PV3DBase< T, PVType, FrameType >::y(), CSCSegFit::yfit(), z, and PV3DBase< T, PVType, FrameType >::z().
Referenced by tryAddingHitsToSegment().
|
private |
Prune bad segment from the worse hit based on residuals
Definition at line 549 of file CSCSegAlgoDF.cc.
References CSCRecHit2D::cscDetId(), runTauDisplay::gp, dqmiolumiharvest::j, CSCDetId::layer(), CSCChamber::layer(), phase1PixelTopology::layer, CSCRecHit2D::localPosition(), maxRatioResidual, nHits, protoSegment, CSCSegFit::Rdev(), sfit_, theChamber, GeomDet::toGlobal(), GeomDet::toLocal(), updateParameters(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by buildSegments().
|
override |
Here we must implement the algorithm
Definition at line 65 of file CSCSegAlgoDF.cc.
References buildSegments(), CSCSegAlgoPreClustering::clusterHits(), minHitsForPreClustering, nHits, 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 290 of file CSCSegAlgoDF.cc.
References addHit(), closeHits, compareProtoSegment(), h, hasHitOnLayer(), mps_fire::i, cuy::ib, isHitNearSegment(), phase1PixelTopology::layer, protoSegment, updateParameters(), and usedHits.
Referenced by buildSegments().
|
private |
Definition at line 448 of file CSCSegAlgoDF.cc.
References CSCSegFit::fit(), protoSegment, sfit_, and theChamber.
Referenced by buildSegments(), pruneFromResidual(), and tryAddingHitsToSegment().
|
private |
Definition at line 136 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 116 of file CSCSegAlgoDF.h.
Referenced by flagHitsAsUsed(), and tryAddingHitsToSegment().
|
private |
Definition at line 122 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), CSCSegAlgoDF(), runTauIdMVA.TauIDEmbedder::loadMVA_WPs_run2_2017(), and runTauIdMVA.TauIDEmbedder::runTauID().
|
private |
Definition at line 133 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and isHitNearSegment().
|
private |
Definition at line 132 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and isHitNearSegment().
|
private |
Definition at line 137 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and pruneFromResidual().
|
private |
Definition at line 124 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), and run().
|
private |
Definition at line 130 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 127 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 112 of file CSCSegAlgoDF.h.
|
private |
Definition at line 128 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 139 of file CSCSegAlgoDF.h.
Referenced by CSCSegAlgoDF(), run(), and ~CSCSegAlgoDF().
|
private |
Definition at line 123 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), CSCSegAlgoDF(), and run().
|
private |
Definition at line 118 of file CSCSegAlgoDF.h.
Referenced by addHit(), buildSegments(), compareProtoSegment(), flagHitsAsUsed(), hasHitOnLayer(), pruneFromResidual(), tryAddingHitsToSegment(), and updateParameters().
|
private |
Definition at line 126 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 119 of file CSCSegAlgoDF.h.
|
private |
Definition at line 141 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), isHitNearSegment(), pruneFromResidual(), and updateParameters().
|
private |
Definition at line 140 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), CSCSegAlgoDF(), and ~CSCSegAlgoDF().
|
private |
Definition at line 134 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 135 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), and CSCSegAlgoDF().
|
private |
Definition at line 113 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), compareProtoSegment(), dumpSegment(), isHitNearSegment(), pruneFromResidual(), run(), and updateParameters().
|
private |
Definition at line 114 of file CSCSegAlgoDF.h.
Referenced by buildSegments(), flagHitsAsUsed(), and tryAddingHitsToSegment().