CMS 3D CMS Logo

SiStripZeroSuppression.cc

Go to the documentation of this file.
00001 // File: SiStripZeroSuppression.cc
00002 // Description:  see SiStripZeroSuppression.h
00003 // Author:  D. Giordano
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   // Virtual destructor needed.
00026   SiStripZeroSuppression::~SiStripZeroSuppression() { 
00027     edm::LogInfo("SiStripZeroSuppression") << "[SiStripZeroSuppression::~SiStripZeroSuppression] Destructing object...";
00028   }  
00029   
00030   // Functions that gets called by framework every event
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       // Step B: Get Inputs   
00041       std::string rawdigiProducer = itRawDigiProducersList->getParameter<std::string>("RawDigiProducer");
00042       std::string rawdigiLabel = itRawDigiProducersList->getParameter<std::string>("RawDigiLabel");
00043       e.getByLabel(rawdigiProducer,rawdigiLabel,input);  //FIXME: fix this label        
00044   
00045       // Step B: produce output product
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       // Step C: create and fill output collection
00053       std::auto_ptr< edm::DetSetVector<SiStripDigi> > output(new edm::DetSetVector<SiStripDigi>(vSiStripDigi) );
00054 
00055       // Step E: write output to file
00056       e.put(output,rawdigiLabel);
00057     }
00058   }   
00059 }

Generated on Tue Jun 9 17:44:01 2009 for CMSSW by  doxygen 1.5.4