47 produces< TrajectoryCollection >();
48 produces< TrajectoryToTrajectoryMap >();
50 produces< reco::TrackExtraCollection >();
51 produces< reco::TrackCollection >();
52 produces< TrackToTrajectoryMap >();
54 produces< TrackToTrackMap >();
112 <<
"Number of trajectories = "<<m_TrajectoryCollection.size() <<std::endl
113 <<
"Number of nuclear interactions = "<<m_NuclearInteractionCollection.size();
116 std::map<reco::TrackRef,TrajectoryRef> m_TrackToTrajMap;
117 swap_map(temp_m_TrajectoryCollection, m_TrackToTrajMap);
119 for(
unsigned int i = 0 ;
i < m_NuclearInteractionCollection.size() ;
i++)
136 pair<unsigned int, unsigned int> tempory_pair;
137 tempory_pair.first = Output_track->size();
138 tempory_pair.second =
i;
143 (algoResults[0].second.first)->setExtra( teref );
145 Output_track->push_back(*algoResults[0].
second.first);
146 Output_trackextra->push_back( newTrackExtra );
147 Output_traj->push_back(newTraj);
153 Output_track->push_back(*primTrackRef);
154 Output_trackextra->push_back( *primTrackRef->extra() );
155 Output_traj->push_back(*trajRef);
162 iEvent.
put(Output_trackextra);
166 if(Handle_tracks->size() != Handle_traj->size() )
168 printf(
"ERROR Handle_tracks->size() != Handle_traj->size() \n");
180 Output_trajmap ->insert(OutTrajRef,InTrajRef);
181 Output_trackmap->insert(TrackRef,InTrajRef);
185 Output_tracktrackmap->
insert(TrackRef,PrimaryTrackRef);
189 iEvent.
put(Output_trajmap);
190 iEvent.
put(Output_trackmap);
191 iEvent.
put(Output_tracktrackmap);
194 if(
verbosity>=3)printf(
"-----------------------\n");
204 bool needNewTraj=
false;
206 double vtx_pos_mag =
sqrt (vtx_pos.X()*vtx_pos.X()+vtx_pos.Y()*vtx_pos.Y()+vtx_pos.Z()*vtx_pos.Z());
207 if(
verbosity>=2) printf(
"Nuclear Interaction pos = %f\n",vtx_pos_mag );
214 if(
verbosity>=2)
LogDebug(
"NuclearTrackCorrector")<<
"Size of Measurements = "<<Measurements.size();
216 for(
unsigned int m=Measurements.size()-1 ;
m!=(
unsigned int)-1 ;
m--){
218 if(!Measurements[
m].recHit()->isValid() )
continue;
219 GlobalPoint hit_pos =
theG->idToDet(Measurements[
m].recHit()->geographicalId())->surface().toGlobal(Measurements[
m].recHit()->localPosition());
223 if(hit_pos.
mag()>vtx_pos_mag){
227 newtrajectory.
push(Measurements[
m]);
241 it->validRecHits( hits );
245 for(
unsigned int h=0 ;
h<hits.size() ;
h++)
247 if( hits[
h]->isValid() )
249 ndof = ndof + hits[
h]->dimension() * hits[
h]->weight();
252 LogDebug(
"NuclearSeedGenerator") <<
" HIT IS INVALID ???";
259 LogDebug(
"NuclearSeedGenerator") <<
" TrackCorrector - number of valid hits" << hits.size() <<
"\n"
260 <<
" - number of hits from Track " << theT->recHitsSize() <<
"\n"
261 <<
" - number of valid hits from initial track " << theT->numberOfValidHits();
264 if( hits.size() > 1){
282 unsigned int innerId, outerId;
324 innerStateFromTrack: outerStateFromTrack;
330 initialStateFromTrack.
surface(),
332 return theInitialStateForRefitting;
336 for(
unsigned int i = 0 ;
i < trajColl->size() ;
i++)
340 result[ PrimaryTrackRef ] = InTrajRef;
void rescaleError(double factor)
T getParameter(std::string const &) const
ConstRecHitPointer const & recHit() const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
const LocalTrajectoryParameters & localParameters() const
NuclearTrackCorrector(const edm::ParameterSet &)
edm::ESHandle< MagneticField > theMF
const edm::RefToBase< reco::Track > & primaryTrack() const
return the base reference to the primary track
virtual void produce(edm::Event &, const edm::EventSetup &) override
const CurvilinearTrajectoryError & curvilinearError() const
std::vector< std::pair< unsigned int, unsigned int > > Indice_Map
std::vector< Track > TrackCollection
collection of Tracks
std::vector< ConstRecHitPointer > RecHitContainer
GlobalPoint globalPosition() const
bool getTrackFromTrajectory(const Trajectory &newTraj, const TrajectoryRef &initialTrajRef, AlgoProductCollection &algoResults)
Get the refitted track from the Trajectory.
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
int KeepOnlyCorrectedTracks
const Point & position() const
position
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.
PropagationDirection const & direction() const
U second(std::pair< T, U > const &p)
const SurfaceType & surface() const
std::vector< TrajectoryMeasurement > DataContainer
const ref_type & refProd() const
return ref-prod structure
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::ESHandle< TrackerGeometry > theG
TrajectoryMeasurement const & lastMeasurement() const
GlobalVector momentum() const
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
std::vector< NuclearInteraction > NuclearInteractionCollection
collection of NuclearInteractions
TrackProducerAlgorithm< reco::Track > * theAlgo
math::XYZPoint Point
point in the space
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const LocalTrajectoryError & localError() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, reco::TrackCollection > > TrackToTrackMap
double likelihood() const
return the likelihood ~ probability that the vertex is a real nuclear interaction ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
RefProd< PROD > getRefBeforePut()
edm::ESHandle< Propagator > thePropagator
GlobalPoint position() const
edm::ESHandle< TrajectoryFitter > theFitter
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
TrajectoryMeasurement const & firstMeasurement() const
T const * product() const
void insert(const key_type &k, const data_type &v)
insert an association
const GlobalTrajectoryParameters & globalParameters() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::TrackExtra getNewTrackExtra(const AlgoProductCollection &algoresults)
get a new TrackExtra from an AlgoProductCollection
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T const * product() const
bool newTrajNeeded(Trajectory &newtrajectory, const TrajectoryRef &trajRef, const reco::NuclearInteraction &ni)
check if the trajectory has to be refitted and get the new trajectory
std::vector< Trajectory > TrajectoryCollection
const TrajTrackAssociationCollection * m_TrajToTrackCollection
const reco::Vertex & vertex() const
return the vertex
TrackProducerAlgorithm< reco::Track >::AlgoProductCollection AlgoProductCollection
TrajectoryStateOnSurface const & updatedState() const
void swap_map(const edm::Handle< TrajectoryCollection > &trajColl, std::map< reco::TrackRef, edm::Ref< TrajectoryCollection > > &result)
void push(const TrajectoryMeasurement &tm)
TrajectoryStateOnSurface getInitialState(const reco::Track *theT, TransientTrackingRecHit::RecHitContainer &hits, const TrackingGeometry *theG, const MagneticField *theMF)
Calculate the inital state to be used to buil the track.
std::string str_Input_Trajectory
std::string str_Input_NuclearInteraction