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* 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
FEDNumbering.h
SiStripRawProcessingFactory.h
sistrip::FEDEmulator::retrievePedestals
void retrievePedestals(const edm::ESHandle< SiStripPedestals > &aHandle)
Definition: SiStripFEDEmulator.cc:60
sistrip::FEDEmulator::subtractPedestals
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)
Definition: SiStripFEDEmulator.cc:84
ESHandle.h
sistrip::FEDEmulator::fillPeds
void fillPeds(const edm::DetSetVector< SiStripRawDigi >::const_iterator &peds)
Definition: SiStripFEDEmulator.cc:203
edm::DetSet< SiStripDigi >
SiStripRawDigi.h
SiStripFedCabling.h
SiStripNoises.h
sistrip::FEDEmulator::printNoises
void printNoises(std::ostream &aOs)
Definition: SiStripFEDEmulator.cc:248
FEDRawData.h
sistrip::FEDEmulator::initialiseModule
void initialiseModule(const uint32_t aDetId, const uint32_t aNPairs, const uint32_t aPair)
Definition: SiStripFEDEmulator.cc:37
sistrip::FEDEmulator::subtractCM
void subtractCM(const std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< SiStripRawDigi > &cmSubtrDetSetData)
Definition: SiStripFEDEmulator.cc:169
sistrip::FEDEmulator::printMeds
void printMeds(std::ostream &aOs)
Definition: SiStripFEDEmulator.cc:259
sistrip::FEDEmulator::fedIndex
uint32_t fedIndex(const uint16_t aFedChannel)
SiStripProcessedRawDigi.h
SiStripFEDBuffer.h
SiStripDigi.h
edm::ESHandle
Definition: DTSurvey.h:22
sistrip::FEDEmulator::print
void print(std::ostream &aOs)
Definition: SiStripFEDEmulator.cc:222
sistrip::FEDEmulator::zeroSuppress
void zeroSuppress(const std::vector< SiStripRawDigi > &cmSubtrDetSetData, edm::DetSet< SiStripDigi > &zsDetSetData, const std::unique_ptr< SiStripRawProcessingAlgorithms > &algorithms)
Definition: SiStripFEDEmulator.cc:190
sistrip::FEDEmulator::noises_
std::vector< float > noises_
Definition: SiStripFEDEmulator.h:86
sistrip::FEDEmulator::messageLabel_
static const char * messageLabel_
Definition: SiStripFEDEmulator.h:74
sistrip::FEDEmulator::minStrip_
uint32_t minStrip_
Definition: SiStripFEDEmulator.h:82
sistrip::FEDEmulator::initialise
void initialise(const bool byModule)
Definition: SiStripFEDEmulator.cc:30
sistrip::FEDEmulator::pedestals_
std::vector< int > pedestals_
Definition: SiStripFEDEmulator.h:85
sistrip::FEDEmulator
Definition: SiStripFEDEmulator.h:35
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
sistrip::FEDEmulator::retrieveNoises
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
Definition: SiStripFEDEmulator.cc:72
FEDRawDataCollection.h
sistrip::FEDEmulator::FEDEmulator
FEDEmulator()
Definition: SiStripFEDEmulator.cc:15
SiStripRawProcessingAlgorithms.h
analysisFilters_cff.algorithms
algorithms
Definition: analysisFilters_cff.py:30
DetSetVector.h
gpuVertexFinder::noise
__shared__ int noise
Definition: gpuFitVertices.h:50
sistrip::FEDEmulator::detId_
uint32_t detId_
Definition: SiStripFEDEmulator.h:78
sistrip::FEDEmulator::maxStrip_
uint32_t maxStrip_
Definition: SiStripFEDEmulator.h:83
Wrapper.h
sistrip::FEDEmulator::fillNoises
void fillNoises(const edm::DetSetVector< SiStripProcessedRawDigi >::const_iterator &noise)
Definition: SiStripFEDEmulator.cc:209
sistrip::FEDEmulator::printPeds
void printPeds(std::ostream &aOs)
Definition: SiStripFEDEmulator.cc:237
sistrip::FEDEmulator::fillMedians
void fillMedians(const std::map< uint32_t, std::vector< uint32_t > >::const_iterator &meds)
Definition: SiStripFEDEmulator.cc:215
sistrip::FEDEmulator::byModule_
bool byModule_
Definition: SiStripFEDEmulator.h:76
SiStripPedestals.h
sistrip::FEDEmulator::nPairs_
uint32_t nPairs_
Definition: SiStripFEDEmulator.h:79
genParticles_cff.map
map
Definition: genParticles_cff.py:11
sistrip
sistrip classes
Definition: EnsembleCalibrationLA.cc:10
sistrip::FEDEmulator::pair_
uint32_t pair_
Definition: SiStripFEDEmulator.h:80
sistrip::FEDEmulator::medians_
std::vector< uint32_t > medians_
Definition: SiStripFEDEmulator.h:87
sistrip::FEDEmulator::~FEDEmulator
~FEDEmulator()
Definition: SiStripFEDEmulator.cc:28