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());
154 }
else if (z1 < 0.) {
156 reverse(layerIndex.begin(), layerIndex.end());
172 return segmentInChamber;
174 segmentInChamber.push_back(segShower);
179 return segmentInChamber;
197 int layer1 = layerIndex[
i1 -
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;
321 int layer1 = layerIndex[
i1 -
ib];
322 int layer2 = layerIndex[
i2 -
ib];
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());
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
ChamberHitContainer protoSegment
std::vector< const CSCRecHit2D * > ChamberHitContainer
std::vector< const CSCRecHit2D * >::const_iterator ChamberHitContainerCIt
T getParameter(std::string const &) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
bool isHitNearSegment(const CSCRecHit2D *h) const
LocalPoint localPosition() const override
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
CSCSegAlgoPreClustering * preCluster_
CSCSegment showerSeg(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Geom::Phi< T > phi() const
LocalPoint intercept() const
ChamberHitContainer closeHits
bool addHit(const CSCRecHit2D *hit, int layer)
float yfit(float z) const
bool hasHitOnLayer(int layer) const
CSCSegAlgoDF(const edm::ParameterSet &ps)
Constructor.
CSCSegAlgoShowering * showering_
double chi2() const override
Chi2 of the segment fit.
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
T getUntrackedParameter(std::string const &, T const &) const
LocalVector localDirection() const override
Local direction.
void dumpSegment(const CSCSegment &seg) const
void updateParameters(void)
std::deque< bool > BoolContainer
void compareProtoSegment(const CSCRecHit2D *h, int layer)
std::vector< int > LayerIndex
Typedefs.
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
int minHitsForPreClustering
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalPoint localPosition() const override
LocalError localDirectionError() const override
Error on the local direction.
void flagHitsAsUsed(const ChamberHitContainer &rechitsInChamber)
void pruneFromResidual(void)
AlgebraicSymMatrix covarianceMatrix(void)
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
std::vector< std::vector< const CSCRecHit2D * > > clusterHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
clusterize
float xfit(float z) const
const Surface::PositionType & position() const
The position (origin of the R.F.)
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits) override
~CSCSegAlgoDF() override
Destructor.
const std::vector< CSCRecHit2D > & specificRecHits() const
LocalVector localdir() const
const CSCChamber * theChamber
CSCSetOfHits hits(void) const
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
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
float Rdev(float x, float y, float z) const
CSCDetId id() const
Get the (concrete) DetId.