CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
FakeTBEventHeaderProducer Class Reference
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::EDGetTokenT< PEcalTBInfoecalTBInfo_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 24 of file FakeTBEventHeaderProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file FakeTBEventHeaderProducer.cc.

References ecalTBInfo_, and HLT_FULL_cff::InputTag.

39  {
40  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
41  produces<EcalTBEventHeader>();
42 }
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer ( )
override

Destructor.

Definition at line 44 of file FakeTBEventHeaderProducer.cc.

44 {}

Member Function Documentation

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

Produce digis out of raw data.

Definition at line 46 of file FakeTBEventHeaderProducer.cc.

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

46  {
47  std::unique_ptr<EcalTBEventHeader> product(new EcalTBEventHeader());
48 
49  // get the vertex information from the event
50 
51  const PEcalTBInfo *theEcalTBInfo = nullptr;
52  edm::Handle<PEcalTBInfo> EcalTBInfo;
53  event.getByToken(ecalTBInfo_, EcalTBInfo);
54  if (EcalTBInfo.isValid()) {
55  theEcalTBInfo = EcalTBInfo.product();
56  } else {
57  edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product PEcalTBInfo";
58  }
59 
60  if (!theEcalTBInfo) {
61  return;
62  }
63 
64  // 64 bits event ID in CMSSW converted to EcalTBEventHeader ID
65  int evtid = (int)event.id().event();
66  product->setEventNumber(evtid);
67  product->setRunNumber(event.id().run());
68  product->setBurstNumber(1);
69  product->setTriggerMask(0x1);
70  product->setCrystalInBeam(EBDetId(1, theEcalTBInfo->nCrystal(), EBDetId::SMCRYSTALMODE));
71 
72  LogDebug("FakeTBHeader") << (*product);
73  LogDebug("FakeTBHeader") << (*product).eventType();
74  LogDebug("FakeTBHeader") << (*product).crystalInBeam();
75 
76  event.put(std::move(product));
77 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
Log< level::Error, false > LogError
int nCrystal() const
Definition: PEcalTBInfo.h:27
def move
Definition: eostools.py:511
bool isValid() const
Definition: HandleBase.h:70
T const * product() const
Definition: Handle.h:70
edm::EventID id() const
Definition: EventBase.h:59
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
#define LogDebug(id)

Member Data Documentation

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

Definition at line 36 of file FakeTBEventHeaderProducer.cc.

Referenced by FakeTBEventHeaderProducer(), and produce().