CMS 3D CMS Logo

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< TrajGsfTrackAssociationCollectiongsfTrajectories
 
edm::EDGetTokenT< TrajTrackAssociationCollectionkfTrajectories
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagFieldToken
 
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

◆ TrajGsfTrackAssociationCollection

Definition at line 40 of file ConversionTrackProducer.cc.

Constructor & Destructor Documentation

◆ ConversionTrackProducer()

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 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::View< reco::Track > > genericTracks
edm::EDGetTokenT< TrajTrackAssociationCollection > kfTrajectories
edm::EDGetTokenT< reco::BeamSpot > beamSpotInputTag
edm::EDGetTokenT< TrajGsfTrackAssociationCollection > gsfTrajectories
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken

◆ ~ConversionTrackProducer()

ConversionTrackProducer::~ConversionTrackProducer ( )
override

Definition at line 96 of file ConversionTrackProducer.cc.

96 {}

Member Function Documentation

◆ produce()

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

Definition at line 99 of file ConversionTrackProducer.cc.

References pwdgSkimBPark_cfi::beamSpot, beamSpotInputTag, edm::RefToBase< T >::castTo(), ConvTrackPreSelector, MillePedeFileConverter_cfg::e, filterOnConvTrackHyp, genericTracks, edm::RefToBase< T >::get(), edm::EventSetup::getData(), gsfTrajectories, mps_fire::i, IdealHelixParameters::isTangentPointDistanceLessThan(), kfTrajectories, magFieldToken, minConvRadius, eostools::move(), 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(), hltEgammaHLTExtra_cfi::trks, and useTrajectory.

99  {
100  //get input collection (through edm::View)
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 
131  math::XYZVector beamSpot{e.get(beamSpotInputTag).position()};
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
REF castTo() const
Definition: RefToBase.h:257
void setMagnField(const MagneticField *magnField)
edm::EDGetTokenT< edm::View< reco::Track > > genericTracks
edm::EDGetTokenT< TrajTrackAssociationCollection > kfTrajectories
IdealHelixParameters ConvTrackPreSelector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
edm::EDGetTokenT< reco::BeamSpot > beamSpotInputTag
edm::EDGetTokenT< TrajGsfTrackAssociationCollection > gsfTrajectories
bool isTangentPointDistanceLessThan(float rmax, const reco::Track *track, const math::XYZVector &refPoint)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken
value_type const * get() const
Definition: RefToBase.h:209
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ beamSpotInputTag

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

Definition at line 65 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ ConvTrackPreSelector

IdealHelixParameters ConversionTrackProducer::ConvTrackPreSelector
private

Definition at line 69 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ filterOnConvTrackHyp

bool ConversionTrackProducer::filterOnConvTrackHyp
private

Definition at line 67 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ genericTracks

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

Definition at line 50 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

◆ gsfTrajectories

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

Definition at line 52 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

◆ kfTrajectories

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

Definition at line 51 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

◆ magFieldToken

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

Definition at line 66 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().

◆ minConvRadius

double ConversionTrackProducer::minConvRadius
private

Definition at line 68 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ setArbitratedEcalSeeded

bool ConversionTrackProducer::setArbitratedEcalSeeded
private

Definition at line 56 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ setArbitratedMerged

bool ConversionTrackProducer::setArbitratedMerged
private

Definition at line 57 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ setArbitratedMergedEcalGeneral

bool ConversionTrackProducer::setArbitratedMergedEcalGeneral
private

Definition at line 58 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ setIsGsfTrackOpen

bool ConversionTrackProducer::setIsGsfTrackOpen
private

Definition at line 55 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ setTrackerOnly

bool ConversionTrackProducer::setTrackerOnly
private

Definition at line 54 of file ConversionTrackProducer.cc.

Referenced by produce().

◆ useTrajectory

bool ConversionTrackProducer::useTrajectory
private

Definition at line 53 of file ConversionTrackProducer.cc.

Referenced by ConversionTrackProducer(), and produce().