CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalTBHodoscopeRecInfoProducer Class Reference

#include <EcalTBHodoscopeRecInfoProducer.h>

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

List of all members.

Public Member Functions

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

Private Attributes

EcalTBHodoscopeRecInfoAlgoalgo_
int fitMethod_
std::string rawInfoCollection_
std::string rawInfoProducer_
std::string recInfoCollection_

Detailed Description

Definition at line 15 of file EcalTBHodoscopeRecInfoProducer.h.


Constructor & Destructor Documentation

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

Definition at line 12 of file EcalTBHodoscopeRecInfoProducer.cc.

References algo_, fitMethod_, edm::ParameterSet::getParameter(), rawInfoCollection_, rawInfoProducer_, and recInfoCollection_.

{
  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
  rawInfoProducer_   = ps.getParameter<std::string>("rawInfoProducer");
  recInfoCollection_        = ps.getParameter<std::string>("recInfoCollection");
  fitMethod_ = ps.getParameter<int>("fitMethod");

//   std::vector<double> planeShift_def;
//   planeShift_def.push_back( -0.333 );
//   planeShift_def.push_back( -0.333 );
//   planeShift_def.push_back( -0.333 );
//   planeShift_def.push_back( -0.333 );
  std::vector<double> planeShift = ps.getParameter< std::vector<double> >("planeShift");

//   std::vector<double> zPosition_def;
//   zPosition_def.push_back( -0.333 );
//   zPosition_def.push_back( -0.333 );
//   zPosition_def.push_back( -0.333 );
//   zPosition_def.push_back( -0.333 );
  std::vector<double> zPosition = ps.getParameter< std::vector<double> >("zPosition");
  
  produces<EcalTBHodoscopeRecInfo>(recInfoCollection_);
  
  algo_ = new EcalTBHodoscopeRecInfoAlgo(fitMethod_, planeShift, zPosition);
}
EcalTBHodoscopeRecInfoProducer::~EcalTBHodoscopeRecInfoProducer ( ) [virtual]

Definition at line 38 of file EcalTBHodoscopeRecInfoProducer.cc.

References algo_.

                                                                {
  delete algo_;
}

Member Function Documentation

void EcalTBHodoscopeRecInfoProducer::produce ( edm::Event e,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 42 of file EcalTBHodoscopeRecInfoProducer.cc.

References algo_, edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::Event::put(), rawInfoCollection_, rawInfoProducer_, recInfoCollection_, and EcalTBHodoscopeRecInfoAlgo::reconstruct().

{
  // Get input
   edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope;  
   const EcalTBHodoscopeRawInfo* ecalHodoRawInfo = 0;
   //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
   e.getByLabel( rawInfoProducer_, ecalRawHodoscope);
   if (ecalRawHodoscope.isValid()) {
     ecalHodoRawInfo = ecalRawHodoscope.product();
   }

   if (! ecalHodoRawInfo )
     {
       edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
       return;
     }

   if ( (*ecalHodoRawInfo).planes() != 4 )
     { 
       edm::LogError("EcalTBHodoscopeRecInfoError") << "Number of planes different from expected " << rawInfoCollection_.c_str() ;
       return;
     }

  // Create empty output
  std::auto_ptr<EcalTBHodoscopeRecInfo> recInfo(new EcalTBHodoscopeRecInfo(algo_->reconstruct(*ecalRawHodoscope)));
  
  e.put(recInfo,recInfoCollection_);
} 

Member Data Documentation

Definition at line 29 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer().

Definition at line 26 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

Definition at line 25 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

Definition at line 27 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().