CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonSeedTrack Class Reference

#include <MuonSeedTrack.h>

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

Public Member Functions

 MuonSeedTrack (const edm::ParameterSet &)
 constructor with config More...
 
 ~MuonSeedTrack () 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 pre-job booking More...
 
std::pair< bool, reco::TrackbuildTrackAtPCA (const TrajectorySeed &) const
 Build a track at the PCA WITHOUT any vertex constriant. More...
 
void endJob () override
 post-job More...
 
TrajectoryStateOnSurface getSeedTSOS (const TrajectorySeed &seed) const
 get the TrajectorySeed's TrajectoryStateOnSurface More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 construct proto-tracks More...
 
void setAlias (std::string alias)
 set the Branch alias More...
 

Private Attributes

std::string theAlias
 the Branch alias More...
 
bool theAllowNoVtxFlag
 
edm::InputTag theSeedsLabel
 the propagator used for extracting TSOS from seed More...
 
edm::EDGetTokenT
< TrajectorySeedCollection
theSeedsToken
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
MuonUpdatorAtVertextheUpdatorAtVtx
 the class used for updating a Trajectory State at veretex More...
 

Additional Inherited Members

- 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
 
- 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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Make a (fake) reco::Track from a TrajectorySeed. The (fake) track can be associated to a TrackingParticle (SimTrack) using SimTracker/TrackAssociation. The association can then be used in Validation packages, such as Validation/RecoMuon/MuonTrackValidator.cc

Author
Adam Everett Purdue University

Definition at line 46 of file MuonSeedTrack.h.

Constructor & Destructor Documentation

MuonSeedTrack::MuonSeedTrack ( const edm::ParameterSet pset)
explicit

constructor with config

Definition at line 39 of file MuonSeedTrack.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), MuonServiceProxy_cff::MuonServiceProxy, MuonUpdatorAtVertex_cff::MuonUpdatorAtVertex, and AlCaHLTBitMon_QueryRunRegistry::string.

39  {
40  // service parameters
41  ParameterSet serviceParameters = pset.getParameter<ParameterSet>("ServiceParameters");
42  theService = new MuonServiceProxy(serviceParameters, consumesCollector());
43 
44  ParameterSet updatorPar = pset.getParameter<ParameterSet>("MuonUpdatorAtVertexParameters");
45  //theSeedPropagatorName = updatorPar.getParameter<string>("Propagator");
46  theSeedsLabel = pset.getParameter<InputTag>("MuonSeed");
47  theSeedsToken = consumes<TrajectorySeedCollection>(theSeedsLabel);
48  theUpdatorAtVtx = new MuonUpdatorAtVertex(updatorPar, theService);
49 
50  theAllowNoVtxFlag = pset.getUntrackedParameter<bool>("AllowNoVertex", false);
51 
52  //register products
53  setAlias(pset.getParameter<std::string>("@module_label"));
54  produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks");
55 }
T getUntrackedParameter(std::string const &, T const &) const
std::string theAlias
the Branch alias
Definition: MuonSeedTrack.h:85
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: MuonSeedTrack.h:79
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< TrajectorySeedCollection > theSeedsToken
Definition: MuonSeedTrack.h:92
MuonUpdatorAtVertex * theUpdatorAtVtx
the class used for updating a Trajectory State at veretex
Definition: MuonSeedTrack.h:82
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool theAllowNoVtxFlag
Definition: MuonSeedTrack.h:95
edm::InputTag theSeedsLabel
the propagator used for extracting TSOS from seed
Definition: MuonSeedTrack.h:91
void setAlias(std::string alias)
set the Branch alias
Definition: MuonSeedTrack.h:68
MuonSeedTrack::~MuonSeedTrack ( )
override

destructor

Definition at line 60 of file MuonSeedTrack.cc.

60  {
61  if (theService)
62  delete theService;
63  if (theUpdatorAtVtx)
64  delete theUpdatorAtVtx;
65 }
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: MuonSeedTrack.h:79
MuonUpdatorAtVertex * theUpdatorAtVtx
the class used for updating a Trajectory State at veretex
Definition: MuonSeedTrack.h:82

Member Function Documentation

void MuonSeedTrack::beginJob ( void  )
overrideprivatevirtual

pre-job booking

empty method

Reimplemented from edm::EDProducer.

Definition at line 104 of file MuonSeedTrack.cc.

104 {}
pair< bool, reco::Track > MuonSeedTrack::buildTrackAtPCA ( const TrajectorySeed seed) const
private

