17 #include "boost/foreach.hpp" 39 void process(
const ClusterCollection&
input, std::vector<DetDigiCollection>& output_base);
59 produces< DigiCollection > (
"ZeroSuppressed");
60 produces< DigiCollection > (
"VirginRaw" );
61 produces< DigiCollection > (
"ProcessedRaw" );
62 produces< DigiCollection > (
"ScopeMode" );
71 std::vector<DetDigiCollection> output_base;
73 event.getByToken(
token,input);
79 auto outputZS = std::make_unique<DigiCollection>(output_base);
80 auto outputVR = std::make_unique<DigiCollection>();
81 auto outputPR = std::make_unique<DigiCollection>();
82 auto outputSM = std::make_unique<DigiCollection>();
84 event.put(
std::move(outputZS),
"ZeroSuppressed");
85 event.put(
std::move(outputVR),
"VirginRaw" );
86 event.put(
std::move(outputPR),
"ProcessedRaw" );
87 event.put(
std::move(outputSM),
"ScopeMode" );
95 uint32_t detid=it->detId();
101 for(;clus!=endclus;clus++){
103 size_t width = clus->amplitudes().size();
104 size_t firstStrip = clus->firstStrip();
105 uint16_t stripPos=firstStrip;
106 for(;istrip<
width;++istrip){
113 output_base.push_back(detDigis);
139 if(adc > 255)
throw cms::Exception(
"Invalid Charge") <<
" digi at strip " << strip <<
" has ADC out of range " <<
adc;
140 if(adc > 253)
return adc;
141 uint16_t
charge =
static_cast<uint16_t
>( adc*
gain(strip) + 0.5 );
142 return ( charge > 1022 ? 255 :
143 ( charge > 253 ? 254 : charge ));
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
void setDetId(const uint32_t id)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::DetSetVector< SiStripDigi > DigiCollection
const_iterator end(bool update=false) const
edmNew::DetSet< SiStripCluster > DetClusterCollection
#define DEFINE_FWK_MODULE(type)
SiStripApvGain::Range gainRange
uint16_t applyGain(const uint16_t &strip, const uint16_t &adc)
data_type const * const_iterator
edm::ESHandle< SiStripGain > gainHandle
float gain(const uint16_t &strip) const
static std::string const input
void initialize(const edm::EventSetup &es)
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
std::pair< ContainerIterator, ContainerIterator > Range
edm::DetSet< SiStripDigi > DetDigiCollection
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
edm::EDGetTokenT< ClusterCollection > token
edmNew::DetSetVector< SiStripCluster > ClusterCollection
void produce(edm::Event &, const edm::EventSetup &) override
void process(const ClusterCollection &input, std::vector< DetDigiCollection > &output_base)
edmNew::DetSet< SiStripCluster >::const_iterator DetClusIter
SiStripClusterToDigiProducer(const edm::ParameterSet &conf)
collection_type::const_iterator const_iterator
edm::DetSet< SiStripDigi >::const_iterator DetDigiIter
const_iterator begin(bool update=false) const
const SiStripApvGain::Range getRange(uint32_t detID) const