2 #include "boost/intrusive_ptr.hpp"
14 if(theData.back().recHit()->isValid()) {
15 theNumberOfFoundHits--;
16 theChiSquared -= theData.back().estimate();
18 else if(lost(* (theData.back().recHit()) )) {
19 theNumberOfLostHits--;
21 else if(isBad(* (theData.back().recHit()) ) && theData.back().recHit()->geographicalId().det()==
DetId::Muon ) {
22 theChiSquaredBad -= theData.back().estimate();
36 push( tm, tm.estimate());
42 theData.push_back(tm); pushAux(chi2Increment);
46 theData.push_back(tm); pushAux(chi2Increment);
52 if ( tm.
recHit()->isValid()) {
53 theChiSquared += chi2Increment;
54 theNumberOfFoundHits++;
57 else if (lost( *(tm.
recHit()) ) ) {
58 theNumberOfLostHits++;
62 theChiSquaredBad += chi2Increment;
68 if ( !theDirectionValidity && theData.size() >= 2) {
69 if (theData[0].updatedState().globalPosition().perp2() <
70 theData.back().updatedState().globalPosition().perp2())
73 theDirectionValidity =
true;
84 for(Trajectory::RecHitContainer::const_iterator rechit = transRecHits.begin();
85 rechit != transRecHits.end(); ++rechit) {
86 if((*rechit)->isValid())
87 dof += (*rechit)->dimension();
88 else if( isBad(**rechit) && (*rechit)->geographicalId().det()==
DetId::Muon )
89 dofBad += (*rechit)->dimension();
97 int constr = bon ? 5 : 4;
104 int constr = bon ? 5 : 4;
105 return std::max(dofBad - constr, 1);
111 hits.reserve(foundHits());
112 for (Trajectory::DataContainer::const_iterator itm
113 = theData.begin(); itm != theData.end(); itm++)
114 if ((*itm).recHit()->isValid()) hits.push_back((*itm).recHit());
119 if (theDirectionValidity)
return theDirection;
120 else throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::direction() requested but not set");
124 if ( theData.empty())
125 throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::check() - information requested from empty Trajectory");
130 if ( hit.
isValid())
return false;
146 if ( hit.
isValid())
return false;
160 if ( firstMeasurement().updatedState().globalMomentum().
perp() > 1.0
161 && ( firstMeasurement().updatedState().globalPosition().basicVector().
dot( firstMeasurement().updatedState().globalMomentum().basicVector() ) *
162 lastMeasurement().updatedState().globalPosition().basicVector().
dot( lastMeasurement().updatedState().globalMomentum().basicVector() ) > 0 ) ) {
163 return (firstMeasurement().updatedState().globalPosition().
mag() < lastMeasurement().updatedState().globalPosition().
mag() ) ?
164 firstMeasurement().updatedState() : lastMeasurement().updatedState();
168 return closestMeasurement(
GlobalPoint(0.0,0.0,0.0)).updatedState();
183 edm::LogError(
"InvalidStateOnMeasurement")<<
"an updated state is not valid. result of LessMag comparator will be wrong.";
194 vector<TrajectoryMeasurement>::const_iterator
iter = std::min_element(measurements().
begin(), measurements().
end(), LessMag(point) );
204 std::reverse(theData.begin(), theData.end());
ConstRecHitPointer const & recHit() const
void pushAux(double chi2Increment)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
TrajectoryStateOnSurface geometricalInnermostState() const
PropagationDirection const & direction() const
uint32_t rawId() const
get the raw id
bool check(const std::string &)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
int ndof(bool bon=true) const
ConstRecHitContainer RecHitContainer
static bool isBad(const TrackingRecHit &hit)
T perp() const
Magnitude of transverse component.
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
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)