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

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.

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  }

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().

◆ put()

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

◆ size()

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

Definition at line 99 of file GsfElectronSelector.h.

99 { return selElectrons_->size(); }

References selElectrons_.

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

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().

reco::Track::outerPosition
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
reco::Track::outerMomentum
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
edm::RefProd< TrackingRecHitCollection >
reco::GsfTrackRef
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
reco::Track::outerStateCovariance
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:68
helper::GsfElectronCollectionStoreManager::selElectronCores_
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_
Definition: GsfElectronSelector.h:103
reco::Track::outerDetId
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:79
mps_fire.i
i
Definition: mps_fire.py:428
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:164
helper::GsfElectronCollectionStoreManager::selTrackExtras_
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
Definition: GsfElectronSelector.h:106
reco::SuperCluster
Definition: SuperCluster.h:18
reco::GsfTrackExtraCollection
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
Definition: GsfTrackExtraFwd.h:9
cms::cuda::assert
assert(be >=bs)
reco::TrackBaseRef
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:35
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
reco::Track::outerOk
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:50
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
reco::CaloClusterPtr
edm::Ptr< CaloCluster > CaloClusterPtr
Definition: CaloClusterFwd.h:21
edm::Ref< GsfTrackCollection >
reco::Track::innerStateCovariance
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:71
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
reco::Track::innerOk
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:53
helper::GsfElectronCollectionStoreManager::selGsfTrackExtras_
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
Definition: GsfElectronSelector.h:107
reco::GsfElectron::core
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
reco::TrackExtra
Definition: TrackExtra.h:26
reco::GsfTrack
Definition: GsfTrack.h:12
reco::Track::innerMomentum
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
reco::Track::recHitsSize
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits).
Definition: Track.h:97
h
Exhume::I
const std::complex< double > I
Definition: I.h:8
reco::GsfElectronCoreCollection
std::vector< GsfElectronCore > GsfElectronCoreCollection
Definition: GsfElectronCoreFwd.h:12
mps_fire.end
end
Definition: mps_fire.py:242
reco::SuperClusterRef
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
Definition: SuperClusterFwd.h:15
reco::TrackExtraCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
reco::Track::recHits
auto recHits() const
Access to reconstructed hits on the track.
Definition: Track.h:85
reco::GsfElectron
Definition: GsfElectron.h:35
reco::GsfTrack::setGsfExtra
void setGsfExtra(const GsfTrackExtraRef &ref)
set reference to GSF "extra" object
Definition: GsfTrack.h:29
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
reco::GsfTrack::gsfExtra
const GsfTrackExtraRef & gsfExtra() const
reference to "extra" object
Definition: GsfTrack.h:31
reco::TrackExtraBase::setTrajParams
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
Definition: TrackExtraBase.h:36
reco::Track::seedDirection
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:148
reco::GsfTrackRefVector
edm::RefVector< GsfTrackCollection > GsfTrackRefVector
vector of reference to GsfTrack in the same collection
Definition: GsfTrackFwd.h:17
helper::GsfElectronCollectionStoreManager::selTracks_
std::unique_ptr< reco::GsfTrackCollection > selTracks_
Definition: GsfElectronSelector.h:105
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::TrackExtraRef
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:16
reco::GsfElectronCore
Definition: GsfElectronCore.h:31
reco::Track::innerPosition
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
reco::TrackExtraBase::trajParams
TrajParams const & trajParams() const
Definition: TrackExtraBase.h:76
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
reco::Track::innerDetId
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:82
helper::GsfElectronCollectionStoreManager::selElectrons_
std::unique_ptr< reco::GsfElectronCollection > selElectrons_
Definition: GsfElectronSelector.h:102
helper::GsfElectronCollectionStoreManager::selSuperClusters_
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
Definition: GsfElectronSelector.h:104
reco::TrackExtraBase::setHits
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
Definition: TrackExtraBase.h:30
reco::TrackExtraBase::recHitsSize
unsigned int recHitsSize() const
number of RecHits
Definition: TrackExtraBase.h:44
reco::Track::setExtra
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
Definition: Track.h:136
reco::GsfTrackCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
reco::GsfElectron::superCluster
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:163
reco::GsfTrackExtra
Definition: GsfTrackExtra.h:16
reco::GsfTrackExtraRef
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
Definition: GsfTrackExtraFwd.h:13
helper::GsfElectronCollectionStoreManager::selHits_
std::unique_ptr< TrackingRecHitCollection > selHits_
Definition: GsfElectronSelector.h:108
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
reco::GsfElectronCoreRef
edm::Ref< GsfElectronCoreCollection > GsfElectronCoreRef
Definition: GsfElectronCoreFwd.h:14