CMS 3D CMS Logo

SiStripFEDEmulator.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripMonitorHardware_SiStripFEDEmulator_H
2 #define DQM_SiStripMonitorHardware_SiStripFEDEmulator_H
3 
4 // Created 2010-01-20 by A.-M. Magnan
5 // Class intended to mimic the data path in the FED firmware in software
6 // steps: pedestal subtraction, CM subtraction, clustering and zero-suppression.
7 #include <sstream>
8 #include <fstream>
9 #include <iostream>
10 
12 
20 
22 
26 
28 
29 //for the zero suppression algorithm(s)
32 
33 namespace sistrip {
34 
35  class FEDEmulator {
36  public:
37  FEDEmulator();
38  ~FEDEmulator();
39 
40  void initialise(const bool byModule);
41 
42  void initialiseModule(const uint32_t aDetId, const uint32_t aNPairs, const uint32_t aPair);
43 
45  void retrieveNoises(const edm::ESHandle<SiStripNoises>& aHandle);
46 
48  std::vector<SiStripRawDigi>& pedsDetSetData,
49  std::vector<SiStripProcessedRawDigi>& noiseDetSetData,
50  std::vector<SiStripRawDigi>& pedSubtrDetSetData,
51  std::vector<uint32_t>& medsDetSetData,
52  const bool fillApvsForCM);
53 
54  void subtractCM(const std::vector<SiStripRawDigi>& pedSubtrDetSetData,
55  std::vector<SiStripRawDigi>& cmSubtrDetSetData);
56 
57  void zeroSuppress(const std::vector<SiStripRawDigi>& cmSubtrDetSetData,
58  edm::DetSet<SiStripDigi>& zsDetSetData,
59  const std::unique_ptr<SiStripRawProcessingAlgorithms>& algorithms);
60 
61  uint32_t fedIndex(const uint16_t aFedChannel);
62 
65 
66  void fillMedians(const std::map<uint32_t, std::vector<uint32_t> >::const_iterator& meds);
67 
68  void print(std::ostream& aOs);
69  void printPeds(std::ostream& aOs);
70  void printNoises(std::ostream& aOs);
71  void printMeds(std::ostream& aOs);
72 
73  private:
74  static const char* const messageLabel_;
75 
76  bool byModule_;
77 
78  uint32_t detId_;
79  uint32_t nPairs_;
80  uint32_t pair_;
81 
82  uint32_t minStrip_;
83  uint32_t maxStrip_;
84 
85  std::vector<int> pedestals_;
86  std::vector<float> noises_;
87  std::vector<uint32_t> medians_;
88 
89  }; //class FEDEmulator
90 
91 } //namespace sistrip
92 #endif //DQM_SiStripMonitorHardware_SiStripFEDEmulator_H
void subtractPedestals(const edm::DetSetVector< SiStripRawDigi >::const_iterator &inputChannel, std::vector< SiStripRawDigi > &pedsDetSetData, std::vector< SiStripProcessedRawDigi > &noiseDetSetData, std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< uint32_t > &medsDetSetData, const bool fillApvsForCM)
void printPeds(std::ostream &aOs)
static const char *const messageLabel_
void fillPeds(const edm::DetSetVector< SiStripRawDigi >::const_iterator &peds)
sistrip classes
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
std::vector< float > noises_
void fillMedians(const std::map< uint32_t, std::vector< uint32_t > >::const_iterator &meds)
void initialiseModule(const uint32_t aDetId, const uint32_t aNPairs, const uint32_t aPair)
std::vector< int > pedestals_
void subtractCM(const std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< SiStripRawDigi > &cmSubtrDetSetData)
uint32_t fedIndex(const uint16_t aFedChannel)
void initialise(const bool byModule)
void zeroSuppress(const std::vector< SiStripRawDigi > &cmSubtrDetSetData, edm::DetSet< SiStripDigi > &zsDetSetData, const std::unique_ptr< SiStripRawProcessingAlgorithms > &algorithms)
void printNoises(std::ostream &aOs)
void print(std::ostream &aOs)
void printMeds(std::ostream &aOs)
std::vector< uint32_t > medians_
void retrievePedestals(const edm::ESHandle< SiStripPedestals > &aHandle)
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
void fillNoises(const edm::DetSetVector< SiStripProcessedRawDigi >::const_iterator &noise)