41 long long totGsfTrack=0;
44 long long totAlgo[15];
46 if (l>0) ++totLoop;
else ++totTrack;
48 void hits(
int f,
int l) { totFound+=
f; totLost+=
l;}
49 void gsf() {++totGsfTrack;}
50 void algo(
int a) {
if (a>=0 && a<15) ++totAlgo[
a];}
54 std::cout <<
"TrackProducer stat\nTrack/Loop/Gsf/FoundHits/LostHits//algos "
55 << totTrack <<
'/'<< totLoop <<
'/'<< totGsfTrack <<
'/'<< totFound <<
'/'<< totLost<<
'/';
60 ~StatCount() {
print();}
71 [[cms::thread_safe]] StatCount statCount;
90 int qualityMask,
signed char nLoops)
100 std::cout <<
"fit failed " <<
algo_ <<
": " << hits.size() <<
'|' << int(nLoops) <<
' ' << std::endl;
107 theTraj->setSeedRef(seedRef);
109 statCount.hits(theTraj->foundHits(),theTraj->lostHits());
110 statCount.algo(
int(
algo_));
120 for (
auto const & tm : theTraj->measurements()) {
121 auto const &
h = tm.recHitR();
122 if (
h.isValid()) ndof = ndof +
float(
h.dimension())*
h.weight();
132 for (
auto const & tm : theTraj->measurements()) {
134 auto const &
hit = tm.recHitR();
135 if (!
hit.isValid()) ++chit[0];
136 if (
hit.det()==
nullptr) ++chit[1];
138 if(0)
std::cout <<
"h " << kk <<
": "<<
hit.localPosition() <<
' ' <<
hit.localPositionError() <<
' ' << tm.estimate() << std::endl;
139 if (
hit.dimension()!=2 ) {
143 auto const & clus = thit.firstClusterRef();
144 if (clus.isPixel()) ++chit[3];
145 else if (thit.isMatched()) {
147 }
else if (thit.isProjected()) {
155 std::cout <<
algo_ <<
": " << hits.size() <<
'|' <<theTraj->measurements().size()<<
'|' << int(nLoops) <<
' ';
for (
auto c:chit)
std::cout <<
c <<
'/';
std::cout<< std::endl;
164 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
167 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
169 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
174 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
180 LogDebug(
"TrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
189 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
192 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
206 LogDebug(
"TrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
208 auto theTrack =
new reco::Track(theTraj->chiSquared(),
216 theTrack->setQualityMask(qualityMask);
217 theTrack->setNLoops(nLoops);
220 LogDebug(
"TrackProducer") <<
"theTrack->pt()=" << theTrack->pt();
222 LogDebug(
"TrackProducer") <<
"track done\n";
224 AlgoProduct aProduct{theTraj,theTrack,seedDir,0};
225 algoResults.push_back(aProduct);
227 statCount.track(nLoops);
242 int qualityMask,
signed char nLoops)
252 theTraj->setSeedRef(seedRef);
281 for (
auto const & tm : theTraj->measurements()) {
282 auto const &
h = tm.recHitR();
283 if (
h.isValid()) ndof = ndof +
h.dimension()*
h.weight();
295 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
298 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
300 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
305 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
312 LogDebug(
"GsfTrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
320 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
323 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
337 LogDebug(
"GsfTrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
351 LogDebug(
"GsfTrackProducer") <<
"track done\n";
353 AlgoProduct aProduct{theTraj,theTrack,seedDir,0};
355 LogDebug(
"GsfTrackProducer") <<
"track done1\n";
356 algoResults.push_back(aProduct);
357 LogDebug(
"GsfTrackProducer") <<
"track done2\n";
PropagationDirection direction() const
double z0() const
z coordinate
bool geometricInnerState_
reco::TrackBase::AlgoMask algoMask_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
int nominalValue() const
The nominal field value for this map in kGauss.
reco::TrackBase::TrackAlgorithm originalAlgo_
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Global3DPoint GlobalPoint
std::vector< ConstRecHitPointer > RecHitContainer
TrackCharge charge() 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.
void setOriginalAlgorithm(const TrackAlgorithm a)
FreeTrajectoryState const * freeState(bool withErrors=true) const
Abs< T >::type abs(const T &t)
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
GlobalPoint position() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::TrackBase::TrackAlgorithm algo_
void setAlgorithm(const TrackAlgorithm a)
Track algorithm.
std::vector< AlgoProduct > AlgoProductCollection
double y0() const
y coordinate
bool isUndef(TrackingRecHit const &hit)
bool usePropagatorForPCA_
double x0() const
x coordinate