20 RecSegment(buildDetId(proto_segment.front()->cscDetId())),
22 theLocalDirection(direction), theCovMatrix(errors), theChi2(chi2), aME11a_duplicate(
false) {
24 for(
unsigned int i=0;
i<proto_segment.size(); ++
i)
31 std::vector<const TrackingRecHit*> pointersOfRecHits;
33 pointersOfRecHits.push_back(&(*irh));
35 return pointersOfRecHits;
40 std::vector<TrackingRecHit*> pointersOfRecHits;
42 pointersOfRecHits.push_back(&(*irh));
44 return pointersOfRecHits;
88 for(
unsigned int i=0;
i<duplicates.size(); ++
i){
96 const std::vector<CSCRecHit2D>& specificRecHits_2,
98 const std::vector<CSCRecHit2D> * rhContainer_1 = &specificRecHits_1;
99 const std::vector<CSCRecHit2D> * rhContainer_2 = &specificRecHits_2;
100 if(specificRecHits_1.size()>specificRecHits_2.size()){
101 rhContainer_2 = &specificRecHits_1;
102 rhContainer_1 = &specificRecHits_2;
105 bool shareConditionPassed =
true;
106 for ( std::vector<CSCRecHit2D>::const_iterator itRH = rhContainer_1->begin();
107 itRH != rhContainer_1->end(); ++itRH) {
109 bool sharedHit =
false;
110 for ( std::vector<CSCRecHit2D>::const_iterator itRH2 = rhContainer_2->begin();
111 itRH2 != rhContainer_2->end(); ++itRH2) {
112 if(itRH2->sharesInput(firstRecHit,sharesInput)){
118 shareConditionPassed =
false;
122 return shareConditionPassed;
151 std::vector<float> wireTimes;
152 for (std::vector<CSCRecHit2D>::const_iterator itRH =
theCSCRecHits.begin();
155 averageTime+=recHit->
tpeak();
157 wireTimes.push_back(recHit->
wireTime());
166 std::vector<float>::iterator
maxHit;
167 for (std::vector<float>::iterator itWT=wireTimes.begin();
168 itWT!=wireTimes.end(); ++itWT) {
169 float diff=fabs(*itWT-averageTime);
177 averageTime=(averageTime*N-(*maxHit))/(N-1);
178 wireTimes.erase(maxHit);
LocalVector localDirection() const override
Local direction.
float tpeak() const
Fitted peaking time.
LocalError localDirectionError() const override
Error on the local direction.
const std::vector< CSCSegment > & duplicateSegments() const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
std::vector< CSCSegment > theDuplicateSegments
void setDuplicateSegments(std::vector< CSCSegment * > &duplicates)
static const AlgebraicMatrix theProjectionMatrix
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
~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
LocalPoint localPosition() const override
const std::vector< CSCRecHit2D > & specificRecHits() const
std::ostream & operator<<(std::ostream &os, const CSCSegment &seg)
CLHEP::HepVector AlgebraicVector
std::vector< CSCRecHit2D > theCSCRecHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
float maxDiff(float one, float two, float three, float four)
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
CSCSegment()
Default constructor.
AlgebraicMatrix createStaticMatrix()
LocalVector theLocalDirection
CLHEP::HepSymMatrix AlgebraicSymMatrix
double chi2() const override
Chi2 of the segment fit.
bool sharesRecHits(const CSCSegment &anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
LocalError localPositionError() const override