69 int nHits = rechits.size();
72 std::vector<CSCSegment> segments_temp;
76 std::vector<CSCSegment> testSegments;
79 for (std::vector<ChamberHitContainer>::iterator subrechits = clusteredHits.begin();
80 subrechits != clusteredHits.end();
85 segments_temp.insert(segments_temp.end(), segs.begin(), segs.end());
90 segments_temp.insert(segments_temp.end(), segs.begin(), segs.end());
112 std::vector<CSCSegment> segmentInChamber;
113 segmentInChamber.clear();
115 unsigned nHitInChamber = rechits.size();
122 if (nHitInChamber < 3)
123 return segmentInChamber;
128 size_t old_layer = 0;
129 for (
size_t i = 0;
i < nHitInChamber; ++
i) {
130 size_t this_layer = rechits[
i]->cscDetId().layer();
132 layerIndex[
i] = this_layer;
134 if (this_layer != old_layer) {
135 old_layer = this_layer;
144 return segmentInChamber;
151 reverse(layerIndex.begin(), layerIndex.end());
152 reverse(rechits.begin(), rechits.end());
154 }
else if (z1 < 0.) {
156 reverse(layerIndex.begin(), layerIndex.end());
157 reverse(rechits.begin(), rechits.end());
172 return segmentInChamber;
174 segmentInChamber.push_back(segShower);
179 return segmentInChamber;
193 if (usedHits[i1 - ib])
197 int layer1 = layerIndex[i1 -
ib];
204 if (usedHits[i2 - ib])
207 int layer2 = layerIndex[i2 -
ib];
220 float dz = gp2.
z() - gp1.
z();
221 float slope_u = (lp2.
x() - lp1.
x()) / dz;
222 float slope_v = (lp2.
y() - lp1.
y()) / dz;
264 segmentInChamber.push_back(
temp);
270 return segmentInChamber;
272 if (segmentInChamber.size() > 4)
273 return segmentInChamber;
281 return segmentInChamber;
313 if (
i == i1 ||
i == i2)
321 int layer1 = layerIndex[i1 -
ib];
322 int layer2 = layerIndex[i2 -
ib];
329 if (rechits.size() < 9) {
355 if (layer != layer1 && layer != layer2)
372 int layer = (*i)->cscDetId().layer();
386 float Hphi = Hgp.
phi();
397 float Sphi = Sgp.
phi();
400 float R =
sqrt(Sgp.
x() * Sgp.
x() + Sgp.
y() * Sgp.
y());
403 if (deltaPhi > 2. *
M_PI)
404 deltaPhi -= 2. *
M_PI;
405 if (deltaPhi < -2. *
M_PI)
406 deltaPhi += 2. *
M_PI;
471 if ((*it)->cscDetId().layer() ==
layer)
488 ChamberHitContainer::iterator it;
490 if ((*it)->cscDetId().layer() ==
layer) {
530 for (iu = ib; iu != rechitsInChamber.end(); ++iu) {
541 for (iu = ib; iu != rechitsInChamber.end(); ++iu) {
556 float maxResidual = 0.;
557 float sumResidual = 0.;
562 ChamberHitContainer::const_iterator ih;
572 sumResidual += residual;
574 if (residual > maxResidual) {
575 maxResidual = residual;
581 float corrAvgResidual = (sumResidual - maxResidual) / (nHits - 1);
594 newProtoSegment.push_back(*ih);
600 for (ih = newProtoSegment.begin(); ih != newProtoSegment.end(); ++ih) {
615 <<
"\ntime = " << seg.
time();
void tryAddingHitsToSegment(const ChamberHitContainer &rechitsInChamber, const ChamberHitContainerCIt i1, const ChamberHitContainerCIt i2, const LayerIndex &layerIndex)
Utility functions.
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
ChamberHitContainer protoSegment
std::vector< const CSCRecHit2D * > ChamberHitContainer
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
CSCSetOfHits hits(void) const
CSCDetId cscDetId() const
LocalPoint localPosition() const override
LocalVector localdir() const
CSCDetId id() const
Get the (concrete) DetId.
CSCSegAlgoPreClustering * preCluster_
CSCSegment showerSeg(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
ChamberHitContainer closeHits
float Rdev(float x, float y, float z) const
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
bool addHit(const CSCRecHit2D *hit, int layer)
bool isHitNearSegment(const CSCRecHit2D *h) const
CSCSegAlgoDF(const edm::ParameterSet &ps)
Constructor.
CSCSegAlgoShowering * showering_
double chi2() const override
Chi2 of the segment fit.
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
LocalVector localDirection() const override
Local direction.
void updateParameters(void)
std::deque< bool > BoolContainer
const Surface::PositionType & position() const
The position (origin of the R.F.)
void compareProtoSegment(const CSCRecHit2D *h, int layer)
void dumpSegment(const CSCSegment &seg) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
std::vector< int > LayerIndex
Typedefs.
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
float xfit(float z) const
const std::vector< CSCRecHit2D > & specificRecHits() const
int minHitsForPreClustering
LocalPoint localPosition() const override
LocalError localDirectionError() const override
Error on the local direction.
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber)
void pruneFromResidual(void)
AlgebraicSymMatrix covarianceMatrix(void)
T getParameter(std::string const &) const
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
std::vector< std::vector< const CSCRecHit2D * > > clusterHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
clusterize
LocalPoint intercept() const
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
~CSCSegAlgoDF() override
Destructor.
const CSCChamber * theChamber
LocalError localPositionError() const override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
int nHitsPerClusterIsShower
bool hasHitOnLayer(int layer) const
float yfit(float z) const