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

◆ ~FakeTBEventHeaderProducer()

FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer ( )
override

Destructor.

Definition at line 18 of file FakeTBEventHeaderProducer.cc.

18 {}

Member Function Documentation

◆ produce()

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.

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 }

References runTauDisplay::evtid, createfilelist::int, edm::HandleBase::isValid(), eostools::move(), PEcalTBInfo::nCrystal(), edm::Handle< T >::product(), EBDetId::SMCRYSTALMODE, and testProducerWithPsetDescEmpty_cfi::x1.

Member Data Documentation

◆ ecalTBInfo_

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

Definition at line 37 of file FakeTBEventHeaderProducer.h.

edm::Handle::product
T const * product() const
Definition: Handle.h:70
runTauDisplay.evtid
evtid
Definition: runTauDisplay.py:293
EBDetId
Definition: EBDetId.h:17
edm::Handle
Definition: AssociativeIterator.h:50
PEcalTBInfo::nCrystal
int nCrystal() const
Definition: PEcalTBInfo.h:27
EcalTBEventHeader
Definition: EcalTBEventHeader.h:14
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
FakeTBEventHeaderProducer::ecalTBInfo_
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
Definition: FakeTBEventHeaderProducer.h:37
edm::LogError
Definition: MessageLogger.h:183
PEcalTBInfo
Definition: PEcalTBInfo.h:18
createfilelist.int
int
Definition: createfilelist.py:10
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
EBDetId::SMCRYSTALMODE
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
edm::InputTag
Definition: InputTag.h:15