23 #include "art_root_io/TFileDirectory.h" 24 #include "art_root_io/TFileService.h" 119 std::vector< art::Ptr< cnn::RegPixelMap > > pixelmaplist;
121 auto pixelmapListHandle = evt.
getHandle< std::vector< cnn::RegPixelMap > >(itag1);
122 if (pixelmapListHandle)
125 unsigned short nhits = pixelmaplist.size();
128 std::vector<art::Ptr<cnn::RegPixelMap3D> > pm3Dlist;
130 auto pm3DListHandle = evt.
getHandle<std::vector<cnn::RegPixelMap3D> >(itag2);
134 unsigned short npm3D = pm3Dlist.size();
138 if (npm3D < 1 && nhits < 1)
return;
141 std::vector<art::Ptr<simb::MCTruth> > mclist;
143 if (mctruthListHandle)
152 std::cout<<
"nuPDG : "<<truthN.
Nu().
PdgCode()<<
", ";
169 bool isFid = (fabs(vtx.X())<310 && fabs(vtx.Y())<550 && vtx.Z()>50 && vtx.Z()<1244);
186 std::stringstream
name;
187 name <<
"RegPixelMap_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
188 std::stringstream nameL;
189 nameL <<
"PixelTruthMap_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
190 std::stringstream nameX;
191 nameX <<
"RegPixelMap_X_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
192 std::stringstream nameY;
193 nameY <<
"RegPixelMap_Y_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
194 std::stringstream nameZ;
195 nameZ <<
"RegPixelMap_Z_r" << evt.
run() <<
"_s" << evt.
subRun()<<
"_e" << evt.
event() <<
"_sl" << slice;
201 hist->SetName(name.str().c_str());
202 histL->SetName(nameL.str().c_str());
203 histX->SetName(nameX.str().c_str());
204 histY->SetName(nameY.str().c_str());
205 histZ->SetName(nameZ.str().c_str());
209 TH2F* histWrite = tfs->make<TH2F>(*hist);
211 TH2F* histWriteL = tfs->make<TH2F>(*histL);
212 histWriteL->GetZaxis()->SetRangeUser(0,10);
214 TH2F* histWriteX = tfs->make<TH2F>(*histX);
216 TH2F* histWriteY = tfs->make<TH2F>(*histY);
218 TH2F* histWriteZ = tfs->make<TH2F>(*histZ);
235 std::cout<<
"Write Map to TH3"<<
std::endl;
236 std::stringstream
name;
237 name <<
"RegPixelMap3D_r" << evt.
run() <<
"_s" << evt.
subRun() <<
"_e" << evt.
event() <<
"_sl" << slice;
239 hist->SetName(name.str().c_str());
242 TH3F* histWrite = tfs->make<TH3F>(*hist);
250 std::cout<<
"Write Cropped Map to TH3"<<
std::endl;
251 std::stringstream
name;
252 name <<
"RegCroppedPixelMap3D_r" << evt.
run() <<
"_s" << evt.
subRun() <<
"_e" << evt.
event() <<
"_sl" << slice;
254 hist->SetName(name.str().c_str());
257 TH3F* histWrite = tfs->make<TH3F>(*hist);
TH3F * ToCroppedTH3() const
EventNumber_t event() const
const simb::MCNeutrino & GetNeutrino() const
void WriteMapTH3(const art::Event &evt, int slice, const RegPixelMap3D &pm)
const TLorentzVector & EndPosition() const
void WriteCroppedMapTH3(const art::Event &evt, int slice, const RegPixelMap3D &pm)
Handle< PROD > getHandle(SelectorBase const &) const
RegPixelMap, basic input to CNN neural net.
const simb::MCParticle & Nu() const
EDAnalyzer(fhicl::ParameterSet const &pset)
void reconfigure(const fhicl::ParameterSet &pset)
art framework interface to geometry description
const simb::MCParticle & Lepton() const
#define DEFINE_ART_MODULE(klass)
TH2F * SingleViewToTH2(const unsigned int &view) const
T get(std::string const &key) const
std::string fPixelMapInput
SubRunNumber_t subRun() const
RegPixelMap3D for RegCNN modified from PixelMap.h.
std::string fGenieGenModuleLabel
void analyze(const art::Event &evt) override
Defines an enumeration for cellhit classification.
Declaration of signal hit object.
std::string fPixelMap3DInput
Access the description of detector geometry.
RegPixelMap3D, input to 3D CNN neural net.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
RegPixelMap for RegCNN modified from PixelMap.h.
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
Event generator information.
RegCNNEventDump(fhicl::ParameterSet const &pset)
void WriteMapTH2(const art::Event &evt, int slice, const RegPixelMap &pm)
Function to extract TH2 from PixelMap and write to TFile.
QTextStream & endl(QTextStream &s)