CMS 3D CMS Logo

ShallowDigisProducer.cc
Go to the documentation of this file.
2 
12 
14  : inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")) {
15  produces<std::vector<unsigned> >("id");
16  produces<std::vector<unsigned> >("subdet");
17  produces<std::vector<unsigned> >("strip");
18  produces<std::vector<unsigned> >("adc");
19  produces<std::vector<float> >("noise");
20 }
21 
23  e.put(std::move(p.id), "id");
24  e.put(std::move(p.subdet), "subdet");
25  e.put(std::move(p.strip), "strip");
26  e.put(std::move(p.adc), "adc");
27  e.put(std::move(p.noise), "noise");
28 }
29 
30 template <class T>
32  for (auto const& set : digiCollection) {
33  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId());
34  for (auto const& digi : set) {
35  p.id->push_back(set.detId());
36  p.subdet->push_back((set.detId() >> 25) & 0x7);
37  p.strip->push_back(digi.strip());
38  p.adc->push_back(digi.adc());
39  p.noise->push_back(noiseHandle->getNoise(digi.strip(), detNoiseRange));
40  }
41  }
42 }
43 
45  products p;
49  if (findInput(inputOld, e))
50  recordDigis(*inputOld, p);
51  else if (findInput(inputNew, e))
52  recordDigis(*inputNew, p);
53  else
54  edm::LogWarning("Input Not Found");
55  insert(p, e);
56 }
57 
58 template <class T>
60  for (auto const& inputTag : inputTags) {
61  e.getByLabel(inputTag, handle);
62  if (handle.isValid() && !handle->empty()) {
63  LogDebug("Input") << inputTag;
64  return true;
65  }
66  }
67  return false;
68 }
ShallowDigisProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ShallowDigisProducer.cc:44
MessageLogger.h
ShallowDigisProducer::recordDigis
void recordDigis(const T &, products &)
Definition: ShallowDigisProducer.cc:31
patZpeak.handle
handle
Definition: patZpeak.py:23
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ShallowDigisProducer::insert
void insert(products &, edm::Event &)
Definition: ShallowDigisProducer.cc:22
SiStripNoises.h
SiStripNoises::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripNoises.cc:34
edm::Handle
Definition: AssociativeIterator.h:50
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
ShallowDigisProducer.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ShallowDigisProducer::findInput
bool findInput(edm::Handle< T > &, const edm::Event &)
Definition: ShallowDigisProducer.cc:59
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
SiStripDigi.h
HLTMuonOfflineAnalyzer_cfi.inputTags
inputTags
All input tags are specified in this pset for convenience.
Definition: HLTMuonOfflineAnalyzer_cfi.py:82
edm::LogWarning
Definition: MessageLogger.h:141
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
ShallowDigisProducer::ShallowDigisProducer
ShallowDigisProducer(const edm::ParameterSet &)
Definition: ShallowDigisProducer.cc:13
Event.h
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
get
#define get
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
T
long double T
Definition: Basic3DVectorLD.h:48
ShallowDigisProducer::inputTags
std::vector< edm::InputTag > inputTags
Definition: ShallowDigisProducer.h:28
EventSetup.h
ShallowDigisProducer::products
Definition: ShallowDigisProducer.h:15
SiStripNoisesRcd.h
ParameterSet.h
SiStripNoises::getNoise
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:71
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::Event
Definition: Event.h:73
DetSetVectorNew.h
ShallowDigisProducer::noiseHandle
edm::ESHandle< SiStripNoises > noiseHandle
Definition: ShallowDigisProducer.h:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37