30 if ( iConfig.
exists(
"clusterRemovalInfo") ) {
43 consumes<reco::TrackCandidateCaloClusterPtrAssociation>(
45 trackCSuperClusterAssociationCollection_));
48 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks" );
49 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras" );
50 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits" );
51 produces<std::vector<Trajectory> >() ;
52 produces<TrajTrackAssociationCollection>();
73 std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(
new std::vector<Trajectory>);
86 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
97 if ( !trkCandidateSCAssocHandle.
isValid() ) {
106 std::vector<int> tccLocations;
114 edm::LogError(
"TrackProducerWithSCAssociation") <<
"TrackProducerWithSCAssociation could not get the TrackCandidateCollection.";}
131 for (TrackCandidateCollection::const_iterator
i=theTCCollection->begin();
i!=theTCCollection->end();
i++)
144 &(theG.
product()->idToDet(detId)->surface()),
156 i!=recHitVec.second;
i++){
157 hits.push_back(theBuilder.
product()->build(&(*
i) ));
167 tccLocations.push_back(tcc);
171 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Number of Tracks found: " << cont <<
"\n";
180 outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults);
185 std::vector<edm::Ptr<reco::CaloCluster> > caloPtrVec;
186 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
189 caloPtrVec.push_back( aClus );
207 edm::LogInfo(
"TrackProducerWithSCAssociation") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
211 std::vector<reco::TransientTrack> ttks;
222 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
244 for (AlgoProductCollection::iterator
prod=algoResults.begin();
prod!=algoResults.end();
prod++){
259 std::auto_ptr<TrackingRecHitCollection>& selHits,
260 std::auto_ptr<reco::TrackCollection>& selTracks,
261 std::auto_ptr<reco::TrackExtraCollection>& selTrackExtras,
262 std::auto_ptr<std::vector<Trajectory> >& selTrajectories,
273 std::map<unsigned int, unsigned int> tjTkMap;
275 for(AlgoProductCollection::iterator
i=algoResults.begin();
i!=algoResults.end();
i++){
278 selTrajectories->push_back(*theTraj);
289 selTracks->push_back( t );
299 unsigned int innerId, outerId;
340 selTrackExtras->push_back(
reco::TrackExtra (outpos, outmom,
true, inpos, inmom,
true,
351 for( TrajectoryFitter::RecHitContainer::const_iterator
j = transHits.begin();
352 j != transHits.end();
j ++ ) {
356 selHits->push_back( hit );
361 for( TrajectoryFitter::RecHitContainer::const_iterator
j = transHits.end()-1;
362 j != transHits.begin()-1; --
j ) {
366 selHits->push_back( hit );
392 evt.
put( selTrackExtras );
400 for ( std::map<unsigned int, unsigned int>::iterator
i = tjTkMap.begin();
401 i != tjTkMap.end();
i++ ) {
404 trajTrackMap->insert(
edm::Ref<std::vector<Trajectory> >( rTrajs, (*i).first ),
407 evt.
put( trajTrackMap );
T getParameter(std::string const &) const
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::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_
std::vector< ConstRecHitPointer > RecHitContainer
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_
ConstRecHitContainer recHits(bool splitting=false) 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)
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
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
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
void setHitPattern(const C &c)
set hit patterns from vector of hit references
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
TrajectoryMeasurement const & firstMeasurement() 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
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
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
bool myTrajectoryInEvent_
Trajectory::RecHitContainer RecHitContainer
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::RefToBase< TrajectorySeed > seedRef() const
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.