CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTRemoveDuplicatedSC Class Reference

#include <EgammaHLTRemoveDuplicatedSC.h>

Inheritance diagram for EgammaHLTRemoveDuplicatedSC:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTRemoveDuplicatedSC (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTRemoveDuplicatedSC () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< reco::SuperClusterCollectionalreadyExistingSC_
 
std::string outputCollection_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsCInputProducer_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 31 of file EgammaHLTRemoveDuplicatedSC.h.

Constructor & Destructor Documentation

EgammaHLTRemoveDuplicatedSC::EgammaHLTRemoveDuplicatedSC ( const edm::ParameterSet ps)
explicit

Definition at line 14 of file EgammaHLTRemoveDuplicatedSC.cc.

References alreadyExistingSC_, edm::ParameterSet::getParameter(), outputCollection_, sCInputProducer_, and AlCaHLTBitMon_QueryRunRegistry::string.

15 {
16 
17 
18  // the input producers
19  sCInputProducer_ = consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("L1NonIsoUskimmedSC"));
20  alreadyExistingSC_= consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("L1IsoSC"));
21 
22  // set the producer parameters
23  outputCollection_ = ps.getParameter<std::string>("L1NonIsoSkimmedCollection");
24  produces<reco::SuperClusterCollection>(outputCollection_);
25 
26 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > sCInputProducer_
edm::EDGetTokenT< reco::SuperClusterCollection > alreadyExistingSC_
EgammaHLTRemoveDuplicatedSC::~EgammaHLTRemoveDuplicatedSC ( )
override

Definition at line 28 of file EgammaHLTRemoveDuplicatedSC.cc.

29 {}

Member Function Documentation

void EgammaHLTRemoveDuplicatedSC::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 31 of file EgammaHLTRemoveDuplicatedSC.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

31  {
32 
34  desc.add<edm::InputTag>(("L1NonIsoUskimmedSC"), edm::InputTag("hltCorrectedMulti5x5EndcapSuperClustersWithPreshowerL1NonIsolatedTemp"));
35  desc.add<edm::InputTag>(("L1IsoSC"), edm::InputTag("hltCorrectedMulti5x5EndcapSuperClustersWithPreshowerL1Isolated"));
36  desc.add<std::string>(("L1NonIsoSkimmedCollection"), "");
37  descriptions.add(("hltEgammaHLTRemoveDuplicatedSC"), desc);
38 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTRemoveDuplicatedSC::produce ( edm::StreamID  sid,
edm::Event evt,
const edm::EventSetup es 
) const
override

Definition at line 42 of file EgammaHLTRemoveDuplicatedSC.cc.

References alreadyExistingSC_, edm::Event::getByToken(), eostools::move(), outputCollection_, edm::Handle< T >::product(), edm::Event::put(), and sCInputProducer_.

42  {
43 
44  using namespace edm;
45 
46  // Get raw SuperClusters from the event
47  Handle<reco::SuperClusterCollection> UnskimmedSuperCluster;
48  evt.getByToken(sCInputProducer_, UnskimmedSuperCluster);
49  Handle<reco::SuperClusterCollection> L1IsoSuperCluster;
50  evt.getByToken(alreadyExistingSC_, L1IsoSuperCluster);
51 
52  // Create a pointer to the existing SuperClusters
53  const reco::SuperClusterCollection *UnskimmedL1NonIsoSC = UnskimmedSuperCluster.product();
54  const reco::SuperClusterCollection *L1IsoSC = L1IsoSuperCluster.product();
55 
56 
57  // Define a collection of corrected SuperClusters to put back into the event
58  auto corrClusters = std::make_unique<reco::SuperClusterCollection>();
59 
60  // Loop over raw clusters and make corrected ones
61  reco::SuperClusterCollection::const_iterator aClus;
62  reco::SuperClusterCollection::const_iterator cit;
63  for(aClus = UnskimmedL1NonIsoSC->begin(); aClus != UnskimmedL1NonIsoSC->end(); aClus++)
64  {
65  bool AlreadyThere = false;
66  //reco::SuperCluster newClus;
67  for(cit = L1IsoSC->begin(); cit != L1IsoSC->end(); cit++){
68  if( fabs(aClus->energy()- cit->energy()) < 0.5 && fabs(aClus->eta()- cit->eta()) < 0.0175 ){
69  float deltaphi=fabs( aClus->phi() - cit->phi() );
70  if(deltaphi>6.283185308) deltaphi -= 6.283185308;
71  if(deltaphi>3.141592654) deltaphi = 6.283185308-deltaphi;
72 
73  if( deltaphi < 0.035 ){AlreadyThere = true; break;}
74  }
75  }
76  // if(AlreadyThere){std::cout<<"AAAA: SC removed: "<<aClus->energy()<<" "<<aClus->eta()<<" "<<aClus->phi()<<std::endl;}
77  if(!AlreadyThere){corrClusters->push_back(*aClus);}
78  }
79 
80  // Put collection of corrected SuperClusters into the event
81  evt.put(std::move(corrClusters), outputCollection_);
82 
83 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::SuperClusterCollection > sCInputProducer_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
T const * product() const
Definition: Handle.h:74
HLT enums.
edm::EDGetTokenT< reco::SuperClusterCollection > alreadyExistingSC_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRemoveDuplicatedSC::alreadyExistingSC_
private

Definition at line 42 of file EgammaHLTRemoveDuplicatedSC.h.

Referenced by EgammaHLTRemoveDuplicatedSC(), and produce().

std::string EgammaHLTRemoveDuplicatedSC::outputCollection_
private

Definition at line 44 of file EgammaHLTRemoveDuplicatedSC.h.

Referenced by EgammaHLTRemoveDuplicatedSC(), and produce().

edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRemoveDuplicatedSC::sCInputProducer_
private

Definition at line 41 of file EgammaHLTRemoveDuplicatedSC.h.

Referenced by EgammaHLTRemoveDuplicatedSC(), and produce().