test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
13 
15  produces<EcalTBEventHeader>();
16  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
17 
18 }
19 
20 
22 {
23 }
24 
26 {
27  auto_ptr<EcalTBEventHeader> product(new EcalTBEventHeader());
28 
29  // get the vertex information from the event
30 
31  const PEcalTBInfo* theEcalTBInfo=0;
32  edm::Handle<PEcalTBInfo> EcalTBInfo;
33  event.getByLabel(ecalTBInfoLabel_,EcalTBInfo);
34  if (EcalTBInfo.isValid()){
35  theEcalTBInfo = EcalTBInfo.product();
36  } else {
37  edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product " << ecalTBInfoLabel_.c_str() ;
38  }
39 
40  if (!theEcalTBInfo)
41  return;
42 
43  // 64 bits event ID in CMSSW converted to EcalTBEventHeader ID
44  int evtid = (int)event.id().event();
45  product->setEventNumber(evtid);
46  product->setRunNumber(event.id().run());
47  product->setBurstNumber(1);
48  product->setTriggerMask(0x1);
49  product->setCrystalInBeam(EBDetId(1,theEcalTBInfo->nCrystal(),EBDetId::SMCRYSTALMODE));
50 
51 // LogDebug("FakeTBHeader") << (*product);
52 // LogDebug("FakeTBHeader") << (*product).eventType();
53 // LogDebug("FakeTBHeader") << (*product).crystalInBeam();
54  event.put(product);
55 
56 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
void produce(edm::Event &event, const edm::EventSetup &eventSetup)
Produce digis out of raw data.
int nCrystal() const
Definition: PEcalTBInfo.h:28
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:75
T const * product() const
Definition: Handle.h:81
virtual ~FakeTBEventHeaderProducer()
Destructor.
FakeTBEventHeaderProducer(const edm::ParameterSet &ps)
Constructor.
edm::EventID id() const
Definition: EventBase.h:59
static const int SMCRYSTALMODE
Definition: EBDetId.h:167