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 {
16  produces<std::vector<unsigned> >("id");
17  produces<std::vector<unsigned> >("subdet");
18  produces<std::vector<unsigned> >("strip");
19  produces<std::vector<unsigned> >("adc");
20  produces<std::vector<float> >("noise");
21 }
22 
25  e.put(std::move(p.id), "id");
26  e.put(std::move(p.subdet), "subdet");
27  e.put(std::move(p.strip), "strip");
28  e.put(std::move(p.adc), "adc");
29  e.put(std::move(p.noise), "noise");
30 }
31 
32 template<class T>
33 inline
36  for(auto const& set : digiCollection) {
37  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId());
38  for(auto const& digi : set) {
39  p.id->push_back(set.detId());
40  p.subdet->push_back((set.detId()>>25)&0x7);
41  p.strip->push_back(digi.strip());
42  p.adc->push_back(digi.adc());
43  p.noise->push_back(noiseHandle->getNoise( digi.strip(), detNoiseRange));
44  }
45  }
46 }
47 
50  products p;
53  es.get<SiStripNoisesRcd>().get(noiseHandle);
54  if( findInput(inputOld, e) ) recordDigis(*inputOld, p); else
55  if( findInput(inputNew, e) ) recordDigis(*inputNew, p); else
56  edm::LogWarning("Input Not Found");
57  insert(p,e);
58 }
59 
60 template<class T>
61 inline
64  for(auto const& inputTag : inputTags) {
65  e.getByLabel(inputTag, handle);
66  if( handle.isValid() && !handle->empty() ) {
67  LogDebug("Input") << inputTag;
68  return true;
69  }
70  }
71  return false;
72 }
#define LogDebug(id)
edm::ESHandle< SiStripNoises > noiseHandle
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::unique_ptr< std::vector< float > > noise
std::vector< edm::InputTag > inputTags
std::unique_ptr< std::vector< unsigned > > strip
void insert(products &, edm::Event &)
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:74
ShallowDigisProducer(const edm::ParameterSet &)
void recordDigis(const T &, products &)
std::unique_ptr< std::vector< unsigned > > id
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
std::unique_ptr< std::vector< unsigned > > adc
bool findInput(edm::Handle< T > &, const edm::Event &)
HLT enums.
const Range getRange(const uint32_t detID) const
T get() const
Definition: EventSetup.h:71
void produce(edm::Event &, const edm::EventSetup &) override
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50
long double T
std::unique_ptr< std::vector< unsigned > > subdet
def move(src, dest)
Definition: eostools.py:511