CMS 3D CMS Logo

SiStripRawProcessingFactory.cc
Go to the documentation of this file.
2 
12 
13 
14 std::auto_ptr<SiStripRawProcessingAlgorithms> SiStripRawProcessingFactory::
15 create(const edm::ParameterSet& conf) {
16  return std::auto_ptr<SiStripRawProcessingAlgorithms>(
20  create_Suppressor(conf),
21  create_Restorer(conf),
23  create_useCMMeanMap(conf)));
24 }
25 
27  bool doAPVRestore = conf.getParameter<bool>("doAPVRestore");
28  return doAPVRestore;
29 }
30 
32  bool useCMMeanMap = conf.getParameter<bool>("useCMMeanMap");
33  return useCMMeanMap;
34 }
35 
36 std::auto_ptr<SiStripPedestalsSubtractor> SiStripRawProcessingFactory::
38  bool fedMode = conf.getParameter<bool>("PedestalSubtractionFedMode");
39  return std::auto_ptr<SiStripPedestalsSubtractor>( new SiStripPedestalsSubtractor(fedMode) );
40 }
41 
42 std::auto_ptr<SiStripCommonModeNoiseSubtractor> SiStripRawProcessingFactory::
44  std::string mode = conf.getParameter<std::string>("CommonModeNoiseSubtractionMode");
45 
46  if ( mode == "Median")
47  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new MedianCMNSubtractor() );
48 
49  if ( mode == "Percentile") {
50  double percentile = conf.getParameter<double>("Percentile");
51  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new PercentileCMNSubtractor(percentile) );
52  }
53 
54  if ( mode == "IteratedMedian") {
55  double cutToAvoidSignal = conf.getParameter<double>("CutToAvoidSignal");
56  int iterations = conf.getParameter<int>("Iterations");
57  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new IteratedMedianCMNSubtractor(cutToAvoidSignal,iterations) );
58  }
59 
60  if ( mode == "FastLinear")
61  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new FastLinearCMNSubtractor() );
62 
63  if ( mode == "TT6") {
64  double cutToAvoidSignal = conf.getParameter<double>("CutToAvoidSignal");
65  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new TT6CMNSubtractor(cutToAvoidSignal) );
66  }
67 
68  edm::LogError("SiStripRawProcessingFactory::create_SubtractorCMN")
69  << "Unregistered Algorithm: "<<mode<<". Use one of {Median, Percentile, IteratedMedian, FastLinear, TT6}";
70  return std::auto_ptr<SiStripCommonModeNoiseSubtractor>( new MedianCMNSubtractor() );
71 }
72 
73 std::auto_ptr<SiStripFedZeroSuppression> SiStripRawProcessingFactory::
75  uint32_t mode = conf.getParameter<uint32_t>("SiStripFedZeroSuppressionMode");
76  bool trunc = conf.getParameter<bool>("TruncateInSuppressor");
77  switch(mode) {
78  case 1: case 2: case 3: case 4:
79  return std::auto_ptr<SiStripFedZeroSuppression>( new SiStripFedZeroSuppression(mode,trunc));
80  default:
81  edm::LogError("SiStripRawProcessingFactory::createSuppressor")
82  << "Unregistered mode: "<<mode<<". Use one of {1,2,3,4}.";
83  return std::auto_ptr<SiStripFedZeroSuppression>( new SiStripFedZeroSuppression(4,true));
84  }
85 }
86 
87 std::auto_ptr<SiStripAPVRestorer> SiStripRawProcessingFactory::
89  if(!conf.exists("APVRestoreMode")) {
90  return std::auto_ptr<SiStripAPVRestorer>( 0 );
91  } else {
92  return std::auto_ptr<SiStripAPVRestorer> (new SiStripAPVRestorer(conf));
93  }
94 }
95 
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
static std::auto_ptr< SiStripFedZeroSuppression > create_Suppressor(const edm::ParameterSet &)
static bool create_useCMMeanMap(const edm::ParameterSet &)
static std::auto_ptr< SiStripCommonModeNoiseSubtractor > create_SubtractorCMN(const edm::ParameterSet &)
static std::auto_ptr< SiStripRawProcessingAlgorithms > create(const edm::ParameterSet &)
static std::auto_ptr< SiStripAPVRestorer > create_Restorer(const edm::ParameterSet &)
static bool create_doAPVRestorer(const edm::ParameterSet &)
static std::auto_ptr< SiStripPedestalsSubtractor > create_SubtractorPed(const edm::ParameterSet &)