CMS 3D CMS Logo

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