Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cvntf::CVNProngEvaluatorTF Class Reference
Inheritance diagram for cvntf::CVNProngEvaluatorTF:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 CVNProngEvaluatorTF (fhicl::ParameterSet const &pset)
 
 ~CVNProngEvaluatorTF ()
 
bool filter (std::vector< unsigned char > pm, int view)
 
std::vector< tensorflow::Tensor > vector_to_tensor (std::vector< unsigned char >, std::vector< unsigned char >)
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
 Module lablel for input clusters. More...
 
std::string fPixelMapInput
 Module label for input pixel maps. More...
 
std::string fSlicePMLabel
 
std::string fProngPMLabel
 
std::string fProngModLabel
 Module lablel for input prongs. More...
 
bool fIs2DProng
 Instance lablel for input 3D prongs. More...
 
std::string fProng3DLabel
 
std::string fProng2DLabel
 
std::string fProngLabel
 
bool fObeyPreselection
 Check rb::IsFiltered? More...
 
bool fSkipLongProngs
 
bool fProngOnly
 
double fProngLengthCut
 
unsigned int fNOutput
 Number of outputs fron neural net. More...
 
bool fUseGeV
 
std::vector< std::stringfPreselectionLabels
 
std::string fLibPath
 
std::string fModelName
 
tensorflow::TFHandlerfTF
 

Detailed Description

Definition at line 51 of file CVNProngEvaluatorTF_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

cvntf::CVNProngEvaluatorTF::CVNProngEvaluatorTF ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 103 of file CVNProngEvaluatorTF_module.cc.

References util::EnvExpansion(), fLibPath, fModelName, and fTF.

103  :
104 
105  fClusterToken(consumes<std::vector<rb::Cluster>>(pset.get<std::string>("ClusterLabel"))),
106  fPixelMapInput (pset.get<std::string> ("PixelMapInput")),
107  fSlicePMLabel (pset.get<std::string> ("SlicePMLabel")),
108  fProngPMLabel (pset.get<std::string> ("ProngPMLabel")),
109  fProngModLabel (pset.get<std::string> ("ProngModLabel")),
110  fIs2DProng (pset.get<bool> ("Is2DProng")),
111  fProng3DLabel (pset.get<std::string> ("Prong3DLabel")),
112  fProng2DLabel (pset.get<std::string> ("Prong2DLabel")),
113  fProngLabel (pset.get<std::string> ("ProngLabel")),//(fIs2Dorong?"Prong2DLabel": "Prong3DLabel")),
114 
115  fObeyPreselection (pset.get<bool> ("ObeyPreselection")),
116  fSkipLongProngs(pset.get<bool> ("SkipLongProngs")),
117  fProngOnly (pset.get<bool> ("ProngOnly")),
118  fProngLengthCut (pset.get<double> ("ProngLengthCut")),
119  fNOutput(8),
120  fUseGeV(true),
121  fPreselectionLabels (pset.get<std::vector<std::string>> ("PreselectionLabels")),
122  fLibPath(pset.get<std::string>("LibPath")),
123  fModelName(pset.get<std::string>("ModelName")),
124  fTF(0)
125  {
128  produces< std::vector<cvn::Result> >();
129  produces< art::Assns<cvn::Result, rb::Cluster> >();
130  produces< art::Assns<cvn::Result, rb::Prong> >();
131  produces< std::vector<rb::PID> >();
132  produces< art::Assns<rb::PID, rb::Prong> >();
133  }
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
std::vector< std::string > fPreselectionLabels
std::string fProngModLabel
Module lablel for input prongs.
const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
Module lablel for input clusters.
bool fObeyPreselection
Check rb::IsFiltered?
unsigned int fNOutput
Number of outputs fron neural net.
bool fIs2DProng
Instance lablel for input 3D prongs.
std::string fPixelMapInput
Module label for input pixel maps.
Wrapper for Tensorflow which handles construction and prediction.
Definition: TFHandler.h:19
ProductToken< T > consumes(InputTag const &)
enum BeamMode string
cvntf::CVNProngEvaluatorTF::~CVNProngEvaluatorTF ( )

Definition at line 136 of file CVNProngEvaluatorTF_module.cc.

