CMS 3D CMS Logo

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

#include <ConversionTrackProducer.h>

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 45 of file ConversionTrackProducer.h.

Member Typedef Documentation

◆ TrajGsfTrackAssociationCollection

Definition at line 47 of file ConversionTrackProducer.h.

Constructor & Destructor Documentation

◆ ConversionTrackProducer()

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

Definition at line 32 of file ConversionTrackProducer.cc.

33  : useTrajectory(conf.getParameter<bool>("useTrajectory")),
34  setTrackerOnly(conf.getParameter<bool>("setTrackerOnly")),
35  setIsGsfTrackOpen(conf.getParameter<bool>("setIsGsfTrackOpen")),
36  setArbitratedEcalSeeded(conf.getParameter<bool>("setArbitratedEcalSeeded")),
37  setArbitratedMerged(conf.getParameter<bool>("setArbitratedMerged")),
38  setArbitratedMergedEcalGeneral(conf.getParameter<bool>("setArbitratedMergedEcalGeneral")),
39  beamSpotInputTag(consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotInputTag"))),
40  filterOnConvTrackHyp(conf.getParameter<bool>("filterOnConvTrackHyp")),
41  minConvRadius(conf.getParameter<double>("minConvRadius")) {
42  edm::InputTag thetp(conf.getParameter<std::string>("TrackProducer"));
43  genericTracks = consumes<edm::View<reco::Track> >(thetp);
44  if (useTrajectory) {
45  kfTrajectories = consumes<TrajTrackAssociationCollection>(thetp);
46  gsfTrajectories = consumes<TrajGsfTrackAssociationCollection>(thetp);
47  }
48  magFieldToken = esConsumes();
49  produces<reco::ConversionTrackCollection>();
50 }

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

◆ ~ConversionTrackProducer()

ConversionTrackProducer::~ConversionTrackProducer ( )
override

Definition at line 53 of file ConversionTrackProducer.cc.

53 {}

Member Function Documentation

◆ produce()

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

Definition at line 56 of file ConversionTrackProducer.cc.

56  {
57  //get input collection (through edm::View)
58  edm::View<reco::Track> const& trks = e.get(genericTracks);
59 
60  //get association maps between trajectories and tracks and build temporary maps
61  std::map<reco::TrackRef, edm::Ref<std::vector<Trajectory> > > tracktrajmap;
62  std::map<reco::GsfTrackRef, edm::Ref<std::vector<Trajectory> > > gsftracktrajmap;
63 
64  if (useTrajectory) {
65  if (!trks.empty()) {
66  if (dynamic_cast<const reco::GsfTrack*>(&trks.at(0))) {
67  //fill map for gsf tracks
68  for (auto const& pair : e.get(gsfTrajectories)) {
69  gsftracktrajmap[pair.val] = pair.key;
70  }
71  } else {
72  //fill map for standard tracks
73  for (auto const& pair : e.get(kfTrajectories)) {
74  tracktrajmap[pair.val] = pair.key;
75  }
76  }
77  }
78  }
79 
80  // Step B: create empty output collection
81  auto outputTrks = std::make_unique<reco::ConversionTrackCollection>();
82 
83  //--------------------------------------------------
84  //Added by D. Giordano
85  // 2011/08/05
86  // Reduction of the track sample based on geometric hypothesis for conversion tracks
87 
88  math::XYZVector beamSpot{e.get(beamSpotInputTag).position()};
89 
91 
92  //----------------------------------------------------------
93 
94  // Simple conversion of tracks to conversion tracks, setting appropriate flags from configuration
95  for (size_t i = 0; i < trks.size(); ++i) {
96  //--------------------------------------------------
97  //Added by D. Giordano
98  // 2011/08/05
99  // Reduction of the track sample based on geometric hypothesis for conversion tracks
100 
101  edm::RefToBase<reco::Track> trackBaseRef = trks.refAt(i);
102  if (filterOnConvTrackHyp &&
104  continue;
105  //--------------------------------------------------
106 
107  reco::ConversionTrack convTrack(trackBaseRef);
108  convTrack.setIsTrackerOnly(setTrackerOnly);
109  convTrack.setIsGsfTrackOpen(setIsGsfTrackOpen);
110  convTrack.setIsArbitratedEcalSeeded(setArbitratedEcalSeeded);
111  convTrack.setIsArbitratedMerged(setArbitratedMerged);
112  convTrack.setIsArbitratedMergedEcalGeneral(setArbitratedMergedEcalGeneral);
113 
114  //fill trajectory association if configured, using correct map depending on track type
115  if (useTrajectory) {
116  if (!gsftracktrajmap.empty()) {
117  convTrack.setTrajRef(gsftracktrajmap.find(trackBaseRef.castTo<reco::GsfTrackRef>())->second);
118  } else {
119  convTrack.setTrajRef(tracktrajmap.find(trackBaseRef.castTo<reco::TrackRef>())->second);
120  }
121  }
122 
123  outputTrks->push_back(convTrack);
124  }
125 
126  e.put(std::move(outputTrks));
127  return;
128 
129 } //end produce

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

Member Data Documentation

◆ beamSpotInputTag

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

Definition at line 72 of file ConversionTrackProducer.h.

Referenced by produce().

◆ ConvTrackPreSelector

IdealHelixParameters ConversionTrackProducer::ConvTrackPreSelector
private

Definition at line 76 of file ConversionTrackProducer.h.

Referenced by produce().

◆ filterOnConvTrackHyp

bool ConversionTrackProducer::filterOnConvTrackHyp
private

Definition at line 74 of file ConversionTrackProducer.h.

Referenced by produce().

◆ genericTracks

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

Definition at line 57 of file ConversionTrackProducer.h.

Referenced by ConversionTrackProducer(), and produce().

◆ gsfTrajectories

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

Definition at line 59 of file ConversionTrackProducer.h.

Referenced by ConversionTrackProducer(), and produce().

◆ kfTrajectories

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

Definition at line 58 of file ConversionTrackProducer.h.

Referenced by ConversionTrackProducer(), and produce().

◆ magFieldToken

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

Definition at line 73 of file ConversionTrackProducer.h.

Referenced by ConversionTrackProducer(), and produce().

◆ minConvRadius

double ConversionTrackProducer::minConvRadius
private

Definition at line 75 of file ConversionTrackProducer.h.

Referenced by produce().

◆ setArbitratedEcalSeeded

bool ConversionTrackProducer::setArbitratedEcalSeeded
private

Definition at line 63 of file ConversionTrackProducer.h.

Referenced by produce().

◆ setArbitratedMerged

bool ConversionTrackProducer::setArbitratedMerged
private

Definition at line 64 of file ConversionTrackProducer.h.

Referenced by produce().

◆ setArbitratedMergedEcalGeneral

bool ConversionTrackProducer::setArbitratedMergedEcalGeneral
private

Definition at line 65 of file ConversionTrackProducer.h.

Referenced by produce().

◆ setIsGsfTrackOpen

bool ConversionTrackProducer::setIsGsfTrackOpen
private

Definition at line 62 of file ConversionTrackProducer.h.

Referenced by produce().

◆ setTrackerOnly

bool ConversionTrackProducer::setTrackerOnly
private

Definition at line 61 of file ConversionTrackProducer.h.

Referenced by produce().

◆ useTrajectory

bool ConversionTrackProducer::useTrajectory
private

Definition at line 60 of file ConversionTrackProducer.h.

Referenced by ConversionTrackProducer(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
edm::View::empty
bool empty() const
reco::ConversionTrack
Definition: ConversionTrack.h:19
ConversionTrackProducer::minConvRadius
double minConvRadius
Definition: ConversionTrackProducer.h:75
edm::View::refAt
RefToBase< value_type > refAt(size_type i) const
ConversionTrackProducer::setTrackerOnly
bool setTrackerOnly
Definition: ConversionTrackProducer.h:61
ConversionTrackProducer::setArbitratedMerged
bool setArbitratedMerged
Definition: ConversionTrackProducer.h:64
edm::Ref< GsfTrackCollection >
ConversionTrackProducer::kfTrajectories
edm::EDGetTokenT< TrajTrackAssociationCollection > kfTrajectories
Definition: ConversionTrackProducer.h:58
IdealHelixParameters::setMagnField
void setMagnField(const MagneticField *magnField)
Definition: IdealHelixParameters.h:31
ConversionTrackProducer::genericTracks
edm::EDGetTokenT< edm::View< reco::Track > > genericTracks
Definition: ConversionTrackProducer.h:57
ConversionTrackProducer::setArbitratedMergedEcalGeneral
bool setArbitratedMergedEcalGeneral
Definition: ConversionTrackProducer.h:65
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::View::size
size_type size() const
ConversionTrackProducer::setArbitratedEcalSeeded
bool setArbitratedEcalSeeded
Definition: ConversionTrackProducer.h:63
edm::View
Definition: CaloClusterFwd.h:14
edm::View::at
const_reference at(size_type pos) const
ConversionTrackProducer::useTrajectory
bool useTrajectory
Definition: ConversionTrackProducer.h:60
ConversionTrackProducer::filterOnConvTrackHyp
bool filterOnConvTrackHyp
Definition: ConversionTrackProducer.h:74
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
ConversionTrackProducer::gsfTrajectories
edm::EDGetTokenT< TrajGsfTrackAssociationCollection > gsfTrajectories
Definition: ConversionTrackProducer.h:59
edm::RefToBase::castTo
REF castTo() const
Definition: RefToBase.h:257
ConversionTrackProducer::magFieldToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken
Definition: ConversionTrackProducer.h:73
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< reco::Track >
ConversionTrackProducer::beamSpotInputTag
edm::EDGetTokenT< reco::BeamSpot > beamSpotInputTag
Definition: ConversionTrackProducer.h:72
ConversionTrackProducer::ConvTrackPreSelector
IdealHelixParameters ConvTrackPreSelector
Definition: ConversionTrackProducer.h:76
edm::InputTag
Definition: InputTag.h:15
IdealHelixParameters::isTangentPointDistanceLessThan
bool isTangentPointDistanceLessThan(float rmax, const reco::Track *track, const math::XYZVector &refPoint)
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ConversionTrackProducer::setIsGsfTrackOpen
bool setIsGsfTrackOpen
Definition: ConversionTrackProducer.h:62