CMS 3D CMS Logo

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