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);
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++){
163 hits.push_back(theBuilder.
product()->build(&(*
i) ));
174 tccLocations.push_back(tcc);
178 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " << cont <<
"\n";
187 outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults, theBuilder.
product(), ttopo);
192 std::vector<edm::Ptr<reco::CaloCluster> > caloPtrVec;
193 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
196 caloPtrVec.push_back( aClus );
214 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
218 std::vector<reco::TransientTrack> ttks;
229 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
251 for (
auto &
prod : algoResults){
252 ttks.emplace_back(*
prod.track,thePropagator.
product()->magneticField());
267 std::auto_ptr<TrackingRecHitCollection>& selHits,
268 std::auto_ptr<reco::TrackCollection>& selTracks,
269 std::auto_ptr<reco::TrackExtraCollection>& selTrackExtras,
270 std::auto_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,
357 auto ih = selHits->size();
359 t2t(*theTraj,*selHits,
false);
360 auto const ie = selHits->size();
361 unsigned int nHitsAdded = 0;
363 auto const &
hit = (*selHits)[ih];
367 tx.
setHits( rHits, hidx, nHitsAdded);
414 evt.
put( selTrackExtras );
422 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
423 i != tjTkMap.end();
i++ ) {
426 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
429 evt.
put( trajTrackMap );
T getParameter(std::string const &) const
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)
tuple cont
load Luminosity info ##
edm::OrphanHandle< reco::TrackCollection > rTracks_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< reco::TransientTrack > getTransient(edm::Event &, const edm::EventSetup &)
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, const TrackerTopology *ttopo)
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 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
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.
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
unsigned int detId() const
edm::RefToBase< TrajectorySeed > seedRef(void) const
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
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_
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.