CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
ShallowDigisProducer Class Reference

#include <ShallowDigisProducer.h>

Inheritance diagram for ShallowDigisProducer:
edm::stream::EDProducer<>

Classes

struct  products
 

Public Member Functions

 ShallowDigisProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

template<class T >
bool findInput (edm::Handle< T > &, const edm::Event &)
 
void insert (products &, edm::Event &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
template<class T >
void recordDigis (const T &, products &, const SiStripNoises &noises)
 

Private Attributes

std::vector< edm::InputTaginputTags
 
edm::ESGetToken< SiStripNoises, SiStripNoisesRcdnoisesToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 10 of file ShallowDigisProducer.h.

Constructor & Destructor Documentation

◆ ShallowDigisProducer()

ShallowDigisProducer::ShallowDigisProducer ( const edm::ParameterSet conf)
explicit

Definition at line 11 of file ShallowDigisProducer.cc.

12  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")), noisesToken_(esConsumes()) {
13  produces<std::vector<unsigned> >("id");
14  produces<std::vector<unsigned> >("subdet");
15  produces<std::vector<unsigned> >("strip");
16  produces<std::vector<unsigned> >("adc");
17  produces<std::vector<float> >("noise");
18 }

Member Function Documentation

◆ findInput()

template<class T >
bool ShallowDigisProducer::findInput ( edm::Handle< T > &  handle,
const edm::Event e 
)
inlineprivate

Definition at line 57 of file ShallowDigisProducer.cc.

57  {
58  for (auto const& inputTag : inputTags) {
59  e.getByLabel(inputTag, handle);
60  if (handle.isValid() && !handle->empty()) {
61  LogDebug("Input") << inputTag;
62  return true;
63  }
64  }
65  return false;
66 }

References MillePedeFileConverter_cfg::e, patZpeak::handle, SimL1EmulatorRepack_Full_cff::inputTag, inputTags, and LogDebug.

Referenced by produce().

◆ insert()

void ShallowDigisProducer::insert ( products p,
edm::Event e 
)
private

Definition at line 20 of file ShallowDigisProducer.cc.

20  {
21  e.put(std::move(p.id), "id");
22  e.put(std::move(p.subdet), "subdet");
23  e.put(std::move(p.strip), "strip");
24  e.put(std::move(p.adc), "adc");
25  e.put(std::move(p.noise), "noise");
26 }

References MillePedeFileConverter_cfg::e, eostools::move(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.PageElement::append(), and produce().

◆ produce()

void ShallowDigisProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
overrideprivate

Definition at line 42 of file ShallowDigisProducer.cc.

42  {
43  products p;
46  const auto& noises = es.getData(noisesToken_);
47  if (findInput(inputOld, e))
48  recordDigis(*inputOld, p, noises);
49  else if (findInput(inputNew, e))
50  recordDigis(*inputNew, p, noises);
51  else
52  edm::LogWarning("Input Not Found");
53  insert(p, e);
54 }

References MillePedeFileConverter_cfg::e, findInput(), edm::EventSetup::getData(), insert(), HLTEgPhaseIITestSequence_cff::noises, noisesToken_, AlCaHLTBitMon_ParallelJobs::p, and recordDigis().

◆ recordDigis()

template<class T >
void ShallowDigisProducer::recordDigis ( const T digiCollection,
products p,
const SiStripNoises noises 
)
inlineprivate

Definition at line 29 of file ShallowDigisProducer.cc.

29  {
30  for (auto const& set : digiCollection) {
31  SiStripNoises::Range detNoiseRange = noises.getRange(set.detId());
32  for (auto const& digi : set) {
33  p.id->push_back(set.detId());
34  p.subdet->push_back((set.detId() >> 25) & 0x7);
35  p.strip->push_back(digi.strip());
36  p.adc->push_back(digi.adc());
37  p.noise->push_back(noises.getNoise(digi.strip(), detNoiseRange));
38  }
39  }
40 }

References apvshotsanalyzer_cfi::digiCollection, HLTEgPhaseIITestSequence_cff::noises, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by produce().

Member Data Documentation

◆ inputTags

std::vector<edm::InputTag> ShallowDigisProducer::inputTags
private

Definition at line 28 of file ShallowDigisProducer.h.

Referenced by findInput().

◆ noisesToken_

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> ShallowDigisProducer::noisesToken_
private

Definition at line 29 of file ShallowDigisProducer.h.

Referenced by produce().

patZpeak.handle
handle
Definition: patZpeak.py:23
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ShallowDigisProducer::insert
void insert(products &, edm::Event &)
Definition: ShallowDigisProducer.cc:20
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
edm::es::products
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
ShallowDigisProducer::findInput
bool findInput(edm::Handle< T > &, const edm::Event &)
Definition: ShallowDigisProducer.cc:57
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
ShallowDigisProducer::recordDigis
void recordDigis(const T &, products &, const SiStripNoises &noises)
Definition: ShallowDigisProducer.cc:29
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
eostools.move
def move(src, dest)
Definition: eostools.py:511
ShallowDigisProducer::inputTags
std::vector< edm::InputTag > inputTags
Definition: ShallowDigisProducer.h:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
ShallowDigisProducer::noisesToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noisesToken_
Definition: ShallowDigisProducer.h:29
HLTEgPhaseIITestSequence_cff.noises
noises
Definition: HLTEgPhaseIITestSequence_cff.py:1348
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37