Build a track at the PCA WITHOUT any vertex constriant.

First calls getSeedTSOS, then propagates to the vertex. Creates a reco::Track from the propagated initial FreeTrajectoryState.

Definition at line 155 of file MuonSeedTrack.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::curvilinearError(), debug, MuonPatternRecoDumper::dumpFTS(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), TrackerBounds::isInside(), LogTrace, metname, FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), HLT_FULL_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

155  {
156  const string metname = "MuonSeedTrack";
157 
159 
160  TSOS seedTSOS = getSeedTSOS(seed);
161  // This is needed to extrapolate the tsos at vertex
162  LogTrace(metname) << "Propagate to PCA...";
163  pair<bool, FreeTrajectoryState> extrapolationResult = theUpdatorAtVtx->propagateToNominalLine(seedTSOS);
164  FreeTrajectoryState ftsAtVtx;
165 
166  if (extrapolationResult.first) {
167  ftsAtVtx = extrapolationResult.second;
168  } else {
169  if (TrackerBounds::isInside(seedTSOS.globalPosition())) {
170  LogWarning(metname) << "Track in the Tracker: taking the innermost state instead of the state at PCA";
171  ftsAtVtx = *seedTSOS.freeState();
172  } else {
173  if (theAllowNoVtxFlag) {
174  LogWarning(metname) << "Propagation to PCA failed, taking the innermost state instead of the state at PCA";
175  ftsAtVtx = *seedTSOS.freeState();
176  } else {
177  LogWarning(metname) << "Stand Alone track: this track will be rejected";
178  return pair<bool, reco::Track>(false, reco::Track());
179  }
180  }
181  }
182 
183  LogTrace(metname) << "TSOS after the extrapolation at vtx";
184  LogTrace(metname) << debug.dumpFTS(ftsAtVtx);
185 
186  GlobalPoint pca = ftsAtVtx.position();
187  math::XYZPoint persistentPCA(pca.x(), pca.y(), pca.z());
188  GlobalVector p = ftsAtVtx.momentum();
189  math::XYZVector persistentMomentum(p.x(), p.y(), p.z());
190 
191  double dummyNDOF = 1.0;
192  double dummyChi2 = 1.0;
193 
195  dummyChi2, dummyNDOF, persistentPCA, persistentMomentum, ftsAtVtx.charge(), ftsAtVtx.curvilinearError());
196 
197  return pair<bool, reco::Track>(true, track);
198 }
static bool isInside(const GlobalPoint &)
const std::string metname
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
#define LogTrace(id)
std::string dumpFTS(const FreeTrajectoryState &fts) const
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:61
GlobalVector momentum() const
MuonUpdatorAtVertex * theUpdatorAtVtx
the class used for updating a Trajectory State at veretex
Definition: MuonSeedTrack.h:82
GlobalPoint position() const
#define debug
Definition: HDRShower.cc:19
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
TrajectoryStateOnSurface getSeedTSOS(const TrajectorySeed &seed) const
get the TrajectorySeed&#39;s TrajectoryStateOnSurface
bool theAllowNoVtxFlag
Definition: MuonSeedTrack.h:95
Log< level::Warning, false > LogWarning
T x() const
Definition: PV3DBase.h:59
std::pair< bool, FreeTrajectoryState > propagateToNominalLine(const TrajectoryStateOnSurface &tsos) const
Propagate the state to the 2D-PCA (nominal CMS axis)
void MuonSeedTrack::endJob ( void  )
overrideprivatevirtual

post-job

empty method

Reimplemented from edm::EDProducer.

Definition at line 109 of file MuonSeedTrack.cc.

109 {}
TrajectoryStateOnSurface MuonSeedTrack::getSeedTSOS ( const TrajectorySeed seed) const
private

get the TrajectorySeed's TrajectoryStateOnSurface

Get the TrajectoryStateOnSurface from the TrajectorySeed

Definition at line 114 of file MuonSeedTrack.cc.

References PTrajectoryStateOnDet::detId(), TrajectorySeed::startingState(), and trajectoryStateTransform::transientState().

