30 if ( iConfig.
exists(
"clusterRemovalInfo") ) {
43 consumes<reco::TrackCandidateCaloClusterPtrAssociation>(
45 trackCSuperClusterAssociationCollection_));
47 consumes<MeasurementTrackerEvent>(
edm::InputTag(
"MeasurementTrackerEvent"));
51 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks" );
52 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras" );
53 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits" );
54 produces<std::vector<Trajectory> >() ;
55 produces<TrajTrackAssociationCollection>();
76 std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(
new std::vector<Trajectory>);
89 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
100 if ( !trkCandidateSCAssocHandle.
isValid() ) {
109 std::vector<int> tccLocations;
117 edm::LogError(
"TrackProducerWithSCAssociation") <<
"TrackProducerWithSCAssociation could not get the TrackCandidateCollection.";}
134 for (TrackCandidateCollection::const_iterator
i=theTCCollection->begin();
i!=theTCCollection->end();
i++)
147 &(theG.
product()->idToDet(detId)->surface()),
159 i!=recHitVec.second;
i++){
160 hits.push_back(theBuilder.
product()->build(&(*
i) ));
171 tccLocations.push_back(tcc);
175 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " << cont <<
"\n";
184 outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults, theBuilder.
product());
189 std::vector<edm::Ptr<reco::CaloCluster> > caloPtrVec;
190 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
193 caloPtrVec.push_back( aClus );
211 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
215 std::vector<reco::TransientTrack> ttks;
226 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
248 for (AlgoProductCollection::iterator
prod=algoResults.begin();
prod!=algoResults.end();
prod++){
264 std::auto_ptr<TrackingRecHitCollection>& selHits,
265 std::auto_ptr<reco::TrackCollection>& selTracks,
266 std::auto_ptr<reco::TrackExtraCollection>& selTrackExtras,
267 std::auto_ptr<std::vector<Trajectory> >& selTrajectories,
278 std::map<unsigned int, unsigned int> tjTkMap;
280 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
283 selTrajectories->push_back(*theTraj);
293 selTracks->push_back( t );
303 unsigned int innerId, outerId;
343 selTrackExtras->push_back(
reco::TrackExtra (outpos, outmom,
true, inpos, inmom,
true,
353 auto ih = selHits->size();
355 t2t(*theTraj,*selHits,
false);
356 auto ie = selHits->size();
358 auto const &
hit = (*selHits)[ih];
408 evt.
put( selTrackExtras );
416 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
417 i != tjTkMap.end();
i++ ) {
420 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
423 evt.
put( trajTrackMap );
T getParameter(std::string const &) const
void putInEvt(edm::Event &evt, const Propagator *thePropagator, const MeasurementTracker *theMeasTk, std::auto_ptr< TrackingRecHitCollection > &selHits, std::auto_ptr< reco::TrackCollection > &selTracks, std::auto_ptr< reco::TrackExtraCollection > &selTrackExtras, std::auto_ptr< std::vector< Trajectory > > &selTrajectories, AlgoProductCollection &algoResults, TransientTrackingRecHitBuilder const *hitBuilder)
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
ConstRecHitPointer const & recHit() const
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
edm::OrphanHandle< reco::TrackCollection > rTracks_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< reco::TransientTrack > getTransient(edm::Event &, const edm::EventSetup &)
const CurvilinearTrajectoryError & curvilinearError() const
TrajectorySeed const & seed() const
void insert(const H &h, I begin, I end)
std::vector< Track > TrackCollection
collection of Tracks
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setClusterRemovalInfo(const edm::InputTag &clusterRemovalInfo)
Sets the information on cluster removal, and turns it on.
std::vector< ConstRecHitPointer > RecHitContainer
std::string trackSuperClusterAssociationCollection_
edm::EDGetTokenT< reco::TrackCandidateCaloClusterPtrAssociation > assoc_token
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
std::pair< const_iterator, const_iterator > range
void setAlias(std::string alias)
set the aliases of produced collections
bool validTrackCandidateSCAssociationInput_
void setConf(const edm::ParameterSet &conf)
Set parameter set.
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::string trackCSuperClusterAssociationCollection_
PropagationDirection const & direction() const
PTrajectoryStateOnDet const & trajectoryStateOnDet() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
TrajectoryMeasurement const & lastMeasurement() const
void setSecondHitPattern(Trajectory *traj, reco::Track &track, const Propagator *prop, const MeasurementTrackerEvent *measTk)
GlobalVector momentum() const
bool appendHitPattern(const TrackingRecHit &hit)
append a single hit to the HitPattern
unsigned int detId() const
edm::RefToBase< TrajectorySeed > seedRef(void) const
std::vector< AlgoProduct > AlgoProductCollection
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
RefProd< PROD > getRefBeforePut()
GlobalPoint position() const
TrackProducerAlgorithm< reco::Track > theAlgo
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
set label of source collection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
TrajectoryMeasurement const & firstMeasurement() const
T const * product() const
const GlobalTrajectoryParameters & globalParameters() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
T const * product() const
TrackProducerWithSCAssociation(const edm::ParameterSet &iConfig)
std::string conversionTrackCandidateProducer_
edm::ESHandle< NavigationSchool > theSchool
void runWithCandidate(const TrackingGeometry *, const MagneticField *, const TrackCandidateCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking TrackCandidates as input.
TrajectoryStateOnSurface const & updatedState() const
bool myTrajectoryInEvent_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::RefToBase< TrajectorySeed > seedRef() const
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
virtual void produce(edm::Event &, const edm::EventSetup &) override
Method where the procduction take place. To be implemented in concrete classes.
virtual void getFromES(const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
Get needed services from the Event Setup.