41 long long totGsfTrack=0;
44 long long totAlgo[12];
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<12) ++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;
106 auto theTraj =
new Trajectory(std::move(trajTmp));
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(),
215 theTrack->setNLoops(nLoops);
217 LogDebug(
"TrackProducer") <<
"theTrack->pt()=" << theTrack->pt();
219 LogDebug(
"TrackProducer") <<
"track done\n";
221 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
222 algoResults.push_back(aProduct);
224 statCount.track(nLoops);
239 int qualityMask,
signed char nLoops)
248 auto theTraj =
new Trajectory( std::move(trajTmp) );
249 theTraj->setSeedRef(seedRef);
278 for (
auto const & tm : theTraj->measurements()) {
279 auto const &
h = tm.recHitR();
280 if (
h.isValid()) ndof = ndof +
h.dimension()*
h.weight();
292 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
295 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
297 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
302 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
309 LogDebug(
"GsfTrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
317 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
320 tscbl = tscblBuilder(stateForProjectionToBeamLine,bs);
334 LogDebug(
"GsfTrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
344 LogDebug(
"GsfTrackProducer") <<
"track done\n";
346 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
347 LogDebug(
"GsfTrackProducer") <<
"track done1\n";
348 algoResults.push_back(aProduct);
349 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
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.
std::pair< Trajectory *, std::pair< reco::Track *, PropagationDirection > > AlgoProduct
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
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, bool set=true)
Track algorithm.
double y0() const
y coordinate
bool isUndef(TrackingRecHit const &hit)
bool usePropagatorForPCA_
double x0() const
x coordinate