CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CaloRecHitsBeamHaloCleaned Class Reference

#include <RecoMET/METProducers/plugins/CaloRecHitsBeamHaloCleaned.cc>

Inheritance diagram for CaloRecHitsBeamHaloCleaned:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CaloRecHitsBeamHaloCleaned (const edm::ParameterSet &)
 
 ~CaloRecHitsBeamHaloCleaned ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

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

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT
< EcalRecHitCollection
ecalebhits_token
 
edm::EDGetTokenT
< EcalRecHitCollection
ecaleehits_token
 
edm::EDGetTokenT< GlobalHaloDataglobalhalo_token
 
edm::EDGetTokenT
< HBHERecHitCollection
hbhehits_token
 
bool ishlt
 
edm::InputTag it_EBRecHits
 
edm::InputTag it_EERecHits
 
edm::InputTag it_GlobalHaloData
 
edm::InputTag it_HBHERecHits
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 46 of file CaloRecHitsBeamHaloCleaned.cc.

Constructor & Destructor Documentation

CaloRecHitsBeamHaloCleaned::CaloRecHitsBeamHaloCleaned ( const edm::ParameterSet iConfig)
explicit

Definition at line 75 of file CaloRecHitsBeamHaloCleaned.cc.

References edm::ParameterSet::getParameter().

76 {
77 
78  ishlt = iConfig.getParameter< bool> ("IsHLT");
79 
80 
81 
82  produces<EcalRecHitCollection>("EcalRecHitsEB");
83  produces<EcalRecHitCollection>("EcalRecHitsEE");
84  produces<HBHERecHitCollection>();
85 
86 
87  it_EBRecHits = iConfig.getParameter<edm::InputTag>("EBRecHitsLabel");
88  it_EERecHits = iConfig.getParameter<edm::InputTag>("EERecHitsLabel");
89  it_HBHERecHits = iConfig.getParameter<edm::InputTag>("HBHERecHitsLabel");
90  it_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
91 
92 
93  ecalebhits_token= consumes<EcalRecHitCollection>(it_EBRecHits);
94  ecaleehits_token= consumes<EcalRecHitCollection>(it_EERecHits);
95  hbhehits_token= consumes<HBHERecHitCollection>(it_HBHERecHits);
96 
97  globalhalo_token=consumes<GlobalHaloData>(it_GlobalHaloData);
98 }
T getParameter(std::string const &) const
edm::EDGetTokenT< GlobalHaloData > globalhalo_token
edm::EDGetTokenT< EcalRecHitCollection > ecalebhits_token
edm::EDGetTokenT< HBHERecHitCollection > hbhehits_token
edm::EDGetTokenT< EcalRecHitCollection > ecaleehits_token
CaloRecHitsBeamHaloCleaned::~CaloRecHitsBeamHaloCleaned ( )

Definition at line 101 of file CaloRecHitsBeamHaloCleaned.cc.

102 {
103 
104  // do anything here that needs to be done at destruction time
105  // (e.g. close files, deallocate resources etc.)
106 
107 }

Member Function Documentation

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

Definition at line 202 of file CaloRecHitsBeamHaloCleaned.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

202  {
203  //The following says we do not know what parameters are allowed so do no validation
204  // Please change this to state exactly what you do use, even if it is no parameters
206  desc.setUnknown();
207  descriptions.addDefault(desc);
208 }
void addDefault(ParameterSetDescription const &psetDescription)
void CaloRecHitsBeamHaloCleaned::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 116 of file CaloRecHitsBeamHaloCleaned.cc.

References CaloRecHit::detid(), EcalRecHit::detid(), edm::Event::getByToken(), i, j, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, and edm::RefVector< C, T, F >::size().

