CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFEDErrorFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EcalFEDErrorFilter
4 // Class: EcalFEDErrorFilter
5 //
13 //
14 // Original Author: Giovanni FRANZONI
15 // Created: Tue Jan 22 13:55:00 CET 2008
16 // $Id: EcalFEDErrorFilter.cc,v 1.5 2012/01/21 14:56:53 fwyzard Exp $
17 //
18 //
19 
21 
22 
23 //
24 // constructors and destructor
25 //
27  HLTFilter(iConfig)
28 {
29  //now do what ever initialization is needed
30 
31  DataLabel_ = iConfig.getParameter<edm::InputTag>("InputLabel");
32  fedUnpackList_ = iConfig.getUntrackedParameter< std::vector<int> >("FEDs", std::vector<int>());
33  if (fedUnpackList_.empty())
35  fedUnpackList_.push_back(i);
36 }
37 
38 
40 {
41 
42  // do anything here that needs to be done at desctruction time
43  // (e.g. close files, deallocate resources etc.)
44 
45 }
46 
47 
48 //
49 // member functions
50 //
51 
52 // ------------ method called on each new Event ------------
53 bool
55 {
56  using namespace edm;
57 
60 
61  // get fed raw data and SM id
62 
63  // loop over FEDS
64  for (std::vector<int>::const_iterator i=fedUnpackList_.begin(); i!=fedUnpackList_.end(); i++)
65  {
66 
67  // get fed raw data and SM id
68  const FEDRawData & fedData = rawdata->FEDData(*i);
69  int length = fedData.size()/sizeof(uint64_t);
70 
71  // LogDebug("EcalRawToDigi") << "raw data length: " << length ;
72  //if data size is not null interpret data
73  if ( length >= 1 )
74  {
75  uint64_t * pData = (uint64_t *)(fedData.data());
76  //When crc error is found return true
77  uint64_t * fedTrailer = pData + (length - 1);
78  bool crcError = (*fedTrailer >> 2 ) & 0x1;
79  if (crcError)
80  {
81  std::cout << "CRCERROR in FED " << *i << " trailer is " << std::setw(8) << std::hex << (*fedTrailer) << std::endl;
82  return true;
83  }
84  }
85  }
86 
87  return false;
88 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
std::vector< int > fedUnpackList_
int iEvent
Definition: GenABIO.cc:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
unsigned long long uint64_t
Definition: Time.h:15
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
EcalFEDErrorFilter(const edm::ParameterSet &)
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
edm::InputTag DataLabel_