CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
37  public:
38  FEDEmulator();
39  ~FEDEmulator();
40 
41  void initialise(const bool byModule);
42 
43  void initialiseModule(const uint32_t aDetId,
44  const uint32_t aNPairs,
45  const uint32_t aPair);
46 
48  void retrieveNoises(const edm::ESHandle<SiStripNoises> & aHandle);
49 
51  std::vector<SiStripRawDigi> & pedsDetSetData,
52  std::vector<SiStripProcessedRawDigi> & noiseDetSetData,
53  std::vector<SiStripRawDigi> & pedSubtrDetSetData,
54  std::vector<uint32_t> & medsDetSetData,
55  const bool fillApvsForCM);
56 
57  void subtractCM(const std::vector<SiStripRawDigi> & pedSubtrDetSetData,
58  std::vector<SiStripRawDigi> & cmSubtrDetSetData);
59 
60  void zeroSuppress(const std::vector<SiStripRawDigi> & cmSubtrDetSetData,
61  edm::DetSet<SiStripDigi> & zsDetSetData,
62  const std::auto_ptr<SiStripRawProcessingAlgorithms> & algorithms);
63 
64  uint32_t fedIndex(const uint16_t aFedChannel);
65 
68 
69  void fillMedians(const std::map<uint32_t,std::vector<uint32_t> >::const_iterator & meds);
70 
71  void print(std::ostream & aOs);
72  void printPeds(std::ostream & aOs);
73  void printNoises(std::ostream & aOs);
74  void printMeds(std::ostream & aOs);
75 
76  private:
77 
78  static const char* messageLabel_;
79 
80  bool byModule_;
81 
82  uint32_t detId_;
83  uint32_t nPairs_;
84  uint32_t pair_;
85 
86  uint32_t minStrip_;
87  uint32_t maxStrip_;
88 
89  std::vector<int> pedestals_;
90  std::vector<float> noises_;
91  std::vector<uint32_t> medians_;
92 
93 
94 
95 
96  };//class FEDEmulator
97 
98 }//namespace sistrip
99 #endif//DQM_SiStripMonitorHardware_SiStripFEDEmulator_H
void zeroSuppress(const std::vector< SiStripRawDigi > &cmSubtrDetSetData, edm::DetSet< SiStripDigi > &zsDetSetData, const std::auto_ptr< SiStripRawProcessingAlgorithms > &algorithms)
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)
void fillPeds(const edm::DetSetVector< SiStripRawDigi >::const_iterator &peds)
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
dictionary map
Definition: Association.py:205
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 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:106
void fillNoises(const edm::DetSetVector< SiStripProcessedRawDigi >::const_iterator &noise)
static const char * messageLabel_