23 #define _debug_SimpleDAFHitCollector_ 29 LogTrace(
"MultiRecHitCollector") <<
" Calling SimpleDAFHitCollector::recHits" << std::endl;
33 const vector<TrajectoryMeasurement>& meas = traj.
measurements();
34 unsigned int hitcounter = 1;
37 return vector<TrajectoryMeasurement>();
39 LogTrace(
"MultiRecHitCollector") <<
" Original measurements are:";
44 vector<TrajectoryMeasurement>
result;
45 for (vector<TrajectoryMeasurement>::const_reverse_iterator itrajmeas = meas.rbegin(); itrajmeas < meas.rend();
46 itrajmeas++, hitcounter++) {
47 DetId id = itrajmeas->recHit()->geographicalId();
51 std::vector<const TrackingRecHit*>
hits;
52 std::vector<std::unique_ptr<const TrackingRecHit>> hitsOwner;
61 LogTrace(
"MultiRecHitCollector") <<
"Something wrong! no valid TSOS found in current group ";
67 if (hitcounter == meas.size())
68 combtsos = predtsos_fwd;
69 else if (hitcounter == 1)
70 combtsos = predtsos_bwd;
72 combtsos =
combiner(predtsos_bwd, predtsos_fwd);
75 if (measDet.
measurements(smoothtsos, *(getEstimator()), tmps)) {
76 LogTrace(
"MultiRecHitCollector") <<
" Found " << tmps.
size() <<
" compatible measurements";
78 for (std::size_t
i = 0;
i != tmps.
size(); ++
i) {
79 DetId idtemps = tmps.
hits[
i]->geographicalId();
81 if (idtemps ==
id && tmps.
hits[
i]->hit()->isValid()) {
82 LogTrace(
"MultiRecHitCollector") <<
" This is valid with position " << tmps.
hits[
i]->hit()->localPosition()
83 <<
" and error " << tmps.
hits[
i]->hit()->localPositionError();
87 auto righthit = rightdimension(*preciseHit);
89 hits.push_back(hitsOwner.back().get());
98 LogTrace(
"MultiRecHitCollector") <<
" -> but no valid hits found in current group.";
108 if (!itrajmeas->recHit()->isValid())
110 <<
" -> " << hits.size() <<
" valid hits for this sensor. (IT WAS INVALID!!!)";
112 LogTrace(
"MultiRecHitCollector") <<
" -> " << hits.size() <<
" valid hits for this sensor.";
115 result.push_back(
TrajectoryMeasurement(predtsos_fwd, theUpdator->buildMultiRecHit(hits, combtsos, measDet)));
118 LogTrace(
"MultiRecHitCollector") <<
" No measurements found in current group.";
129 LogTrace(
"MultiRecHitCollector") <<
" Ending SimpleDAFHitCollector::recHits >> " << result.size();
136 if (result.size() > 2) {
139 for (vector<TrajectoryMeasurement>::const_iterator iimeas = result.begin(); iimeas != result.end(); ++iimeas) {
140 if (iimeas->recHit()->isValid())
147 return vector<TrajectoryMeasurement>();
151 return vector<TrajectoryMeasurement>();
157 for (vector<TrajectoryMeasurement>::const_iterator itrajmeas = TM.begin(); itrajmeas < TM.end(); itrajmeas++) {
158 if (itrajmeas->recHit()->isValid()) {
159 LogTrace(
"MultiRecHitCollector") <<
" Valid Hit with DetId " << itrajmeas->recHit()->geographicalId().rawId()
161 << itrajmeas->recHit()->dimension()
163 <<
" local position " << itrajmeas->recHit()->hit()->localPosition()
164 <<
" global position " << itrajmeas->recHit()->hit()->globalPosition()
165 <<
" and r " << itrajmeas->recHit()->hit()->globalPosition().perp();
167 DetId hitId = itrajmeas->recHit()->geographicalId();
172 LogTrace(
"MultiRecHitCollector") <<
" I am TIB " << theTopology->tibLayer(hitId);
175 LogTrace(
"MultiRecHitCollector") <<
" I am TOB " << theTopology->tobLayer(hitId);
178 LogTrace(
"MultiRecHitCollector") <<
" I am TEC " << theTopology->tecWheel(hitId);
181 LogTrace(
"MultiRecHitCollector") <<
" I am TID " << theTopology->tidWheel(hitId);
184 LogTrace(
"MultiRecHitCollector") <<
" I am PixBar " << theTopology->pxbLayer(hitId);
187 LogTrace(
"MultiRecHitCollector") <<
" I am PixFwd " << theTopology->pxfDisk(hitId);
190 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN TRACKER HIT TYPE ";
201 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN MUON HIT TYPE ";
203 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN HIT TYPE ";
205 LogTrace(
"MultiRecHitCollector") <<
" TSOS predicted_fwd " << itrajmeas->predictedState().localPosition();
206 LogTrace(
"MultiRecHitCollector") <<
" TSOS predicted_bwd " 207 << itrajmeas->backwardPredictedState().localPosition();
208 LogTrace(
"MultiRecHitCollector") <<
" TSOS smoothtsos " << itrajmeas->updatedState().localPosition();
210 LogTrace(
"MultiRecHitCollector") <<
" Invalid Hit with DetId " << itrajmeas->recHit()->geographicalId().rawId();
212 LogTrace(
"MultiRecHitCollector") <<
"\n";
static constexpr auto TEC
void Debug(const std::vector< TrajectoryMeasurement > TM) const
virtual const GeomDet & geomDet() const
DataContainer const & measurements() const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
const MeasurementDet & mdet() const
std::shared_ptr< TrackingRecHit const > RecHitPointer
static constexpr auto TIB
std::vector< TrajectoryMeasurement > recHits(const Trajectory &, const MeasurementTrackerEvent *theMTE) const override
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
static constexpr auto TID
constexpr Detector det() const
get the detector field from this detid