CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
EcalHexDisplay Class Reference

#include <EcalHexDisplay.h>

Inheritance diagram for EcalHexDisplay:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalHexDisplay (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Protected Attributes

int beg_fed_id_
 
int end_fed_id_
 
int event_
 
std::string filename_
 
int first_event_
 
int last_event_
 
int verbosity_
 
bool writeDcc_
 

Private Attributes

edm::InputTag fedRawDataCollectionTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Author
G. Franzoni

Definition at line 27 of file EcalHexDisplay.h.

Constructor & Destructor Documentation

EcalHexDisplay::EcalHexDisplay ( const edm::ParameterSet ps)
Author
G. Franzoni

Definition at line 9 of file EcalHexDisplay.cc.

9  :
10  verbosity_ (ps.getUntrackedParameter<int>("verbosity",1)),
11  beg_fed_id_ (ps.getUntrackedParameter<int>("beg_fed_id",0)),
12  end_fed_id_ (ps.getUntrackedParameter<int>("end_fed_id",654)),
13  first_event_ (ps.getUntrackedParameter<int>("first_event",1)),
14  last_event_ (ps.getUntrackedParameter<int>("last_event",9999999)),
15  event_ (0),
16  writeDcc_ (ps.getUntrackedParameter<bool>("writeDCC",false)),
17  filename_ (ps.getUntrackedParameter<std::string>("filename","dump.bin")),
18  fedRawDataCollectionTag_(ps.getParameter<edm::InputTag>("fedRawDataCollectionTag"))
19 {
20 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag fedRawDataCollectionTag_
std::string filename_

Member Function Documentation

void EcalHexDisplay::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 22 of file EcalHexDisplay.cc.

References beg_fed_id_, gather_cfg::cout, FEDRawData::data(), data, end_fed_id_, event_, fedRawDataCollectionTag_, filename_, first_event_, edm::Event::getByLabel(), last_event_, FEDNumbering::MAXFEDID, lumiPlot::rawdata, FEDRawData::size(), and writeDcc_.

22  {
23 
24  event_++;
25  if (event_ < first_event_ || last_event_ < event_) return;
26 
27 
30 
31  std::ofstream dumpFile (filename_.c_str(),std::ios::app );
32 
33  for (int id= 0; id<=FEDNumbering::MAXFEDID; ++id){
34 
35  if (id < beg_fed_id_ || end_fed_id_ < id) continue;
36 
37  const FEDRawData& data = rawdata->FEDData(id);
38 
39  if (data.size()>4){
40 
41  std::cout << "\n\n\n[EcalHexDumperModule] Event: "
42  << std::dec << event_
43  << " fed_id: " << id
44  << " size_fed: " << data.size() << "\n"<< std::endl;
45 
46  if ( ( data.size() %16 ) !=0)
47  {
48  std::cout << "***********************************************" << std::endl;
49  std::cout<< "Fed size in bits not multiple of 64, strange." << std::endl;
50  std::cout << "***********************************************" << std::endl;
51  }
52 
53 
54  int length = data.size();
55  const unsigned long * pData = ( reinterpret_cast<unsigned long*>(const_cast<unsigned char*> ( data.data())));
56  std::cout << std::setfill('0');
57  for (int words=0; words < length/4; (words+=2) )
58  {
59  std::cout << std::setw(8) << std::hex << pData[words+1] << " ";
60  std::cout << std::setw(8) << std::hex << pData[words] << std::endl;
61  }
62 
63  std::cout << "\n";
64 
65 
66  if (beg_fed_id_ <= id && id <= end_fed_id_ && writeDcc_)
67  {
68  dumpFile.write( reinterpret_cast <const char *> (pData), length);
69  }
70  }
71 
72  }
73  dumpFile.close();
74  if (! writeDcc_) remove(filename_.c_str());
75 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
edm::InputTag fedRawDataCollectionTag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393
std::string filename_

Member Data Documentation

int EcalHexDisplay::beg_fed_id_
protected

Definition at line 34 of file EcalHexDisplay.h.

Referenced by analyze().

int EcalHexDisplay::end_fed_id_
protected

Definition at line 35 of file EcalHexDisplay.h.

Referenced by analyze().

int EcalHexDisplay::event_
protected

Definition at line 38 of file EcalHexDisplay.h.

Referenced by analyze().

edm::InputTag EcalHexDisplay::fedRawDataCollectionTag_
private

Definition at line 45 of file EcalHexDisplay.h.

Referenced by analyze().

std::string EcalHexDisplay::filename_
protected

Definition at line 40 of file EcalHexDisplay.h.

Referenced by analyze().

int EcalHexDisplay::first_event_
protected

Definition at line 36 of file EcalHexDisplay.h.

Referenced by analyze().

int EcalHexDisplay::last_event_
protected

Definition at line 37 of file EcalHexDisplay.h.

Referenced by analyze().

int EcalHexDisplay::verbosity_
protected

Definition at line 33 of file EcalHexDisplay.h.

bool EcalHexDisplay::writeDcc_
protected

Definition at line 39 of file EcalHexDisplay.h.

Referenced by analyze().