30 #define _debug_SimpleDAFHitCollector_
36 LogTrace(
"MultiRecHitCollector") <<
" Calling SimpleDAFHitCollector::recHits" << std::endl;
40 const vector<TrajectoryMeasurement> meas = traj.
measurements();
41 unsigned int hitcounter = 1;
43 if (meas.empty())
return vector<TrajectoryMeasurement>();
45 LogTrace(
"MultiRecHitCollector") <<
" Original measurements are:";
50 vector<TrajectoryMeasurement>
result;
51 for(vector<TrajectoryMeasurement>::const_reverse_iterator itrajmeas = meas.rbegin(); itrajmeas < meas.rend();
52 itrajmeas++, hitcounter++) {
54 DetId id = itrajmeas->recHit()->geographicalId();
58 std::vector<const TrackingRecHit*> hits;
59 std::vector<std::unique_ptr<const TrackingRecHit>> hitsOwner;
68 LogTrace(
"MultiRecHitCollector") <<
"Something wrong! no valid TSOS found in current group ";
74 if (hitcounter == meas.size()) combtsos = predtsos_fwd;
75 else if (hitcounter == 1) combtsos = predtsos_bwd;
76 else combtsos =
combiner(predtsos_bwd, predtsos_fwd);
79 if( measDet.
measurements(smoothtsos, *(getEstimator()), tmps)){
81 LogTrace(
"MultiRecHitCollector") <<
" Found " << tmps.
size() <<
" compatible measurements";
83 for (std::size_t
i=0;
i!=tmps.
size(); ++
i){
85 DetId idtemps = tmps.
hits[
i]->geographicalId();
87 if( idtemps ==
id && tmps.
hits[
i]->hit()->isValid() ) {
88 LogTrace(
"MultiRecHitCollector") <<
" This is valid with position " << tmps.
hits[
i]->hit()->localPosition() <<
" and error " << tmps.
hits[
i]->hit()->localPositionError();
91 theUpdator->getBuilder()->build(tmps.
hits[
i]->hit());
93 auto righthit = rightdimension(*preciseHit);
94 hitsOwner.push_back(std::move(righthit));
95 hits.push_back(hitsOwner.back().get());
105 LogTrace(
"MultiRecHitCollector") <<
" -> but no valid hits found in current group.";
107 if( result.empty() )
continue;
114 if(!itrajmeas->recHit()->isValid())
115 LogTrace(
"MultiRecHitCollector") <<
" -> " << hits.size() <<
" valid hits for this sensor. (IT WAS INVALID!!!)";
116 else LogTrace(
"MultiRecHitCollector") <<
" -> " << hits.size() <<
" valid hits for this sensor.";
119 result.push_back(
TrajectoryMeasurement(predtsos_fwd,theUpdator->buildMultiRecHit(hits, combtsos, measDet)));
122 LogTrace(
"MultiRecHitCollector") <<
" No measurements found in current group.";
126 if( result.empty() )
continue;
135 LogTrace(
"MultiRecHitCollector") <<
" Ending SimpleDAFHitCollector::recHits >> " << result.size();
146 for (vector<TrajectoryMeasurement>::const_iterator iimeas = result.begin(); iimeas != result.end(); ++iimeas) {
147 if(iimeas->recHit()->isValid()) hitcounter++;
152 else return vector<TrajectoryMeasurement>();
155 else{
return vector<TrajectoryMeasurement>();}
163 for(vector<TrajectoryMeasurement>::const_iterator itrajmeas = TM.begin(); itrajmeas < TM.end();
165 if (itrajmeas->recHit()->isValid()){
167 LogTrace(
"MultiRecHitCollector") <<
" Valid Hit with DetId " << itrajmeas->recHit()->geographicalId().rawId() <<
" and dim:" << itrajmeas->recHit()->dimension()
169 <<
" local position " << itrajmeas->recHit()->hit()->localPosition()
170 <<
" global position " << itrajmeas->recHit()->hit()->globalPosition()
171 <<
" and r " << itrajmeas->recHit()->hit()->globalPosition().perp() ;
173 DetId hitId = itrajmeas->recHit()->geographicalId();
189 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN TRACKER HIT TYPE ";
199 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN MUON HIT TYPE ";
202 LogTrace(
"MultiRecHitCollector") <<
" UNKNOWN HIT TYPE ";
205 LogTrace(
"MultiRecHitCollector") <<
" TSOS predicted_fwd " << itrajmeas->predictedState().localPosition() ;
206 LogTrace(
"MultiRecHitCollector") <<
" TSOS predicted_bwd " << itrajmeas->backwardPredictedState().localPosition() ;
207 LogTrace(
"MultiRecHitCollector") <<
" TSOS smoothtsos " << itrajmeas->updatedState().localPosition() ;
209 LogTrace(
"MultiRecHitCollector") <<
" Invalid Hit with DetId " << itrajmeas->recHit()->geographicalId().rawId();
211 LogTrace(
"MultiRecHitCollector") <<
"\n";
void Debug(const std::vector< TrajectoryMeasurement > TM) const
unsigned int layer() const
layer id
virtual const GeomDet & geomDet() const
unsigned int layer() const
layer id
DataContainer const & measurements() const
virtual std::vector< TrajectoryMeasurement > recHits(const Trajectory &, const MeasurementTrackerEvent *theMTE) const override
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
const MeasurementDet & mdet() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
std::shared_ptr< TrackingRecHit const > RecHitPointer
unsigned int wheel() const
wheel id
tuple MeasurementTrackerEvent
unsigned int layer() const
layer id
Detector det() const
get the detector field from this detid
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
unsigned int wheel() const
wheel id