CMS 3D CMS Logo

SiStripRawProcessingFactory.cc
Go to the documentation of this file.
1 #include <memory>
2 
5 
15 
16 std::unique_ptr<SiStripRawProcessingAlgorithms> SiStripRawProcessingFactory::create(const edm::ParameterSet& conf,
18  return std::unique_ptr<SiStripRawProcessingAlgorithms>(
20  create_SubtractorPed(conf, iC),
21  create_SubtractorCMN(conf, iC),
22  create_Suppressor(conf, iC),
23  create_Restorer(conf, iC),
24  conf.getParameter<bool>("doAPVRestore"),
25  conf.getParameter<bool>("useCMMeanMap")));
26 }
27 
28 std::unique_ptr<SiStripPedestalsSubtractor> SiStripRawProcessingFactory::create_SubtractorPed(
29  const edm::ParameterSet& conf, edm::ConsumesCollector iC) {
30  return std::unique_ptr<SiStripPedestalsSubtractor>(
31  new SiStripPedestalsSubtractor(conf.getParameter<bool>("PedestalSubtractionFedMode"), iC));
32 }
33 
34 std::unique_ptr<SiStripCommonModeNoiseSubtractor> SiStripRawProcessingFactory::create_SubtractorCMN(
35  const edm::ParameterSet& conf, edm::ConsumesCollector iC) {
36  const std::string mode = conf.getParameter<std::string>("CommonModeNoiseSubtractionMode");
37 
38  if (mode == "Median")
39  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(new MedianCMNSubtractor());
40 
41  if (mode == "Percentile") {
42  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(
43  new PercentileCMNSubtractor(conf.getParameter<double>("Percentile")));
44  }
45 
46  if (mode == "IteratedMedian") {
47  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(new IteratedMedianCMNSubtractor(
48  conf.getParameter<double>("CutToAvoidSignal"), conf.getParameter<int>("Iterations"), iC));
49  }
50 
51  if (mode == "FastLinear")
52  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(new FastLinearCMNSubtractor());
53 
54  if (mode == "TT6") {
55  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(
56  new TT6CMNSubtractor(conf.getParameter<double>("CutToAvoidSignal"), iC));
57  }
58 
59  edm::LogError("SiStripRawProcessingFactory::create_SubtractorCMN")
60  << "Unregistered Algorithm: " << mode << ". Use one of {Median, Percentile, IteratedMedian, FastLinear, TT6}";
61  return std::unique_ptr<SiStripCommonModeNoiseSubtractor>(new MedianCMNSubtractor());
62 }
63 
64 std::unique_ptr<SiStripFedZeroSuppression> SiStripRawProcessingFactory::create_Suppressor(const edm::ParameterSet& conf,
66  const uint32_t mode = conf.getParameter<uint32_t>("SiStripFedZeroSuppressionMode");
67  const bool trunc = conf.getParameter<bool>("TruncateInSuppressor");
68  const bool trunc10bits = conf.getParameter<bool>("Use10bitsTruncation");
69  switch (mode) {
70  case 1:
71  case 2:
72  case 3:
73  case 4:
74  return std::make_unique<SiStripFedZeroSuppression>(mode, &iC, trunc, trunc10bits);
75  default:
76  edm::LogError("SiStripRawProcessingFactory::createSuppressor")
77  << "Unregistered mode: " << mode << ". Use one of {1,2,3,4}.";
78  return std::make_unique<SiStripFedZeroSuppression>(4, &iC, true, trunc10bits);
79  }
80 }
81 
82 std::unique_ptr<SiStripAPVRestorer> SiStripRawProcessingFactory::create_Restorer(const edm::ParameterSet& conf,
84  if (!conf.exists("APVRestoreMode")) {
85  return std::unique_ptr<SiStripAPVRestorer>(nullptr);
86  } else {
87  return std::unique_ptr<SiStripAPVRestorer>(new SiStripAPVRestorer(conf, iC));
88  }
89 }
SiStripRawProcessingFactory.h
SiStripRawProcessingAlgorithms
Definition: SiStripRawProcessingAlgorithms.h:15
TT6CMNSubtractor.h
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
MedianCMNSubtractor
Definition: MedianCMNSubtractor.h:5
SiStripRawProcessingFactory::create
static std::unique_ptr< SiStripRawProcessingAlgorithms > create(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:16
TT6CMNSubtractor
Definition: TT6CMNSubtractor.h:12
SiStripPedestalsSubtractor
Definition: SiStripPedestalsSubtractor.h:14
IteratedMedianCMNSubtractor
Definition: IteratedMedianCMNSubtractor.h:14
SiStripFedZeroSuppression.h
SiStripRawProcessingFactory::create_Restorer
static std::unique_ptr< SiStripAPVRestorer > create_Restorer(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:82
PercentileCMNSubtractor.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripRawProcessingFactory::create_SubtractorCMN
static std::unique_ptr< SiStripCommonModeNoiseSubtractor > create_SubtractorCMN(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:34
MedianCMNSubtractor.h
IteratedMedianCMNSubtractor.h
SiStripRawProcessingAlgorithms.h
FastLinearCMNSubtractor.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PercentileCMNSubtractor
Definition: PercentileCMNSubtractor.h:5
SiStripAPVRestorer
Definition: SiStripAPVRestorer.h:25
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripRawProcessingFactory::create_Suppressor
static std::unique_ptr< SiStripFedZeroSuppression > create_Suppressor(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:64
FastLinearCMNSubtractor
Definition: FastLinearCMNSubtractor.h:5
SiStripRawProcessingFactory::create_SubtractorPed
static std::unique_ptr< SiStripPedestalsSubtractor > create_SubtractorPed(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: SiStripRawProcessingFactory.cc:28
ConsumesCollector.h
ParameterSet.h
SiStripPedestalsSubtractor.h
pileupReCalc_HLTpaths.trunc
trunc
Definition: pileupReCalc_HLTpaths.py:143
edm::ConsumesCollector
Definition: ConsumesCollector.h:45