CMS 3D CMS Logo

EcalHexDisplay.cc
Go to the documentation of this file.
1 
8 
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 
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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:366
funct::false
false
Definition: Factorize.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalHexDisplay::first_event_
int first_event_
Definition: EcalHexDisplay.h:33
EcalHexDisplay::EcalHexDisplay
EcalHexDisplay(const edm::ParameterSet &ps)
Definition: EcalHexDisplay.cc:9
EcalHexDisplay::filename_
std::string filename_
Definition: EcalHexDisplay.h:37
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
edm::Handle< FEDRawDataCollection >
EcalHexDisplay.h
FEDRawData
Definition: FEDRawData.h:19
EcalHexDisplay::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: EcalHexDisplay.cc:20
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
edm::ParameterSet
Definition: ParameterSet.h:47
EcalHexDisplay::last_event_
int last_event_
Definition: EcalHexDisplay.h:34
event_
void event_()
createfilelist.int
int
Definition: createfilelist.py:10
EcalHexDisplay::fedRawDataCollectionTag_
edm::InputTag fedRawDataCollectionTag_
Definition: EcalHexDisplay.h:42
edm::EventSetup
Definition: EventSetup.h:58
EcalHexDisplay::end_fed_id_
int end_fed_id_
Definition: EcalHexDisplay.h:32
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
std
Definition: JetResolutionObject.h:76
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
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37