CMS 3D CMS Logo

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

#include <DumpClustersDetails.h>

Public Member Functions

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

Detailed Description

Definition at line 74 of file DumpClustersDetails.h.

Constructor & Destructor Documentation

◆ DumpClustersSoA()

hgcalUtils::DumpClustersSoA::DumpClustersSoA ( )
default

Member Function Documentation

◆ dumpInfos()

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

Definition at line 79 of file DumpClustersDetails.h.

References corrVsCorr::filename, dqm-mbProfile::format, mps_fire::i, HerwigMaxPtPartonFilter_cfi::moduleLabel, das-up-to-nevents::outfile, and writedatasetfile::run.

Referenced by HGCalLayerClustersFromSoAProducer::produce().

83  {
84  // Get the process ID
85  pid_t pid = getpid();
86 
87  // Create the filename using the PID
88  std::ostringstream filename;
89  filename << "CLUSTERS_UTILS_SOA_" << pid << "_" << moduleLabel << "_" << run << "_" << lumi << "_" << event
90  << ".txt";
91  // Open the file
92  std::ofstream outfile(filename.str());
93  for (int i = 0; i < clustersSoA->metadata().size(); ++i) {
94  auto clusterSoAV = clustersSoA.view()[i];
95  outfile << fmt::format("Idx: {}, delta: {:.{}f}, rho: {:.{}f}, nearest: {}, clsIdx: {}, isSeed: {}",
96  i,
97  clusterSoAV.delta(),
98  std::numeric_limits<float>::max_digits10,
99  clusterSoAV.rho(),
100  std::numeric_limits<float>::max_digits10,
101  clusterSoAV.nearestHigher(),
102  clusterSoAV.clusterIndex(),
103  clusterSoAV.isSeed())
104  << std::endl;
105  }
106  outfile.close();
107  }