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

const edm::EDGetTokenT
< PEcalTBInfo
ecalTBInfo_
 

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.

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

Destructor.

Member Function Documentation

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

Produce digis out of raw data.

Definition at line 44 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.

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

Member Data Documentation

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

Definition at line 36 of file FakeTBEventHeaderProducer.cc.

Referenced by produce().