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

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...
 
 ~FakeTBEventHeaderProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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
 

Detailed Description

Definition at line 25 of file FakeTBEventHeaderProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 13 of file FakeTBEventHeaderProducer.cc.

References HLT_2018_cff::InputTag.

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

Destructor.

Definition at line 18 of file FakeTBEventHeaderProducer.cc.

18 {}

Member Function Documentation

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

Produce digis out of raw data.

Definition at line 20 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(), EBDetId::SMCRYSTALMODE, and testProducerWithPsetDescEmpty_cfi::x1.

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

Member Data Documentation

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

Definition at line 37 of file FakeTBEventHeaderProducer.h.