131 std::vector<Trajectory> FinalTrajectories;
164 LogDebug(
"RoadSearch") <<
"Clean Clouds input size: " << input->size();
166 <<
"*** NEW EVENT: Clean Clouds input size: " << input->size() << std::endl;
169 for ( RoadSearchCloudCollection::const_iterator cloud = input->begin(); cloud != input->end(); ++cloud ) {
174 std::vector<Trajectory> CloudTrajectories;
183 const unsigned int nlost_max = 2;
187 const unsigned int max_layers = 128;
190 std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > > RecHitsByLayer;
191 std::map<const DetLayer*, int> cloud_layer_reference;
192 std::map<const DetLayer*, int>::iterator hiter;
193 for(RoadSearchCloud::RecHitVector::const_iterator ihit = recHits.begin();
194 ihit != recHits.end(); ihit++) {
199 std::map<const DetLayer*, int>::const_iterator ilyr = cloud_layer_reference.find(thisLayer);
200 if (ilyr==cloud_layer_reference.end())
201 cloud_layer_reference.insert(std::make_pair( thisLayer, RecHitsByLayer.size()));
203 if (!RecHitsByLayer.empty() && RecHitsByLayer.back().first == thisLayer) {
204 RecHitsByLayer.back().second.push_back(*ihit);
207 if (ilyr != cloud_layer_reference.end()){
208 int ilayer = ilyr->second;
209 (RecHitsByLayer.begin()+ilayer)->
second.push_back(*ihit);
212 if (RecHitsByLayer.size() >= max_layers)
break;
213 lstereo[RecHitsByLayer.size()] =
false;
214 if ((*ihit)->localPositionError().yy()<1.)
lstereo[RecHitsByLayer.size()] =
true;
216 rhc.push_back(*ihit);
217 RecHitsByLayer.push_back(std::make_pair(thisLayer, rhc));
222 LogDebug(
"RoadSearch")<<
"Cloud #"<<i_c<<
" has "<<recHits.size()<<
" hits in "<<RecHitsByLayer.size()<<
" layers ";
223 if (
debug_)
std::cout <<
"Cloud "<<i_c<<
" has "<<recHits.size()<<
" hits in " <<RecHitsByLayer.size() <<
" layers " <<std::endl;;
229 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilhv = RecHitsByLayer.begin();
230 ilhv != RecHitsByLayer.end(); ++ilhv) {
231 std::cout<<
" Layer " << ilhv-RecHitsByLayer.begin() <<
" has " << ilhv->second.size() <<
" hits " << std::endl;
234 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilhv = RecHitsByLayer.begin();
235 ilhv != RecHitsByLayer.end(); ++ilhv) {
237 for (RoadSearchCloud::RecHitVector::const_iterator ihit = theLayerHits.begin();
238 ihit != theLayerHits.end(); ++ihit) {
244 << gp.
x() <<
" " << gp.
y() <<
" " << gp.
z()
245 <<
" in layer " << ilhv-RecHitsByLayer.begin()
246 <<
" is hit " << (ihit-theLayerHits.begin())+1
247 <<
" of " << theLayerHits.size() << std::endl;
252 << gp.
perp() <<
" " << gp.
z()
253 <<
" in layer " << ilhv-RecHitsByLayer.begin()
254 <<
" is hit " << (ihit-theLayerHits.begin())+1
255 <<
" of " << theLayerHits.size() << std::endl;
266 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr0 = RecHitsByLayer.begin();
267 ilyr0 != RecHitsByLayer.end(); ++ilyr0) {
269 unsigned int ilayer0 = (
unsigned int)(ilyr0-RecHitsByLayer.begin());
272 std::vector<Trajectory> ChunkTrajectories;
273 std::vector<Trajectory> CleanChunks;
274 bool all_chunk_layers_used =
false;
276 if (
debug_)
std::cout <<
"*** START NEW CHUNK --> layer range (" << ilyr0-RecHitsByLayer.begin()
277 <<
"-" << RecHitsByLayer.size()-1 <<
")";
289 std::multimap<int, const DetLayer*> layer_map;
290 std::map<const DetLayer*, int> layer_reference;
292 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilayer = ilyr0+1;
293 ilayer != RecHitsByLayer.end(); ++ilayer) {
294 layer_map.insert(std::make_pair(ilayer->second.size(), ilayer->first));
295 layer_reference.insert(std::make_pair(ilayer->first, ilayer-RecHitsByLayer.begin()));
299 std::cout<<std::endl<<
" Available layers are: " << std::endl;
300 for (std::multimap<int, const DetLayer*>::iterator ilm1 = layer_map.begin();
301 ilm1 != layer_map.end(); ++ilm1) {
302 std::map<const DetLayer*, int>::iterator ilr = layer_reference.find(ilm1->second);
303 if (ilr != layer_reference.end() &&
debug_)
304 std::cout <<
"Layer " << ilr->second <<
" with " << ilm1->first <<
" hits" <<std::endl;;
309 std::set<const DetLayer*> the_good_layers;
310 std::vector<const DetLayer*> the_middle_layers;
314 chooseStartingLayers(RecHitsByLayer,ilyr0,layer_map,the_good_layers,the_middle_layers,the_recHits_middle);
316 std::cout <<
" From new code... With " << the_good_layers.size() <<
" useful layers: ";
317 for (std::set<const DetLayer*>::iterator igl = the_good_layers.begin();
318 igl!= the_good_layers.end(); ++igl){
319 std::map<const DetLayer*, int>::iterator ilr = layer_reference.find(*igl);
320 if (ilr != layer_reference.end())
std::cout <<
" " << ilr->second;
323 std::cout <<
" From new code... and middle layers: ";
324 for (std::vector<const DetLayer*>::iterator iml = the_middle_layers.begin();
325 iml!= the_middle_layers.end(); ++iml){
326 std::map<const DetLayer*, int>::iterator ilr = layer_reference.find(*iml);
327 if (ilr != layer_reference.end())
std::cout <<
" " << ilr->second;
333 std::set<const DetLayer*> good_layers = the_good_layers;
334 unsigned int ngoodlayers = good_layers.size();
337 std::cout<<
"Found " << recHits_inner.size() <<
" inner hits and " << recHits_outer.size() <<
" outer hits" << std::endl;
340 std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > > goodHits;
342 std::set<const DetLayer*> skipped_layers;
343 std::map<int, const DetLayer*> skipped_layer_detmap;
346 goodHits.push_back(*ilyr0);
348 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr = ilyr0+1;
349 ilyr != RecHitsByLayer.end(); ++ilyr) {
350 if (good_layers.find(ilyr->first) != good_layers.end()){
351 goodHits.push_back(*ilyr);
354 skipped_layers.insert(ilyr->first);
355 std::map<const DetLayer*, int>::iterator ilr = layer_reference.find(ilyr->first);
356 if (ilr != layer_reference.end())
357 skipped_layer_detmap.insert(std::make_pair(ilr->second,ilyr->first));
359 if (
debug_)
std::cout<<
"Couldn't find thisLayer to insert into map..."<<std::endl;
364 for (RoadSearchCloud::RecHitVector::const_iterator innerHit = recHits_inner.begin();
365 innerHit != recHits_inner.end(); ++innerHit) {
371 RoadSearchCloud::RecHitVector::iterator middleHit, outerHit;
372 RoadSearchCloud::RecHitVector::iterator firstHit, lastHit;
377 firstHit = recHits_outer.begin();
378 lastHit = recHits_outer.end();
381 firstHit = recHits_outer.begin()+1;
382 lastHit = recHits_outer.end();
385 for (RoadSearchCloud::RecHitVector::iterator outerHit = firstHit; outerHit != lastHit; ++outerHit) {
389 middleHit = outerHit-1;
394 if (middleHitLayer == outerHitLayer)
continue;
399 std::map<const DetLayer*, int>::iterator ilro = layer_reference.find(outerHitLayer);
400 if (ilro != layer_reference.end()) {
401 std::cout <<
"Try trajectory with Inner Hit on Layer " << ilayer0 <<
" and " ;
402 std::cout <<
"Outer Hit on Layer " << ilro->second << std::endl;
409 std::map<const DetLayer*, int>::iterator ilrm = layer_reference.find(middleHitLayer);
410 std::map<const DetLayer*, int>::iterator ilro = layer_reference.find(outerHitLayer);
411 if (ilro != layer_reference.end() && ilrm != layer_reference.end()) {
412 std::cout <<
"Try trajectory with Hits on Layers " << ilayer0 <<
" , "
413 << ilrm->second <<
" and " << ilro->second << std::endl;
424 std::vector<Trajectory> rawTrajectories;
425 if (seedTraj.
isValid() && !seedTraj.
measurements().empty() ) rawTrajectories.push_back(seedTraj);
430 std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr_start = (goodHits.begin()+1);
431 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilhv = ilyr_start;
432 ilhv != goodHits.end(); ++ilhv) {
437 std::map<const DetLayer*, int>::iterator ilr = cloud_layer_reference.find(ilhv->first);
438 if (ilr != cloud_layer_reference.end())
439 std::cout <<
"extrapolating " << rawTrajectories.size()
440 <<
" trajectories to layer " << ilr->second
441 <<
" which has " << hits.size() <<
" hits " << std::endl;
444 std::vector<Trajectory>newTrajectories;
445 for (std::vector<Trajectory>::const_iterator it = rawTrajectories.begin();
446 it != rawTrajectories.end(); it++) {
447 if (
debug_)
std::cout <<
"extrapolating Trajectory #" << it-rawTrajectories.begin() << std::endl;
452 innerHitLayer, *outerHit, outerHitLayer);
453 if (theTrajectories.empty()) {
454 if (
debug_)
std::cout<<
" Could not add the hit in this layer " << std::endl;
456 std::cout <<
" --> trajectory " << it-rawTrajectories.begin()
457 <<
" has "<<it->recHits().size()<<
" hits after "
458 << (ilhv-ilyr_start+1) <<
" tested (ntested=" <<ntested<<
") "
459 <<
" --> misses="<< (ilhv-ilyr_start+1)-(it->recHits().size()-1)
460 <<
" but there are " << (goodHits.end() - ilhv)
461 <<
" more layers in first pass and "<< skipped_layers.size() <<
" skipped layers " <<std::endl;
466 if ((ilhv-ilyr_start+1)-(it->recHits().size()-1) <= nlost_max){
467 newTrajectories.push_back(*it);
471 for (std::vector<Trajectory>::const_iterator it = theTrajectories.begin();
472 it != theTrajectories.end(); it++) {
473 newTrajectories.push_back(*it);
477 rawTrajectories = newTrajectories;
478 if (newTrajectories.empty())
break;
480 if (rawTrajectories.size()==0){
482 if (
debug_)
std::cout<<
" --> yields ZERO raw trajectories!" << std::endl;
485 for (std::vector<Trajectory>::const_iterator it = rawTrajectories.begin();
486 it != rawTrajectories.end(); it++) {
487 std::cout <<
" --> yields trajectory with "<<it->recHits().size()<<
" hits with chi2="
488 <<it->chiSquared()<<
" and is valid? "<<it->isValid() <<std::endl;
491 std::vector<Trajectory> rawCleaned;
493 for (std::vector<Trajectory>::const_iterator itr = rawTrajectories.begin();
494 itr != rawTrajectories.end(); ++itr) {
496 if (!itr->isValid())
continue;
497 std::set<const DetLayer*> used_layers;
499 for (Trajectory::DataContainer::iterator itm = tmv.begin();
500 itm != tmv.end(); ++itm) {
502 if (!rh->isValid())
continue;
507 if (
debug_)
std::cout<<
"Used " << (used_layers.size()-1) <<
" layers out of " << ngoodlayers
508 <<
" good layers, so " << ngoodlayers - (used_layers.size()-1) <<
" missed "
510 if ((
int)used_layers.size() <
nFoundMin_)
continue;
511 unsigned int nlostlayers = ngoodlayers - (used_layers.size()-1);
512 if (nlostlayers > nlost_max)
continue;
514 rawCleaned.push_back(*itr);
517 if (!rawCleaned.empty()) {
518 ChunkTrajectories.insert(ChunkTrajectories.end(), rawCleaned.begin(), rawCleaned.end());
526 if (
debug_)
std::cout <<
"Clean the " << ChunkTrajectories.size()<<
" trajectories for this chunk" << std::endl;
529 for (std::vector<Trajectory>::const_iterator it = ChunkTrajectories.begin();
530 it != ChunkTrajectories.end(); it++) {
531 if (it->isValid()) CleanChunks.push_back(*it);
533 if (
debug_)
std::cout <<
"After cleaning there are " << CleanChunks.size() <<
" trajectories for this chunk" << std::endl;
542 std::vector<Trajectory> extendedChunks;
548 if (skipped_layers.empty()) {
549 std::cout <<
"all layers were used in first pass" << std::endl;
551 std::cout <<
"There are " << skipped_layer_detmap.size() <<
" skipped layers:";
552 for (std::map<int, const DetLayer*>::const_iterator imap = skipped_layer_detmap.begin();
553 imap!=skipped_layer_detmap.end(); imap++){
560 for (std::vector<Trajectory>::const_iterator
i = CleanChunks.begin();
561 i != CleanChunks.end();
i++) {
562 if (!(*i).isValid())
continue;
563 if (
debug_)
std::cout<<
"Now process CleanChunk trajectory " <<
i-CleanChunks.begin() << std::endl;
564 bool all_layers_used =
false;
565 if (skipped_layers.empty() &&
i->measurements().size() >=
theNumHitCut) {
567 <<
" hits from a cloud of " << RecHitsByLayer.size()
568 <<
" layers and a chunk of " << (RecHitsByLayer.size() - ilayer0) <<
" layers " << std::endl;
569 extendedChunks.insert(extendedChunks.end(), *
i);
570 if (
i->measurements().size() >= (RecHitsByLayer.size() - ilayer0)){
571 all_layers_used =
true;
579 if (tmv.size()+skipped_layer_detmap.size() <
theNumHitCut)
continue;
583 for (Trajectory::DataContainer::const_iterator ih=tmv.begin();
588 std::map<const DetLayer*, int>::iterator ilr = cloud_layer_reference.find(Layer);
589 if (ilr != cloud_layer_reference.end())
590 std::cout <<
" Hit #"<<ih-tmv.begin() <<
" of " << tmv.size()
591 <<
" is on Layer " << ilr->second << std::endl;
593 std::cout <<
" Layer for Hit #"<<ih-tmv.begin() <<
" can't be found " << std::endl;
594 std::cout<<
" updatedState:\n" << ih->updatedState() << std::endl;
595 std::cout<<
" predictState:\n" << ih->predictedState() << std::endl;
601 std::set<const DetLayer*> final_layers;
602 Trajectory::DataContainer::const_iterator im = tmv.begin();
603 Trajectory::DataContainer::const_iterator im2 = tmv.begin();
611 if(
debug_)
std::cout<<
"Smoothing has returned " << freshStartv.size() <<
" trajectory " << std::endl;
612 if (!freshStartv.empty()){
613 if(
debug_)
std::cout<<
"Smoothing of trajectory " <<
i-CleanChunks.begin() <<
" has succeeded with " << freshStartv.begin()->measurements().size() <<
" hits and a chi2 of " << freshStartv.begin()->chiSquared() <<
" for " << freshStartv.begin()->ndof() <<
" DOF. Now add hits." <<std::endl;
615 if (
debug_)
std::cout<<
"Smoothing of trajectory " <<
i-CleanChunks.begin() <<
" has failed"<<std::endl;
620 std::vector<TrajectoryMeasurement> freshStartTM = freshStart.
measurements();
623 for (std::vector<TrajectoryMeasurement>::const_iterator itm = freshStartTM.begin();itm != freshStartTM.end(); ++itm){
624 std::cout<<
"Trajectory hit " << itm-freshStartTM.begin() <<
" updatedState:\n" << itm->updatedState() << std::endl;
630 if(
debug_)
std::cout <<
" NewFirstTSOS:\n " << NewFirstTsos << std::endl;
634 std::cout<<
"First hit for fresh start on det " << rh->det() <<
", r/phi/z = " << rh->globalPosition().perp() <<
" " << rh->globalPosition().phi() <<
" " << rh->globalPosition().z();
638 rh->geographicalId().rawId());
656 final_layers.insert(firstDetLayer);
658 if(
debug_)
std::cout <<
"TRAJ is valid: " << newTrajectory.isValid() <<std::endl;
668 if (firstDetLayer != ilyr0->first){
669 if (
debug_)
std::cout<<
"!!! ERROR !!! firstDetLayer ("<<firstDetLayer<<
") != ilyr0 ( " <<ilyr0->first <<
")"<< std::endl;
674 std::map<const DetLayer*, int>::iterator ilr = cloud_layer_reference.find(firstDetLayer);
675 if (ilr != cloud_layer_reference.end() ){
676 std::cout <<
" First hit is on layer " << ilr->second << std::endl;
679 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr = ilyr0+1;
680 ilyr != RecHitsByLayer.end(); ++ilyr) {
687 std::cout<<
"Trajectory has " << newTrajectory.measurements().size() <<
" measurements with " << (RecHitsByLayer.end()-ilyr)
688 <<
" remaining layers " << std::endl;
690 if (im != tmv.end()) im2 = im;
695 if (
debug_)
std::cout<<
" Layer " << ilyr-RecHitsByLayer.begin() <<
" has a good hit " << std::endl;
700 currTsos = newTrajectory.measurements().back().updatedState();
701 predTsos = thePropagator->propagate(currTsos, det->
surface());
702 if (!predTsos.
isValid())
continue;
707 std::cout <<
"Propagation distance2 is " << propagationDistance.
mag() << std::endl;
708 std::cout <<
"predTSOS is valid!!" << std::endl;
719 if (
debug_)
std::cout<<
"Failed to add one of the original hits on a low occupancy layer!!!!" << std::endl;
733 newTrajectory.push(tm,est.second);
734 final_layers.insert(ilyr->first);
737 if (
debug_)
std::cout<<
" Layer " << ilyr-RecHitsByLayer.begin() <<
" is one of the skipped layers " << std::endl;
741 std::set<const GeomDet*> dets;
742 for (RoadSearchCloud::RecHitVector::const_iterator ih = ilyr->second.begin();
743 ih != ilyr->second.end(); ++ih) {
749 std::cout<<
" ---> probing missing hits (nh="<< skipped_hits.
size() <<
", nd=" << dets.size()
750 <<
") in layer " << ilyr-RecHitsByLayer.begin() <<std::endl;
760 if (!theGoodHits.empty()){
761 final_layers.insert(ilyr->first);
762 if (
debug_)
std::cout<<
"Found " << theGoodHits.size() <<
" good hits to add" << std::endl;
763 for (std::vector<TrajectoryMeasurement>::const_iterator im=theGoodHits.begin();im!=theGoodHits.end();++im){
764 newTrajectory.push(*im,im->estimate());
770 if (
debug_)
std::cout<<
"Finished loop over layers in cloud. Trajectory now has " <<newTrajectory.measurements().size()
771 <<
" hits. " << std::endl;
772 if (
debug_)
std::cout<<
"The trajectory has " << newTrajectory.measurements().size() <<
" hits on " << final_layers.size()
773 <<
" layers from a cloud of " << RecHitsByLayer.size()
774 <<
" layers and a chunk of " << (RecHitsByLayer.size() - ilayer0) <<
" layers " << std::endl;
775 if (newTrajectory.measurements().size() >=
theNumHitCut)
776 extendedChunks.insert(extendedChunks.end(), newTrajectory);
777 if (final_layers.size() >= (RecHitsByLayer.size() - ilayer0)){
778 if (
debug_)
std::cout<<
"All layers of the chunk have been used..." << std::endl;
779 all_layers_used =
true;
782 if (all_layers_used) {
783 if (
debug_)
std::cout <<
"All layers were used, so break....." << std::endl;
784 all_chunk_layers_used =
true;
789 if (
debug_)
std::cout<<
"Now Clean the " << extendedChunks.size() <<
" extended chunks " <<std::endl;
791 for (std::vector<Trajectory>::const_iterator it = extendedChunks.begin();
792 it != extendedChunks.end(); it++) {
793 if (it->isValid()) CloudTrajectories.push_back(*it);
795 if (all_chunk_layers_used)
break;
801 << CloudTrajectories.size() <<
" cloud trajectories "<<std::endl ;
803 for (std::vector<Trajectory>::const_iterator it = CloudTrajectories.begin();
804 it != CloudTrajectories.end(); it++) {
805 if (it->isValid()) FinalTrajectories.push_back(*it);
808 if (
debug_)
std::cout<<
" Final trajectories now has size " << FinalTrajectories.size()<<std::endl ;
829 std::vector<TrajectoryMeasurement>
831 const std::set<const GeomDet*>& theDets,
837 std::vector<TrajectoryMeasurement> theBestHits;
840 std::map<const GeomDet*, TrajectoryStateOnSurface> dmmap;
841 for (std::set<const GeomDet*>::iterator idet = theDets.begin();
842 idet != theDets.end(); ++idet) {
847 dmmap.insert(std::make_pair(*idet, predTsos));
851 std::map<const GeomDet*, TrajectoryMeasurement> dtmmap;
853 ih != theHits.
end(); ++ih) {
856 std::map<const GeomDet*, TrajectoryStateOnSurface>::iterator idm = dmmap.find(det);
857 if (idm == dmmap.end())
continue;
865 std::map<const GeomDet*, TrajectoryMeasurement>::iterator idtm = dtmmap.find(det);
866 if (idtm == dtmmap.end()) {
869 dtmmap.insert(std::make_pair(det, tm));
870 }
else if (idtm->second.estimate() > est.second) {
874 dtmmap.insert(std::make_pair(det, tm));
879 if (!dtmmap.empty()) {
880 for (std::map<const GeomDet*, TrajectoryMeasurement>::iterator idtm = dtmmap.begin();
881 idtm != dtmmap.end(); ++idtm) {
883 theBestHits.push_back(itm);
891 std::vector<TrajectoryMeasurement>
893 const std::set<const GeomDet*>& theDets,
897 std::vector<TrajectoryMeasurement> theBestHits;
899 double bestchi = 10000.0;
901 std::map<const GeomDet*, TrajectoryStateOnSurface> dmmap;
902 for (std::set<const GeomDet*>::iterator idet = theDets.begin();
903 idet != theDets.end(); ++idet) {
908 dmmap.insert(std::make_pair(*idet, predTsos));
912 std::map<const GeomDet*, TrajectoryMeasurement> dtmmap;
914 ih != theHits.
end(); ++ih) {
917 std::map<const GeomDet*, TrajectoryStateOnSurface>::iterator idm = dmmap.find(det);
918 if (idm == dmmap.end())
continue;
926 if (est.second < bestchi){
927 if(!theBestHits.empty()){
928 theBestHits.erase(theBestHits.begin());
930 bestchi = est.second;
933 theBestHits.push_back(tm);
938 if (theBestHits.empty()){
942 for (std::vector<TrajectoryMeasurement>::const_iterator im=theBestHits.begin();im!=theBestHits.end();++im)
945 <<
" with estimate " << im->estimate()<<std::endl ;
951 std::vector<TrajectoryMeasurement>
953 const std::set<const GeomDet*>& theDets,
960 std::vector<TrajectoryMeasurement> theBestHits;
966 std::map<const GeomDet*, TrajectoryStateOnSurface> dmmap;
967 for (std::set<const GeomDet*>::iterator idet = theDets.begin();
968 idet != theDets.end(); ++idet) {
973 dmmap.insert(std::make_pair(*idet, predTsos));
977 if(
debug_)
std::cout <<
"TRAJECTORY INTERSECTS " << dmmap.size() <<
" DETECTORS." << std::endl;
980 std::map<const GeomDet*, TrajectoryMeasurement> dtmmap;
986 std::map<const GeomDet*, TrajectoryStateOnSurface>::iterator idm = dmmap.find(det);
987 if (idm == dmmap.end())
continue;
991 const SiStripMatchedRecHit2D *origHit =
dynamic_cast<const SiStripMatchedRecHit2D *
>(&(*ih));
994 const SiStripMatchedRecHit2D *corrHit = theHitMatcher->
match(origHit,gdet,predTsos.
localDirection());
1005 std::cout <<
"rhit local position x: " << rhit->localPosition().x() <<
"+-" <<
sqrt(rhit->localPositionError().xx()) << std::endl;
1006 std::cout <<
"rhit local position y: " << rhit->localPosition().y() <<
"+-" <<
sqrt(rhit->localPositionError().yy()) << std::endl;
1011 <<
": est = " << est.first <<
" " << est.second <<std::endl;
1018 std::map<const GeomDet*, TrajectoryMeasurement>::iterator idtm = dtmmap.find(det);
1019 if (idtm == dtmmap.end()) {
1022 dtmmap.insert(std::make_pair(det, tm));
1023 }
else if (idtm->second.estimate() > est.second) {
1027 dtmmap.insert(std::make_pair(det, tm));
1034 else if (!firstTM) {
1036 if (est.second < theBestTM.
estimate()) {
1044 if (
debug_)
std::cout<<
"Hits(Dets) to add: " << dtmmap.size() <<std::endl;
1045 if (!dtmmap.empty()) {
1047 std::vector<std::pair<TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement*> > OverlapHits;
1048 for (std::map<const GeomDet*, TrajectoryMeasurement>::iterator idtm = dtmmap.begin();
1049 idtm != dtmmap.end(); ++idtm) {
1050 OverlapHits.push_back(std::make_pair(idtm->second.recHit(),&idtm->second));
1054 <<
" with estimate " << idtm->second.estimate()<<std::endl ;
1057 std::cout<<
" Best Measurement is on layer "
1059 <<
" with estimate " << theBestTM.
estimate()<<std::endl ;
1062 if (dtmmap.size()==1){
1063 for (std::map<const GeomDet*, TrajectoryMeasurement>::iterator idtm = dtmmap.begin();
1064 idtm != dtmmap.end(); ++idtm) {
1068 <<
" with estimate " << itm.
estimate()<<std::endl ;
1069 theBestHits.push_back(itm);
1072 else if (dtmmap.size()>=2) {
1074 if (
debug_)
std::cout<<
"Unsorted OverlapHits has size " <<OverlapHits.size() << std::endl;
1076 for (std::vector<std::pair<TransientTrackingRecHit::ConstRecHitPointer,TrajectoryMeasurement*> >::iterator irh =OverlapHits.begin();
1077 irh!=OverlapHits.end();++irh){
1079 <<
" on det " << irh->first->det()
1083 << irh->first->globalPosition().perp() <<
" "
1084 << irh->first->globalPosition().phi() <<
" "
1085 << irh->first->globalPosition().z()
1090 if (
debug_)
std::cout<<
"Sorted OverlapHits has size " <<OverlapHits.size() << std::endl;
1092 float workingBestChi2 = 1000000.0;
1093 std::vector<TrajectoryMeasurement> workingBestHits;
1095 std::vector<std::pair<TransientTrackingRecHit::ConstRecHitPointer,TrajectoryMeasurement*> >::iterator irh1;
1096 std::vector<std::pair<TransientTrackingRecHit::ConstRecHitPointer,TrajectoryMeasurement*> >::iterator irh2;
1097 for (irh1 =OverlapHits.begin(); irh1!=--OverlapHits.end(); ++irh1){
1098 theBestHits.clear();
1099 float running_chi2=0;
1101 <<
" on det " << irh1->first->det()
1106 << irh1->first->globalPosition().perp() <<
" "
1107 << irh1->first->globalPosition().phi() <<
" "
1108 << irh1->first->globalPosition().z()
1113 theBestHits.push_back(*(irh1->second));
1114 if (
debug_)
std::cout<<
"Added first hit with chi2 = " << irh1->second->estimate() << std::endl;
1115 running_chi2 += irh1->second->estimate();
1116 for (irh2 = irh1; irh2!=OverlapHits.end(); ++irh2){
1117 if (irh2 == irh1)
continue;
1119 const GeomDet* det = irh2->first->det();
1125 if (
debug_)
std::cout<<
"Added overlap hit with est = " << est.first <<
" " << est.second << std::endl;
1129 theBestHits.push_back(tm);
1130 running_chi2 += est.second ;
1137 if (theBestHits.size()==dtmmap.size()){
1138 if (
debug_)
std::cout<<
"Added all "<<theBestHits.size()<<
" hits out of " << dtmmap.size() << std::endl;
1142 if (theBestHits.size() < dtmmap.size()){
1143 if (
debug_)
std::cout<<
"Added only "<<theBestHits.size()<<
" hits out of " << dtmmap.size() << std::endl;
1145 if (theBestHits.size() > workingBestHits.size()){
1146 if (
debug_)
std::cout<<
"Current combo has more hits so replace best" << std::endl;
1147 workingBestHits = theBestHits;
1150 else if (theBestHits.size() == workingBestHits.size()){
1151 if (running_chi2< workingBestChi2){
1152 if (
debug_)
std::cout<<
"Current combo has same # of hits but lower chi2 so replace best" << std::endl;
1153 workingBestHits = theBestHits;
1154 workingBestChi2 = running_chi2;
1159 if (theBestHits.size()<2){
1162 << theBestTM.
recHit()->det()
1166 << theBestTM.
recHit()->globalPosition().perp() <<
" "
1167 << theBestTM.
recHit()->globalPosition().phi() <<
" "
1168 << theBestTM.
recHit()->globalPosition().z()
1169 <<
" with estimate " << theBestTM.
estimate()<<std::endl ;
1170 theBestHits.clear();
1171 theBestHits.push_back(theBestTM);
1176 if (
debug_)
std::cout <<
"ERROR: Unexpected size from DTMMAP = " << dtmmap.size() << std::endl;
1177 theBestHits.push_back(theBestTM);
1188 std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr0,
1189 const std::multimap<int, const DetLayer*>& layer_map,
1190 std::set<const DetLayer*>& good_layers,
1191 std::vector<const DetLayer*>& middle_layers ,
1194 const unsigned int max_middle_layers = 2;
1201 std::multimap<int, const DetLayer*>::const_iterator ilm = layer_map.begin();
1202 int ngoodlayers = 0;
1203 while (ilm != layer_map.end()) {
1204 if (ngoodlayers >=
nFoundMin_ && ilm->first > 1)
break;
1206 good_layers.insert(ilm->second);
1212 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilayer = ilyr0+1;
1213 ilayer != recHitsByLayer.end(); ++ilayer) {
1215 if (good_layers.find(ilayer->first) == good_layers.end())
continue;
1218 middle_layers.push_back(ilayer->first);
1219 if (middle_layers.size() >= max_middle_layers)
break;
1222 for (std::vector<const DetLayer*>::iterator ml = middle_layers.begin();
1223 ml!=middle_layers.end();++ml){
1224 unsigned int middle_layers_found = 0;
1225 for (std::vector<std::pair<const DetLayer*, RoadSearchCloud::RecHitVector > >::iterator ilyr = recHitsByLayer.begin();
1226 ilyr != recHitsByLayer.end(); ++ilyr) {
1227 if (ilyr->first == *ml){
1228 for (RoadSearchCloud::RecHitVector::const_iterator ih = ilyr->second.begin();
1229 ih != ilyr->second.end(); ++ih) {
1230 recHits_middle.push_back(*ih);
1232 ++middle_layers_found;
1234 if (middle_layers_found == middle_layers.size())
continue;
1238 return (recHits_middle.size()>0);
1250 LogDebug(
"RoadSearch") <<
"inner hit: r/phi/z = "<< inner.
perp() <<
" " << inner.
phi() <<
" " << inner.
z() ;
1251 LogDebug(
"RoadSearch") <<
"outer hit: r/phi/z = "<< outer.
perp() <<
" " << outer.
phi() <<
" " << outer.
z() ;
1254 const double dRmin = 0.1;
1255 if (outer.
perp() - inner.
perp() < dRmin)
return fts;
1260 const double dz2 = 5.3*5.3;
1264 double z_0 = -linearFit.
c()/linearFit.
n2();
1275 double x0=0.0,y0=0.0,z0=0.0;
1276 double phi0 = -999.0;
1278 phi0=atan2(outer.
y()-inner.
y(),outer.
x()-inner.
x());
1280 if (inner.
y()<outer.
y()){
1285 double alpha=atan2(inner.
y(),inner.
x());
1286 double d1=
sqrt(inner.
x()*inner.
x()+inner.
y()*inner.
y());
1287 double d0=-d1*
sin(alpha-phi0); x0=d0*
sin(phi0); y0=-d0*
cos(phi0);
1288 double l1=0.0,l2=0.0;
1289 if (fabs(
cos(phi0))>0.1){
1290 l1=(inner.
x()-x0)/
cos(phi0);l2=(outer.
x()-x0)/
cos(phi0);
1292 l1=(inner.
y()-y0)/
sin(phi0);l2=(outer.
y()-y0)/
sin(phi0);
1294 z0=(l2*inner.
z()-l1*outer.
z())/(l2-l1);
1301 float zErr = vertexErr.
czz();
1302 float transverseErr = vertexErr.
cxx();
1303 C(3, 3) = transverseErr;
1310 double dzdr = -flfit.
n1()/flfit.
n2();
1311 if (inner.
y()<outer.
y()) dzdr*=-1;
1314 if (
debug_)
std::cout<<
"Initial Point (x0/y0/z0): " << x0 <<
'\t'<< y0 <<
'\t'<< z0 << std::endl;
1325 if (
debug_)
std::cout<<
"\nInitial CError (dx/dy/dz): " << CErr(1,1) <<
'\t'<< CErr(2,2) <<
'\t'<< CErr(3,3) << std::endl;
1348 LogDebug(
"RoadSearch") <<
"inner hit: r/phi/z = "<< inner.
perp() <<
" " << inner.
phi() <<
" " << inner.
z() ;
1349 LogDebug(
"RoadSearch") <<
"middlehit: r/phi/z = "<< inner.
perp() <<
" " << inner.
phi() <<
" " << inner.
z() ;
1350 LogDebug(
"RoadSearch") <<
"outer hit: r/phi/z = "<< outer.
perp() <<
" " << outer.
phi() <<
" " << outer.
z() ;
1353 const double dRmin = 0.1;
1354 if (outer.
perp() - inner.
perp() < dRmin)
return fts;
1356 const double dz2 = 5.3*5.3;
1360 double z_0 = -linearFit.
c()/linearFit.
n2();
1364 FastHelix helix(outer, middle, inner, es);
1375 float transverseErr = dr2;
1376 C(3, 3) = transverseErr;
1415 if (
debug_)
std::cout<<
"*******DISASTER ********* seed doesn't make it to first hit!!!!!" << std::endl;
1416 return theSeedTrajectory;
1420 const SiStripMatchedRecHit2D *origHit =
dynamic_cast<const SiStripMatchedRecHit2D *
>(theInnerHit);
1431 if (!est.first)
return theSeedTrajectory;
1434 if (!innerUpdated.
isValid() ||
1436 if (
debug_)
std::cout<<
"Trajectory updated with first hit is invalid!!!" << std::endl;
1437 return theSeedTrajectory;
1442 intrhit->geographicalId().rawId());
1444 newHitsTwo.
push_back(intrhit->hit()->clone());
1459 theSeedTrajectory.
push(tm,est.second);
1461 return theSeedTrajectory;
1472 std::vector<Trajectory> newTrajectories;
1474 for(RoadSearchCloud::RecHitVector::const_iterator ihit = theLayerHits.begin();
1475 ihit != theLayerHits.end(); ihit++) {
1479 if (thisLayer == innerHitLayer){
1485 if (thisLayer == outerHitLayer){
1488 if (p1.
x()!=p2.
x() || p1.
y()!=p2.
y())
continue;
1495 if (rhit->isValid()) {
1496 LogDebug(
"RoadSearch") <<
"RecHit " << ihit-theLayerHits.begin()
1497 <<
", det " << rhit->det() <<
", r/phi/z = "
1498 << rhit->globalPosition().perp() <<
" "
1499 << rhit->globalPosition().phi() <<
" "
1500 << rhit->globalPosition().z();
1502 LogDebug(
"RoadSearch") <<
"RecHit " << ihit-theLayerHits.begin()
1514 if (
debug_)
std::cout<<
"BIG ERROR!!! How did we make it to here with no trajectory measurements?!?!?"<<std::endl;
1533 std::cout <<
"Propagation distance1 is " << propagationDistance.
mag() << std::endl;
1539 <<
", hit " << ihit-theLayerHits.begin()
1542 <<
", hit at " << rhit->localPosition().x() <<
" +- " <<
sqrt(rhit->localPositionError().xx())
1549 const SiStripMatchedRecHit2D *origHit =
dynamic_cast<const SiStripMatchedRecHit2D *
>(*ihit);
1560 if (
debug_)
std::cout <<
"estimation: " << est.first <<
" " << est.second << std::endl;
1561 if (!est.first)
continue;
1564 traj.
push(tm,est.second);
1565 newTrajectories.push_back(traj);
1570 return newTrajectories;
1586 std::vector<Trajectory> traj;
1589 std::vector<bool> trajUsed;
1591 for (std::vector<Trajectory>::iterator it = theTrajectories.begin(); it != theTrajectories.end(); ++it) {
1592 if (it->isValid()) {
1593 traj.push_back(*it);
1594 trajUsed.push_back(
false);
1599 std::cout <<
"==========ENTERING COSMIC MODE===========" << std::endl;
1601 for (std::vector<Trajectory>::iterator it = traj.begin(); it != traj.end(); it++) {
1602 std::cout <<
"Trajectory " << it-traj.begin() <<
" has "<<it->recHits().size()<<
" hits and is valid: " << it->isValid() << std::endl;
1606 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator rhit=itHits.begin(); rhit!=itHits.end(); ++rhit)
1607 std::cout <<
"-->good hit position: " << (*rhit)->globalPosition().x() <<
", "
1608 << (*rhit)->globalPosition().y() <<
", "<< (*rhit)->globalPosition().z() << std::endl;
1614 for (
unsigned int i = 0;
i < traj.size(); ++
i) {
1615 if (trajUsed[
i])
continue;
1616 for (
unsigned int j = i+1;
j != traj.size(); ++
j) {
1617 if (trajUsed[
j])
continue;
1619 if (
debugCosmics_)
std::cout<<
"Trajectory " <<i<<
" has "<<traj[
i].recHits().size()<<
" hits with chi2=" << traj[
i].chiSquared() <<
" and is valid"<<std::endl;
1620 if (
debugCosmics_)
std::cout<<
"Trajectory " <<j<<
" has "<<traj[
j].recHits().size()<<
" hits with chi2=" << traj[
j].chiSquared() <<
" and is valid"<<std::endl;
1675 Trajectory *upperTrajectory, *lowerTrajectory;
1679 lowerTSOS1=lastTraj1TSOS; upperTSOS1=firstTraj1TSOS;
1682 lowerTSOS1=firstTraj1TSOS; upperTSOS1=lastTraj1TSOS;
1686 else lowerTSOS2=firstTraj2TSOS;
1691 upperTrajectory = &(traj[
i]);
1692 lowerTrajectory = &(traj[
j]);
1698 upperTrajectory = &(traj[
j]);
1699 lowerTrajectory = &(traj[
i]);
1705 if (freshStartUpperTrajectory.empty() || freshStartLowerTrajectory .empty()){
1711 TrajectoryStateOnSurface forwardTsos = freshStartUpperTrajectory.begin()->firstMeasurement().forwardPredictedState();
1712 TrajectoryStateOnSurface backwardTsos = freshStartUpperTrajectory.begin()->lastMeasurement().backwardPredictedState();
1714 Trajectory freshStartTrajectory = *freshStartUpperTrajectory.begin();
1729 bool addHitToFreshStartTrajectory =
false;
1730 bool propagationFailed =
false;
1732 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator rhit=ttHits.begin(); rhit!=ttHits.end(); ++rhit){
1735 std::cout <<
" Lost " << lostHits <<
" of " << ttHits.size() <<
" on lower trajectory " << std::endl;
1736 std::cout <<
" Lost " << ((float)lostHits/(
float)ttHits.size()) <<
" of hits of on lower trajectory " << std::endl;
1738 if ((
float)lostHits/(float)ttHits.size() > 0.5) {
1739 propagationFailed =
true;
1742 if(
debugCosmics_)
std::cout <<
"-->hit position: " << (*rhit)->globalPosition().x() <<
", " << (*rhit)->globalPosition().y() <<
", "<< (*rhit)->globalPosition().z() << std::endl;
1812 if( rh->isValid() ) {
1815 if( addHitToFreshStartTrajectory==
false ) {
1840 if(
debugCosmics_)
std::cout<<
"Failed to add one of the original hits on a low occupancy layer!!!!" << std::endl;
1850 freshStartTrajectory.
push(tm,est.second);
1851 addHitToFreshStartTrajectory=
true;
1858 if (propagationFailed) {
1868 for (
int k=tttempHits.size()-1;
k>=0;
k--) {
1869 if(
debugCosmics_)
std::cout <<
"-->good hit position: " << tttempHits[
k]->globalPosition().x() <<
", " << tttempHits[
k]->globalPosition().y() <<
", "<< tttempHits[
k]->globalPosition().z() << std::endl;
1876 DetId FirstHitId = (*(freshStartTrajectory.
recHits().end()-1))->geographicalId();
1881 if (firstState.
isValid() ==
false)
continue;
1886 if(
debugCosmics_)
std::cout <<
"generate new trajectory seed with hit (x/y/z): " << firstTSOS.globalPosition().x() <<
", " << firstTSOS.globalPosition().y() <<
", " << firstTSOS.globalPosition().z() <<
", " << std::endl;
1890 newHits.
push_back(rhit->hit()->clone());
1904 for (
unsigned int i = 0;
i < traj.size(); ++
i) {
1906 if (trajUsed[
i]==
true)
continue;
1908 if (
debugCosmics_)
std::cout<<
"Trajectory (not merged) has "<<traj[
i].recHits().size()<<
" hits with chi2=" << traj[
i].chiSquared() <<
" and is valid? "<< traj[
i].isValid()<<std::endl;
1911 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator rhit=ttHits.begin(); rhit!=ttHits.end(); ++rhit){
1912 goodHits.
push_back((*rhit)->hit()->clone());
1918 DetId FirstHitId = (*(traj[
i].recHits().begin()))->geographicalId();
1926 theCollection.push_back(
TrackCandidate(goodHits,traj[
i].seed(),state));
1930 <<
" candidates. Merged collection has " << theCollection.size() << std::endl;
1935 for (std::vector<Trajectory>::const_iterator it = theTrajectories.begin(); it != theTrajectories.end(); it++) {
1936 if (
debug_)
std::cout<<
" Trajectory has "<<it->recHits().size()<<
" hits with chi2=" << it->chiSquared() <<
" and is valid? "<<it->isValid()<<std::endl;
1941 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator rhit=ttHits.begin(); rhit!=ttHits.end(); ++rhit){
1942 goodHits.
push_back((*rhit)->hit()->clone());
1948 DetId FirstHitId = (*(it->recHits().begin()))->geographicalId();
1954 if (firstState.
isValid() ==
false)
continue;
1961 return theCollection;
PropagationDirection direction() const
T getParameter(std::string const &) const
MeasurementEstimator * theEstimator
const MeasurementTracker * theMeasurementTracker
FTS stateAtVertex() const
~RoadSearchTrackCandidateMakerAlgorithm()
std::vector< TrajectoryMeasurement > FindBestHit(const TrajectoryStateOnSurface &tsosBefore, const std::set< const GeomDet * > &theDets, edm::OwnVector< TrackingRecHit > &theHits)
const TrackerGeometry * trackerGeom
virtual PropagationDirection propagationDirection() const
virtual void update(const edm::Event &) const =0
TrajectoryStateOnSurface propagate(const FreeTrajectoryState &fts, const Plane &plane) const
propagation to plane
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
const GlobalTrajectoryParameters & parameters() const
FreeTrajectoryState initialTrajectory(const edm::EventSetup &es, const TrackingRecHit *InnerHit, const TrackingRecHit *OuterHit)
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
SiStripRecHitMatcher * theHitMatcher
FreeTrajectoryState initialTrajectoryFromTriplet(const edm::EventSetup &es, const TrackingRecHit *InnerHit, const TrackingRecHit *MiddleHit, const TrackingRecHit *OuterHit)
void run(const RoadSearchCloudCollection *input, const edm::Event &e, const edm::EventSetup &es, TrackCandidateCollection &output)
Runs the algorithm.
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
SiStripMatchedRecHit2D * match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
LocalVector localDirection() const
LocalPoint localPosition() const
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
std::vector< Trajectory > extrapolateTrajectory(const Trajectory &inputTrajectory, RoadSearchCloud::RecHitVector &theLayerHits, const DetLayer *innerHitLayer, const TrackingRecHit *outerHit, const DetLayer *outerHitLayer)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Sin< T >::type sin(const T &t)
std::vector< TrackCandidate > TrackCandidateCollection
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Geom::Phi< T > phi() const
virtual void clean(TrajectoryPointerContainer &) const
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
ConstRecHitPointer recHit() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::vector< TrajectoryMeasurement > FindBestHitsByDet(const TrajectoryStateOnSurface &tsosBefore, const std::set< const GeomDet * > &theDets, edm::OwnVector< TrackingRecHit > &theHits)
LocalError positionError() const
AnalyticalPropagator * theAnalyticalPropagator
ConstRecHitContainer recHits(bool splitting=false) const
uint32_t rawId() const
get the raw id
double initialVertexErrorXY_
U second(std::pair< T, U > const &p)
virtual std::vector< Trajectory > trajectories(const Trajectory &aTraj) const
DataContainer const & measurements() const
std::vector< TrajectoryMeasurement > DataContainer
PropagatorWithMaterial * thePropagator
TrajectoryCleanerBySharedHits * theTrajectoryCleaner
RoadSearchTrackCandidateMakerAlgorithm(const edm::ParameterSet &conf)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
Cos< T >::type cos(const T &t)
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
Trajectory createSeedTrajectory(FreeTrajectoryState &fts, const TrackingRecHit *InnerHit, const DetLayer *innerHitLayer)
PropagatorWithMaterial * theRevPropagator
TrajectoryStateOnSurface updatedState() const
const LocalTrajectoryError & localError() const
const MagneticField * magField
tuple Chi2MeasurementEstimator
virtual const GeomDet * idToDet(DetId) const
PropagatorWithMaterial * theAloPropagator
double maxPropagationDistance
GlobalPoint position() const
unsigned int theNumHitCut
virtual TrajectoryStateOnSurface propagate(const TrajectoryStateOnSurface &tsos, const Plane &plane) const
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::string measurementTrackerName_
const TransientTrackingRecHitBuilder * ttrhBuilder
std::pair< bool, double > HitReturnType
KFTrajectorySmoother * theSmoother
virtual LocalError localPositionError() const =0
T const * product() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void linearFit(T const *__restrict__ x, T const *__restrict__ y, int ndat, T const *__restrict__ sigy2, T &slope, T &intercept, T &covss, T &covii, T &covsi)
std::vector< TrajectoryMeasurement > FindBestHits(const TrajectoryStateOnSurface &tsosBefore, const std::set< const GeomDet * > &theDets, const SiStripRecHitMatcher *theHitMatcher, edm::OwnVector< TrackingRecHit > &theHits)
GlobalVector globalMomentum() const
const BoundPlane & surface() const
The nominal surface of the GeomDet.
const Surface & surface() const
tuple KFTrajectorySmoother
std::vector< const TrackingRecHit * > RecHitVector
bool chooseStartingLayers(std::vector< std::pair< const DetLayer *, RoadSearchCloud::RecHitVector > > &RecHitsByLayer, std::vector< std::pair< const DetLayer *, RoadSearchCloud::RecHitVector > >::iterator ilyr0, const std::multimap< int, const DetLayer * > &layer_map, std::set< const DetLayer * > &good_layers, std::vector< const DetLayer * > &middle_layers, RoadSearchCloud::RecHitVector &recHits_middle)
DetId geographicalId() const
TrackCharge charge() const
TrajectoryStateUpdator * theUpdator
const GeometricSearchTracker * geometricSearchTracker() const
virtual LocalPoint localPosition() const =0
const PositionType & position() const
TrackCandidateCollection PrepareTrackCandidates(std::vector< Trajectory > &theTrajectories)
void push(const TrajectoryMeasurement &tm)
std::vector< RoadSearchCloud > RoadSearchCloudCollection
tuple AnalyticalPropagator
TrajectoryStateOnSurface backwardPredictedState() const
Access to backward predicted state (from smoother)