2 #include "boost/intrusive_ptr.hpp"
19 if(theData.back().recHit()->isValid()) {
20 theNumberOfFoundHits--;
21 theChiSquared -= theData.back().estimate();
23 else if(lost(* (theData.back().recHit()) )) {
24 theNumberOfLostHits--;
26 else if(isBad(* (theData.back().recHit()) ) && theData.back().recHit()->geographicalId().det()==
DetId::Muon ) {
27 theChiSquaredBad -= theData.back().estimate();
41 theData.push_back(tm);
42 if ( tm.
recHit()->isValid()) {
43 theChiSquared += chi2Increment;
44 theNumberOfFoundHits++;
47 else if (lost( *(tm.
recHit()) ) ) {
48 theNumberOfLostHits++;
52 theChiSquaredBad += chi2Increment;
58 if ( !theDirectionValidity && theData.size() >= 2) {
59 if (theData[0].updatedState().globalPosition().perp() <
60 theData.back().updatedState().globalPosition().perp())
63 theDirectionValidity =
true;
69 recHitsV(hits,splitting);
80 for(Trajectory::RecHitContainer::const_iterator rechit = transRecHits.begin();
81 rechit != transRecHits.end(); ++rechit) {
82 if((*rechit)->isValid())
83 dof += (*rechit)->dimension();
84 else if( isBad(**rechit) && (*rechit)->geographicalId().det()==
DetId::Muon )
85 dofBad += (*rechit)->dimension();
93 int constr = bon ? 5 : 4;
100 int constr = bon ? 5 : 4;
101 return std::max(dofBad - constr, 1);
108 hits.reserve(theData.size());
110 for (Trajectory::DataContainer::const_iterator itm
111 = theData.begin(); itm != theData.end(); itm++){
112 hits.push_back((*itm).recHit());
115 for (Trajectory::DataContainer::const_iterator itm
116 = theData.begin(); itm != theData.end(); itm++){
123 if(
typeid(*(itm->recHit()->hit())) ==
typeid(SiStripMatchedRecHit2D)){
125 itm->updatedState().surface().toLocal(itm->recHit()->transientHits()[0]->globalPosition());
128 itm->updatedState().surface().toLocal(itm->recHit()->transientHits()[1]->globalPosition());
130 LocalVector Delta = secondLocalPos - firstLocalPos;
131 float scalar = Delta.
z() * (itm->updatedState().localDirection().z());
141 if(!itm->recHit()->transientHits()[0]->detUnit()->type().isEndcap()){
142 hitA = itm->recHit()->transientHits()[0]->transientHits()[0];
143 hitB = itm->recHit()->transientHits()[1]->transientHits()[0];
145 hitA = itm->recHit()->transientHits()[0];
146 hitB = itm->recHit()->transientHits()[1];
151 hits.push_back(hitA);
152 hits.push_back(hitB);
155 hits.push_back(hitB);
156 hits.push_back(hitA);
160 <<
"Error in Trajectory::recHitsV: scalar = " << scalar
162 << theDirection <<
"\n";
163 hits.push_back(hitA);
164 hits.push_back(hitB);
168 if(!itm->recHit()->transientHits()[0]->detUnit()->type().isEndcap()){
169 hits.push_back(itm->recHit()->transientHits()[0]->transientHits()[0]);
171 hits.push_back(itm->recHit()->transientHits()[0]);
174 }
else if(
typeid(*(itm->recHit()->hit())) ==
typeid(SiStripRecHit2D)){
176 if(!itm->recHit()->detUnit()->type().isEndcap()){
177 hits.push_back(itm->recHit()->transientHits()[0]);
179 hits.push_back(itm->recHit());
182 hits.push_back(itm->recHit());
189 hits.reserve(foundHits());
190 for (Trajectory::DataContainer::const_iterator itm
191 = theData.begin(); itm != theData.end(); itm++)
192 if ((*itm).recHit()->isValid()) hits.push_back((*itm).recHit());
197 if (theDirectionValidity)
return theDirection;
198 else throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::direction() requested but not set");
202 if ( theData.empty())
203 throw cms::Exception(
"TrackingTools/PatternTools",
"Trajectory::check() - information requested from empty Trajectory");
208 if ( hit.
isValid())
return false;
224 if ( hit.
isValid())
return false;
238 if ( firstMeasurement().updatedState().globalMomentum().
perp() > 1.0
239 && ( firstMeasurement().updatedState().globalPosition().basicVector().
dot( firstMeasurement().updatedState().globalMomentum().basicVector() ) *
240 lastMeasurement().updatedState().globalPosition().basicVector().
dot( lastMeasurement().updatedState().globalMomentum().basicVector() ) > 0 ) ) {
241 return (firstMeasurement().updatedState().globalPosition().
mag() < lastMeasurement().updatedState().globalPosition().
mag() ) ?
242 firstMeasurement().updatedState() : lastMeasurement().updatedState();
246 return closestMeasurement(
GlobalPoint(0.0,0.0,0.0)).updatedState();
261 edm::LogError(
"InvalidStateOnMeasurement")<<
"an updated state is not valid. result of LessMag comparator will be wrong.";
272 vector<TrajectoryMeasurement>::const_iterator iter = std::min_element(measurements().
begin(), measurements().
end(), LessMag(point) );
282 std::reverse(theData.begin(), theData.end());
static bool lost(const TransientTrackingRecHit &hit)
ConstRecHitPointer const & recHit() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
TrajectoryStateOnSurface geometricalInnermostState() const
void recHitsV(ConstRecHitContainer &cont, bool splitting=false) const
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
ConstRecHitContainer recHits(bool splitting=false) const
PropagationDirection const & direction() const
uint32_t rawId() const
get the raw id
const T & max(const T &a, const T &b)
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void validRecHits(ConstRecHitContainer &cont) const
int ndof(bool bon=true) const
static bool isBad(const TransientTrackingRecHit &hit)
ConstRecHitContainer RecHitContainer
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
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .