00001
00002
00003
00004
00005
00006 #include "RecoLocalTracker/SiStripZeroSuppression/interface/SiStripZeroSuppression.h"
00007
00008 namespace cms
00009 {
00010 SiStripZeroSuppression::SiStripZeroSuppression(edm::ParameterSet const& conf):
00011 conf_(conf),
00012 SiStripZeroSuppressionAlgorithm_(conf),
00013 RawDigiProducersList(conf_.getParameter<Parameters>("RawDigiProducersList")){
00014
00015 edm::LogInfo("SiStripZeroSuppression") << "[SiStripZeroSuppression::SiStripZeroSuppression] Constructing object...";
00016
00017
00018 Parameters::iterator itRawDigiProducersList = RawDigiProducersList.begin();
00019 for(; itRawDigiProducersList != RawDigiProducersList.end(); ++itRawDigiProducersList ) {
00020 std::string rawdigiLabel = itRawDigiProducersList->getParameter<std::string>("RawDigiLabel");
00021 produces< edm::DetSetVector<SiStripDigi> > (rawdigiLabel);
00022 }
00023 }
00024
00025
00026 SiStripZeroSuppression::~SiStripZeroSuppression() {
00027 edm::LogInfo("SiStripZeroSuppression") << "[SiStripZeroSuppression::~SiStripZeroSuppression] Destructing object...";
00028 }
00029
00030
00031 void SiStripZeroSuppression::produce(edm::Event& e, const edm::EventSetup& es)
00032 {
00033 LogDebug("SiStripZeroSuppression") << "[SiStripZeroSuppression::produce] Analysing " << e.id();
00034
00035 edm::Handle< edm::DetSetVector<SiStripRawDigi> > input;
00036
00037 Parameters::iterator itRawDigiProducersList = RawDigiProducersList.begin();
00038 for(; itRawDigiProducersList != RawDigiProducersList.end(); ++itRawDigiProducersList ) {
00039
00040
00041 std::string rawdigiProducer = itRawDigiProducersList->getParameter<std::string>("RawDigiProducer");
00042 std::string rawdigiLabel = itRawDigiProducersList->getParameter<std::string>("RawDigiLabel");
00043 e.getByLabel(rawdigiProducer,rawdigiLabel,input);
00044
00045
00046 std::vector< edm::DetSet<SiStripDigi> > vSiStripDigi;
00047 vSiStripDigi.reserve(10000);
00048 if (input->size()){
00049 LogDebug("SiStripZeroSuppression") << "[SiStripZeroSuppression::produce] Analysing " << rawdigiProducer << " " << rawdigiLabel << std::endl;
00050 SiStripZeroSuppressionAlgorithm_.run(rawdigiLabel,*input,vSiStripDigi,es);
00051 }
00052
00053 std::auto_ptr< edm::DetSetVector<SiStripDigi> > output(new edm::DetSetVector<SiStripDigi>(vSiStripDigi) );
00054
00055
00056 e.put(output,rawdigiLabel);
00057 }
00058 }
00059 }