|
|
Go to the documentation of this file.
28 if (iConfig.
exists(
"clusterRemovalInfo")) {
41 assoc_token = consumes<reco::TrackCandidateCaloClusterPtrAssociation>(
47 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks");
48 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras");
49 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits");
50 produces<std::vector<Trajectory>>();
51 produces<TrajTrackAssociationCollection>();
65 auto outputRHColl = std::make_unique<TrackingRecHitCollection>();
66 auto outputTColl = std::make_unique<reco::TrackCollection>();
67 auto outputTEColl = std::make_unique<reco::TrackExtraCollection>();
68 auto outputTrajectoryColl = std::make_unique<std::vector<Trajectory>>();
70 auto scTrkAssoc_p = std::make_unique<reco::TrackCaloClusterPtrAssociation>();
81 getFromES(
setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
94 if (!trkCandidateSCAssocHandle.
isValid()) {
98 <<
" but keep running. Empty collection will be produced "
103 if (scTrkCandAssCollection.
empty())
106 std::vector<int> tccLocations;
114 <<
"TrackProducerWithSCAssociation could not get the TrackCandidateCollection.";
131 for (TrackCandidateCollection::const_iterator
i = theTCCollection->begin();
i != theTCCollection->end();
i++) {
162 tccLocations.push_back(tcc);
166 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " <<
cont <<
"\n";
171 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"cms::Exception caught!!!"
192 std::vector<edm::Ptr<reco::CaloCluster>> caloPtrVec;
193 for (AlgoProductCollection::iterator
i = algoResults.begin();
i != algoResults.end();
i++) {
196 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);
252 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"cms::Exception caught!!!"
257 for (
auto&
prod : algoResults) {
271 std::unique_ptr<TrackingRecHitCollection> selHits,
272 std::unique_ptr<reco::TrackCollection> selTracks,
273 std::unique_ptr<reco::TrackExtraCollection> selTrackExtras,
284 std::map<unsigned int, unsigned int> tjTkMap;
286 for (
auto&
i : algoResults) {
289 selTrajectories->push_back(*theTraj);
299 selTracks->push_back(
t);
304 tjTkMap[iTjRef - 1] = iTkRef - 1;
310 unsigned int innerId, outerId;
338 track.setExtra(teref);
367 auto ih = selHits->size();
368 t2t(*theTraj, *selHits, trajParams, chi2s);
369 auto ie = selHits->size();
370 tx.
setHits(rHits, ih, ie - ih);
372 for (; ih < ie; ++ih) {
373 auto const&
hit = (*selHits)[ih];
374 track.appendHitPattern(
hit, *ttopo);
402 auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>(rTrajs,
rTracks_);
403 for (std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
i != tjTkMap.end();
i++) {
406 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.
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