CMS 3D CMS Logo

SiStripRawProcessingAlgorithms.cc
Go to the documentation of this file.
2 
11 #include <memory>
12 
13 
14 SiStripRawProcessingAlgorithms::SiStripRawProcessingAlgorithms(std::auto_ptr<SiStripPedestalsSubtractor> ped,
15  std::auto_ptr<SiStripCommonModeNoiseSubtractor> cmn,
16  std::auto_ptr<SiStripFedZeroSuppression> zs,
17  std::auto_ptr<SiStripAPVRestorer> res,
18  bool doAPVRest,
19  bool useCMMap)
20  : subtractorPed(ped),
21  subtractorCMN(cmn),
22  suppressor(zs),
23  restorer(res),
24  doAPVRestore(doAPVRest),
25  useCMMeanMap(useCMMap)
26  {}
27 
28 
30  subtractorPed->init(es);
31  subtractorCMN->init(es);
32  suppressor->init(es);
33  if(restorer.get()) restorer->init(es);
34 }
35 
37  this->initialize(es);
38  if(restorer.get()&&doAPVRestore&&useCMMeanMap) restorer->LoadMeanCMMap(e);
39 
40 }
41 
42 int16_t SiStripRawProcessingAlgorithms::SuppressVirginRawData(const uint32_t& id, const uint16_t& firstAPV, std::vector<int16_t>& processedRawDigis , edm::DetSet<SiStripDigi>& suppressedDigis ){
43 
44  subtractorPed->subtract( id, firstAPV*128,processedRawDigis);
45  return this->SuppressProcessedRawData(id, firstAPV, processedRawDigis , suppressedDigis );
46 
47 }
48 
50 
51  std::vector<int16_t> RawDigis;
52  RawDigis.clear();
53  edm::DetSet<SiStripRawDigi>::const_iterator itrawDigis = rawDigis.begin();
54  for(; itrawDigis != rawDigis.end(); ++itrawDigis) RawDigis.push_back(itrawDigis->adc());
55  return this->SuppressVirginRawData(rawDigis.id, 0,RawDigis , suppressedDigis);
56 }
57 
58 
59 
60 
61 int16_t SiStripRawProcessingAlgorithms::SuppressProcessedRawData(const uint32_t& id, const uint16_t& firstAPV, std::vector<int16_t>& processedRawDigis , edm::DetSet<SiStripDigi>& suppressedDigis ){
62  std::vector<int16_t> processedRawDigisPedSubtracted ;
63 
64  int16_t nAPVFlagged =0;
65  if( doAPVRestore ) processedRawDigisPedSubtracted.assign(processedRawDigis.begin(), processedRawDigis.end());
66  subtractorCMN->subtract(id, firstAPV, processedRawDigis);
67  if( doAPVRestore ) nAPVFlagged = restorer->InspectAndRestore(id, firstAPV, processedRawDigisPedSubtracted, processedRawDigis, subtractorCMN->getAPVsCM() );
68  suppressor->suppress( processedRawDigis, firstAPV, suppressedDigis );
69  return nAPVFlagged;
70 }
71 
72 
74  std::vector<int16_t> RawDigis;
75  RawDigis.clear();
76  edm::DetSet<SiStripRawDigi>::const_iterator itrawDigis = rawDigis.begin();
77  for(; itrawDigis != rawDigis.end(); ++itrawDigis) RawDigis.push_back(itrawDigis->adc());
78  return this->SuppressProcessedRawData(rawDigis.id, 0, RawDigis , suppressedDigis );
79 }
iterator end()
Definition: DetSet.h:60
const std::auto_ptr< SiStripAPVRestorer > restorer
int16_t SuppressVirginRawData(const uint32_t &, const uint16_t &, std::vector< int16_t > &, edm::DetSet< SiStripDigi > &)
const std::auto_ptr< SiStripPedestalsSubtractor > subtractorPed
const std::auto_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
const std::auto_ptr< SiStripFedZeroSuppression > suppressor
Definition: Electron.h:4
SiStripRawProcessingAlgorithms(std::auto_ptr< SiStripPedestalsSubtractor > ped, std::auto_ptr< SiStripCommonModeNoiseSubtractor > cmn, std::auto_ptr< SiStripFedZeroSuppression > zs, std::auto_ptr< SiStripAPVRestorer > res, bool doAPVRest, bool useCMMap)
iterator begin()
Definition: DetSet.h:59
int16_t SuppressProcessedRawData(const uint32_t &, const uint16_t &, std::vector< int16_t > &, edm::DetSet< SiStripDigi > &)
det_id_type id
Definition: DetSet.h:77
void initialize(const edm::EventSetup &)
collection_type::const_iterator const_iterator
Definition: DetSet.h:33