114  {
115  // Get the Trajectory State on Det (persistent version of a TSOS) from the seed
116  PTrajectoryStateOnDet pTSOD = seed.startingState();
117 
118  // Transform it in a TrajectoryStateOnSurface
119 
120  DetId seedDetId(pTSOD.detId());
121 
122  const GeomDet* gdet = theService->trackingGeometry()->idToDet(seedDetId);
123 
124  TrajectoryStateOnSurface initialState =
125  trajectoryStateTransform::transientState(pTSOD, &(gdet->surface()), &*theService->magneticField());
126 
127  /*
128  // Get the layer on which the seed relies
129  const DetLayer *initialLayer = theService->detLayerGeometry()->idToLayer( seedDetId );
130 
131  PropagationDirection detLayerOrder = oppositeToMomentum;
132 
133  // ask for compatible layers
134  vector<const DetLayer*> detLayers;
135  detLayers = initialLayer->compatibleLayers( *initialState.freeState(),detLayerOrder);
136 
137  TrajectoryStateOnSurface result = initialState;
138  if(detLayers.size()){
139  const DetLayer* finalLayer = detLayers.back();
140  const TrajectoryStateOnSurface propagatedState = theService->propagator(theSeedPropagatorName)->propagate(initialState, finalLayer->surface());
141  if(propagatedState.isValid())
142  result = propagatedState;
143  }
144 
145  return result;
146  */
147 
148  return initialState;
149 }
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: MuonSeedTrack.h:79
unsigned int detId() const
Definition: DetId.h:17
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
void MuonSeedTrack::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

construct proto-tracks

For each seed, make a (fake) reco::Track

Implements edm::EDProducer.

Definition at line 74 of file MuonSeedTrack.cc.

References eostools::move(), DetachedQuadStep_cff::seeds, HLT_FULL_cff::track, and HLT_FULL_cff::trackCollection.

74  {
75  using namespace edm;
76 
77  // Update the services
78  theService->update(eventSetup);
79 
80  // the track collectios; they will be loaded in the event
81  unique_ptr<reco::TrackCollection> trackCollection(new reco::TrackCollection());
82  // ... and its reference into the event
83  reco::TrackRefProd trackCollectionRefProd = event.getRefBeforePut<reco::TrackCollection>();
84 
86  event.getByToken(theSeedsToken, seeds);
87 
88  for (TrajectorySeedCollection::const_iterator iSeed = seeds->begin(); iSeed != seeds->end(); iSeed++) {
89  pair<bool, reco::Track> resultOfTrackExtrapAtPCA = buildTrackAtPCA(*iSeed);
90  if (!resultOfTrackExtrapAtPCA.first)
91  continue;
92  // take the "bare" track at PCA
93  reco::Track& track = resultOfTrackExtrapAtPCA.second;
94  // fill the TrackCollection
95  trackCollection->push_back(track);
96  }
97 
98  event.put(std::move(trackCollection));
99 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: MuonSeedTrack.h:79
def move
Definition: eostools.py:511
std::pair< bool, reco::Track > buildTrackAtPCA(const TrajectorySeed &) const
Build a track at the PCA WITHOUT any vertex constriant.
edm::EDGetTokenT< TrajectorySeedCollection > theSeedsToken
Definition: MuonSeedTrack.h:92
tuple trackCollection
void MuonSeedTrack::setAlias ( std::string  alias)
inlineprivate

set the Branch alias

Definition at line 68 of file MuonSeedTrack.h.

References HLT_FULL_cff::alias, and theAlias.

68  {
69  alias.erase(alias.size() - 1, alias.size());
70  theAlias = alias;
71  }
std::string theAlias
the Branch alias
Definition: MuonSeedTrack.h:85

Member Data Documentation

std::string MuonSeedTrack::theAlias
private

the Branch alias

Definition at line 85 of file MuonSeedTrack.h.

Referenced by setAlias().

bool MuonSeedTrack::theAllowNoVtxFlag
private

Definition at line 95 of file MuonSeedTrack.h.

edm::InputTag MuonSeedTrack::theSeedsLabel
private

the propagator used for extracting TSOS from seed

the TrajectorySeed label

Definition at line 91 of file MuonSeedTrack.h.

edm::EDGetTokenT<TrajectorySeedCollection> MuonSeedTrack::theSeedsToken
private

Definition at line 92 of file MuonSeedTrack.h.

MuonServiceProxy* MuonSeedTrack::theService
private

the event setup proxy, it takes care the services update

Definition at line 79 of file MuonSeedTrack.h.

MuonUpdatorAtVertex* MuonSeedTrack::theUpdatorAtVtx
private

the class used for updating a Trajectory State at veretex

Definition at line 82 of file MuonSeedTrack.h.