CMS 3D CMS Logo

ShallowDigisProducer.cc
Go to the documentation of this file.
1 #include "ShallowDigisProducer.h"
2 
10 
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 }
19 
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 }
27 
28 template <class T>
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 }
41 
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 }
55 
56 template <class T>
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 }
ShallowDigisProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ShallowDigisProducer.cc:42
MessageLogger.h
SiStripNoises
Definition: SiStripNoises.h:25
patZpeak.handle
handle
Definition: patZpeak.py:23
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
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
ShallowDigisProducer.h
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
SiStripDigi.h
HLTMuonOfflineAnalyzer_cfi.inputTags
inputTags
All input tags are specified in this pset for convenience.
Definition: HLTMuonOfflineAnalyzer_cfi.py:82
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
ShallowDigisProducer::ShallowDigisProducer
ShallowDigisProducer(const edm::ParameterSet &)
Definition: ShallowDigisProducer.cc:11
Event.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
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
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
ParameterSet.h
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
ShallowDigisProducer::noisesToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noisesToken_
Definition: ShallowDigisProducer.h:29
edm::Event
Definition: Event.h:73
DetSetVectorNew.h
HLTEgPhaseIITestSequence_cff.noises
noises
Definition: HLTEgPhaseIITestSequence_cff.py:1348
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37