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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 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 ( )
override

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(), EBDetId::SMCRYSTALMODE, and globals_cff::x1.

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:60
edm::EDGetTokenT< PEcalTBInfo > ecalTBInfo_
static const int SMCRYSTALMODE
Definition: EBDetId.h:167
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 41 of file FakeTBEventHeaderProducer.h.