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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 37 of file MuonMillepedeTrackRefitter.h.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 39 of file MuonMillepedeTrackRefitter.h.

◆ ConstTrajTrackPairCollection

Definition at line 40 of file MuonMillepedeTrackRefitter.h.

Constructor & Destructor Documentation

◆ MuonMillepedeTrackRefitter()

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

Constructor.

Definition at line 51 of file MuonMillepedeTrackRefitter.cc.

51  {
52  SACollectionTag = pset.getParameter<edm::InputTag>("SATrackCollectionTag");
53 
54  //Products
55  produces<std::vector<Trajectory>>();
56  produces<TrajTrackAssociationCollection>();
57 }

References muonDTDigis_cfi::pset, and SACollectionTag.

◆ ~MuonMillepedeTrackRefitter()

MuonMillepedeTrackRefitter::~MuonMillepedeTrackRefitter ( )
override

Destructor.

Definition at line 60 of file MuonMillepedeTrackRefitter.cc.

60 {}

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 62 of file MuonMillepedeTrackRefitter.cc.

62  {
63  //Get collections from the event
64 
66  event.getByLabel(SACollectionTag, tracksSA);
67 
69  eventSetup.get<IdealMagneticFieldRecord>().get(theMGField);
70 
71  edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
72  eventSetup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry);
73 
74  edm::RefProd<std::vector<Trajectory>> trajectoryCollectionRefProd = event.getRefBeforePut<std::vector<Trajectory>>();
75 
76  //Allocate collection of tracks
77  auto trajectoryCollection = std::make_unique<std::vector<Trajectory>>();
78  // Association map between Trajectory and Track
79  auto trajTrackMap = std::make_unique<TrajTrackAssociationCollection>();
80 
81  //Create the propagator
82 
83  std::map<edm::Ref<std::vector<Trajectory>>::key_type, edm::Ref<reco::TrackCollection>::key_type> trajToTrack_map;
84 
85  edm::Ref<std::vector<Trajectory>>::key_type trajectoryIndex = 0;
86 
87  reco::TrackRef::key_type trackIndex = 0;
88 
89  for (reco::TrackCollection::const_iterator trackSA = tracksSA->begin(); trackSA != tracksSA->end(); ++trackSA) {
90  reco::TransientTrack tTrackSA(*trackSA, &*theMGField, theTrackingGeometry);
91 
92  //Create an empty trajectory
93  Trajectory myTraj;
94 
95  TrajectoryStateOnSurface innerTSOS = tTrackSA.innermostMeasurementState();
96 
97  for (trackingRecHit_iterator theHit = tTrackSA.recHitsBegin(); theHit != tTrackSA.recHitsEnd(); ++theHit) {
98  TrackingRecHit* myClone = (*theHit)->clone();
99  const GeomDet* myDet = theTrackingGeometry->idToDet((*theHit)->geographicalId());
100  TrajectoryMeasurement myMeas(innerTSOS,
102  myTraj.push(myMeas);
103  }
104 
105  trajectoryCollection->push_back(myTraj);
106  trajToTrack_map[trajectoryIndex] = trackIndex;
107  ++trajectoryIndex;
108  ++trackIndex;
109  }
110 
111  edm::OrphanHandle<std::vector<Trajectory>> trajsRef = event.put(std::move(trajectoryCollection));
112 
113  for (trajectoryIndex = 0; trajectoryIndex < tracksSA->size(); ++trajectoryIndex) {
114  edm::Ref<reco::TrackCollection>::key_type trackCounter = trajToTrack_map[trajectoryIndex];
115  trajTrackMap->insert(edm::Ref<std::vector<Trajectory>>(trajsRef, trajectoryIndex),
116  edm::Ref<reco::TrackCollection>(tracksSA, trackCounter));
117  }
118 
119  event.put(std::move(trajTrackMap));
120 }

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

Member Data Documentation

◆ SACollectionTag

edm::InputTag MuonMillepedeTrackRefitter::SACollectionTag
private

Definition at line 54 of file MuonMillepedeTrackRefitter.h.

Referenced by MuonMillepedeTrackRefitter(), and produce().

edm::RefProd
Definition: EDProductfwd.h:25
MuonTransientTrackingRecHit::specificBuild
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
Definition: MuonTransientTrackingRecHit.h:75
GeomDet
Definition: GeomDet.h:27
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
edm::Handle< reco::TrackCollection >
edm::Ref
Definition: AssociativeIterator.h:58
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MuonMillepedeTrackRefitter::SACollectionTag
edm::InputTag SACollectionTag
Definition: MuonMillepedeTrackRefitter.h:54
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::ESHandle< MagneticField >
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
get
#define get
Trajectory::push
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
TrackingRecHit::clone
virtual TrackingRecHit * clone() const =0
edm::Ref::key_type
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:164
TrackingRecHit
Definition: TrackingRecHit.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
reco::TransientTrack
Definition: TransientTrack.h:19
Trajectory
Definition: Trajectory.h:38
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27