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 Types | Private Attributes
ConversionTrackProducer Class Reference
Inheritance diagram for ConversionTrackProducer:
edm::stream::EDProducer<>

Public Member Functions

 ConversionTrackProducer (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~ConversionTrackProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

typedef edm::AssociationMap
< edm::OneToOne< std::vector
< Trajectory >
, reco::GsfTrackCollection,
unsigned short > > 
TrajGsfTrackAssociationCollection
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotInputTag
 
IdealHelixParameters ConvTrackPreSelector
 
bool filterOnConvTrackHyp
 
edm::EDGetTokenT< edm::View
< reco::Track > > 
genericTracks
 
edm::EDGetTokenT
< TrajGsfTrackAssociationCollection
gsfTrajectories
 
edm::EDGetTokenT
< TrajTrackAssociationCollection
kfTrajectories
 
edm::ESGetToken< MagneticField,
IdealMagneticFieldRecord
magFieldToken
 
double minConvRadius
 
bool setArbitratedEcalSeeded
 
bool setArbitratedMerged
 
bool setArbitratedMergedEcalGeneral
 
bool setIsGsfTrackOpen
 
bool setTrackerOnly
 
bool useTrajectory
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 38 of file ConversionTrackProducer.cc.

Member Typedef Documentation

Definition at line 40 of file ConversionTrackProducer.cc.

Constructor & Destructor Documentation

ConversionTrackProducer::ConversionTrackProducer ( const edm::ParameterSet conf)
explicit

Definition at line 75 of file ConversionTrackProducer.cc.

References DeDxTools::esConsumes(), genericTracks, edm::ParameterSet::getParameter(), gsfTrajectories, kfTrajectories, magFieldToken, AlCaHLTBitMon_QueryRunRegistry::string, and useTrajectory.

76  : useTrajectory(conf.getParameter<bool>("useTrajectory")),
77  setTrackerOnly(conf.getParameter<bool>("setTrackerOnly")),
78  setIsGsfTrackOpen(conf.getParameter<bool>("setIsGsfTrackOpen")),
79  setArbitratedEcalSeeded(conf.getParameter<bool>("setArbitratedEcalSeeded")),
80  setArbitratedMerged(conf.getParameter<bool>("setArbitratedMerged")),
81  setArbitratedMergedEcalGeneral(conf.getParameter<bool>("setArbitratedMergedEcalGeneral")),
82  beamSpotInputTag(consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotInputTag"))),
83  filterOnConvTrackHyp(conf.getParameter<bool>("filterOnConvTrackHyp")),
84  minConvRadius(conf.getParameter<double>("minConvRadius")) {
85  edm::InputTag thetp(conf.getParameter<std::string>("TrackProducer"));
86  genericTracks = consumes<edm::View<reco::Track> >(thetp);
87  if (useTrajectory) {
88  kfTrajectories = consumes<TrajTrackAssociationCollection>(thetp);
89  gsfTrajectories = consumes<TrajGsfTrackAssociationCollection>(thetp);
90  }
92  produces<reco::ConversionTrackCollection>();
93 }
edm::EDGetTokenT< edm::View< reco::Track > > genericTracks
edm::EDGetTokenT< TrajTrackAssociationCollection > kfTrajectories
edm::EDGetTokenT< reco::BeamSpot > beamSpotInputTag
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< TrajGsfTrackAssociationCollection > gsfTrajectories
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
ConversionTrackProducer::~ConversionTrackProducer ( )
override

Definition at line 96 of file ConversionTrackProducer.cc.

96 {}

Member Function Documentation

void ConversionTrackProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 99 of file ConversionTrackProducer.cc.

References edm::View< T >::at(), beam_dqm_sourceclient-live_cfg::beamSpot, beamSpotInputTag, edm::RefToBase< T >::castTo(), ConvTrackPreSelector, edm::View< T >::empty(), filterOnConvTrackHyp, genericTracks, edm::RefToBase< T >::get(), edm::Event::get(), edm::EventSetup::getData(), gsfTrajectories, mps_fire::i, IdealHelixParameters::isTangentPointDistanceLessThan(), kfTrajectories, magFieldToken, minConvRadius, eostools::move(), edm::Event::put(), edm::View< T >::refAt(), setArbitratedEcalSeeded, setArbitratedMerged, setArbitratedMergedEcalGeneral, reco::ConversionTrack::setIsArbitratedEcalSeeded(), reco::ConversionTrack::setIsArbitratedMerged(), reco::ConversionTrack::setIsArbitratedMergedEcalGeneral(), reco::ConversionTrack::setIsGsfTrackOpen(), setIsGsfTrackOpen, reco::ConversionTrack::setIsTrackerOnly(), IdealHelixParameters::setMagnField(), setTrackerOnly, reco::ConversionTrack::setTrajRef(), edm::View< T >::size(), and useTrajectory.

99  {
100  //get input collection (through edm::View)
101  edm::View<reco::Track> const& trks = e.get(genericTracks);
102 
103  //get association maps between trajectories and tracks and build temporary maps
104  std::map<reco::TrackRef, edm::Ref<std::vector<Trajectory> > > tracktrajmap;
105  std::map<reco::GsfTrackRef, edm::Ref<std::vector<Trajectory> > > gsftracktrajmap;
106 
107  if (useTrajectory) {
108  if (!trks.empty()) {
109  if (dynamic_cast<const reco::GsfTrack*>(&trks.at(0))) {
110  //fill map for gsf tracks
111  for (auto const& pair : e.get(gsfTrajectories)) {
112  gsftracktrajmap[pair.val] = pair.key;
113  }
114  } else {
115  //fill map for standard tracks
116  for (auto const& pair : e.get(kfTrajectories)) {
117  tracktrajmap[pair.val] = pair.key;
118  }
119  }
120  }
121  }
122 
123  // Step B: create empty output collection
124  auto outputTrks = std::make_unique<reco::ConversionTrackCollection>();
125 
126  //--------------------------------------------------
127  //Added by D. Giordano
128  // 2011/08/05
129  // Reduction of the track sample based on geometric hypothesis for conversion tracks
130 
132 
134 
135  //----------------------------------------------------------
136 
137  // Simple conversion of tracks to conversion tracks, setting appropriate flags from configuration
138  for (size_t i = 0; i < trks.size(); ++i) {
139  //--------------------------------------------------
140  //Added by D. Giordano
141  // 2011/08/05
142  // Reduction of the track sample based on geometric hypothesis for conversion tracks
143 
144  edm::RefToBase<reco::Track> trackBaseRef = trks.refAt(i);
145  if (filterOnConvTrackHyp &&
147  continue;
148  //--------------------------------------------------
149 
150  reco::ConversionTrack convTrack(trackBaseRef);
151  convTrack.setIsTrackerOnly(setTrackerOnly);
152  convTrack.setIsGsfTrackOpen(setIsGsfTrackOpen);
153  convTrack.setIsArbitratedEcalSeeded(setArbitratedEcalSeeded);
154  convTrack.setIsArbitratedMerged(setArbitratedMerged);
155  convTrack.setIsArbitratedMergedEcalGeneral(setArbitratedMergedEcalGeneral);
156 
157  //fill trajectory association if configured, using correct map depending on track type
158  if (useTrajectory) {
159  if (!gsftracktrajmap.empty()) {
160  convTrack.setTrajRef(gsftracktrajmap.find(trackBaseRef.castTo<reco::GsfTrackRef>())->second);
161  } else {
162  convTrack.setTrajRef(tracktrajmap.find(trackBaseRef.castTo<reco::TrackRef>())->second);
163  }
164  }
165 
166  outputTrks->push_back(convTrack);
167  }
168 
169  e.put(std::move(outputTrks));
170  return;
171 
172 } //end produce
value_type const * get() const
Definition: RefToBase.h:209
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
void setMagnField(const MagneticField *magnField)
edm::EDGetTokenT< edm::View< reco::Track > > genericTracks
edm::EDGetTokenT< TrajTrackAssociationCollection > kfTrajectories
size_type size() const
RefToBase< value_type > refAt(size_type i) const
def move
Definition: eostools.py:511
bool empty() const
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
IdealHelixParameters ConvTrackPreSelector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::EDGetTokenT< reco::BeamSpot > beamSpotInputTag
REF castTo() const
Definition: RefToBase.h:257
edm::EDGetTokenT< TrajGsfTrackAssociationCollection > gsfTrajectories
bool isTangentPointDistanceLessThan(float rmax, const reco::Track *track, const math::XYZVector &refPoint)
const_reference at(size_type pos) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> ConversionTrackProducer::beamSpotInputTag
private

Definition at line 65 of file ConversionTrackProducer.cc.

Referenced by produce().

IdealHelixParameters ConversionTrackProducer::ConvTrackPreSelector
private

Definition at line 69 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::filterOnConvTrackHyp
private

Definition at line 67 of file ConversionTrackProducer.cc.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::Track> > ConversionTrackProducer::genericTracks
private

Definition at line 50 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

edm::EDGetTokenT<TrajGsfTrackAssociationCollection> ConversionTrackProducer::gsfTrajectories
private

Definition at line 52 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

edm::EDGetTokenT<TrajTrackAssociationCollection> ConversionTrackProducer::kfTrajectories
private

Definition at line 51 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> ConversionTrackProducer::magFieldToken
private

Definition at line 66 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

double ConversionTrackProducer::minConvRadius
private

Definition at line 68 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::setArbitratedEcalSeeded
private

Definition at line 56 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::setArbitratedMerged
private

Definition at line 57 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::setArbitratedMergedEcalGeneral
private

Definition at line 58 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::setIsGsfTrackOpen
private

Definition at line 55 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::setTrackerOnly
private

Definition at line 54 of file ConversionTrackProducer.cc.

Referenced by produce().

bool ConversionTrackProducer::useTrajectory
private

Definition at line 53 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().