88 vector<Trajectory> &trajoutput)
94 std::vector<Trajectory> trajSmooth;
95 std::vector<Trajectory>::iterator trajIter;
97 TrajectorySeedCollection::const_iterator
iseed;
99 for(iseed=collseed.begin();iseed!=collseed.end();iseed++){
106 vector<const TrackingRecHit*> allHits=
SortHits(collstereo,collrphi,collmatched,collpixel,*iseed);
108 AddHit(startingTraj,allHits);
109 for (trajIter=
trajFit.begin(); trajIter!=
trajFit.end();trajIter++){
112 for (trajIter= trajSmooth.begin(); trajIter!=trajSmooth.end();trajIter++){
113 if((*trajIter).isValid()){
114 trajoutput.push_back((*trajIter));
134 if ( !seedMeas.empty()) {
135 for (std::vector<TM>::const_iterator
i=seedMeas.begin();
i!=seedMeas.end();
i++){
144 std::vector<TrajectoryMeasurement>
147 std::vector<TrajectoryMeasurement>
result;
150 ihit != hitRange.second; ihit++) {
153 const GeomDet* hitGeomDet = (&(*tracker))->idToDet( ihit->geographicalId());
156 if (ihit == hitRange.second - 1) {
158 result.push_back(
TM( invalidState, updatedState, recHit));
162 result.push_back(
TM( invalidState, recHit));
174 vector<const TrackingRecHit*>
185 vector<const TrackingRecHit*> allHits;
191 for (ihit = hRange.first;
192 ihit != hRange.second; ihit++) {
199 if ((&collpixel)!=0){
201 for(ipix=collpixel.
data().begin();ipix!=collpixel.
data().end();ipix++){
204 allHits.push_back(&(*ipix));
211 for(istrip=collrphi.
data().begin();istrip!=collrphi.
data().end();istrip++){
214 allHits.push_back(&(*istrip));
221 if ((&collstereo)!=0){
222 for(istrip=collstereo.
data().begin();istrip!=collstereo.
data().end();istrip++){
225 allHits.push_back(&(*istrip));
252 const GeomDet* gdet = (&(*tracker))->idToDet(
DetId(pState.detId()));
260 vector<const TrackingRecHit*>Hits){
264 unsigned int ibestdet;
266 for (
unsigned int icosmhit=0;icosmhit<Hits.size();icosmhit++){
268 unsigned int iraw= Hits[icosmhit]->geographicalId().rawId();
269 LogDebug(
"CosmicTrackFinder")<<
" HIT POSITION "<< gphit;
273 tracker->idToDet(Hits[icosmhit]->geographicalId())->surface());
281 LogDebug(
"CosmicTrackFinder") <<
"STATE PROPAGATED AT DET "<<iraw<<
" "<<prSt;
282 for(icosm2=icosmhit;icosm2<Hits.size();icosm2++){
284 if (iraw==Hits[icosm2]->geographicalId().rawId()){
291 if (icosm2!=icosmhit) icosmhit++;
294 else icosm2=Hits.size();
298 LogDebug(
"CosmicTrackFinder")<<
"Chi2 contribution for hit at "
306 if ((
abs(ck.
x()/ck.
y())>2)||(
abs(ck.
z()/ck.
y())>2)) chi2min=300;
309 if (
abs(prLoc.
x()) < 25 &&
abs(prLoc.
y()) < 25 ){
317 "STATE UPDATED WITH HIT AT POSITION "
318 <<tmphitbestdet->globalPosition()
322 hits.push_back(&(*tmphitbestdet));
324 }
else LogDebug(
"CosmicTrackFinder")<<
" Hits outside module surface "<< prLoc;
325 }
else LogDebug(
"CosmicTrackFinder")<<
" State can not be updated with hit at position " <<gphit;
326 }
else LogDebug(
"CosmicTrackFinder")<<
" State can not be propagated at det "<< iraw;
334 tracker->idToDet((*
hits.begin())->geographicalId())->surface()).isValid()){
337 tracker->idToDet((*
hits.begin())->geographicalId())->surface());
350 std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> >
hits= traj.
recHits();
351 std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> >::const_iterator
hit;
352 for(hit=hits.begin();hit!=hits.end();hit++){
353 unsigned int iid=(*hit)->hit()->geographicalId().rawId();
355 if(((iid>>0)&0x3)!=1) ngoodhits++;
PropagationDirection direction() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
edm::ESHandle< MagneticField > magfield
edm::ESHandle< TrackerGeometry > tracker
LocalPoint localPosition() const
PropagatorWithMaterial * thePropagatorOp
GlobalPoint globalPosition() const
std::vector< Trajectory > trajFit
ConstRecHitContainer recHits(bool splitting=false) const
void init(const edm::EventSetup &es, bool)
const TransientTrackingRecHitBuilder * RHBuilder
virtual std::vector< Trajectory > trajectories(const Trajectory &aTraj) const
std::vector< TrajectoryMeasurement > seedMeasurements(const TrajectorySeed &seed) const
std::vector< TrajectorySeed > TrajectorySeedCollection
virtual std::vector< Trajectory > fit(const Trajectory &aTraj) const
recHitContainer::const_iterator const_iterator
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectoryMeasurement const & lastMeasurement() const
const KFTrajectorySmoother * theSmoother
data_type const * data(size_t cell) const
std::pair< const_iterator, const_iterator > range
TSOS startingTSOS(const TrajectorySeed &seed) const
TrajectoryStateOnSurface updatedState() const
void AddHit(Trajectory &traj, std::vector< const TrackingRecHit * >Hits)
tuple Chi2MeasurementEstimator
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
virtual TrajectoryStateOnSurface propagate(const TrajectoryStateOnSurface &tsos, const Plane &plane) const
const KFTrajectoryFitter * theFitter
TrajectoryMeasurement const & firstMeasurement() const
PTrajectoryStateOnDet const & startingState() const
void run(const TrajectorySeedCollection &collseed, const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const SiPixelRecHitCollection &collpixel, const edm::EventSetup &es, edm::Event &e, std::vector< Trajectory > &trajoutput)
Runs the algorithm.
T const * product() const
bool qualityFilter(Trajectory traj)
PropagatorWithMaterial * thePropagator
std::vector< const TrackingRecHit * > SortHits(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const SiPixelRecHitCollection &collpixel, const TrajectorySeed &seed)
Chi2MeasurementEstimator * theEstimator
const BoundPlane & surface() const
The nominal surface of the GeomDet.
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
tuple KFTrajectorySmoother
Trajectory createStartingTrajectory(const TrajectorySeed &seed) const
CosmicTrajectoryBuilder(const edm::ParameterSet &conf)
TransientTrackingRecHit::RecHitContainer hits
~CosmicTrajectoryBuilder()
void push(const TrajectoryMeasurement &tm)
double chiSquared() const