References fTF.

137  {
138  if(fTF) delete fTF;
139 
140  //======================================================================
141  // Clean up any memory allocated by your module
142  //======================================================================
143  }

Member Function Documentation

void cvntf::CVNProngEvaluatorTF::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 187 of file CVNProngEvaluatorTF_module.cc.

188  { }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
void cvntf::CVNProngEvaluatorTF::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 191 of file CVNProngEvaluatorTF_module.cc.

192  {
193  }
bool cvntf::CVNProngEvaluatorTF::filter ( std::vector< unsigned char >  pm,
int  view 
)

Definition at line 145 of file CVNProngEvaluatorTF_module.cc.

References MECModelEnuComparisons::i, submit_syst::x, and submit_syst::y.

Referenced by produce().

146  {
147  float x(0), y(0), tmpx(0), tmpy(0);
148  for(int i = 0; i<8000; i++){
149  tmpx=pm[i];
150  if(tmpx>0){
151  x++;
152  }
153  }
154  for(int i = 8000; i<16000; i++){
155  tmpy = pm[i];
156  if(tmpy>0) y++;
157  }
158  if(view && y<=3) return false;
159  if((!view) && x<=3) return false;
160  else return true;
161  }
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void cvntf::CVNProngEvaluatorTF::produce ( art::Event evt)
virtual

Define containers for the things we're going to produce

Implements art::EDProducer.

Definition at line 196 of file CVNProngEvaluatorTF_module.cc.

References om::cout, util::CreateAssn(), DEFINE_ART_MODULE(), allTimeWatchdog::endl, fClusterToken, filter(), fIs2DProng, check_time_usage::float, fNOutput, fObeyPreselection, fPixelMapInput, fPreselectionLabels, fProng2DLabel, fProngLengthCut, fProngModLabel, fSkipLongProngs, fTF, fUseGeV, art::DataViewImpl::getByToken(), cvn::GetPDGByPType(), MECModelEnuComparisons::i, rb::IsFiltered(), calib::j, make_pair(), rb::Cluster::NXCell(), rb::Cluster::NYCell(), output, tensorflow::TFHandler::Predict(), art::PtrVector< T >::push_back(), art::Event::put(), fillBadChanDBTables::result, moon_position_table_new3::second, rb::Prong::TotalLength(), vector_to_tensor(), and POTSpillRate::view.

