CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalSimpleAmplitudeZS Class Reference

#include <HcalSimpleAmplitudeZS.h>

Inheritance diagram for HcalSimpleAmplitudeZS:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HcalSimpleAmplitudeZS (const edm::ParameterSet &ps)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
virtual ~HcalSimpleAmplitudeZS ()

Private Attributes

std::auto_ptr< HcalZSAlgoEnergyhbhe_
std::auto_ptr< HcalZSAlgoEnergyhf_
std::auto_ptr< HcalZSAlgoEnergyho_
edm::InputTag inputLabel_

Detailed Description

Date:
2007/09/13 15:02:50
Revision:
1.2
Author:
J. Mans - Minnesota

Definition at line 20 of file HcalSimpleAmplitudeZS.h.


Constructor & Destructor Documentation

HcalSimpleAmplitudeZS::HcalSimpleAmplitudeZS ( const edm::ParameterSet ps) [explicit]

Definition at line 18 of file HcalSimpleAmplitudeZS.cc.

References edm::ParameterSet::getParameter(), hbhe_, hf_, and ho_.

                                                                       :
  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel"))
{
  const edm::ParameterSet& psHBHE=conf.getParameter<edm::ParameterSet>("hbhe");
  bool markAndPass=psHBHE.getParameter<bool>("markAndPass");
  hbhe_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
                                                             psHBHE.getParameter<int>("level"),
                                                             psHBHE.getParameter<int>("firstSample"),
                                                             psHBHE.getParameter<int>("samplesToAdd"),
                                                             psHBHE.getParameter<bool>("twoSided")));
  produces<HBHEDigiCollection>();  

  const edm::ParameterSet& psHO=conf.getParameter<edm::ParameterSet>("ho");
  markAndPass=psHO.getParameter<bool>("markAndPass");
  ho_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass,
                                                           psHO.getParameter<int>("level"),
                                                           psHO.getParameter<int>("firstSample"),
                                                           psHO.getParameter<int>("samplesToAdd"),
                                                           psHO.getParameter<bool>("twoSided")));
  produces<HODigiCollection>();
  
  const edm::ParameterSet& psHF=conf.getParameter<edm::ParameterSet>("hf");
  markAndPass=psHO.getParameter<bool>("markAndPass");
  hf_=std::auto_ptr<HcalZSAlgoEnergy>(new HcalZSAlgoEnergy(markAndPass, 
                                                           psHF.getParameter<int>("level"),
                                                           psHF.getParameter<int>("firstSample"),
                                                           psHF.getParameter<int>("samplesToAdd"),
                                                           psHF.getParameter<bool>("twoSided")));
  produces<HFDigiCollection>();
  
}
HcalSimpleAmplitudeZS::~HcalSimpleAmplitudeZS ( ) [virtual]

Definition at line 50 of file HcalSimpleAmplitudeZS.cc.

                                              {
}

Member Function Documentation

void HcalSimpleAmplitudeZS::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 53 of file HcalSimpleAmplitudeZS.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), hbhe_, hf_, ho_, inputLabel_, edm::Handle< T >::product(), and edm::Event::put().

{
  // get conditions
  edm::ESHandle<HcalDbService> conditions;
  eventSetup.get<HcalDbRecord>().get(conditions);
  

  {
    hbhe_->prepare(&(*conditions));
    edm::Handle<HBHEDigiCollection> digi;    
    e.getByLabel(inputLabel_,digi);
    
    // create empty output
    std::auto_ptr<HBHEDigiCollection> zs(new HBHEDigiCollection);
    // run the algorithm
    hbhe_->suppress(*(digi.product()),*zs);
    
    edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << digi->size() << " digis, output " << zs->size() << " digis";
    
    // return result
    e.put(zs);
    hbhe_->done();
  } 
  {
    ho_->prepare(&(*conditions));
    edm::Handle<HODigiCollection> digi;
    e.getByLabel(inputLabel_,digi);
    
    // create empty output
    std::auto_ptr<HODigiCollection> zs(new HODigiCollection);
    // run the algorithm
    ho_->suppress(*(digi.product()),*zs);

    edm::LogInfo("HcalZeroSuppression") << "Suppression (HO) input " << digi->size() << " digis, output " << zs->size() << " digis";

    // return result
    e.put(zs);    
    ho_->done();
  } 
  {
    hf_->prepare(&(*conditions));
    edm::Handle<HFDigiCollection> digi;
    e.getByLabel(inputLabel_,digi);
    
    // create empty output
    std::auto_ptr<HFDigiCollection> zs(new HFDigiCollection);
    // run the algorithm
    hf_->suppress(*(digi.product()),*zs);

    edm::LogInfo("HcalZeroSuppression") << "Suppression (HF) input " << digi->size() << " digis, output " << zs->size() << " digis";

    // return result
    e.put(zs);     
    hf_->done();
  }

}

Member Data Documentation

Definition at line 26 of file HcalSimpleAmplitudeZS.h.

Referenced by HcalSimpleAmplitudeZS(), and produce().

std::auto_ptr<HcalZSAlgoEnergy> HcalSimpleAmplitudeZS::hf_ [private]

Definition at line 26 of file HcalSimpleAmplitudeZS.h.

Referenced by HcalSimpleAmplitudeZS(), and produce().

std::auto_ptr<HcalZSAlgoEnergy> HcalSimpleAmplitudeZS::ho_ [private]

Definition at line 26 of file HcalSimpleAmplitudeZS.h.

Referenced by HcalSimpleAmplitudeZS(), and produce().

Definition at line 27 of file HcalSimpleAmplitudeZS.h.

Referenced by produce().