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 49 of file CaloRecHitsBeamHaloCleaned.cc.

Constructor & Destructor Documentation

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

Definition at line 78 of file CaloRecHitsBeamHaloCleaned.cc.

References edm::ParameterSet::getParameter().

79 {
80 
81  ishlt = iConfig.getParameter< bool> ("IsHLT");
82 
83 
84 
85  produces<EcalRecHitCollection>("EcalRecHitsEB");
86  produces<EcalRecHitCollection>("EcalRecHitsEE");
87  produces<HBHERecHitCollection>();
88 
89 
90  it_EBRecHits = iConfig.getParameter<edm::InputTag>("EBRecHitsLabel");
91  it_EERecHits = iConfig.getParameter<edm::InputTag>("EERecHitsLabel");
92  it_HBHERecHits = iConfig.getParameter<edm::InputTag>("HBHERecHitsLabel");
93  it_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
94 
95 
96  ecalebhits_token= consumes<EcalRecHitCollection>(it_EBRecHits);
97  ecaleehits_token= consumes<EcalRecHitCollection>(it_EERecHits);
98  hbhehits_token= consumes<HBHERecHitCollection>(it_HBHERecHits);
99 
100  globalhalo_token=consumes<GlobalHaloData>(it_GlobalHaloData);
101 }
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 104 of file CaloRecHitsBeamHaloCleaned.cc.

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

Member Function Documentation

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

Definition at line 205 of file CaloRecHitsBeamHaloCleaned.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_25ns10e33_v2_cff::InputTag.

205  {
207  desc.add<edm::InputTag>("EBRecHitsLabel", edm::InputTag("EcalRecHit","EcalRecHitsEB"));
208  desc.add<edm::InputTag>("EERecHitsLabel", edm::InputTag("EcalRecHit","EcalRecHitsEE"));
209  desc.add<edm::InputTag>("HBHERecHitsLabel", edm::InputTag("hbhereco"));
210  desc.add<edm::InputTag>("GlobalHaloDataLabel", edm::InputTag("GlobalHaloData"));
211  desc.add<bool>("IsHLT",false);
212  descriptions.add("caloRecHitsBeamHaloCleaned",desc);
213 
214 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CaloRecHitsBeamHaloCleaned::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 119 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().

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

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

Definition at line 61 of file CaloRecHitsBeamHaloCleaned.cc.

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

Definition at line 63 of file CaloRecHitsBeamHaloCleaned.cc.

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

Definition at line 62 of file CaloRecHitsBeamHaloCleaned.cc.

bool CaloRecHitsBeamHaloCleaned::ishlt
private

Definition at line 72 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_EBRecHits
private

Definition at line 66 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_EERecHits
private

Definition at line 67 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_GlobalHaloData
private

Definition at line 69 of file CaloRecHitsBeamHaloCleaned.cc.

edm::InputTag CaloRecHitsBeamHaloCleaned::it_HBHERecHits
private

Definition at line 68 of file CaloRecHitsBeamHaloCleaned.cc.