CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
FakeTBEventHeaderProducer Class Reference

#include <FakeTBEventHeaderProducer.h>

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

Public Member Functions

 FakeTBEventHeaderProducer (const edm::ParameterSet &ps)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup)
 Produce digis out of raw data. More...
 
virtual ~FakeTBEventHeaderProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::string ecalTBInfoLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 27 of file FakeTBEventHeaderProducer.h.

Constructor & Destructor Documentation

FakeTBEventHeaderProducer::FakeTBEventHeaderProducer ( const edm::ParameterSet ps)

Constructor.

Definition at line 15 of file FakeTBEventHeaderProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

15  {
16  produces<EcalTBEventHeader>();
17  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
18 
19 }
T getUntrackedParameter(std::string const &, T const &) const
FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer ( )
virtual

Destructor.

Definition at line 22 of file FakeTBEventHeaderProducer.cc.

23 {
24 }

Member Function Documentation

void FakeTBEventHeaderProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Produce digis out of raw data.

Implements edm::EDProducer.

Definition at line 26 of file FakeTBEventHeaderProducer.cc.

References edm::EventID::event(), edm::EventBase::id(), edm::HandleBase::isValid(), PEcalTBInfo::nCrystal(), edm::Handle< T >::product(), edm::EventID::run(), and EBDetId::SMCRYSTALMODE.

27 {
28  auto_ptr<EcalTBEventHeader> product(new EcalTBEventHeader());
29 
30  // get the vertex information from the event
31 
32  const PEcalTBInfo* theEcalTBInfo=0;
33  edm::Handle<PEcalTBInfo> EcalTBInfo;
34  event.getByLabel(ecalTBInfoLabel_,EcalTBInfo);
35  if (EcalTBInfo.isValid()){
36  theEcalTBInfo = EcalTBInfo.product();
37  } else {
38  edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product " << ecalTBInfoLabel_.c_str() ;
39  }
40 
41  if (!theEcalTBInfo)
42  return;
43 
44  product->setEventNumber(event.id().event());
45  product->setRunNumber(event.id().run());
46  product->setBurstNumber(1);
47  product->setTriggerMask(0x1);
48  product->setCrystalInBeam(EBDetId(1,theEcalTBInfo->nCrystal(),EBDetId::SMCRYSTALMODE));
49 
50 // LogDebug("FakeTBHeader") << (*product);
51 // LogDebug("FakeTBHeader") << (*product).eventType();
52 // LogDebug("FakeTBHeader") << (*product).crystalInBeam();
53  event.put(product);
54 
55 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
int nCrystal() const
Definition: PEcalTBInfo.h:29
bool isValid() const
Definition: HandleBase.h:76
T const * product() const
Definition: Handle.h:74
edm::EventID id() const
Definition: EventBase.h:56
static const int SMCRYSTALMODE
Definition: EBDetId.h:146

Member Data Documentation

std::string FakeTBEventHeaderProducer::ecalTBInfoLabel_
private

Definition at line 50 of file FakeTBEventHeaderProducer.h.