20 :
RecSegment(buildDetId(proto_segment.front()->cscDetId())),
22 theLocalDirection(direction),
25 aME11a_duplicate(
false) {
26 for (
unsigned int i = 0;
i < proto_segment.size(); ++
i)
33 std::vector<const TrackingRecHit*> pointersOfRecHits;
35 pointersOfRecHits.push_back(&(*irh));
37 return pointersOfRecHits;
41 std::vector<TrackingRecHit*> pointersOfRecHits;
43 pointersOfRecHits.push_back(&(*irh));
45 return pointersOfRecHits;
85 for (
unsigned int i = 0;
i < duplicates.size(); ++
i) {
93 const std::vector<CSCRecHit2D>& specificRecHits_2,
95 const std::vector<CSCRecHit2D>* rhContainer_1 = &specificRecHits_1;
96 const std::vector<CSCRecHit2D>* rhContainer_2 = &specificRecHits_2;
97 if (specificRecHits_1.size() > specificRecHits_2.size()) {
98 rhContainer_2 = &specificRecHits_1;
99 rhContainer_1 = &specificRecHits_2;
102 bool shareConditionPassed =
true;
103 for (std::vector<CSCRecHit2D>::const_iterator itRH = rhContainer_1->begin(); itRH != rhContainer_1->end(); ++itRH) {
105 bool sharedHit =
false;
106 for (std::vector<CSCRecHit2D>::const_iterator itRH2 = rhContainer_2->begin(); itRH2 != rhContainer_2->end();
108 if (itRH2->sharesInput(firstRecHit, sharesInput)) {
114 shareConditionPassed =
false;
118 return shareConditionPassed;
145 float averageTime = 0;
146 std::vector<float> wireTimes;
149 averageTime += recHit->
tpeak();
151 wireTimes.push_back(recHit->
wireTime());
156 bool modified =
true;
160 std::vector<float>::iterator maxHit;
161 for (std::vector<float>::iterator itWT = wireTimes.begin(); itWT != wireTimes.end(); ++itWT) {
162 float diff = fabs(*itWT - averageTime);
163 if (diff > maxDiff) {
170 averageTime = (averageTime * N - (*maxHit)) / (N - 1);
171 wireTimes.erase(maxHit);
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
LocalPoint localPosition() const override
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
float tpeak() const
Fitted peaking time.
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
std::vector< CSCSegment > theDuplicateSegments
void setDuplicateSegments(std::vector< CSCSegment * > &duplicates)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static const AlgebraicMatrix theProjectionMatrix
double chi2() const override
Chi2 of the segment fit.
LocalVector localDirection() const override
Local direction.
~CSCSegment() override
Destructor.
bool testSharesAllInSpecificRecHits(const std::vector< CSCRecHit2D > &specificRecHits_1, const std::vector< CSCRecHit2D > &specificRecHits_2, CSCRecHit2D::SharedInputType) const
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicSymMatrix theCovMatrix
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
const std::vector< CSCRecHit2D > & specificRecHits() const
LocalError localDirectionError() const override
Error on the local direction.
CLHEP::HepVector AlgebraicVector
std::vector< CSCRecHit2D > theCSCRecHits
float maxDiff(float one, float two, float three, float four)
CSCSegment()
Default constructor.
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
AlgebraicMatrix createStaticMatrix()
const std::vector< CSCSegment > & duplicateSegments() const
LocalVector theLocalDirection
CLHEP::HepSymMatrix AlgebraicSymMatrix
bool sharesRecHits(const CSCSegment &anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const
LocalError localPositionError() const override