18 #include "art_root_io/TFileService.h" 19 #include "canvas/Persistency/Common/FindManyP.h" 44 Name(
"HitsModuleLabel"),
Comment(
"tag of hits producer")
48 Name(
"SpacePointModuleLabel"),
Comment(
"tag of spacepoint producer")
52 Name(
"CnnModuleLabel"),
Comment(
"tag of CNN module for EM/track id")
107 fEventTree = tfs->make<TTree>(
"EventTree",
"event by event info");
136 for (
size_t p = 0;
p < 3; ++
p)
155 fNHits[0] = 0; fNHits[1] = 0; fNHits[2] = 0;
157 for (
const auto &
h : *hitsHandle)
159 size_t p =
h.WireID().Plane;
170 if (spHandle->size() != qHandle->size())
173 <<
"size of point and charge containers must be equal" <<
std::endl;
181 for (
size_t i = 0; i < spHandle->size(); ++i)
183 fPointX[i] = (*spHandle)[i].XYZ()[0];
184 fPointY[i] = (*spHandle)[i].XYZ()[1];
185 fPointZ[i] = (*spHandle)[i].XYZ()[2];
198 size_t emLikeIdx = cluResults->getIndex(
"em");
200 const art::FindManyP<recob::Hit> hitsFromClusters(cluResults->dataHandle(),
evt, cluResults->dataTag());
203 std::vector<size_t> sizeScore(
fNPoints, 0);
205 for (
size_t c = 0;
c < cluResults->size(); ++
c)
209 const std::vector< art::Ptr<recob::Hit> > & hits = hitsFromClusters.at(
c);
210 std::array<float, MVA_LENGTH> cnn_out = cluResults->getOutput(
c);
212 for (
const auto & hptr : hits)
214 const std::vector< art::Ptr<recob::SpacePoint> > & sp = spFromHits.at(hptr.key());
215 for (
const auto & spptr : sp)
217 if (hits.size() > sizeScore[spptr.key()])
219 sizeScore[spptr.key()] = hits.size();
234 mf::LogVerbatim(
"ReadSpacePointAndCnn") <<
"ReadSpacePointAndCnn finished job";
std::vector< float > fPointCharge
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
art::InputTag fHitsModuleLabel
std::vector< float > fPointZ
void analyze(art::Event const &e) override
ChannelGroupService::Name Name
std::vector< float > fHitWire[3]
Information about charge reconstructed in the active volume.
EDAnalyzer(fhicl::ParameterSet const &pset)
std::vector< float > fPointEmScore
ReadSpacePointAndCnn & operator=(ReadSpacePointAndCnn const &)=delete
#define DEFINE_ART_MODULE(klass)
std::vector< unsigned char > fHitTpc[3]
std::vector< float > fHitCharge[3]
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
fhicl::Atom< art::InputTag > SpacePointModuleLabel
Declaration of signal hit object.
std::vector< float > fHitTime[3]
fhicl::Atom< art::InputTag > CnnModuleLabel
std::vector< float > fPointX
EventNumber_t event() const
std::vector< float > fPointY
art::InputTag fSpacePointModuleLabel
fhicl::Atom< art::InputTag > HitsModuleLabel
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
ReadSpacePointAndCnn(Parameters const &config)
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
art::InputTag fCnnModuleLabel