Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SiStripZeroSuppression_h
0002 #define SiStripZeroSuppression_h
0003 #include "FWCore/Framework/interface/stream/EDProducer.h"
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 
0006 #include "FWCore/Framework/interface/Frameworkfwd.h"
0007 #include "FWCore/Utilities/interface/InputTag.h"
0008 #include "DataFormats/Common/interface/DetSet.h"
0009 #include "DataFormats/Common/interface/DetSetVector.h"
0010 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripRawProcessingAlgorithms.h"
0011 #include "DataFormats/SiStripDigi/interface/SiStripProcessedRawDigi.h"
0012 
0013 class SiStripDigi;
0014 class SiStripRawDigi;
0015 
0016 class SiStripZeroSuppression : public edm::stream::EDProducer<> {
0017 public:
0018   explicit SiStripZeroSuppression(const edm::ParameterSet&);
0019   void produce(edm::Event&, const edm::EventSetup&) override;
0020 
0021 private:
0022   enum class RawType { Unknown, VirginRaw, ProcessedRaw, ScopeMode };
0023 
0024   void clearOutputs();
0025   void putOutputs(edm::Event& evt, const std::string& tagName);
0026 
0027   void processRaw(const edm::DetSetVector<SiStripRawDigi>& input, RawType inType);
0028   void processHybrid(const edm::DetSetVector<SiStripDigi>& input);
0029   void storeExtraOutput(uint32_t, int16_t);
0030   edm::DetSet<SiStripRawDigi> formatRawDigis(const edm::DetSet<SiStripRawDigi>& rawDigis);
0031   edm::DetSet<SiStripRawDigi> formatRawDigis(uint32_t detId, const std::vector<int16_t>& rawDigis);
0032   using medians_t = std::vector<std::pair<short, float>>;
0033   void storeCMN(uint32_t, const medians_t&);
0034   void storeBaseline(uint32_t, const medians_t&);
0035   void storeBaselinePoints(uint32_t);
0036 
0037   std::unique_ptr<SiStripRawProcessingAlgorithms> algorithms;
0038 
0039   bool produceRawDigis;
0040   bool storeCM;
0041   bool fixCM;
0042   bool produceCalculatedBaseline;
0043   bool produceBaselinePoints;
0044   bool storeInZScollBadAPV;
0045   bool produceHybridFormat;
0046 
0047   using rawtoken_t = edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi>>;
0048   using zstoken_t = edm::EDGetTokenT<edm::DetSetVector<SiStripDigi>>;
0049   std::vector<std::tuple<std::string, RawType, rawtoken_t>> rawInputs;
0050   std::vector<std::tuple<std::string, zstoken_t>> hybridInputs;
0051 
0052   std::vector<edm::DetSet<SiStripDigi>> output_base;
0053   std::vector<edm::DetSet<SiStripRawDigi>> output_base_raw;
0054   std::vector<edm::DetSet<SiStripProcessedRawDigi>> output_apvcm;
0055   std::vector<edm::DetSet<SiStripProcessedRawDigi>> output_baseline;
0056   std::vector<edm::DetSet<SiStripDigi>> output_baseline_points;
0057 };
0058 #endif