CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalRealisticZS Class Reference

#include <HcalRealisticZS.h>

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

List of all members.

Public Member Functions

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

Private Attributes

std::auto_ptr
< HcalZSAlgoRealistic
algo_
edm::InputTag inputLabel_

Detailed Description

Definition at line 23 of file HcalRealisticZS.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file HcalRealisticZS.cc.

References algo_, and edm::ParameterSet::getParameter().

                                                           :
  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel"))
{
  bool markAndPass=conf.getParameter<bool>("markAndPass");
  
    algo_=std::auto_ptr<HcalZSAlgoRealistic>(new HcalZSAlgoRealistic(markAndPass));
  
    //this constructor will be called if useConfigZSvalues is set to 1 in
    //HcalZeroSuppressionProducers/python/hcalDigisRealistic_cfi.py
    //which means that channel-by-channel ZS thresholds from DB will NOT be used
    if ( conf.getParameter<int>("useConfigZSvalues") )
      algo_=std::auto_ptr<HcalZSAlgoRealistic>(new HcalZSAlgoRealistic(markAndPass,
                                                           conf.getParameter<int>("HBlevel"),
                                                           conf.getParameter<int>("HElevel"),
                                                           conf.getParameter<int>("HOlevel"),
                                                           conf.getParameter<int>("HFlevel")));

  produces<HBHEDigiCollection>();
  produces<HODigiCollection>();
  produces<HFDigiCollection>();
    
}
HcalRealisticZS::~HcalRealisticZS ( ) [virtual]

Definition at line 39 of file HcalRealisticZS.cc.

References algo_.

                                  {
  algo_->clearDbService();
}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 43 of file HcalRealisticZS.cc.

References algo_, edm::EventSetup::get(), edm::Event::getByLabel(), inputLabel_, edm::ESHandle< T >::product(), edm::Handle< T >::product(), and edm::Event::put().

{
 
  edm::Handle<HBHEDigiCollection> hbhe;    
  edm::Handle<HODigiCollection> ho;    
  edm::Handle<HFDigiCollection> hf;    

  edm::ESHandle<HcalDbService> conditions;
  eventSetup.get<HcalDbRecord>().get(conditions);
  algo_->setDbService(conditions.product());

  e.getByLabel(inputLabel_,hbhe);
  
  // create empty output
  std::auto_ptr<HBHEDigiCollection> zs_hbhe(new HBHEDigiCollection);
  
  e.getByLabel(inputLabel_,ho);
  
  // create empty output
  std::auto_ptr<HODigiCollection> zs_ho(new HODigiCollection);
  
  e.getByLabel(inputLabel_,hf);
  
  // create empty output
  std::auto_ptr<HFDigiCollection> zs_hf(new HFDigiCollection);
  
  //run the algorithm

  algo_->suppress(*(hbhe.product()),*zs_hbhe);
  algo_->suppress(*(ho.product()),*zs_ho);
  algo_->suppress(*(hf.product()),*zs_hf);

  
  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << hbhe->size() << " digis, output " << zs_hbhe->size() << " digis" 
                                      <<  " (HO) input " << ho->size() << " digis, output " << zs_ho->size() << " digis"
                                      <<  " (HF) input " << hf->size() << " digis, output " << zs_hf->size() << " digis";
  

    // return result
    e.put(zs_hbhe);
    e.put(zs_ho);
    e.put(zs_hf);

}

Member Data Documentation

std::auto_ptr<HcalZSAlgoRealistic> HcalRealisticZS::algo_ [private]

Definition at line 29 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), produce(), and ~HcalRealisticZS().

Definition at line 30 of file HcalRealisticZS.h.

Referenced by produce().