CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
MuonMillepedeTrackRefitter Class Reference

#include <MuonMillepedeTrackRefitter.h>

Inheritance diagram for MuonMillepedeTrackRefitter:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair
 
typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 MuonMillepedeTrackRefitter (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 ~MuonMillepedeTrackRefitter () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::InputTag SACollectionTag
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Date
2010/02/24 09:09:10
Revision
1.3
Author
P. Martinez Ruiz del Arbol, IFCA (CSIC-UC) Pablo.nosp@m..Mar.nosp@m.tinez.nosp@m.@cer.nosp@m.n.ch

This class produces a collection of TrackForAlignment using as input Tracks and 4DSegments from AlcaReco. Calculation of predicted states is performed here.

Date
2009/12/15 15:07:16
Revision
1.1
Author
P. Martinez Ruiz del Arbol, IFCA (CSIC-UC) Pablo.nosp@m..Mar.nosp@m.tinez.nosp@m.@cer.nosp@m.n.ch

Definition at line 40 of file MuonMillepedeTrackRefitter.h.

Member Typedef Documentation

Definition at line 43 of file MuonMillepedeTrackRefitter.h.

Definition at line 44 of file MuonMillepedeTrackRefitter.h.

Constructor & Destructor Documentation

MuonMillepedeTrackRefitter::MuonMillepedeTrackRefitter ( const edm::ParameterSet pset)

Constructor.

Definition at line 53 of file MuonMillepedeTrackRefitter.cc.

References edm::ParameterSet::getParameter(), and SACollectionTag.

54 {
55 
56  SACollectionTag = pset.getParameter<edm::InputTag>( "SATrackCollectionTag" );
57 
58  //Products
59  produces<std::vector<Trajectory> >();
60  produces<TrajTrackAssociationCollection>();
61 
62 }
T getParameter(std::string const &) const
MuonMillepedeTrackRefitter::~MuonMillepedeTrackRefitter ( )
override

Destructor.

Definition at line 65 of file MuonMillepedeTrackRefitter.cc.

66 {
67 }

Member Function Documentation

void MuonMillepedeTrackRefitter::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

Definition at line 70 of file MuonMillepedeTrackRefitter.cc.

References TrackingRecHit::clone(), DEFINE_FWK_MODULE, edm::EventSetup::get(), GlobalTrackingGeometry::idToDet(), reco::TransientTrack::innermostMeasurementState(), eostools::move(), Trajectory::push(), reco::TransientTrack::recHitsBegin(), reco::TransientTrack::recHitsEnd(), SACollectionTag, and MuonTransientTrackingRecHit::specificBuild().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

71 {
72 
73  //Get collections from the event
74 
76  event.getByLabel( SACollectionTag, tracksSA );
77 
79  eventSetup.get<IdealMagneticFieldRecord>().get( theMGField );
80 
81  edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
82  eventSetup.get<GlobalTrackingGeometryRecord>().get( theTrackingGeometry );
83 
84  edm::RefProd<std::vector<Trajectory> > trajectoryCollectionRefProd
85  = event.getRefBeforePut<std::vector<Trajectory> >();
86 
87  //Allocate collection of tracks
88  auto trajectoryCollection = std::make_unique<std::vector<Trajectory>>();
89  // Association map between Trajectory and Track
90  auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>();
91 
92 
93  //Create the propagator
94 
95  std::map<edm::Ref<std::vector<Trajectory> >::key_type, edm::Ref<reco::TrackCollection>::key_type> trajToTrack_map;
96 
97  edm::Ref<std::vector<Trajectory> >::key_type trajectoryIndex = 0;
98 
99  reco::TrackRef::key_type trackIndex = 0;
100 
101  for (reco::TrackCollection::const_iterator trackSA = tracksSA->begin(); trackSA != tracksSA->end(); ++trackSA ) {
102 
103  reco::TransientTrack tTrackSA( *trackSA, &*theMGField, theTrackingGeometry );
104 
105  //Create an empty trajectory
106  Trajectory myTraj;
107 
108  TrajectoryStateOnSurface innerTSOS = tTrackSA.innermostMeasurementState();
109 
110 
111  for(trackingRecHit_iterator theHit = tTrackSA.recHitsBegin(); theHit != tTrackSA.recHitsEnd(); ++theHit) {
112 
113  TrackingRecHit *myClone = (*theHit)->clone();
114  const GeomDet* myDet = theTrackingGeometry->idToDet( (*theHit)->geographicalId() );
116  myTraj.push(myMeas);
117 
118  }
119 
120  trajectoryCollection->push_back(myTraj);
121  trajToTrack_map[trajectoryIndex] = trackIndex;
122  ++trajectoryIndex;
123  ++trackIndex;
124  }
125 
126  edm::OrphanHandle<std::vector<Trajectory> > trajsRef = event.put(std::move(trajectoryCollection));
127 
128  for( trajectoryIndex = 0; trajectoryIndex < tracksSA->size(); ++trajectoryIndex)
129  {
130  edm::Ref<reco::TrackCollection>::key_type trackCounter = trajToTrack_map[trajectoryIndex];
131  trajTrackMap->insert(edm::Ref<std::vector<Trajectory> >(trajsRef, trajectoryIndex), edm::Ref<reco::TrackCollection>(tracksSA, trackCounter));
132  }
133 
134  event.put(std::move(trajTrackMap));
135 
136 }
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:169
virtual TrackingRecHit * clone() const =0
T get() const
Definition: EventSetup.h:62
const GeomDet * idToDet(DetId) const override
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::InputTag MuonMillepedeTrackRefitter::SACollectionTag
private

Definition at line 61 of file MuonMillepedeTrackRefitter.h.

Referenced by MuonMillepedeTrackRefitter(), and produce().