CMS 3D CMS Logo

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

#include <PhotonSelector.h>

Public Types

typedef reco::PhotonCollection collection
 

Public Member Functions

template<typename I >
void cloneAndStore (const I &begin, const I &end, edm::Event &evt)
 
 PhotonCollectionStoreManager (const edm::Handle< reco::PhotonCollection > &)
 
edm::OrphanHandle< reco::PhotonCollectionput (edm::Event &evt)
 
size_t size () const
 

Private Attributes

std::unique_ptr< reco::PhotonCollectionselPhotons_
 
std::unique_ptr< reco::SuperClusterCollectionselSuperClusters_
 

Detailed Description

Definition at line 22 of file PhotonSelector.h.

Member Typedef Documentation

Definition at line 23 of file PhotonSelector.h.

Constructor & Destructor Documentation

helper::PhotonCollectionStoreManager::PhotonCollectionStoreManager ( const edm::Handle< reco::PhotonCollection > &  )
inline

Definition at line 24 of file PhotonSelector.h.

24  :
27  }
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::unique_ptr< reco::PhotonCollection > selPhotons_

Member Function Documentation

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

Definition at line 29 of file PhotonSelector.h.

References end, Exhume::I, mps_fire::i, training_settings::idx, nanoDQM_cfi::Photon, selPhotons_, selSuperClusters_, and reco::Photon::superCluster().

29  {
30  using namespace reco;
31  PhotonRefProd rPhotons = evt.template getRefBeforePut<PhotonCollection>();
32  SuperClusterRefProd rSuperClusters = evt.template getRefBeforePut<SuperClusterCollection>();
33  size_t idx = 0;
34  for( I i = begin; i != end; ++ i ) {
35  const Photon & ele = * * i;
36  selPhotons_->push_back( Photon( ele ) );
37  selPhotons_->back().setSuperCluster( SuperClusterRef( rSuperClusters, idx ++ ) );
38  selSuperClusters_->push_back( SuperCluster( * ( ele.superCluster() ) ) );
39  }
40  }
Definition: Photon.py:1
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:39
fixed size matrix
#define begin
Definition: vmac.h:32
std::unique_ptr< reco::PhotonCollection > selPhotons_
edm::OrphanHandle<reco::PhotonCollection> helper::PhotonCollectionStoreManager::put ( edm::Event evt)
inline

Definition at line 41 of file PhotonSelector.h.

References h, eostools::move(), edm::Event::put(), selPhotons_, and selSuperClusters_.

41  {
44  return h;
45  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< reco::PhotonCollection > selPhotons_
size_t helper::PhotonCollectionStoreManager::size ( void  ) const
inline

Definition at line 46 of file PhotonSelector.h.

References selPhotons_.

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

46 { return selPhotons_->size(); }
std::unique_ptr< reco::PhotonCollection > selPhotons_

Member Data Documentation

std::unique_ptr<reco::PhotonCollection> helper::PhotonCollectionStoreManager::selPhotons_
private

Definition at line 48 of file PhotonSelector.h.

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

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

Definition at line 49 of file PhotonSelector.h.

Referenced by cloneAndStore(), and put().