CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ShallowEventDataProducer.cc
Go to the documentation of this file.
5 
7  produces <unsigned int> ( "run" );
8  produces <unsigned int> ( "event" );
9  produces <unsigned int> ( "bx" );
10  produces <unsigned int> ( "lumi" );
11  produces <float> ( "instLumi" );
12  produces <float> ( "PU" );
13  produces <std::vector<bool> > ( "TrigTech" );
14  produces <std::vector<bool> > ( "TrigPh" );
15 
16  trig_token_ = consumes<L1GlobalTriggerReadoutRecord>(iConfig.getParameter<edm::InputTag>("trigRecord"));
17  scalerToken_ = consumes< LumiScalersCollection >(iConfig.getParameter<edm::InputTag>("lumiScalers"));
18 
19 }
20 
23 
24 
25  std::auto_ptr<unsigned int > run ( new unsigned int(iEvent.id().run() ) );
26  std::auto_ptr<unsigned int > event ( new unsigned int(iEvent.id().event() ) );
27  std::auto_ptr<unsigned int > bx ( new unsigned int(iEvent.bunchCrossing() ) );
28  std::auto_ptr<unsigned int > lumi ( new unsigned int(iEvent.luminosityBlock() ) );
29 
30 
32  iEvent.getByToken(trig_token_, gtRecord);
33 
34  std::vector<bool> TrigTech_(64,0);
35  std::vector<bool> TrigPh_(128,0);
36 
37  // Get dWord after masking disabled bits
38  DecisionWord dWord = gtRecord->decisionWord();
39  if ( ! dWord.empty() ) { // if board not there this is zero
40  // loop over dec. bit to get total rate (no overlap)
41  for ( int i = 0; i < 64; ++i ) {
42  TrigPh_[i]= dWord[i];
43  }
44  }
45 
46  TechnicalTriggerWord tw = gtRecord->technicalTriggerWord();
47  if ( ! tw.empty() ) {
48  // loop over dec. bit to get total rate (no overlap)
49  for ( int i = 0; i < 64; ++i ) {
50  TrigTech_[i]=tw[i];
51  }
52  }
53 
54  std::auto_ptr<std::vector<bool> > TrigTech(new std::vector<bool>(TrigTech_));
55  std::auto_ptr<std::vector<bool> > TrigPh(new std::vector<bool>(TrigPh_));
56 
57  // Luminosity informations
59  float instLumi_=0; float PU_=0;
60  iEvent.getByToken(scalerToken_, lumiScalers);
61  if(lumiScalers.isValid()){
62  if (lumiScalers->begin() != lumiScalers->end()) {
63  instLumi_ = lumiScalers->begin()->instantLumi();
64  PU_ = lumiScalers->begin()->pileup();
65  }
66  } else {
67  edm::LogInfo("ShallowEventDataProducer")
68  << "LumiScalers collection not found in the event; will write dummy values";
69  }
70 
71  auto instLumi = std::make_unique<float>(instLumi_);
72  auto PU = std::make_unique<float>(PU_);
73 
74  iEvent.put( run, "run" );
75  iEvent.put( event, "event" );
76  iEvent.put( bx, "bx" );
77  iEvent.put( lumi, "lumi" );
78  iEvent.put( TrigTech, "TrigTech" );
79  iEvent.put( TrigPh, "TrigPh" );
80  iEvent.put(std::move(instLumi), "instLumi");
81  iEvent.put(std::move(PU), "PU");
82 }
RunNumber_t run() const
Definition: EventID.h:39
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
tuple lumi
Definition: fjr2json.py:35
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
int bunchCrossing() const
Definition: EventBase.h:65
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:62
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > trig_token_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< bool > DecisionWord
typedefs
def move
Definition: eostools.py:510
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
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
void produce(edm::Event &, const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:59
ShallowEventDataProducer(const edm::ParameterSet &)