CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
helper::GsfElectronCollectionStoreManager Struct Reference

#include <GsfElectronSelector.h>

Public Types

typedef reco::GsfElectronCollection collection
 

Public Member Functions

template<typename I >
void cloneAndStore (const I &begin, const I &end, edm::Event &evt)
 
 GsfElectronCollectionStoreManager (const edm::Handle< reco::GsfElectronCollection > &)
 
edm::OrphanHandle< reco::GsfElectronCollectionput (edm::Event &evt)
 
size_t size () const
 

Private Attributes

std::unique_ptr< reco::GsfElectronCoreCollectionselElectronCores_
 
std::unique_ptr< reco::GsfElectronCollectionselElectrons_
 
std::unique_ptr< reco::GsfTrackExtraCollectionselGsfTrackExtras_
 
std::unique_ptr< TrackingRecHitCollectionselHits_
 
std::unique_ptr< reco::SuperClusterCollectionselSuperClusters_
 
std::unique_ptr< reco::TrackExtraCollectionselTrackExtras_
 
std::unique_ptr< reco::GsfTrackCollectionselTracks_
 

Detailed Description

Definition at line 25 of file GsfElectronSelector.h.

Member Typedef Documentation

◆ collection

typedef reco::GsfElectronCollection helper::GsfElectronCollectionStoreManager::collection

Definition at line 26 of file GsfElectronSelector.h.

Constructor & Destructor Documentation

◆ GsfElectronCollectionStoreManager()

helper::GsfElectronCollectionStoreManager::GsfElectronCollectionStoreManager ( const edm::Handle< reco::GsfElectronCollection > &  )
inline

Definition at line 27 of file GsfElectronSelector.h.

std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
std::unique_ptr< reco::GsfTrackCollection > selTracks_
std::unique_ptr< reco::GsfElectronCollection > selElectrons_
std::unique_ptr< TrackingRecHitCollection > selHits_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_

Member Function Documentation

◆ cloneAndStore()

template<typename I >
void helper::GsfElectronCollectionStoreManager::cloneAndStore ( const I &  begin,
const I &  end,
edm::Event evt 
)
inline

Definition at line 36 of file GsfElectronSelector.h.

References cms::cuda::assert(), reco::GsfElectron::core(), mps_fire::end, reco::Track::extra(), reco::GsfTrack::gsfExtra(), reco::GsfElectron::gsfTrack(), Exhume::I, mps_fire::i, heavyIonCSV_trainingSettings::idx, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), edm::Ref< C, T, F >::isNonnull(), reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), reco::Track::recHits(), reco::TrackExtraBase::recHitsSize(), reco::Track::recHitsSize(), reco::Track::seedDirection(), selElectronCores_, selElectrons_, selGsfTrackExtras_, selHits_, selSuperClusters_, selTrackExtras_, selTracks_, reco::Track::setExtra(), reco::GsfTrack::setGsfExtra(), reco::TrackExtraBase::setHits(), reco::TrackExtraBase::setTrajParams(), reco::GsfElectron::superCluster(), and reco::TrackExtraBase::trajParams().

