CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

EcalElectronicsMappingBuilder Class Reference

#include <EcalElectronicsMappingBuilder.h>

Inheritance diagram for EcalElectronicsMappingBuilder:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef std::auto_ptr
< EcalElectronicsMapping
ReturnType

Public Member Functions

void DBCallback (const EcalMappingElectronicsRcd &fRecord)
 EcalElectronicsMappingBuilder (const edm::ParameterSet &)
ReturnType produce (const EcalMappingRcd &)
 ~EcalElectronicsMappingBuilder ()

Private Member Functions

void FillFromDatabase (const std::vector< EcalMappingElement > &ee, EcalElectronicsMapping &theMap)

Private Attributes

const EcalMappingElectronicsMapping_

Detailed Description

Definition at line 34 of file EcalElectronicsMappingBuilder.h.


Member Typedef Documentation

Definition at line 40 of file EcalElectronicsMappingBuilder.h.


Constructor & Destructor Documentation

EcalElectronicsMappingBuilder::EcalElectronicsMappingBuilder ( const edm::ParameterSet iConfig)

Definition at line 27 of file EcalElectronicsMappingBuilder.cc.

References DBCallback(), edm::eventsetup::dependsOn(), and edm::ESProducer::setWhatProduced().

                                                                                           :
  Mapping_ ( 0 )
{
  //the following line is needed to tell the framework what
  // data is being produced
  // setWhatProduced(this);
  setWhatProduced(this, (dependsOn (&EcalElectronicsMappingBuilder::DBCallback)) );
  //now do what ever other initialization is needed
}
EcalElectronicsMappingBuilder::~EcalElectronicsMappingBuilder ( )

Definition at line 38 of file EcalElectronicsMappingBuilder.cc.

{ 
}

Member Function Documentation

void EcalElectronicsMappingBuilder::DBCallback ( const EcalMappingElectronicsRcd fRecord)
void EcalElectronicsMappingBuilder::FillFromDatabase ( const std::vector< EcalMappingElement > &  ee,
EcalElectronicsMapping theMap 
) [private]

Definition at line 68 of file EcalElectronicsMappingBuilder.cc.

References EcalElectronicsMapping::assign(), i, and EEDetId::unhashIndex().

Referenced by produce().

{
  //  std::cout << " --- Reading the EE mapping from Database --- " << std::endl;
  for (unsigned int i=0; i < ee.size(); i++) 
    {
      if (ee[i].electronicsid == 0)
        continue;
      if (ee[i].triggerid == 0)
        continue;
      theMap.assign(EEDetId::unhashIndex(i).rawId(),ee[i].electronicsid,ee[i].triggerid);
    }
  return;
}
EcalElectronicsMappingBuilder::ReturnType EcalElectronicsMappingBuilder::produce ( const EcalMappingRcd iRecord)

Definition at line 58 of file EcalElectronicsMappingBuilder.cc.

References FillFromDatabase(), Mapping_, and CrabTask::prod.

{
   using namespace edm::es;
   std::auto_ptr<EcalElectronicsMapping> prod(new EcalElectronicsMapping());
   const std::vector<EcalMappingElement>& ee = Mapping_ -> endcapItems();
   FillFromDatabase(ee,*prod);
   return prod;

}

Member Data Documentation

Definition at line 52 of file EcalElectronicsMappingBuilder.h.

Referenced by DBCallback(), and produce().