33 #define DPRINT(x) std::cout << x << ": "
35 #define DPRINT(x) LogTrace(x)
41 long long totTrack = 0;
42 long long totLoop = 0;
43 long long totGsfTrack = 0;
44 long long totFound = 0;
45 long long totLost = 0;
46 long long totAlgo[15];
57 void gsf() { ++totGsfTrack; }
64 std::cout <<
"TrackProducer stat\nTrack/Loop/Gsf/FoundHits/LostHits//algos " << totTrack <<
'/' << totLoop <<
'/'
65 << totGsfTrack <<
'/' << totFound <<
'/' << totLost <<
'/';
66 for (
auto a : totAlgo)
71 ~StatCount() {
print(); }
78 void hits(
int,
int) {}
90 AlgoProductCollection& algoResults,
108 DPRINT(
"TrackFitters") <<
"fit failed " <<
algo_ <<
": " <<
hits.size() <<
'|' <<
int(nLoops) <<
' ' << std::endl;
113 theTraj->setSeedRef(seedRef);
115 statCount.hits(theTraj->foundHits(), theTraj->lostHits());
116 statCount.algo(
int(
algo_));
126 for (
auto const& tm : theTraj->measurements()) {
127 auto const&
h = tm.recHitR();
129 ndof =
ndof +
float(
h.dimension()) *
h.weight();
136 #if defined(VI_DEBUG) || defined(EDM_ML_DEBUG)
139 for (
auto const& tm : theTraj->measurements()) {
141 auto const&
hit = tm.recHitR();
144 if (
hit.det() ==
nullptr)
149 std::cout <<
"h " <<
kk <<
": " <<
hit.localPosition() <<
' ' <<
hit.localPositionError() <<
' ' << tm.estimate()
151 if (
hit.dimension() != 2) {
154 auto const& thit = static_cast<BaseTrackerRecHit const&>(
hit);
155 auto const& clus = thit.firstClusterRef();
158 else if (thit.isMatched()) {
160 }
else if (thit.isProjected()) {
168 std::ostringstream
ss;
169 ss <<
algo_ <<
": " <<
hits.size() <<
'|' << theTraj->measurements().size() <<
'|' <<
int(nLoops) <<
' ';
173 DPRINT(
"TrackProducer") <<
ss.str();
182 stateForProjectionToBeamLineOnSurface =
183 theTraj->closestMeasurement(
GlobalPoint(
bs.x0(),
bs.y0(),
bs.z0())).updatedState();
186 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
188 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
194 edm::LogError(
"CannotPropagateToBeamLine") <<
"the state on the closest measurement isnot valid. skipping track.";
200 LogDebug(
"TrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
209 tscbl = tscblBuilder(stateForProjectionToBeamLine,
bs);
212 tscbl = tscblBuilder(stateForProjectionToBeamLine,
bs);
226 LogDebug(
"TrackProducer") <<
"pos=" <<
v <<
" mom=" <<
p <<
" pt=" <<
p.perp() <<
" mag=" <<
p.mag();
228 auto theTrack =
new reco::Track(theTraj->chiSquared(),
240 theTrack->setQualityMask(qualityMask);
241 theTrack->setNLoops(nLoops);
244 LogDebug(
"TrackProducer") <<
"theTrack->pt()=" << theTrack->pt();
246 LogDebug(
"TrackProducer") <<
"track done\n";
248 AlgoProduct aProduct{theTraj, theTrack, seedDir, 0};
249 algoResults.push_back(aProduct);
251 statCount.track(nLoops);
259 AlgoProductCollection& algoResults,
267 signed char nLoops) {
276 theTraj->setSeedRef(seedRef);
283 innertsos = theTraj->firstMeasurement().updatedState();
284 outertsos = theTraj->lastMeasurement().updatedState();
286 innertsos = theTraj->lastMeasurement().updatedState();
287 outertsos = theTraj->firstMeasurement().updatedState();
289 std::ostringstream
ss;
291 std::vector<TrajectoryStateOnSurface>
const&
components = tsos.components();
292 auto sinTheta =
std::sin(tsos.globalMomentum().theta());
294 ss << ic.weight() <<
"/";
297 ss << ic.localParameters().vector()[0] / sinTheta <<
"/";
300 ss <<
std::sqrt(ic.localError().matrix()(0, 0)) / sinTheta <<
"/";
302 ss <<
"\ninner comps\n";
304 ss <<
"\nouter comps\n";
306 LogDebug(
"TrackProducer") <<
"Nr. of first / last states = " << innertsos.
components().size() <<
" "
311 for (
auto const& tm : theTraj->measurements()) {
312 auto const&
h = tm.recHitR();
326 stateForProjectionToBeamLineOnSurface =
327 theTraj->closestMeasurement(
GlobalPoint(
bs.x0(),
bs.y0(),
bs.z0())).updatedState();
330 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
332 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
338 edm::LogError(
"CannotPropagateToBeamLine") <<
"the state on the closest measurement isnot valid. skipping track.";
345 LogDebug(
"GsfTrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
353 tscbl = tscblBuilder(stateForProjectionToBeamLine,
bs);
356 tscbl = tscblBuilder(stateForProjectionToBeamLine,
bs);
370 LogDebug(
"GsfTrackProducer") <<
"pos=" <<
v <<
" mom=" <<
p <<
" pt=" <<
p.perp() <<
" mag=" <<
p.mag();
390 LogDebug(
"GsfTrackProducer") <<
"track done\n";
392 AlgoProduct aProduct{theTraj, theTrack, seedDir, 0};
394 LogDebug(
"GsfTrackProducer") <<
"track done1\n";
395 algoResults.push_back(aProduct);
396 LogDebug(
"GsfTrackProducer") <<
"track done2\n";