197  {
198 
199  /// Define containers for the things we're going to produce
200  std::unique_ptr< std::vector<Result> >
201  resultCol(new std::vector<Result>);
202  std::unique_ptr< std::vector<rb::PID> >
203  pidCol(new std::vector<rb::PID>);
204  std::unique_ptr< art::Assns<Result, rb::Cluster> >
206  std::unique_ptr< art::Assns<Result, rb::Prong> >
207  assocp(new art::Assns<Result, rb::Prong>);
208  std::unique_ptr< art::Assns<rb::PID, rb::Prong> >
209  assocpid(new art::Assns<rb::PID, rb::Prong>);
210 
211  // get the slices
213  evt.getByToken(fClusterToken, clusterHandle);
214  const std::vector<rb::Cluster> & clusters = *clusterHandle;
215 
217  for(unsigned int i = 0; i<clusterHandle->size(); i++){
218  art::Ptr<rb::Cluster> clust(clusterHandle,i);
219  sliceCol.push_back(clust);
220  }
221 
222  art::FindManyP<PixelMap> fmSlicePM(clusterHandle, evt, fPixelMapInput);//art::InputTag(fPixelMapInput, fSlicePMLabel));
223  if(!fmSlicePM.isValid()) return;
224 
225  for(size_t iClust = 0; iClust < clusters.size(); iClust++) {
226  if(fObeyPreselection && rb::IsFiltered(evt,clusterHandle,iClust,fPreselectionLabels))
227  continue;
228  if(clusters[iClust].IsNoise()) continue;
229 
230  const std::vector<art::Ptr<PixelMap> > slicePMs = fmSlicePM.at(iClust);
231 
233  if(!fmProng.isValid()) continue;
234  //for 3d's x,y 2ds
235  std::vector<art::Ptr<rb::Prong>> prongs;
236 
237  prongs = fmProng.at(iClust);
238 
239  if(prongs.empty()) continue;
240  art::FindManyP<PixelMap> fmProngPM(prongs, evt, fPixelMapInput);
241  if( !fmProngPM.isValid()) continue;
242  // prong first
243  for( unsigned int iProng = 0; iProng < prongs.size(); iProng++ ){
244  art::Ptr<rb::Prong> prong = prongs[iProng];
245  int view = 2;
246 
247  if(fIs2DProng){
248  if(prong->NXCell()) view = 0;
249  else if(prong->NYCell()) view = 1;
250  else std::cout<<"How the hell do we get to no cells at all..."<<std::endl;
251  }
252  else{
253  if(!prong->NXCell() || !prong->NYCell()){
254  std::cout<<" 3d prong with an empty view!!!!!!"<<std::endl;
255  continue;
256  }
257  abort(); //abort here for now
258  }
259  if ( fSkipLongProngs && prong->TotalLength() > fProngLengthCut ) continue;
260  const std::vector<art::Ptr<PixelMap>> pm = fmProngPM.at(iProng);
261  if (pm.empty()) continue;
262  if (slicePMs.empty()) continue;
263  std::vector<unsigned char> prongpm = (*pm[0]).PixelMapToVector(fUseGeV);
264  std::vector<unsigned char> slicepm = (*slicePMs[0]).PixelMapToVector(fUseGeV);
265 
266  if(!filter(prongpm, view)) continue;
267  std::vector<tensorflow::Tensor> tensor = vector_to_tensor(prongpm, slicepm);
268  std::vector<tensorflow::Tensor> result = fTF->Predict({std::make_pair("input", tensor[view])}, {"output/Softmax"});
269 
270  float output[fNOutput];
271 
272  auto tfoutput = result[0].tensor<float,2>();
273 
274  std::vector<std::pair<int, double>> outputwithpdg;
275 
276  for ( unsigned int j = 0; j < fNOutput; j++ ){
277  outputwithpdg.push_back(std::make_pair(GetPDGByPType((cvn::PType)j), (double)tfoutput(0,j)));
278  pidCol->emplace_back(outputwithpdg[j].first, outputwithpdg[j].second);
279  util::CreateAssn(*this, evt, *(pidCol.get()),
280  prongs[iProng], *(assocpid.get()), UINT_MAX);
281  output[j] = (float)tfoutput(0,j);
282  }
283  const float* outputptr = output;
284  resultCol->emplace_back(outputptr, fNOutput);
285 // PixelMap tmp = *pm[0];
286 // (tmp).Print();
287 // for (unsigned int i = 0; i < fNOutput; i++) {std::cout<<*outputptr<<std::endl;outputptr++;}
288 
289  // Output object with PDGs rather than version dependednt cvn ID
290  util::CreateAssn(*this, evt, *(resultCol.get()),
291  sliceCol[iClust], *(assoc.get()), UINT_MAX);
292  util::CreateAssn(*this, evt, *(resultCol.get()),
293  prongs[iProng], *(assocp.get()), UINT_MAX);
294  }//iProng
295  }//iClust
296 
297  evt.put(std::move(pidCol));
298  evt.put(std::move(resultCol));
299  evt.put(std::move(assoc));
300  evt.put(std::move(assocp));
301  evt.put(std::move(assocpid));
302 
303  }
ofstream output
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.
bool filter(std::vector< unsigned char > pm, int view)
std::vector< std::string > fPreselectionLabels
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< Tensor > Predict(std::vector< std::pair< std::string, Tensor >> inputs, std::vector< std::string > outputLabels)
Definition: TFHandler.cxx:64
std::string fProngModLabel
Module lablel for input prongs.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
const art::ProductToken< std::vector< rb::Cluster > > fClusterToken
Module lablel for input clusters.
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
std::vector< tensorflow::Tensor > vector_to_tensor(std::vector< unsigned char >, std::vector< unsigned char >)
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
const double j
Definition: BetheBloch.cxx:29
int GetPDGByPType(PType ptype)
Definition: ProngType.cxx:5
OStream cout
Definition: OStream.cxx:6
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
bool fObeyPreselection
Check rb::IsFiltered?
unsigned int fNOutput
Number of outputs fron neural net.
bool fIs2DProng
Instance lablel for input 3D prongs.
std::string fPixelMapInput
Module label for input pixel maps.
PType
Definition: ProngType.h:18
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
Definition: DataViewImpl.h:387
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
std::vector< tensorflow::Tensor > cvntf::CVNProngEvaluatorTF::vector_to_tensor ( std::vector< unsigned char >  prongpm,
std::vector< unsigned char >  slicepm 
)

