CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTROMonitorFilter.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2012/01/21 14:56:54 $
5  * $Revision: 1.3 $
6  * \author G. Cerminara - INFN Torino
7  */
8 
10 
12 
16 
20 
21 using namespace edm;
22 
23 
25  HLTFilter(pset)
26 {
27  inputLabel = pset.getUntrackedParameter<InputTag>("inputLabel",InputTag("source"));
28 }
29 
31 
32 
34  // get the raw data
35  event.getByLabel(inputLabel, rawdata);
36 
37 
38  // Loop over the DT FEDs
39  int FEDIDmin = FEDNumbering::MINDTFEDID;
40  int FEDIDMax = FEDNumbering::MAXDTFEDID;
41 
42  // Definitions
43  static const int wordSize_32 = 4;
44  static const int wordSize_64 = 8;
45 
46  for (int dduID=FEDIDmin; dduID<=FEDIDMax; ++dduID) { // loop over all feds
47  const FEDRawData& feddata = rawdata->FEDData(dduID);
48  const int datasize = feddata.size();
49  if (datasize){ // check the FED payload
50  const unsigned int* index32 = reinterpret_cast<const unsigned int*>(feddata.data());
51  const int numberOf32Words = datasize/wordSize_32;
52 
53  const unsigned char* index8 = reinterpret_cast<const unsigned char*>(index32);
54 
55  // Check Status Words (1 x ROS)
56  for (int rosId = 0; rosId < 12; rosId++ ) {
57  int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + rosId;
58  DTDDUFirstStatusWord statusWord(index8[wordIndex8]);
59  // check the error bit
60  if(statusWord.errorFromROS() != 0) return true;
61  }
62  }
63  }
64 
65  // check the event error flag
66  return false;
67 }
virtual bool hltFilter(edm::Event &event, const edm::EventSetup &setup, trigger::TriggerFilterObjectWithRefs &filterproduct)
T getUntrackedParameter(std::string const &, T const &) const
int errorFromROS() const
Definition: DTDDUWords.h:892
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
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
virtual ~DTROMonitorFilter()
Destructor.
DTROMonitorFilter(const edm::ParameterSet &)
Constructor.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::InputTag inputLabel
if not you need the label
edm::Handle< FEDRawDataCollection > rawdata