21 #include "art_root_io/TFileDirectory.h" 22 #include "art_root_io/TFileService.h" 84 fTrainTree = tfs->make<TTree>(
"CVNTrainTree",
"Training records");
101 std::vector< art::Ptr< cvn::PixelMap > > pixelmaplist;
103 auto pixelmapListHandle = evt.
getHandle< std::vector< cvn::PixelMap > >(itag1);
104 if (pixelmapListHandle)
107 std::cout <<
"Found " << pixelmaplist.size() <<
" pixel maps in event" <<
std::endl;
109 for(
unsigned int p = 0;
p < pixelmaplist.size(); ++
p){
132 std::stringstream
name;
133 name <<
"PixelMap_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
134 std::stringstream nameL;
135 nameL <<
"PixelTruthMap_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
136 std::stringstream nameX;
137 nameX <<
"PixelMap_X_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
138 std::stringstream nameY;
139 nameY <<
"PixelMap_Y_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
140 std::stringstream nameZ;
141 nameZ <<
"PixelMap_Z_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
147 hist->SetName(name.str().c_str());
148 histL->SetName(nameL.str().c_str());
149 histX->SetName(nameX.str().c_str());
150 histY->SetName(nameY.str().c_str());
151 histZ->SetName(nameZ.str().c_str());
155 TH2F* histWrite = tfs->make<TH2F>(*hist);
157 TH2F* histWriteL = tfs->make<TH2F>(*histL);
158 histWriteL->GetZaxis()->SetRangeUser(0,10);
160 TH2F* histWriteX = tfs->make<TH2F>(*histX);
162 TH2F* histWriteY = tfs->make<TH2F>(*histY);
164 TH2F* histWriteZ = tfs->make<TH2F>(*histZ);
EventNumber_t event() const
void analyze(const art::Event &evt) override
Handle< PROD > getHandle(SelectorBase const &) const
void WriteMapTH2(const art::Event &evt, int slice, const PixelMap &pm)
Function to extract TH2 from PixelMap and write to TFile.
TH2F * SingleViewToTH2(const unsigned int &view) const
enum cvn::Interaction InteractionType
EDAnalyzer(fhicl::ParameterSet const &pset)
Utility class for truth labels.
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
PixelMap fPMap
PixelMap for the event.
def train(model, train_files, valid_files, maskpatterns, epochs, batchsize, info)
#define DEFINE_ART_MODULE(klass)
void reconfigure(const fhicl::ParameterSet &pset)
T get(std::string const &key) const
SubRunNumber_t subRun() const
Something else. Tau? Hopefully we don't use this.
The TrainingData objects contains a PixelMap and the output class type, and any other bit that goes i...
PixelMap, basic input to CVN neural net.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::string fPixelMapInput
QTextStream & endl(QTextStream &s)
CVNEventDumpProtoDUNE(fhicl::ParameterSet const &pset)