#include <MuonMillepedeTrackRefitter.h>
Public Types | |
typedef AlignmentAlgorithmBase::ConstTrajTrackPair | ConstTrajTrackPair |
typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection | ConstTrajTrackPairCollection |
Public Member Functions | |
MuonMillepedeTrackRefitter (const edm::ParameterSet &pset) | |
Constructor. | |
virtual void | produce (edm::Event &event, const edm::EventSetup &eventSetup) |
virtual | ~MuonMillepedeTrackRefitter () |
Destructor. | |
Private Attributes | |
edm::InputTag | SACollectionTag |
This class produces a collection of TrackForAlignment using as input Tracks and 4DSegments from AlcaReco. Calculation of predicted states is performed here.
Definition at line 40 of file MuonMillepedeTrackRefitter.h.
Definition at line 43 of file MuonMillepedeTrackRefitter.h.
typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection MuonMillepedeTrackRefitter::ConstTrajTrackPairCollection |
Definition at line 44 of file MuonMillepedeTrackRefitter.h.
MuonMillepedeTrackRefitter::MuonMillepedeTrackRefitter | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 53 of file MuonMillepedeTrackRefitter.cc.
References edm::ParameterSet::getParameter(), and SACollectionTag.
{ SACollectionTag = pset.getParameter<edm::InputTag>( "SATrackCollectionTag" ); //Products produces<std::vector<Trajectory> >(); produces<TrajTrackAssociationCollection>(); }
MuonMillepedeTrackRefitter::~MuonMillepedeTrackRefitter | ( | ) | [virtual] |
void MuonMillepedeTrackRefitter::produce | ( | edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 70 of file MuonMillepedeTrackRefitter.cc.
References TrackingRecHit::clone(), edm::EventSetup::get(), reco::TransientTrack::innermostMeasurementState(), Trajectory::push(), reco::TransientTrack::recHitsBegin(), reco::TransientTrack::recHitsEnd(), SACollectionTag, and MuonTransientTrackingRecHit::specificBuild().
{ //Get collections from the event edm::Handle<reco::TrackCollection> tracksSA; event.getByLabel( SACollectionTag, tracksSA ); edm::ESHandle<MagneticField> theMGField; eventSetup.get<IdealMagneticFieldRecord>().get( theMGField ); edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry; eventSetup.get<GlobalTrackingGeometryRecord>().get( theTrackingGeometry ); edm::RefProd<std::vector<Trajectory> > trajectoryCollectionRefProd = event.getRefBeforePut<std::vector<Trajectory> >(); //Allocate collection of tracks std::auto_ptr<std::vector<Trajectory> > trajectoryCollection( new std::vector<Trajectory> ); // Association map between Trajectory and Track std::auto_ptr<TrajTrackAssociationCollection> trajTrackMap( new TrajTrackAssociationCollection ); //Create the propagator std::map<edm::Ref<std::vector<Trajectory> >::key_type, edm::Ref<reco::TrackCollection>::key_type> trajToTrack_map; edm::Ref<std::vector<Trajectory> >::key_type trajectoryIndex = 0; reco::TrackRef::key_type trackIndex = 0; for (reco::TrackCollection::const_iterator trackSA = tracksSA->begin(); trackSA != tracksSA->end(); ++trackSA ) { reco::TransientTrack tTrackSA( *trackSA, &*theMGField, theTrackingGeometry ); //Create an empty trajectory Trajectory myTraj; TrajectoryStateOnSurface innerTSOS = tTrackSA.innermostMeasurementState(); for(trackingRecHit_iterator theHit = tTrackSA.recHitsBegin(); theHit != tTrackSA.recHitsEnd(); ++theHit) { TrackingRecHit *myClone = (*theHit)->clone(); const GeomDet* myDet = theTrackingGeometry->idToDet( (*theHit)->geographicalId() ); TrajectoryMeasurement myMeas(innerTSOS, &* MuonTransientTrackingRecHit::specificBuild(myDet, (TrackingRecHit *) &*myClone)); myTraj.push(myMeas); } trajectoryCollection->push_back(myTraj); trajToTrack_map[trajectoryIndex] = trackIndex; ++trajectoryIndex; ++trackIndex; } edm::OrphanHandle<std::vector<Trajectory> > trajsRef = event.put(trajectoryCollection); for( trajectoryIndex = 0; trajectoryIndex < tracksSA->size(); ++trajectoryIndex) { edm::Ref<reco::TrackCollection>::key_type trackCounter = trajToTrack_map[trajectoryIndex]; trajTrackMap->insert(edm::Ref<std::vector<Trajectory> >(trajsRef, trajectoryIndex), edm::Ref<reco::TrackCollection>(tracksSA, trackCounter)); } event.put(trajTrackMap); }
Definition at line 61 of file MuonMillepedeTrackRefitter.h.
Referenced by MuonMillepedeTrackRefitter(), and produce().