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

Definition at line 26 of file GsfElectronSelector.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file GsfElectronSelector.h.

27  :
35  }
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:11
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_

Member Function Documentation

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

Definition at line 37 of file GsfElectronSelector.h.

References reco::GsfElectron::core(), end, reco::Track::extra(), reco::GsfTrack::gsfExtra(), reco::GsfElectron::gsfTrack(), Exhume::I, mps_fire::i, training_settings::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::recHitsBegin(), reco::Track::recHitsEnd(), reco::TrackExtraBase::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().

37  {
38  using namespace reco;
39  TrackingRecHitRefProd rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
40  TrackExtraRefProd rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
41  GsfTrackExtraRefProd rGsfTrackExtras = evt.template getRefBeforePut<GsfTrackExtraCollection>();
42  GsfTrackRefProd rTracks = evt.template getRefBeforePut<GsfTrackCollection>();
43  GsfElectronCoreRefProd rElectronCores = evt.template getRefBeforePut<GsfElectronCoreCollection>();
44  GsfElectronRefProd rElectrons = evt.template getRefBeforePut<GsfElectronCollection>();
45  SuperClusterRefProd rSuperClusters = evt.template getRefBeforePut<SuperClusterCollection>();
46  size_t idx = 0, tidx = 0, hidx = 0;
47  for( I i = begin; i != end; ++ i ) {
48  const GsfElectron & ele = * * i;
49  selElectronCores_->push_back( GsfElectronCore( *(ele.core()) ) );
50  selElectronCores_->back().setGsfTrack( GsfTrackRef( rTracks, idx ) );
51  selElectronCores_->back().setSuperCluster( SuperClusterRef( rSuperClusters, idx ) );
52  selSuperClusters_->push_back( SuperCluster( * ( ele.superCluster() ) ) );
54  GsfTrackRef trkRef = ele.gsfTrack();
55  if ( trkRef.isNonnull() ) {
56  selTracks_->push_back( GsfTrack( * trkRef ) );
57  GsfTrack & trk = selTracks_->back();
58  selTrackExtras_->push_back( TrackExtra( trk.outerPosition(), trk.outerMomentum(), trk.outerOk(),
59  trk.innerPosition(), trk.innerMomentum(), trk.innerOk(),
60  trk.outerStateCovariance(), trk.outerDetId(),
61  trk.innerStateCovariance(), trk.innerDetId(),
62  trk.seedDirection() ) );
63  selGsfTrackExtras_->push_back( GsfTrackExtra( *(trk.gsfExtra()) ) );
64  TrackExtra & tx = selTrackExtras_->back();
65  unsigned int nHitsToAdd = 0;
66  for( trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++ hit ) {
67  selHits_->push_back( (*hit)->clone() );
68  ++nHitsToAdd;
69  }
70  tx.setHits( rHits, hidx, nHitsToAdd );
71  tx.setTrajParams(trk.extra()->trajParams(),trk.extra()->chi2sX5());
72  assert(tx.trajParams().size()==tx.recHitsSize());
73  hidx += nHitsToAdd;
74  trk.setGsfExtra( GsfTrackExtraRef( rGsfTrackExtras, tidx ) );
75  trk.setExtra( TrackExtraRef( rTrackExtras, tidx ++ ) );
76  }
77  }
78  }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
edm::Ref< GsfElectronCoreCollection > GsfElectronCoreRef
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
void setGsfExtra(const GsfTrackExtraRef &ref)
set reference to GSF "extra" object
Definition: GsfTrack.h:30
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:50
std::unique_ptr< reco::GsfTrackCollection > selTracks_
std::unique_ptr< reco::GsfElectronCollection > selElectrons_
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:17
edm::Ptr< CaloCluster > CaloClusterPtr
std::unique_ptr< TrackingRecHitCollection > selHits_
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:32
unsigned int recHitsSize() const
number of RecHits
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:184
TrajParams const & trajParams() const
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:75
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:94
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
#define end
Definition: vmac.h:37
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
void setExtra(const TrackExtraRef &ref)
set reference to "extra" object
Definition: Track.h:184
const GsfTrackExtraRef & gsfExtra() const
reference to "extra" object
Definition: GsfTrack.h:32
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:70
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:45
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:204
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:80
std::unique_ptr< reco::GsfTrackExtraCollection > selGsfTrackExtras_
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
std::unique_ptr< reco::GsfElectronCoreCollection > selElectronCores_
fixed size matrix
#define begin
Definition: vmac.h:30
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:60
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:99
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:185
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
edm::OrphanHandle<reco::GsfElectronCollection> helper::GsfElectronCollectionStoreManager::put ( edm::Event evt)
inline

Definition at line 80 of file GsfElectronSelector.h.

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

80  {
84  evt.put(std::move(selTracks_ ));
87  evt.put(std::move(selHits_ ));
88  return h;
89  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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_
def move(src, dest)
Definition: eostools.py:510
size_t helper::GsfElectronCollectionStoreManager::size ( void  ) const
inline

Definition at line 91 of file GsfElectronSelector.h.

References selElectrons_.

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

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

Member Data Documentation

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

Definition at line 94 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

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

Definition at line 93 of file GsfElectronSelector.h.

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

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

Definition at line 98 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

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

Definition at line 99 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

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

Definition at line 95 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

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

Definition at line 97 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().

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

Definition at line 96 of file GsfElectronSelector.h.

Referenced by cloneAndStore(), and put().