Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:14

0001 #ifndef RecoLocalTracker_SiStripZeroSuppression_SiStripRawProcessingAlgorithms_h
0002 #define RecoLocalTracker_SiStripZeroSuppression_SiStripRawProcessingAlgorithms_h
0003 
0004 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripPedestalsSubtractor.h"
0005 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripCommonModeNoiseSubtractor.h"
0006 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripFedZeroSuppression.h"
0007 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripAPVRestorer.h"
0008 
0009 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0010 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0011 
0012 #include "DataFormats/Common/interface/DetSet.h"
0013 #include "DataFormats/Common/interface/DetSetVector.h"
0014 
0015 class SiStripRawProcessingAlgorithms {
0016   friend class SiStripRawProcessingFactory;
0017 
0018 public:
0019   using digivector_t = SiStripAPVRestorer::digivector_t;
0020 
0021   void initialize(const edm::EventSetup&);
0022   void initialize(const edm::EventSetup&, const edm::Event&);
0023 
0024   uint16_t suppressHybridData(const edm::DetSet<SiStripDigi>& inDigis,
0025                               edm::DetSet<SiStripDigi>& suppressedDigis,
0026                               uint16_t firstAPV = 0);
0027 
0028   uint16_t suppressVirginRawData(uint32_t detId,
0029                                  uint16_t firstAPV,
0030                                  digivector_t& procRawDigis,
0031                                  edm::DetSet<SiStripDigi>& output);
0032   uint16_t suppressVirginRawData(const edm::DetSet<SiStripRawDigi>& rawDigis, edm::DetSet<SiStripDigi>& output);
0033 
0034   uint16_t suppressProcessedRawData(uint32_t detId,
0035                                     uint16_t firstAPV,
0036                                     digivector_t& procRawDigis,
0037                                     edm::DetSet<SiStripDigi>& output);
0038   uint16_t suppressProcessedRawData(const edm::DetSet<SiStripRawDigi>& rawDigis, edm::DetSet<SiStripDigi>& output);
0039 
0040   uint16_t convertVirginRawToHybrid(uint32_t detId,
0041                                     uint16_t firstAPV,
0042                                     digivector_t& inDigis,
0043                                     edm::DetSet<SiStripDigi>& rawDigis);
0044   uint16_t convertVirginRawToHybrid(const edm::DetSet<SiStripRawDigi>& rawDigis,
0045                                     edm::DetSet<SiStripDigi>& suppressedDigis);
0046 
0047   inline const std::vector<bool>& getAPVFlags() const { return restorer->getAPVFlags(); }
0048   inline const SiStripAPVRestorer::baselinemap_t& getBaselineMap() const { return restorer->getBaselineMap(); }
0049   inline const std::map<uint16_t, SiStripAPVRestorer::digimap_t>& getSmoothedPoints() const {
0050     return restorer->getSmoothedPoints();
0051   }
0052   inline const SiStripAPVRestorer::medians_t& getAPVsCM() const { return subtractorCMN->getAPVsCM(); }
0053 
0054   const std::unique_ptr<SiStripPedestalsSubtractor> subtractorPed;
0055   const std::unique_ptr<SiStripCommonModeNoiseSubtractor> subtractorCMN;
0056   const std::unique_ptr<SiStripFedZeroSuppression> suppressor;
0057   const std::unique_ptr<SiStripAPVRestorer> restorer;
0058 
0059 private:
0060   const bool doAPVRestore;
0061   const bool useCMMeanMap;
0062 
0063   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0064   const TrackerGeometry* trGeo;
0065 
0066   SiStripRawProcessingAlgorithms(edm::ConsumesCollector iC,
0067                                  std::unique_ptr<SiStripPedestalsSubtractor> ped,
0068                                  std::unique_ptr<SiStripCommonModeNoiseSubtractor> cmn,
0069                                  std::unique_ptr<SiStripFedZeroSuppression> zs,
0070                                  std::unique_ptr<SiStripAPVRestorer> res,
0071                                  bool doAPVRest,
0072                                  bool useCMMap);
0073 };
0074 #endif