31 #include "Utilities/AssociationUtil.h" 91 produces< std::vector<cvn::Result> >();
92 produces< art::Assns<cvn::Result,rb::Cluster> >();
112 "Spill Data not found, aborting without horn current information";
119 return spillPot->
isRHC;
139 const unsigned int vectorSize = pm.size();
142 tensorflow::Tensor tensor(tensorflow::DT_FLOAT, {1, vectorSize});
143 auto rel = tensor.tensor<
float,2>();
146 for(
unsigned int i = 0;
i < vectorSize; ++
i)
rel(0,
i) = pm[
i];
156 std::unique_ptr< std::vector<cvn::Result> >
157 resultCol(
new std::vector<cvn::Result>);
158 std::unique_ptr< art::Assns<cvn::Result, rb::Cluster> >
165 for(
unsigned int i = 0;
i < slicecol->size(); ++
i){
173 for(
size_t iClust = 0; iClust < slicelist.
size(); ++iClust) {
174 if(!fmPixelMap.isValid())
continue;
175 if(slicelist[iClust]->IsNoise())
continue;
178 const std::vector<art::Ptr<cvn::PixelMap> > pixelMaps = fmPixelMap.at(iClust);
179 if(pixelMaps.empty())
continue;
181 std::vector<unsigned char> pmslice = (*pixelMaps[0]).PixelMapToVector(
fUseGeV);
187 auto tfoutput = result[0].tensor<
float,2>();
192 resultvec[
i] = (
float)tfoutput(0,
i);
194 const float*
output = resultvec;
196 resultCol->emplace_back(output, fNOutput);
199 slicelist[iClust], *(assocresult.get()), UINT_MAX);
203 evt.
put(std::move(resultCol));
204 evt.
put(std::move(assocresult));
bool isRHC
is the beam in antineutrino mode, aka RHC
bool IsRHC(const art::Event &evt)
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
std::string fModelRHCName
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
bool fUseOppositeHornCurrentNetwork
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
void produce(art::Event &evt)
std::vector< Tensor > Predict(std::vector< std::pair< std::string, Tensor >> inputs, std::vector< std::string > outputLabels)
tensorflow::Tensor vector_to_tensor(std::vector< unsigned char >)
tensorflow::TFHandler * fTFFHC
ProductID put(std::unique_ptr< PROD > &&product)
std::string fGeneratorLabel
void push_back(Ptr< U > const &p)
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
tensorflow::TFHandler * GetModel(const art::Event &evt)
CVNEventTF(fhicl::ParameterSet const &pset)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
std::vector< std::string > fPreselectionLabels
tensorflow::TFHandler * fTFRHC
std::string fPixelMapInput
std::string fModelFHCName
Wrapper for Tensorflow which handles construction and prediction.