CMS 3D CMS Logo

FakeTBEventHeaderProducer.cc
Go to the documentation of this file.
1 /*
2  * \file FakeTBEventHeaderProducer.cc
3  *
4  *
5  */
6 
9 
10 using namespace cms;
11 using namespace std;
12 
14  ecalTBInfo_ = consumes<PEcalTBInfo>(edm::InputTag("EcalTBInfoLabel", "SimEcalTBG4Object"));
15  produces<EcalTBEventHeader>();
16 }
17 
19 
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 }
FakeTBEventHeaderProducer::FakeTBEventHeaderProducer
FakeTBEventHeaderProducer(const edm::ParameterSet &ps)
Constructor.
Definition: FakeTBEventHeaderProducer.cc:13
edm::Handle::product
T const * product() const
Definition: Handle.h:70
runTauDisplay.evtid
evtid
Definition: runTauDisplay.py:293
FakeTBEventHeaderProducer.h
EBDetId
Definition: EBDetId.h:17
EBDetId.h
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
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
PEcalTBInfo
Definition: PEcalTBInfo.h:18
createfilelist.int
int
Definition: createfilelist.py:10
FakeTBEventHeaderProducer::produce
void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Produce digis out of raw data.
Definition: FakeTBEventHeaderProducer.cc:20
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
FakeTBEventHeaderProducer::~FakeTBEventHeaderProducer
~FakeTBEventHeaderProducer() override
Destructor.
Definition: FakeTBEventHeaderProducer.cc:18
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
EBDetId::SMCRYSTALMODE
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
edm::InputTag
Definition: InputTag.h:15
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21