CMS 3D CMS Logo

List of all members | Public Member Functions
hgcalUtils::DumpCellsSoA Class Reference

#include <DumpClustersDetails.h>

Public Member Functions

 DumpCellsSoA ()=default
 
template<typename T >
void dumpInfos (const T &cells, const std::string &moduleLabel, edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event) const
 

Detailed Description

Definition at line 110 of file DumpClustersDetails.h.

Constructor & Destructor Documentation

◆ DumpCellsSoA()

hgcalUtils::DumpCellsSoA::DumpCellsSoA ( )
default

Member Function Documentation

◆ dumpInfos()

template<typename T >
void hgcalUtils::DumpCellsSoA::dumpInfos ( const T cells,
const std::string &  moduleLabel,
edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
) const
inline

Definition at line 115 of file DumpClustersDetails.h.

References hgcalTBTopologyTester_cfi::cells, corrVsCorr::filename, dqm-mbProfile::format, mps_fire::i, HerwigMaxPtPartonFilter_cfi::moduleLabel, timingPdfMaker::outfile, and writedatasetfile::run.

Referenced by HGCalLayerClustersFromSoAProducer::produce().

119  {
120  // Get the process ID
121  pid_t pid = getpid();
122 
123  // Create the filename using the PID
124  std::ostringstream filename;
125  filename << "RECHITS_SOA_" << pid << "_" << moduleLabel << "_" << run << "_" << lumi << "_" << event << ".txt";
126  // Open the file
127  std::ofstream outfile(filename.str());
128  for (int i = 0; i < cells->metadata().size(); ++i) {
129  auto cellSoAV = cells.view()[i];
130  outfile
131  << fmt::format(
132  "Idx Cell: {}, x: {:.{}f}, y: {:.{}f}, layer: {}, weight: {:.{}f}, sigmaNoise: {:.{}f}, detid: {}",
133  i,
134  (cellSoAV.dim1()),
135  std::numeric_limits<float>::max_digits10,
136  (cellSoAV.dim2()),
137  std::numeric_limits<float>::max_digits10,
138  cellSoAV.layer(),
139  (cellSoAV.weight()),
140  std::numeric_limits<float>::max_digits10,
141  (cellSoAV.sigmaNoise()),
142  std::numeric_limits<float>::max_digits10,
143  cellSoAV.detid())
144  << std::endl;
145  }
146  outfile.close();
147  }