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>();
73 auto outputRHColl = std::make_unique<TrackingRecHitCollection>();
74 auto outputTColl = std::make_unique<reco::TrackCollection>();
75 auto outputTEColl = std::make_unique<reco::TrackExtraCollection>();
76 auto outputTrajectoryColl = std::make_unique<std::vector<Trajectory>>();
78 auto scTrkAssoc_p = std::make_unique<reco::TrackCaloClusterPtrAssociation>();
89 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
103 if ( !trkCandidateSCAssocHandle.
isValid() ) {
112 std::vector<int> tccLocations;
120 edm::LogError(
"TrackProducerWithSCAssociation") <<
"TrackProducerWithSCAssociation could not get the TrackCandidateCollection.";}
137 for (TrackCandidateCollection::const_iterator
i=theTCCollection->begin();
i!=theTCCollection->end();
i++)
150 &(theG.product()->idToDet(detId)->surface()),
162 i!=recHitVec.second;
i++){
174 tccLocations.push_back(tcc);
178 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " << cont <<
"\n";
188 algoResults, theBuilder.
product(), ttopo);
193 std::vector<edm::Ptr<reco::CaloCluster> > caloPtrVec;
194 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
197 caloPtrVec.push_back( aClus );
215 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
219 std::vector<reco::TransientTrack> ttks;
230 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
252 for (
auto &
prod : algoResults){
268 std::unique_ptr<TrackingRecHitCollection> selHits,
269 std::unique_ptr<reco::TrackCollection> selTracks,
270 std::unique_ptr<reco::TrackExtraCollection> selTrackExtras,
271 std::unique_ptr<std::vector<Trajectory>> selTrajectories,
282 std::map<unsigned int, unsigned int> tjTkMap;
284 for(
auto &
i : algoResults){
287 selTrajectories->push_back(*theTraj);
297 selTracks->push_back( t );
307 unsigned int innerId, outerId;
347 selTrackExtras->push_back(
reco::TrackExtra (outpos, outmom,
true, inpos, inmom,
true,
359 auto ih = selHits->size();
360 t2t(*theTraj,*selHits,trajParams,chi2s);
361 auto ie = selHits->size();
365 auto const &
hit = (*selHits)[ih];
396 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>(rTrajs,
rTracks_);
397 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
398 i != tjTkMap.end();
i++ ) {
401 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
T getParameter(std::string const &) const
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void setSecondHitPattern(Trajectory *traj, reco::Track &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo)
void setClusterRemovalInfo(const edm::InputTag &clusterRemovalInfo)
Sets the information on cluster removal, and turns it on.
std::vector< ConstRecHitPointer > RecHitContainer
def setup(process, global_tag, zero_tesla=False)
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
virtual const MagneticField * magneticField() const =0
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
unsigned int detId() const
edm::RefToBase< TrajectorySeed > seedRef(void) const
RefProd< PROD > getRefBeforePut()
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
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
bool appendHitPattern(const TrackingRecHit &hit, const TrackerTopology &ttopo)
append a single hit to the HitPattern
TrackProducerWithSCAssociation(const edm::ParameterSet &iConfig)
std::vector< AlgoProduct > AlgoProductCollection
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 putInEvt(edm::Event &evt, const Propagator *thePropagator, const MeasurementTracker *theMeasTk, std::unique_ptr< TrackingRecHitCollection > selHits, std::unique_ptr< reco::TrackCollection > selTracks, std::unique_ptr< reco::TrackExtraCollection > selTrackExtras, std::unique_ptr< std::vector< Trajectory >> selTrajectories, AlgoProductCollection &algoResults, TransientTrackingRecHitBuilder const *hitBuilder, const TrackerTopology *ttopo)
T const * product() const
edm::RefToBase< TrajectorySeed > seedRef() const
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.