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  * $Id: FakeTBEventHeaderProducer.cc,v 1.5 2007/12/18 17:56:15 crovelli Exp $
5  *
6  */
7 
10 
11 using namespace cms;
12 using namespace std;
13 
14 
16  produces<EcalTBEventHeader>();
17  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
18 
19 }
20 
21 
23 {
24 }
25 
27 {
28  auto_ptr<EcalTBEventHeader> product(new EcalTBEventHeader());
29 
30  // get the vertex information from the event
31 
32  const PEcalTBInfo* theEcalTBInfo=0;
33  edm::Handle<PEcalTBInfo> EcalTBInfo;
34  event.getByLabel(ecalTBInfoLabel_,EcalTBInfo);
35  if (EcalTBInfo.isValid()){
36  theEcalTBInfo = EcalTBInfo.product();
37  } else {
38  edm::LogError("FakeTBEventHeaderProducer") << "Error! can't get the product " << ecalTBInfoLabel_.c_str() ;
39  }
40 
41  if (!theEcalTBInfo)
42  return;
43 
44  product->setEventNumber(event.id().event());
45  product->setRunNumber(event.id().run());
46  product->setBurstNumber(1);
47  product->setTriggerMask(0x1);
48  product->setCrystalInBeam(EBDetId(1,theEcalTBInfo->nCrystal(),EBDetId::SMCRYSTALMODE));
49 
50 // LogDebug("FakeTBHeader") << (*product);
51 // LogDebug("FakeTBHeader") << (*product).eventType();
52 // LogDebug("FakeTBHeader") << (*product).crystalInBeam();
53  event.put(product);
54 
55 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
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:29
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:76
virtual ~FakeTBEventHeaderProducer()
Destructor.
FakeTBEventHeaderProducer(const edm::ParameterSet &ps)
Constructor.
T const * product() const
Definition: Handle.h:74
edm::EventID id() const
Definition: EventBase.h:56
static const int SMCRYSTALMODE
Definition: EBDetId.h:168