Definition at line 163 of file CVNProngEvaluatorTF_module.cc.

References check_time_usage::float, MECModelEnuComparisons::i, submit_syst::x, and submit_syst::y.

Referenced by produce().

164  {
165  tensorflow::Tensor tensorx(tensorflow::DT_FLOAT, {1,16000});
166  tensorflow::Tensor tensory(tensorflow::DT_FLOAT, {1,16000});
167 
168  auto relx = tensorx.tensor<float,2>();
169  auto rely = tensory.tensor<float,2>();
170  float x(0),y(0);
171 
172  for(int i = 0; i<8000; i++){
173  //odd-view
174  relx(0, i) = slicepm[i];
175  relx(0, i+8000) = prongpm[i];
176  x += prongpm[i];
177  }
178  for(int i = 8000; i< 16000; i++){
179  rely(0, i-8000) = slicepm[i];
180  rely(0, i) = prongpm[i];
181  y += prongpm[i];
182  }
183  return {tensorx, tensory};
184  }

Member Data Documentation

const art::ProductToken<std::vector<rb::Cluster> > cvntf::CVNProngEvaluatorTF::fClusterToken
private

Module lablel for input clusters.

Definition at line 67 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

bool cvntf::CVNProngEvaluatorTF::fIs2DProng
private

Instance lablel for input 3D prongs.

Definition at line 78 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fLibPath
private

Definition at line 95 of file CVNProngEvaluatorTF_module.cc.

Referenced by CVNProngEvaluatorTF().

std::string cvntf::CVNProngEvaluatorTF::fModelName
private

Definition at line 96 of file CVNProngEvaluatorTF_module.cc.

Referenced by CVNProngEvaluatorTF().

unsigned int cvntf::CVNProngEvaluatorTF::fNOutput
private

Number of outputs fron neural net.

Definition at line 92 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

bool cvntf::CVNProngEvaluatorTF::fObeyPreselection
private

Check rb::IsFiltered?

Definition at line 84 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fPixelMapInput
private

Module label for input pixel maps.

Definition at line 70 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::vector<std::string> cvntf::CVNProngEvaluatorTF::fPreselectionLabels
private

Definition at line 94 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fProng2DLabel
private

Definition at line 80 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fProng3DLabel
private

Definition at line 79 of file CVNProngEvaluatorTF_module.cc.

std::string cvntf::CVNProngEvaluatorTF::fProngLabel
mutableprivate

Definition at line 81 of file CVNProngEvaluatorTF_module.cc.

double cvntf::CVNProngEvaluatorTF::fProngLengthCut
private

Definition at line 87 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fProngModLabel
private

Module lablel for input prongs.

Definition at line 75 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

bool cvntf::CVNProngEvaluatorTF::fProngOnly
private

Definition at line 86 of file CVNProngEvaluatorTF_module.cc.

std::string cvntf::CVNProngEvaluatorTF::fProngPMLabel
private

Definition at line 72 of file CVNProngEvaluatorTF_module.cc.

bool cvntf::CVNProngEvaluatorTF::fSkipLongProngs
private

Definition at line 85 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().

std::string cvntf::CVNProngEvaluatorTF::fSlicePMLabel
private

Definition at line 71 of file CVNProngEvaluatorTF_module.cc.

tensorflow::TFHandler* cvntf::CVNProngEvaluatorTF::fTF
private
bool cvntf::CVNProngEvaluatorTF::fUseGeV
private

Definition at line 93 of file CVNProngEvaluatorTF_module.cc.

Referenced by produce().


The documentation for this class was generated from the following file: