38 void process(
const ClusterCollection&
input, std::vector<DetDigiCollection>& output_base);
58 produces< DigiCollection > (
"ZeroSuppressed");
59 produces< DigiCollection > (
"VirginRaw" );
60 produces< DigiCollection > (
"ProcessedRaw" );
61 produces< DigiCollection > (
"ScopeMode" );
70 std::vector<DetDigiCollection> output_base;
72 event.getByToken(
token,input);
78 auto outputZS = std::make_unique<DigiCollection>(output_base);
79 auto outputVR = std::make_unique<DigiCollection>();
80 auto outputPR = std::make_unique<DigiCollection>();
81 auto outputSM = std::make_unique<DigiCollection>();
83 event.put(
std::move(outputZS),
"ZeroSuppressed");
84 event.put(
std::move(outputVR),
"VirginRaw" );
85 event.put(
std::move(outputPR),
"ProcessedRaw" );
86 event.put(
std::move(outputSM),
"ScopeMode" );
94 uint32_t detid=it->detId();
100 for(;clus!=endclus;clus++){
102 size_t width = clus->amplitudes().size();
103 size_t firstStrip = clus->firstStrip();
104 uint16_t stripPos=firstStrip;
105 for(;istrip<
width;++istrip){
111 if (!detDigis.
empty())
112 output_base.push_back(detDigis);
138 if(adc > 255)
throw cms::Exception(
"Invalid Charge") <<
" digi at strip " << strip <<
" has ADC out of range " <<
adc;
139 if(adc > 253)
return adc;
140 uint16_t
charge =
static_cast<uint16_t
>( adc*
gain(strip) + 0.5 );
141 return ( charge > 1022 ? 255 :
142 ( charge > 253 ? 254 : charge ));
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
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)
#define DEFINE_FWK_MODULE(type)
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
std::pair< ContainerIterator, ContainerIterator > Range
edm::DetSet< SiStripDigi > DetDigiCollection
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
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