37 long long totGsfTrack=0;
40 long long totAlgo[12];
42 if (l>0) ++totLoop;
else ++totTrack;
44 void hits(
int f,
int l) { totFound+=
f; totLost+=
l;}
45 void gsf() {++totGsfTrack;}
46 void algo(
int a) {
if (a>=0 && a<12) ++totAlgo[
a];}
50 std::cout <<
"TrackProducer stat\nTrack/Loop/Gsf/FoundHits/LostHits/algos "
51 << totTrack <<
'/'<< totLoop <<
'/'<< totGsfTrack <<
'/'<< totFound <<
'/'<< totLost;
56 ~StatCount() {
print();}
67 [[cms::thread_safe]] StatCount statCount;
86 int qualityMask,
signed char nLoops)
97 std::cout <<
"fit failed " <<
algo_ <<
": " << hits.size() <<
'|' << int(nLoops) <<
' ' << std::endl;
107 statCount.algo(
int(
algo_));
118 auto const &
h = tm.recHitR();
119 if (
h.isValid()) ndof = ndof +
float(
h.dimension())*
h.weight();
131 auto const &
hit = tm.recHitR();
132 if (!
hit.isValid()) ++chit[0];
133 if (
hit.det()==
nullptr) ++chit[1];
135 if(0)
std::cout <<
"h " << kk <<
": "<<
hit.localPosition() <<
' ' <<
hit.localPositionError() <<
' ' << tm.estimate() << std::endl;
136 if (
hit.dimension()!=2 ) {
140 auto const & clus = thit.firstClusterRef();
141 if (clus.isPixel()) ++chit[3];
142 else if (thit.isMatched()) {
144 }
else if (thit.isProjected()) {
171 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
177 LogDebug(
"TrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
192 LogDebug(
"TrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
203 LogDebug(
"TrackProducer") <<
"theTrack->pt()=" << theTrack->
pt();
205 LogDebug(
"TrackProducer") <<
"track done\n";
207 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
208 algoResults.push_back(aProduct);
210 statCount.track(nLoops);
225 int qualityMask,
signed char nLoops)
236 theTraj =
new Trajectory( std::move(trajTmp) );
237 theTraj->setSeedRef(seedRef);
266 for (
auto const & tm : theTraj->measurements()) {
267 auto const &
h = tm.recHitR();
268 if (
h.isValid()) ndof = ndof +
h.dimension()*
h.weight();
280 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
283 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
285 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
290 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
297 LogDebug(
"GsfTrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
312 LogDebug(
"GsfTrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
322 LogDebug(
"GsfTrackProducer") <<
"track done\n";
324 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
325 LogDebug(
"GsfTrackProducer") <<
"track done1\n";
326 algoResults.push_back(aProduct);
327 LogDebug(
"GsfTrackProducer") <<
"track done2\n";
PropagationDirection direction() const
void setQualityMask(int qualMask)
double z0() const
z coordinate
bool geometricInnerState_
int nominalValue() const
The nominal field value for this map in kGauss.
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Global3DPoint GlobalPoint
std::vector< ConstRecHitPointer > RecHitContainer
TrackCharge charge() const
std::vector< AlgoProduct > AlgoProductCollection
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
const MagneticField * magneticField() const
const CurvilinearTrajectoryError & curvilinearError() const
bool buildTrack(const TrajectoryFitter *, const Propagator *, AlgoProductCollection &, TransientTrackingRecHit::RecHitContainer &, TrajectoryStateOnSurface &, const TrajectorySeed &, float, const reco::BeamSpot &, SeedRef seedRef=SeedRef(), int qualityMask=0, signed char nLoops=0)
Construct Tracks to be put in the event.
PropagationDirection const & direction() const
void setNLoops(signed char value)
DataContainer const & measurements() const
std::pair< Trajectory *, std::pair< reco::Track *, PropagationDirection > > AlgoProduct
double pt() const
track transverse momentum
TrajectoryMeasurement const & lastMeasurement() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
Abs< T >::type abs(const T &t)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
GlobalPoint position() const
TrajectoryMeasurement const & firstMeasurement() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::TrackBase::TrackAlgorithm algo_
void setSeedRef(const edm::RefToBase< TrajectorySeed > &seedRef)
void setAlgorithm(const TrackAlgorithm a, bool set=true)
position index
double y0() const
y coordinate
bool isUndef(TrackingRecHit const &hit)
TrajectoryStateOnSurface const & updatedState() const
double x0() const
x coordinate