117 {
118  using namespace edm;
119  using namespace reco;
120  using namespace std;
121 
122 
123  Handle<EcalRecHitCollection> ebrhitsuncleaned;
124  iEvent.getByToken(ecalebhits_token, ebrhitsuncleaned );
125 
126  Handle<EcalRecHitCollection> eerhitsuncleaned;
127  iEvent.getByToken(ecaleehits_token, eerhitsuncleaned );
128 
129  Handle<HBHERecHitCollection> hbherhitsuncleaned;
130  iEvent.getByToken(hbhehits_token, hbherhitsuncleaned );
131 
132  // Get GlobalHaloData
133  edm::Handle<reco::GlobalHaloData> TheGlobalHaloData;
134  iEvent.getByToken(globalhalo_token, TheGlobalHaloData);
135 
136 
137 
138  const GlobalHaloData TheSummaryHalo = (*TheGlobalHaloData );
139 
140 
141  //Cleaning of the various rechits collections:
142 
143  // EcalRecHit EB
144  auto_ptr<EcalRecHitCollection> ebrhitscleaned(new EcalRecHitCollection());
145  for(unsigned int i = 0; i < ebrhitsuncleaned->size(); i++){
146  const EcalRecHit & rhit = (*ebrhitsuncleaned)[i];
147  bool isclean(true);
148  edm::RefVector<EcalRecHitCollection> refbeamhalorechits = TheSummaryHalo.GetEBRechits();
149  for(unsigned int j = 0; j <refbeamhalorechits.size() ; j++){
150  const EcalRecHit &rhitbeamhalo = *(refbeamhalorechits)[j];
151  if( rhit.detid() == rhitbeamhalo.detid() ) {
152  isclean = false;
153  break;
154  }
155  }
156  if(isclean) ebrhitscleaned->push_back(rhit);
157  }
158 
159  // EcalRecHit EE
160  auto_ptr<EcalRecHitCollection> eerhitscleaned(new EcalRecHitCollection());
161  for(unsigned int i = 0; i < eerhitsuncleaned->size(); i++){
162  const EcalRecHit & rhit = (*eerhitsuncleaned)[i];
163  bool isclean(true);
164  edm::RefVector<EcalRecHitCollection> refbeamhalorechits = TheSummaryHalo.GetEERechits();
165  for(unsigned int j = 0; j <refbeamhalorechits.size() ; j++){
166  const EcalRecHit &rhitbeamhalo = *(refbeamhalorechits)[j];
167  if( rhit.detid() == rhitbeamhalo.detid() ) {
168  isclean = false;
169  break;
170  }
171  }
172  if(isclean) eerhitscleaned->push_back(rhit);
173  }
174 
175  // HBHERecHit
176  auto_ptr<HBHERecHitCollection> hbherhitscleaned(new HBHERecHitCollection());
177  for(unsigned int i = 0; i < hbherhitsuncleaned->size(); i++){
178  const HBHERecHit & rhit = (*hbherhitsuncleaned)[i];
179  bool isclean(true);
180  edm::RefVector<HBHERecHitCollection> refbeamhalorechits = TheSummaryHalo.GetHBHERechits();
181  for(unsigned int j = 0; j <refbeamhalorechits.size() ; j++){
182  const HBHERecHit &rhitbeamhalo = *(refbeamhalorechits)[j];
183  if( rhit.detid() == rhitbeamhalo.detid() ) {
184  isclean = false;
185  break;
186  }
187  }
188  if(isclean) hbherhitscleaned->push_back(rhit);
189  }
190 
191 
192 
193  iEvent.put(ebrhitscleaned,"EcalRecHitsEB");
194  iEvent.put(eerhitscleaned,"EcalRecHitsEE");
195  iEvent.put(hbherhitscleaned);
196 
197 }
int i
Definition: DBlmapReader.cc:9
const DetId & detid() const
Definition: CaloRecHit.h:20
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const DetId & detid() const
Definition: EcalRecHit.h:71
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
int j
Definition: DBlmapReader.cc:9
edm::SortedCollection< HBHERecHit > HBHERecHitCollection
edm::EDGetTokenT< GlobalHaloData > globalhalo_token
edm::EDGetTokenT< EcalRecHitCollection > ecalebhits_token
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
edm::EDGetTokenT< HBHERecHitCollection > hbhehits_token
edm::SortedCollection< EcalRecHit > EcalRecHitCollection
edm::EDGetTokenT< EcalRecHitCollection > ecaleehits_token

Member Data Documentation

edm::EDGetTokenT<EcalRecHitCollection> CaloRecHitsBeamHaloCleaned::ecalebhits_token
private

Definition at line 57 of file CaloRecHitsBeamHaloCleaned.cc.

edm::EDGetTokenT<EcalRecHitCollection> CaloRecHitsBeamHaloCleaned::ecaleehits_token
private

Definition at line 58 of file CaloRecHitsBeamHaloCleaned.cc.

edm::EDGetTokenT<GlobalHaloData> CaloRecHitsBeamHaloCleaned::globalhalo_token
private

Definition at line 60 of file CaloRecHitsBeamHaloCleaned.cc.

edm::EDGetTokenT<HBHERecHitCollection> CaloRecHitsBeamHaloCleaned::hbhehits_token
private

Definition at line 59 of file CaloRecHitsBeamHaloCleaned.cc.

bool CaloRecHitsBeamHaloCleaned::ishlt
private

Definition at line 69 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_EBRecHits
private

Definition at line 63 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_EERecHits
private

Definition at line 64 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_GlobalHaloData
private

Definition at line 66 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_HBHERecHits
private

Definition at line 65 of file CaloRecHitsBeamHaloCleaned.cc.