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)
96 std::cout <<
"fit failed " <<
algo_ <<
": " << hits.size() <<
'|' << int(nLoops) <<
' ' << std::endl;
102 auto theTraj =
new Trajectory(std::move(trajTmp));
103 theTraj->setSeedRef(seedRef);
105 statCount.hits(theTraj->foundHits(),theTraj->lostHits());
106 statCount.algo(
int(
algo_));
116 for (
auto const & tm : theTraj->measurements()) {
117 auto const &
h = tm.recHitR();
118 if (
h.isValid()) ndof = ndof +
float(
h.dimension())*
h.weight();
128 for (
auto const & tm : theTraj->measurements()) {
130 auto const &
hit = tm.recHitR();
131 if (!
hit.isValid()) ++chit[0];
132 if (
hit.det()==
nullptr) ++chit[1];
134 if(0)
std::cout <<
"h " << kk <<
": "<<
hit.localPosition() <<
' ' <<
hit.localPositionError() <<
' ' << tm.estimate() << std::endl;
135 if (
hit.dimension()!=2 ) {
139 auto const & clus = thit.firstClusterRef();
140 if (clus.isPixel()) ++chit[3];
141 else if (thit.isMatched()) {
143 }
else if (thit.isProjected()) {
151 std::cout <<
algo_ <<
": " << hits.size() <<
'|' <<theTraj->measurements().size()<<
'|' << int(nLoops) <<
' ';
for (
auto c:chit)
std::cout <<
c <<
'/';
std::cout<< std::endl;
160 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
163 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
165 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
170 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
176 LogDebug(
"TrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
191 LogDebug(
"TrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
193 auto theTrack =
new reco::Track(theTraj->chiSquared(),
200 theTrack->setNLoops(nLoops);
202 LogDebug(
"TrackProducer") <<
"theTrack->pt()=" << theTrack->pt();
204 LogDebug(
"TrackProducer") <<
"track done\n";
206 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
207 algoResults.push_back(aProduct);
209 statCount.track(nLoops);
224 int qualityMask,
signed char nLoops)
233 auto theTraj =
new Trajectory( std::move(trajTmp) );
234 theTraj->setSeedRef(seedRef);
263 for (
auto const & tm : theTraj->measurements()) {
264 auto const &
h = tm.recHitR();
265 if (
h.isValid()) ndof = ndof +
h.dimension()*
h.weight();
277 stateForProjectionToBeamLineOnSurface = theTraj->closestMeasurement(
GlobalPoint(bs.
x0(),bs.
y0(),bs.
z0())).updatedState();
280 stateForProjectionToBeamLineOnSurface = theTraj->firstMeasurement().updatedState();
282 stateForProjectionToBeamLineOnSurface = theTraj->lastMeasurement().updatedState();
287 edm::LogError(
"CannotPropagateToBeamLine")<<
"the state on the closest measurement isnot valid. skipping track.";
294 LogDebug(
"GsfTrackProducer") <<
"stateForProjectionToBeamLine=" << stateForProjectionToBeamLine;
309 LogDebug(
"GsfTrackProducer") <<
"pos=" << v <<
" mom=" << p <<
" pt=" << p.
perp() <<
" mag=" << p.mag();
319 LogDebug(
"GsfTrackProducer") <<
"track done\n";
321 AlgoProduct aProduct(theTraj,std::make_pair(theTrack,seedDir));
322 LogDebug(
"GsfTrackProducer") <<
"track done1\n";
323 algoResults.push_back(aProduct);
324 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)
double x0() const
x coordinate