CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PhotonSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_PhotonSelector_h
2 #define RecoAlgos_PhotonSelector_h
3 
19 
20 namespace helper {
26  }
27  template<typename I>
28  void cloneAndStore( const I & begin, const I & end, edm::Event & evt ) {
29  using namespace reco;
30  PhotonRefProd rPhotons = evt.template getRefBeforePut<PhotonCollection>();
31  SuperClusterRefProd rSuperClusters = evt.template getRefBeforePut<SuperClusterCollection>();
32  size_t idx = 0;
33  for( I i = begin; i != end; ++ i ) {
34  const Photon & ele = * * i;
35  selPhotons_->push_back( Photon( ele ) );
36  selPhotons_->back().setSuperCluster( SuperClusterRef( rSuperClusters, idx ++ ) );
37  selSuperClusters_->push_back( SuperCluster( * ( ele.superCluster() ) ) );
38  }
39  }
42  evt.put( selSuperClusters_ );
43  return h;
44  }
45  size_t size() const { return selPhotons_->size(); }
46  private:
47  std::auto_ptr<reco::PhotonCollection> selPhotons_;
48  std::auto_ptr<reco::SuperClusterCollection> selSuperClusters_;
49  };
50 
52  public:
54  std::string alias( cfg.getParameter<std::string>( "@module_label" ) );
55  produces<reco::PhotonCollection>().setBranchAlias( alias + "Photons" );
56  produces<reco::SuperClusterCollection>().setBranchAlias( alias + "SuperClusters" );
57  }
58  };
59 
60  template<>
64  };
65 
66 }
67 
68 #endif
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
reco::SuperClusterRef superCluster() const
Retrieve photonCore attributes.
Definition: Photon.h:54
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
std::auto_ptr< reco::PhotonCollection > selPhotons_
edm::OrphanHandle< reco::PhotonCollection > put(edm::Event &evt)
std::auto_ptr< reco::SuperClusterCollection > selSuperClusters_
void cloneAndStore(const I &begin, const I &end, edm::Event &evt)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:38
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
#define begin
Definition: vmac.h:31
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4