6 #include "boost/intrusive_ptr.hpp"
18 if(theData.back().recHit()->isValid()) {
19 theNumberOfFoundHits--;
20 theChiSquared -= theData.back().estimate();
22 else if(lost(* (theData.back().recHit()) )) {
23 theNumberOfLostHits--;
25 else if(isBad(* (theData.back().recHit()) ) && theData.back().recHit()->geographicalId().det()==
DetId::Muon ) {
26 theChiSquaredBad -= theData.back().estimate();
28 else if(badForCCC(theData.back())) theNumberOfCCCBadHits_--;
41 push( tm, tm.estimate());
47 theData.push_back(tm); pushAux(chi2Increment);
51 theData.push_back(tm); pushAux(chi2Increment);
57 if ( tm.
recHit()->isValid()) {
58 theChiSquared += chi2Increment;
59 theNumberOfFoundHits++;
62 else if (lost( *(tm.
recHit()) ) ) {
63 theNumberOfLostHits++;
67 theChiSquaredBad += chi2Increment;
70 else if (badForCCC(tm)) theNumberOfCCCBadHits_++;
75 if ( !theDirectionValidity && theData.size() >= 2) {
76 if (theData[0].updatedState().globalPosition().perp2() <
77 theData.back().updatedState().globalPosition().perp2())
80 theDirectionValidity =
true;
91 for(Trajectory::RecHitContainer::const_iterator rechit = transRecHits.begin();
92 rechit != transRecHits.end(); ++rechit) {
93 if((*rechit)->isValid())
94 dof += (*rechit)->dimension();
95 else if( isBad(**rechit) && (*rechit)->geographicalId().det()==
DetId::Muon )
96 dofBad += (*rechit)->dimension();
104 int constr = bon ? 5 : 4;
111 int constr = bon ? 5 : 4;
112 return std::max(dofBad - constr, 1);
118 hits.reserve(foundHits());
119 for (Trajectory::DataContainer::const_iterator itm
120 = theData.begin(); itm != theData.end(); itm++)
121 if ((*itm).recHit()->isValid()) hits.push_back((*itm).recHit());
126 if (theDirectionValidity)
return theDirection;
127 else throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::direction() requested but not set");
131 if ( theData.empty())
132 throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::check() - information requested from empty Trajectory");
137 if ( hit.
isValid())
return false;
153 if ( hit.
isValid())
return false;
171 thit->firstClusterRef().stripCluster(),
179 if (ccc_threshold == theCCCThreshold_)
182 theCCCThreshold_ = ccc_threshold;
183 theNumberOfCCCBadHits_ = 0;
184 for (
auto const &
h : theData) {
186 theNumberOfCCCBadHits_++;
191 updateBadForCCC(ccc_threshold);
192 return theNumberOfCCCBadHits_;
200 if ( firstMeasurement().updatedState().globalMomentum().
perp() > 1.0
201 && ( firstMeasurement().updatedState().globalPosition().basicVector().
dot( firstMeasurement().updatedState().globalMomentum().basicVector() ) *
202 lastMeasurement().updatedState().globalPosition().basicVector().
dot( lastMeasurement().updatedState().globalMomentum().basicVector() ) > 0 ) ) {
203 return (firstMeasurement().updatedState().globalPosition().
mag() < lastMeasurement().updatedState().globalPosition().
mag() ) ?
204 firstMeasurement().updatedState() : lastMeasurement().updatedState();
208 return closestMeasurement(
GlobalPoint(0.0,0.0,0.0)).updatedState();
223 edm::LogError(
"InvalidStateOnMeasurement")<<
"an updated state is not valid. result of LessMag comparator will be wrong.";
234 vector<TrajectoryMeasurement>::const_iterator iter = std::min_element(measurements().
begin(), measurements().
end(), LessMag(point) );
244 std::reverse(theData.begin(), theData.end());
ConstRecHitPointer const & recHit() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const LocalTrajectoryParameters & localParameters() const
void pushAux(double chi2Increment)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
bool badForCCC(const TrajectoryMeasurement &tm)
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
TrajectoryStateOnSurface geometricalInnermostState() const
PropagationDirection const & direction() const
uint32_t rawId() const
get the raw id
void updateBadForCCC(float ccc_threshold)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void validRecHits(ConstRecHitContainer &cont) const
int ndof(bool bon=true) const
ConstRecHitContainer RecHitContainer
static bool isBad(const TrackingRecHit &hit)
TrackingRecHit::ConstRecHitContainer ConstRecHitContainer
int numberOfCCCBadHits(float ccc_threshold)
T perp() const
Magnitude of transverse component.
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
void push(const TrajectoryMeasurement &tm)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
static bool lost(const TrackingRecHit &hit)