CMS 3D CMS Logo

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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Author
G. Franzoni

Definition at line 25 of file EcalHexDisplay.h.

Constructor & Destructor Documentation

◆ EcalHexDisplay()

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

Definition at line 9 of file EcalHexDisplay.cc.

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")) {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 20 of file EcalHexDisplay.cc.

20  {
21  event_++;
23  return;
24 
26  e.getByLabel(fedRawDataCollectionTag_, rawdata);
27 
28  std::ofstream dumpFile(filename_.c_str(), std::ios::app);
29 
30  for (int id = 0; id <= FEDNumbering::MAXFEDID; ++id) {
31  if (id < beg_fed_id_ || end_fed_id_ < id)
32  continue;
33 
34  const FEDRawData& data = rawdata->FEDData(id);
35 
36  if (data.size() > 4) {
37  std::cout << "\n\n\n[EcalHexDumperModule] Event: " << std::dec << event_ << " fed_id: " << id
38  << " size_fed: " << data.size() << "\n"
39  << std::endl;
40 
41  if ((data.size() % 16) != 0) {
42  std::cout << "***********************************************" << std::endl;
43  std::cout << "Fed size in bits not multiple of 64, strange." << std::endl;
44  std::cout << "***********************************************" << std::endl;
45  }
46 
47  int length = data.size();
48  const unsigned long* pData = (reinterpret_cast<unsigned long*>(const_cast<unsigned char*>(data.data())));
49  std::cout << std::setfill('0');
50  for (int words = 0; words < length / 4; (words += 2)) {
51  std::cout << std::setw(8) << std::hex << pData[words + 1] << " ";
52  std::cout << std::setw(8) << std::hex << pData[words] << std::endl;
53  }
54 
55  std::cout << "\n";
56 
57  if (beg_fed_id_ <= id && id <= end_fed_id_ && writeDcc_) {
58  dumpFile.write(reinterpret_cast<const char*>(pData), length);
59  }
60  }
61  }
62  dumpFile.close();
63  if (!writeDcc_)
64  remove(filename_.c_str());
65 }

References beg_fed_id_, gather_cfg::cout, data, TauDecayModes::dec, MillePedeFileConverter_cfg::e, end_fed_id_, event_, FEDRawDataCollection::FEDData(), fedRawDataCollectionTag_, filename_, first_event_, triggerObjects_cff::id, last_event_, FEDNumbering::MAXFEDID, MatrixUtil::remove(), and writeDcc_.

Member Data Documentation

◆ beg_fed_id_

int EcalHexDisplay::beg_fed_id_
protected

Definition at line 31 of file EcalHexDisplay.h.

Referenced by analyze().

◆ end_fed_id_

int EcalHexDisplay::end_fed_id_
protected

Definition at line 32 of file EcalHexDisplay.h.

Referenced by analyze().

◆ event_

int EcalHexDisplay::event_
protected

Definition at line 35 of file EcalHexDisplay.h.

Referenced by analyze().

◆ fedRawDataCollectionTag_

edm::InputTag EcalHexDisplay::fedRawDataCollectionTag_
private

Definition at line 42 of file EcalHexDisplay.h.

Referenced by analyze().

◆ filename_

std::string EcalHexDisplay::filename_
protected

Definition at line 37 of file EcalHexDisplay.h.

Referenced by analyze().

◆ first_event_

int EcalHexDisplay::first_event_
protected

Definition at line 33 of file EcalHexDisplay.h.

Referenced by analyze().

◆ last_event_

int EcalHexDisplay::last_event_
protected

Definition at line 34 of file EcalHexDisplay.h.

Referenced by analyze().

◆ verbosity_

int EcalHexDisplay::verbosity_
protected

Definition at line 30 of file EcalHexDisplay.h.

◆ writeDcc_

bool EcalHexDisplay::writeDcc_
protected

Definition at line 36 of file EcalHexDisplay.h.

Referenced by analyze().

EcalHexDisplay::first_event_
int first_event_
Definition: EcalHexDisplay.h:33
EcalHexDisplay::filename_
std::string filename_
Definition: EcalHexDisplay.h:37
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalHexDisplay::verbosity_
int verbosity_
Definition: EcalHexDisplay.h:30
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition: FEDRawData.h:19
EcalHexDisplay::beg_fed_id_
int beg_fed_id_
Definition: EcalHexDisplay.h:31
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
EcalHexDisplay::writeDcc_
bool writeDcc_
Definition: EcalHexDisplay.h:36
EcalHexDisplay::last_event_
int last_event_
Definition: EcalHexDisplay.h:34
EcalHexDisplay::fedRawDataCollectionTag_
edm::InputTag fedRawDataCollectionTag_
Definition: EcalHexDisplay.h:42
EcalHexDisplay::end_fed_id_
int end_fed_id_
Definition: EcalHexDisplay.h:32
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalHexDisplay::event_
int event_
Definition: EcalHexDisplay.h:35
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:219
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37