CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FakeTBEventHeaderProducer Class Reference

#include <FakeTBEventHeaderProducer.h>

Inheritance diagram for FakeTBEventHeaderProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase 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) override
 Produce digis out of raw data. More...
 
virtual ~FakeTBEventHeaderProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< PEcalTBInfoecalTBInfo_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
explicit

Constructor.

Definition at line 13 of file FakeTBEventHeaderProducer.cc.

13  {
14  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel","SimEcalTBG4Object"));
15  produces<EcalTBEventHeader>();
16 }
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer ( )
virtual

Destructor.

Definition at line 18 of file FakeTBEventHeaderProducer.cc.

19 {
20 }

Member Function Documentation

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

Produce digis out of raw data.

Definition at line 22 of file FakeTBEventHeaderProducer.cc.

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

23 {
24  unique_ptr<EcalTBEventHeader> product(new EcalTBEventHeader());
25 
26  // get the vertex information from the event
27 
28  const PEcalTBInfo* theEcalTBInfo = nullptr;
29  edm::Handle<PEcalTBInfo> EcalTBInfo;
30  event.getByToken(ecalTBInfo_,EcalTBInfo);
31  if (EcalTBInfo.isValid()){
32  theEcalTBInfo = EcalTBInfo.product();
33  } else {
34  edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product PEcalTBInfo";
35  }
36 
37  if (!theEcalTBInfo)
38  { return; }
39 
40  // 64 bits event ID in CMSSW converted to EcalTBEventHeader ID
41  int evtid = (int)event.id().event();
42  product->setEventNumber(evtid);
43  product->setRunNumber(event.id().run());
44  product->setBurstNumber(1);
45  product->setTriggerMask(0x1);
46  product->setCrystalInBeam(EBDetId(1,theEcalTBInfo->nCrystal(),EBDetId::SMCRYSTALMODE));
47 
48 // LogDebug("FakeTBHeader") << (*product);
49 // LogDebug("FakeTBHeader") << (*product).eventType();
50 // LogDebug("FakeTBHeader") << (*product).crystalInBeam();
51  event.put(std::move(product));
52 
53 }
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:74
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:58
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
static const int SMCRYSTALMODE
Definition: EBDetId.h:167
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<PEcalTBInfo> FakeTBEventHeaderProducer::ecalTBInfo_
private

Definition at line 41 of file FakeTBEventHeaderProducer.h.