28 #include <boost/uuid/uuid.hpp> 29 #include <boost/uuid/uuid_generators.hpp> 30 #include <boost/uuid/uuid_io.hpp> 93 std::vector<art::Ptr<SparsePixelMap>> maps;
95 auto hMaps = e.
getHandle<std::vector<SparsePixelMap>>(itag1);
98 <<
"Could not find SparsePixelMap vector with module label " 105 <<
"There shouldn't be more than one SparsePixelMap per producer per event," 106 <<
" but here there are " << maps.size() <<
"." <<
std::endl;
108 if (maps.empty())
return;
110 for (
unsigned int it = 0; it < maps[0]->GetViews(); ++it) {
130 boost::uuids::random_generator
generator;
134 fFile = TFile::Open(fileName.str().c_str(),
"recreate");
146 fTree->Branch(
"Event", &
fEvent);
147 fTree->Branch(
"View", &
fView);
unsigned int fView
View numbers.
Handle< PROD > getHandle(SelectorBase const &) const
CVNSparseROOT & operator=(CVNSparseROOT const &)=delete
std::string fMapInstanceLabel
Name of sparse map instance.
std::vector< std::vector< std::string > > fProcesses
EDAnalyzer(fhicl::ParameterSet const &pset)
Utility class for truth labels.
std::vector< std::vector< int > > fPixelPDG
Pixel PDG truth.
void beginSubRun(art::SubRun const &sr) override
Beginning of a subrun, make a new file.
bool fIncludeGroundTruth
Whether to include per-pixel ground truth.
#define DEFINE_ART_MODULE(klass)
TFile * fFile
Output ROOT file.
T get(std::string const &key) const
CVNSparseROOT(fhicl::ParameterSet const &p)
std::vector< std::vector< int > > fPixelTrackID
Pixel track ID.
std::vector< std::vector< float > > fCoordinates
Pixel coordinates.
void analyze(art::Event const &e) override
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< std::vector< float > > fPixelEnergies
Pixel energy.
std::string fMapModuleLabel
Name of map producer module.
std::string fOutputName
ROOT output filename.
std::vector< unsigned int > fEvent
Event numbers.
EventNumber_t event() const
size_t fCacheSize
Size of TTree cache.
Sparse pixel map for CVN.
std::string fTreeName
ROOt tree name.
void reconfigure(fhicl::ParameterSet const &p)
void endSubRun(art::SubRun const &sr) override
End of a subrun, write all events to a ROOT file.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
static constexpr double sr
TTree * fTree
ROOT tree for writing to file.
SubRunNumber_t subRun() const
QTextStream & endl(QTextStream &s)
std::vector< std::vector< float > > fFeatures
Pixel features.