CMS 3D CMS Logo

PhotonSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_PhotonSelector_h
2 #define RecoAlgos_PhotonSelector_h
3 
20 
21 namespace helper {
27  }
28  template<typename I>
29  void cloneAndStore( const I & begin, const I & end, edm::Event & evt ) {
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  }
44  return h;
45  }
46  size_t size() const { return selPhotons_->size(); }
47  private:
48  std::unique_ptr<reco::PhotonCollection> selPhotons_;
49  std::unique_ptr<reco::SuperClusterCollection> selSuperClusters_;
50  };
51 
53  public:
55  std::string alias( cfg.getParameter<std::string>( "@module_label" ) );
56  produces<reco::PhotonCollection>().setBranchAlias( alias + "Photons" );
57  produces<reco::SuperClusterCollection>().setBranchAlias( alias + "SuperClusters" );
58  }
59  };
60 
61  template<>
65  };
66 
67 }
68 
69 #endif
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
Definition: Photon.py:1
Definition: helper.py:1
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
reco::PhotonCollection collection
PhotonCollectionStoreManager(const edm::Handle< reco::PhotonCollection > &)
PhotonSelectorBase(const edm::ParameterSet &cfg)
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
edm::OrphanHandle< reco::PhotonCollection > put(edm::Event &evt)
std::unique_ptr< reco::SuperClusterCollection > selSuperClusters_
void cloneAndStore(const I &begin, const I &end, edm::Event &evt)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:37
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
fixed size matrix
#define begin
Definition: vmac.h:30
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< reco::PhotonCollection > selPhotons_