36  {
37  using namespace reco;
38  TrackingRecHitRefProd rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
39  TrackExtraRefProd rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
40  GsfTrackExtraRefProd rGsfTrackExtras = evt.template getRefBeforePut<GsfTrackExtraCollection>();
41  GsfTrackRefProd rTracks = evt.template getRefBeforePut<GsfTrackCollection>();
42  GsfElectronCoreRefProd rElectronCores = evt.template getRefBeforePut<GsfElectronCoreCollection>();
43  GsfElectronRefProd rElectrons = evt.template getRefBeforePut<GsfElectronCollection>();
44  SuperClusterRefProd rSuperClusters = evt.template getRefBeforePut<SuperClusterCollection>();
45  size_t idx = 0, tidx = 0, hidx = 0;
46  for (I i = begin; i != end; ++i) {
47  const GsfElectron& ele = **i;
48  selElectronCores_->push_back(GsfElectronCore(*(ele.core())));
49  selElectronCores_->back().setGsfTrack(GsfTrackRef(rTracks, idx));
50  selElectronCores_->back().setSuperCluster(SuperClusterRef(rSuperClusters, idx));
51  selSuperClusters_->push_back(SuperCluster(*(ele.superCluster())));
52  selElectrons_->push_back(GsfElectron(ele,
53  GsfElectronCoreRef(rElectronCores, idx++),
55  TrackRef(),
56  TrackBaseRef(),
58  GsfTrackRef trkRef = ele.gsfTrack();
59  if (trkRef.isNonnull()) {
60  selTracks_->push_back(GsfTrack(*trkRef));
61  GsfTrack& trk = selTracks_->back();
62  selTrackExtras_->push_back(TrackExtra(trk.outerPosition(),
63  trk.outerMomentum(),
64  trk.outerOk(),
65  trk.innerPosition(),
66  trk.innerMomentum(),
67  trk.innerOk(),
69  trk.outerDetId(),
71  trk.innerDetId(),
72  trk.seedDirection()));
73  selGsfTrackExtras_->push_back(GsfTrackExtra(*(trk.gsfExtra())));
74  TrackExtra& tx = selTrackExtras_->back();
75  unsigned int nHitsToAdd = trk.recHitsSize();
76  for (auto const& hit : trk.recHits())
77  selHits_->push_back(hit->clone());
78  tx.setHits(rHits, hidx, nHitsToAdd);
79  tx.setTrajParams(trk.extra()->trajParams(), trk.extra()->chi2sX5());
80  assert(tx.trajParams().size() == tx.recHitsSize());
81  hidx += nHitsToAdd;
82  trk.setGsfExtra(GsfTrackExtraRef(rGsfTrackExtras, tidx));
83  trk.setExtra(TrackExtraRef(rTrackExtras, tidx++));
84  }
85  }
86  }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
edm::Ref< GsfElectronCoreCollection > GsfElectronCoreRef
TrajParams const & trajParams() const
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:97
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:68
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
void setGsfExtra(const GsfTrackExtraRef &ref)
set reference to GSF "extra" object
Definition: GsfTrack.h:29
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
unsigned int recHitsSize() const
number of RecHits
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
std::unique_ptr< reco::GsfTrackCollection > selTracks_
std::unique_ptr< reco::GsfElectronCollection > selElectrons_
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:16
edm::Ptr< CaloCluster > CaloClusterPtr
std::unique_ptr< TrackingRecHitCollection > selHits_
assert(be >=bs)
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:71
auto recHits() const
Access to reconstructed hits on the track.
Definition: Track.h:85
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:35
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
const std::complex< double > I
Definition: I.h:8
edm::RefVector< GsfTrackCollection > GsfTrackRefVector
vector of reference to GsfTrack in the same collection
Definition: GsfTrackFwd.h:17
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:53
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:148
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
Definition: Track.h:136
const GsfTrackExtraRef & gsfExtra() const
reference to "extra" object
Definition: GsfTrack.h:31
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:79
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_
fixed size matrix
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:50
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ put()

edm::OrphanHandle<reco::GsfElectronCollection> helper::GsfElectronCollectionStoreManager::put ( edm::Event evt)
inline

Definition at line 88 of file GsfElectronSelector.h.

References h, eostools::move(), edm::Event::put(), selElectronCores_, selElectrons_, selGsfTrackExtras_, selHits_, selSuperClusters_, selTrackExtras_, and selTracks_.

88  {
92  evt.put(std::move(selTracks_));
95  evt.put(std::move(selHits_));
96  return h;
97  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::unique_ptr< reco::GsfTrackCollection > selTracks_
std::unique_ptr< reco::GsfElectronCollection > selElectrons_
std::unique_ptr< TrackingRecHitCollection > selHits_
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ size()

size_t helper::GsfElectronCollectionStoreManager::size ( void  ) const
inline

Definition at line 99 of file GsfElectronSelector.h.

References selElectrons_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

99 { return selElectrons_->size(); }
std::unique_ptr< reco::GsfElectronCollection > selElectrons_

Member Data Documentation

◆ selElectronCores_

std::unique_ptr<reco::GsfElectronCoreCollection> helper::GsfElectronCollectionStoreManager::selElectronCores_
private

Definition at line 103 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

◆ selElectrons_

std::unique_ptr<reco::GsfElectronCollection> helper::GsfElectronCollectionStoreManager::selElectrons_
private

Definition at line 102 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), put(), and size().

◆ selGsfTrackExtras_

std::unique_ptr<reco::GsfTrackExtraCollection> helper::GsfElectronCollectionStoreManager::selGsfTrackExtras_
private

Definition at line 107 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

◆ selHits_

std::unique_ptr<TrackingRecHitCollection> helper::GsfElectronCollectionStoreManager::selHits_
private

Definition at line 108 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

◆ selSuperClusters_

std::unique_ptr<reco::SuperClusterCollection> helper::GsfElectronCollectionStoreManager::selSuperClusters_
private

Definition at line 104 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

◆ selTrackExtras_

std::unique_ptr<reco::TrackExtraCollection> helper::GsfElectronCollectionStoreManager::selTrackExtras_
private

Definition at line 106 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

◆ selTracks_

std::unique_ptr<reco::GsfTrackCollection> helper::GsfElectronCollectionStoreManager::selTracks_
private

Definition at line 105 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().