#include <RecoLocalTracker/SiStripZeroSuppression/interface/SiStripZeroSuppressionAlgorithm.h>
Public Member Functions | |
void | run (std::string RawDigiType, const edm::DetSetVector< SiStripRawDigi > &input, std::vector< edm::DetSet< SiStripDigi > > &output, const edm::EventSetup &es) |
Runs the algorithm. | |
SiStripZeroSuppressionAlgorithm (const edm::ParameterSet &conf) | |
~SiStripZeroSuppressionAlgorithm () | |
Private Attributes | |
std::string | CMNSubtractionMode_ |
edm::ParameterSet | conf_ |
SiStripCommonModeNoiseSubtractor * | SiStripCommonModeNoiseSubtractor_ |
SiStripPedestalsSubtractor * | SiStripPedestalsSubtractor_ |
SiStripFedZeroSuppression * | SiStripZeroSuppressor_ |
bool | validCMNSubtraction_ |
bool | validZeroSuppression_ |
std::string | ZeroSuppressionMode_ |
Definition at line 38 of file SiStripZeroSuppressionAlgorithm.h.
SiStripZeroSuppressionAlgorithm::SiStripZeroSuppressionAlgorithm | ( | const edm::ParameterSet & | conf | ) |
Definition at line 16 of file SiStripZeroSuppressionAlgorithm.cc.
References CMNSubtractionMode_, lat::endl(), edm::ParameterSet::getParameter(), SiStripCommonModeNoiseSubtractor_, SiStripPedestalsSubtractor_, SiStripZeroSuppressor_, validCMNSubtraction_, validZeroSuppression_, and ZeroSuppressionMode_.
00016 : 00017 conf_(conf), 00018 ZeroSuppressionMode_(conf.getParameter<std::string>("ZeroSuppressionMode")), 00019 CMNSubtractionMode_(conf.getParameter<std::string>("CommonModeNoiseSubtractionMode")){ 00020 00021 edm::LogInfo("SiStripZeroSuppression") 00022 << "[SiStripZeroSuppressionAlgorithm::SiStripZeroSuppressionAlgorithm] Constructing object..." 00023 << " ZeroSuppressionMode: " << ZeroSuppressionMode_ 00024 << "[SiStripZeroSuppressionAlgorithm::SiStripZeroSuppressionAlgorithm] CMNSubtractionMode: " << CMNSubtractionMode_; 00025 00026 //------------------------ 00027 if ( ZeroSuppressionMode_ == "SiStripFedZeroSuppression" ) { 00028 SiStripZeroSuppressor_ = new SiStripFedZeroSuppression(conf.getParameter<uint32_t>("FEDalgorithm")); 00029 validZeroSuppression_ = true; 00030 } 00031 else { 00032 edm::LogError("SiStripZeroSuppression") << "[SiStripZeroSuppressionAlgorithm::SiStripZeroSuppressionAlgorithm] No valid strip ZeroSuppressor selected, possible ZeroSuppressor: SiStripFedZeroSuppression" << std::endl; 00033 validZeroSuppression_ = false; 00034 } 00035 00036 //------------------------ 00037 if ( CMNSubtractionMode_ == "Median") { 00038 SiStripCommonModeNoiseSubtractor_ = new SiStripMedianCommonModeNoiseSubtraction(); 00039 validCMNSubtraction_ = true; 00040 } 00041 else if ( CMNSubtractionMode_ == "TT6") { 00042 SiStripCommonModeNoiseSubtractor_ = new SiStripTT6CommonModeNoiseSubtraction(conf.getParameter<double>("CutToAvoidSignal")); 00043 validCMNSubtraction_ = true; 00044 } 00045 else if ( CMNSubtractionMode_ == "FastLinear") { 00046 SiStripCommonModeNoiseSubtractor_ = new SiStripFastLinearCommonModeNoiseSubtraction(); 00047 validCMNSubtraction_ = true; 00048 } 00049 else { 00050 edm::LogError("SiStripZeroSuppression") << "[SiStripZeroSuppressionAlgorithm::SiStripZeroSuppressionAlgorithm] No valid CommonModeNoiseSubtraction Mode selected, possible CMNSubtractionMode: Median or TT6" << std::endl; 00051 validCMNSubtraction_ = false; 00052 } 00053 00054 //------------------------ 00055 00056 SiStripPedestalsSubtractor_ = new SiStripPedestalsSubtractor(); 00057 }
SiStripZeroSuppressionAlgorithm::~SiStripZeroSuppressionAlgorithm | ( | ) |
Definition at line 59 of file SiStripZeroSuppressionAlgorithm.cc.
References SiStripCommonModeNoiseSubtractor_, SiStripPedestalsSubtractor_, and SiStripZeroSuppressor_.
00059 { 00060 if ( SiStripZeroSuppressor_ != 0 ) 00061 delete SiStripZeroSuppressor_; 00062 if ( SiStripCommonModeNoiseSubtractor_ != 0 ) 00063 delete SiStripCommonModeNoiseSubtractor_; 00064 if ( SiStripPedestalsSubtractor_ != 0 ) 00065 delete SiStripPedestalsSubtractor_; 00066 }
void SiStripZeroSuppressionAlgorithm::run | ( | std::string | RawDigiType, | |
const edm::DetSetVector< SiStripRawDigi > & | input, | |||
std::vector< edm::DetSet< SiStripDigi > > & | output, | |||
const edm::EventSetup & | es | |||
) |
Runs the algorithm.
Definition at line 68 of file SiStripZeroSuppressionAlgorithm.cc.
References edm::DetSetVector< T >::begin(), CMNSubtractionMode_, edm::DetSet< T >::data, edm::DetSetVector< T >::end(), Exception, SiStripFedZeroSuppression::init(), SiStripCommonModeNoiseSubtractor::init(), SiStripPedestalsSubtractor::init(), output(), SiStripCommonModeNoiseSubtractor_, SiStripPedestalsSubtractor_, SiStripZeroSuppressor_, SiStripCommonModeNoiseSubtractor::subtract(), SiStripPedestalsSubtractor::subtract(), SiStripFedZeroSuppression::suppress(), validCMNSubtraction_, validZeroSuppression_, and ZeroSuppressionMode_.
00071 { 00072 00073 00074 00075 if ( validZeroSuppression_ && validCMNSubtraction_) { 00076 int number_detunits = 0; 00077 int number_localstripdigis = 0; 00078 00079 SiStripPedestalsSubtractor_->init(es); 00080 SiStripCommonModeNoiseSubtractor_->init(es); 00081 SiStripZeroSuppressor_->init(es); 00082 00083 //loop on all detset inside the input collection 00084 edm::DetSetVector<SiStripRawDigi>::const_iterator DSViter=input.begin(); 00085 for (; DSViter!=input.end();DSViter++){ 00086 ++number_detunits; 00087 00088 //Create a new DetSet<SiStripDigi> 00089 edm::DetSet<SiStripDigi> ssd(DSViter->id); 00090 00091 //Create a temporary edm::DetSet<SiStripRawDigi> 00092 std::vector<int16_t> vssRd((*DSViter).data.size()); 00093 00094 if ( RawDigiType == "VirginRaw" ) { 00095 SiStripPedestalsSubtractor_->subtract(*DSViter,vssRd); 00096 SiStripCommonModeNoiseSubtractor_->subtract(DSViter->id,vssRd); 00097 SiStripZeroSuppressor_->suppress(vssRd,ssd); 00098 } 00099 else if ( RawDigiType == "ProcessedRaw" ){ 00100 SiStripZeroSuppressor_->suppress((*DSViter),ssd); 00101 } 00102 else{ 00103 //FIXME 00104 //insert throw exception 00105 } 00106 number_localstripdigis += ssd.data.size(); 00107 00108 if (ssd.data.size()) 00109 output.push_back(ssd); // insert the DetSet<SiStripDigi> in the DetSetVec<SiStripDigi> only if there is at least a digi 00110 } 00111 00112 } else if(!validCMNSubtraction_){ 00113 throw cms::Exception("Wrong Parameter Configuraiton") 00114 << "[SiStripZeroSuppressionAlgorithm::run] invalid CMNSubtraction algorithm " << CMNSubtractionMode_ << "\n Please set in the SiStripZeroSuppression configuration file the string CommonModeNoiseSubtractionMode to one of the following Supported modes: Median, TT6, FastLinearone"; 00115 } else { 00116 throw cms::Exception("Wrong Parameter Configuraiton") 00117 << "[SiStripZeroSuppressionAlgorithm::run] invalid ZeroSuppression algorithm " << ZeroSuppressionMode_ << "\n Please set in the SiStripZeroSuppression configuration file the string ZeroSuppressionMode = SiStripFedZeroSuppression"; 00118 } 00119 }
std::string SiStripZeroSuppressionAlgorithm::CMNSubtractionMode_ [private] |
Definition at line 57 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), and SiStripZeroSuppressionAlgorithm().
Definition at line 50 of file SiStripZeroSuppressionAlgorithm.h.
SiStripCommonModeNoiseSubtractor* SiStripZeroSuppressionAlgorithm::SiStripCommonModeNoiseSubtractor_ [private] |
Definition at line 56 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), SiStripZeroSuppressionAlgorithm(), and ~SiStripZeroSuppressionAlgorithm().
Definition at line 60 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), SiStripZeroSuppressionAlgorithm(), and ~SiStripZeroSuppressionAlgorithm().
Definition at line 52 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), SiStripZeroSuppressionAlgorithm(), and ~SiStripZeroSuppressionAlgorithm().
Definition at line 58 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), and SiStripZeroSuppressionAlgorithm().
Definition at line 54 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), and SiStripZeroSuppressionAlgorithm().
std::string SiStripZeroSuppressionAlgorithm::ZeroSuppressionMode_ [private] |
Definition at line 53 of file SiStripZeroSuppressionAlgorithm.h.
Referenced by run(), and SiStripZeroSuppressionAlgorithm().