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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string ecalTBInfoLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 26 of file FakeTBEventHeaderProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 14 of file FakeTBEventHeaderProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

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

Destructor.

Definition at line 21 of file FakeTBEventHeaderProducer.cc.

22 {
23 }

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 25 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.

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

Member Data Documentation

std::string FakeTBEventHeaderProducer::ecalTBInfoLabel_
private

Definition at line 49 of file FakeTBEventHeaderProducer.h.