|
|
Go to the documentation of this file.
53 std::unique_ptr<TrackingRecHitCollection> selHits,
54 std::unique_ptr<reco::TrackCollection> selTracks,
55 std::unique_ptr<reco::TrackExtraCollection> selTrackExtras,
73 if (iConfig.
exists(
"clusterRemovalInfo")) {
86 assoc_token = consumes<reco::TrackCandidateCaloClusterPtrAssociation>(
92 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks");
93 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras");
94 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits");
95 produces<std::vector<Trajectory>>();
96 produces<TrajTrackAssociationCollection>();
110 auto outputRHColl = std::make_unique<TrackingRecHitCollection>();
111 auto outputTColl = std::make_unique<reco::TrackCollection>();
112 auto outputTEColl = std::make_unique<reco::TrackExtraCollection>();
113 auto outputTrajectoryColl = std::make_unique<std::vector<Trajectory>>();
115 auto scTrkAssoc_p = std::make_unique<reco::TrackCaloClusterPtrAssociation>();
126 getFromES(
setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
139 if (!trkCandidateSCAssocHandle.
isValid()) {
143 <<
" but keep running. Empty collection will be produced "
148 if (scTrkCandAssCollection.
empty())
151 std::vector<int> tccLocations;
159 <<
"TrackProducerWithSCAssociation could not get the TrackCandidateCollection.";
176 for (TrackCandidateCollection::const_iterator
i = theTCCollection->begin();
i != theTCCollection->end();
i++) {
207 tccLocations.push_back(tcc);
211 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " <<
cont <<
"\n";
216 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"cms::Exception caught!!!"
237 std::vector<edm::Ptr<reco::CaloCluster>> caloPtrVec;
238 for (AlgoProductCollection::iterator
i = algoResults.begin();
i != algoResults.end();
i++) {
241 caloPtrVec.push_back(aClus);
256 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
260 std::vector<reco::TransientTrack> ttks;
271 getFromES(
setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
297 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"cms::Exception caught!!!"
302 for (
auto&
prod : algoResults) {
316 std::unique_ptr<TrackingRecHitCollection> selHits,
317 std::unique_ptr<reco::TrackCollection> selTracks,
318 std::unique_ptr<reco::TrackExtraCollection> selTrackExtras,
329 std::map<unsigned int, unsigned int> tjTkMap;
331 for (
auto&
i : algoResults) {
334 selTrajectories->push_back(*theTraj);
344 selTracks->push_back(
t);
349 tjTkMap[iTjRef - 1] = iTkRef - 1;
355 unsigned int innerId, outerId;
383 track.setExtra(teref);
412 auto ih = selHits->size();
413 t2t(*theTraj, *selHits, trajParams, chi2s);
414 auto ie = selHits->size();
415 tx.
setHits(rHits, ih, ie - ih);
417 for (; ih < ie; ++ih) {
418 auto const&
hit = (*selHits)[ih];
419 track.appendHitPattern(
hit, *ttopo);
447 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>(rTrajs,
rTracks_);
448 for (std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
i != tjTkMap.end();
i++) {
451 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory>>(rTrajs, (*i).first),
PTrajectoryStateOnDet const & trajectoryStateOnDet() const
const TrackerGeomDet * idToDet(DetId) const override
T const * product() const
RefProd< PROD > getRefBeforePut()
std::string trackSuperClusterAssociationCollection_
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.
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
TrackProducerAlgorithm< reco::Track > theAlgo
T const * product() const
edm::RefToBase< TrajectorySeed > seedRef(void) const
GlobalPoint position() const
PropagationDirection const & direction() const
void produce(edm::Event &, const edm::EventSetup &) override
Method where the procduction take place. To be implemented in concrete classes.
void setConf(const edm::ParameterSet &conf)
Set parameter set.
edm::Range< RecHitContainer::const_iterator > recHits() const
cont
load Luminosity info ##
TrajectoryStateOnSurface const & updatedState() const
TrackProducerWithSCAssociation(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkToken_
virtual const MagneticField * magneticField() const =0
Log< level::Info, false > LogInfo
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
void setSecondHitPattern(Trajectory *traj, reco::Track &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo)
std::vector< AlgoProduct > AlgoProductCollection
const Plane & surface() const
The nominal surface of the GeomDet.
void setClusterRemovalInfo(const edm::InputTag &clusterRemovalInfo)
Sets the information on cluster removal, and turns it on.
#define DEFINE_FWK_MODULE(type)
std::vector< ConstRecHitPointer > RecHitContainer
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.
edm::RefToBase< TrajectorySeed > seedRef() const
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void setAlias(std::string alias)
set the aliases of produced collections
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
bool myTrajectoryInEvent_
GlobalVector momentum() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
XYZPointD XYZPoint
point in space with cartesian internal representation
TrajectoryMeasurement const & lastMeasurement() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
TrajectorySeed const & seed() const
edm::OrphanHandle< reco::TrackCollection > rTracks_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Log< level::Error, false > LogError
std::vector< reco::TransientTrack > getTransient(edm::Event &, const edm::EventSetup &)
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
set label of source collection
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
ConstRecHitPointer const & recHit() const
bool validTrackCandidateSCAssociationInput_
TrajectoryMeasurement const & firstMeasurement() const
edm::EDGetTokenT< reco::TrackCandidateCaloClusterPtrAssociation > assoc_token
const CurvilinearTrajectoryError & curvilinearError() const
std::string trackCSuperClusterAssociationCollection_
T getParameter(std::string const &) const
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.
const GlobalTrajectoryParameters & globalParameters() const
std::string conversionTrackCandidateProducer_
edm::ESHandle< NavigationSchool > theSchool