All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
flashmatch Namespace Reference

Namespaces

 msg
 
 parser
 

Classes

class  CommonAmps
 
class  CommonAmpsFactory
 
class  ChargeAnalytical
 
class  ChargeAnalyticalFactory
 
class  LightPath
 
class  LightPathFactory
 
class  MaxNPEWindow
 
class  MaxNPEWindowFactory
 
class  NPtFilter
 
class  NPtFilterFactory
 
class  PhotonLibHypothesis
 
class  PhotonLibHypothesisFactory
 
class  QLLMatch
 
class  QLLMatchFactory
 
class  QWeightPoint
 
class  QWeightPointFactory
 
class  TimeCompatMatch
 
class  TimeCompatMatchFactory
 
class  TimeRange
 
class  TimeRangeSet
 
class  BaseAlgorithm
 
class  BaseFlashFilter
 
class  BaseFlashHypothesis
 
class  BaseFlashMatch
 
class  BaseProhibitAlgo
 
class  BaseTPCFilter
 
class  CustomAlgoFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  CustomAlgoFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  FlashFilterFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  FlashFilterFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  FlashHypothesisFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  FlashHypothesisFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  FlashMatchFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  FlashMatchFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  FlashMatchManager
 
class  FlashProhibitFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  FlashProhibitFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  DetectorSpecs
 
class  ConfigManager
 Utility class to register a set of configurations Provides also a shared instance through which registered configurations can be shared beyond a single owner.
Using flashmatch::PSet, the uniqueness of configuration parameters is guaranteed (no worry to "overwrite")
. More...
 
class  PSet
 A nested configuration parameter set holder for flashmatch framework. More...
 
class  LoggerFeature
 
class  OpT0FinderException
 
class  logger
 Utility class used to show formatted message on the screen. A logger class for flashmatch. Simply shows a formatted colored message on a screen.
A static getter method is provided to create a sharable logger instance (see OpT0FinderBase for useage).
. More...
 
struct  Flash_t
 Struct to represent an optical flash. More...
 
struct  QPoint_t
 Struct to represent an energy deposition point in 3D space. More...
 
class  QCluster_t
 Collection of charge deposition 3D point (cluster) More...
 
struct  FlashMatch_t
 Flash-TPC match info. More...
 
struct  MCSource_t
 Struct to represent the ancestor information for a specific interaction (QCluster) More...
 
class  TPCFilterFactoryBase
 Abstract base class for factory (to be implemented per flash) More...
 
class  TPCFilterFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  load_pyutil
 

Typedefs

using Config_t = fhicl::ParameterSet
 Configuration object. More...
 
typedef size_t ID_t
 Index used to identify Flash_t/QPointCollection_t uniquely in an event. More...
 
typedef std::vector
< flashmatch::QCluster_t
QClusterArray_t
 Collection of 3D point clusters (one use case is TPC object representation for track(s) and shower(s)) More...
 
typedef std::vector
< flashmatch::Flash_t
FlashArray_t
 Collection of Flash objects. More...
 
typedef std::vector
< flashmatch::ID_t
IDArray_t
 Index collection. More...
 

Enumerations

enum  Algorithm_t {
  kTPCFilter, kFlashFilter, kFlashMatch, kMatchProhibit,
  kFlashHypothesis, kCustomAlgo, kAlgorithmTypeMax
}
 Enumerator for different types of algorithm. More...
 
enum  MCAncestor_t { kMCShowerAncestor, kMCTrackAncestor, kUnknownAncestor }
 Enum to define MC source type (MCTrack or MCShower) for a given QCluster. More...
 

Functions

void MIN_vtx_qll (Int_t &, Double_t *, Double_t &, Double_t *, Int_t)
 
template<>
PSet PSet::get< flashmatch::PSet > (const std::string &key) const
 
std::string ConfigFile2String (std::string fname)
 Given a configuration string, format to create flashmatch::PSet. More...
 
PSet CreatePSetFromFile (std::string fname, std::string cfg_name="cfg")
 Given a configuration file (full path), create and return flashmatch::PSet. More...
 
std::ostream & operator<< (std::ostream &out, const flashmatch::QCluster_t &obj)
 streamer override More...
 
void SetPyUtil ()
 Utility function: call one-time-only numpy module initialization (you don't have to call) More...
 
PyObjectas_ndarray (const QCluster_t &traj)
 
PyObjectas_ndarray (const ::geoalgo::Trajectory &traj)
 
PyObjectas_ndarray (const Flash_t &flash)
 
template<class T >
void _copy_array (PyObject *arrayin, const std::vector< T > &cvec)
 copy array More...
 
template void _copy_array< unsigned short > (PyObject *arrayin, const std::vector< unsigned short > &cvec)
 
template void _copy_array< unsigned int > (PyObject *arrayin, const std::vector< unsigned int > &cvec)
 
template void _copy_array< short > (PyObject *arrayin, const std::vector< short > &cvec)
 
template void _copy_array< int > (PyObject *arrayin, const std::vector< int > &cvec)
 
template void _copy_array< long long > (PyObject *arrayin, const std::vector< long long > &cvec)
 
template void _copy_array< float > (PyObject *arrayin, const std::vector< float > &cvec)
 
template void _copy_array< double > (PyObject *arrayin, const std::vector< double > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< unsigned short > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< unsigned int > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< short > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< int > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< long long > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< float > &cvec)
 
void copy_array (PyObject *arrayin, const std::vector< double > &cvec)
 
template<>
int ctype_to_numpy< short > ()
 
template<>
int ctype_to_numpy< unsigned short > ()
 
template<>
int ctype_to_numpy< int > ()
 
template<>
int ctype_to_numpy< unsigned int > ()
 
template<>
int ctype_to_numpy< long long > ()
 
template<>
int ctype_to_numpy< unsigned long long > ()
 
template<>
int ctype_to_numpy< float > ()
 
template<>
int ctype_to_numpy< double > ()
 
template<class T >
PyObject_as_ndarray (const std::vector< T > &data)
 convert vectors into np array More...
 
template PyObject_as_ndarray< short > (const std::vector< short > &vec)
 
template PyObject_as_ndarray< unsigned short > (const std::vector< unsigned short > &vec)
 
template PyObject_as_ndarray< int > (const std::vector< int > &vec)
 
template PyObject_as_ndarray< unsigned int > (const std::vector< unsigned int > &vec)
 
template PyObject_as_ndarray< long long > (const std::vector< long long > &vec)
 
template PyObject_as_ndarray< unsigned long long > (const std::vector< unsigned long long > &vec)
 
template PyObject_as_ndarray< float > (const std::vector< float > &vec)
 
template PyObject_as_ndarray< double > (const std::vector< double > &vec)
 
PyObjectas_ndarray (const std::vector< short > &vec)
 
PyObjectas_ndarray (const std::vector< unsigned short > &vec)
 
PyObjectas_ndarray (const std::vector< int > &vec)
 
PyObjectas_ndarray (const std::vector< unsigned int > &vec)
 
PyObjectas_ndarray (const std::vector< long long > &vec)
 
PyObjectas_ndarray (const std::vector< unsigned long long > &vec)
 
PyObjectas_ndarray (const std::vector< float > &vec)
 
PyObjectas_ndarray (const std::vector< double > &vec)
 
template<class T >
PyObjectnumpy_array (std::vector< size_t > dims)
 
template PyObjectnumpy_array< float > (std::vector< size_t >dims)
 
template<class T >
int ctype_to_numpy ()
 

Variables

static CommonAmpsFactory __global_CommonAmpsFactory__
 
static ChargeAnalyticalFactory __global_ChargeAnalyticalFactory__
 
static LightPathFactory __global_LightPathFactory__
 
static MaxNPEWindowFactory __global_MaxNPEWindowFactory__
 
static NPtFilterFactory __global_NPtFilterFactory__
 
static PhotonLibHypothesisFactory __global_PhotonLibHypothesisFactory__
 
static QLLMatchFactory __global_QLLMatchFactory__
 
static QWeightPointFactory __global_QWeightPointFactory__
 
static TimeCompatMatchFactory __global_TimeCompatMatchFactory__
 
const double kINVALID_DOUBLE = std::numeric_limits<double>::max()
 Utility: invalid value for double. More...
 
const int kINVALID_INT = std::numeric_limits<int>::max()
 Utility: invalid value for int. More...
 
const size_t kINVALID_SIZE = std::numeric_limits<size_t>::max()
 Utility: invalid value for size. More...
 
const ID_t kINVALID_ID = kINVALID_SIZE
 Invalid ID. More...
 

Typedef Documentation

using flashmatch::Config_t = typedef fhicl::ParameterSet

Configuration object.

Definition at line 31 of file FMWKInterface.h.

Collection of Flash objects.

Definition at line 142 of file OpT0FinderTypes.h.

typedef size_t flashmatch::ID_t

Index used to identify Flash_t/QPointCollection_t uniquely in an event.

Definition at line 12 of file OpT0FinderTypes.h.

Index collection.

Definition at line 145 of file OpT0FinderTypes.h.

Collection of 3D point clusters (one use case is TPC object representation for track(s) and shower(s))

Definition at line 140 of file OpT0FinderTypes.h.

Enumeration Type Documentation

Enumerator for different types of algorithm.

Enumerator
kTPCFilter 

Algorithm type to filter out TPC objects from matching candidate list.

kFlashFilter 

Algorithm type to filter out flash from matching candidate list.

kFlashMatch 

Algorithm type to match flash hypothesis and reconstructed flash.

kMatchProhibit 

Algorithm type to prohibit a match between a flash and a cluster.

kFlashHypothesis 

Algorithm type to make QCluster_t => Flash_t hypothesis.

kCustomAlgo 

Algorithm type that does not play a role in the framework execution but inherits from BaseAlgorithm.

kAlgorithmTypeMax 

enum flag for algorithm type count & invalid type

Definition at line 17 of file OpT0FinderTypes.h.

17  {
18  kTPCFilter, ///< Algorithm type to filter out TPC objects from matching candidate list
19  kFlashFilter, ///< Algorithm type to filter out flash from matching candidate list
20  kFlashMatch, ///< Algorithm type to match flash hypothesis and reconstructed flash
21  kMatchProhibit, ///< Algorithm type to prohibit a match between a flash and a cluster
22  kFlashHypothesis, ///< Algorithm type to make QCluster_t => Flash_t hypothesis
23  kCustomAlgo, ///< Algorithm type that does not play a role in the framework execution but inherits from BaseAlgorithm
24  kAlgorithmTypeMax ///< enum flag for algorithm type count & invalid type
25  };
Algorithm type to make QCluster_t =&gt; Flash_t hypothesis.
Algorithm type to match flash hypothesis and reconstructed flash.
Algorithm type to filter out TPC objects from matching candidate list.
Algorithm type to filter out flash from matching candidate list.
Algorithm type to prohibit a match between a flash and a cluster.
enum flag for algorithm type count &amp; invalid type
Algorithm type that does not play a role in the framework execution but inherits from BaseAlgorithm...

Enum to define MC source type (MCTrack or MCShower) for a given QCluster.

Enumerator
kMCShowerAncestor 
kMCTrackAncestor 
kUnknownAncestor 

Definition at line 176 of file OpT0FinderTypes.h.

Function Documentation

template<class T >
PyObject * flashmatch::_as_ndarray ( const std::vector< T > &  vec)

convert vectors into np array

Definition at line 193 of file PyUtils.cxx.

193  {
194  SetPyUtil();
195 
196  if (vec.size() >= INT_MAX) {
197  std::cerr << "Length of data vector too long to specify ndarray. " << std::endl;
198  throw std::exception();
199  }
200  int nd = 1;
201  npy_intp dims[1];
202  dims[0] = (int)vec.size();
203  PyArrayObject *array = (PyArrayObject *)PyArray_SimpleNewFromData(
204  nd, dims, ctype_to_numpy<T>(), (char *)&(vec[0]));
205  return PyArray_Return(array);
206  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
BEGIN_PROLOG could also be cerr
then echo ***************************************echo array
Definition: find_fhicl.sh:28
template PyObject* flashmatch::_as_ndarray< double > ( const std::vector< double > &  vec)
template PyObject* flashmatch::_as_ndarray< float > ( const std::vector< float > &  vec)
template PyObject* flashmatch::_as_ndarray< int > ( const std::vector< int > &  vec)
template PyObject* flashmatch::_as_ndarray< long long > ( const std::vector< long long > &  vec)
template PyObject* flashmatch::_as_ndarray< short > ( const std::vector< short > &  vec)
template PyObject* flashmatch::_as_ndarray< unsigned int > ( const std::vector< unsigned int > &  vec)
template PyObject* flashmatch::_as_ndarray< unsigned long long > ( const std::vector< unsigned long long > &  vec)
template PyObject* flashmatch::_as_ndarray< unsigned short > ( const std::vector< unsigned short > &  vec)
template<class T >
void flashmatch::_copy_array ( PyObject arrayin,
const std::vector< T > &  cvec 
)

copy array

Definition at line 124 of file PyUtils.cxx.

124  {
125  SetPyUtil();
126  PyArrayObject *ptr = (PyArrayObject *)(arrayin);
127 
128  //std::cout<< PyArray_NDIM(ptr) << std::endl
129  // << PyArray_DIM(ptr,0)<<std::endl
130  // << PyArray_SIZE(ptr) << std::endl;
131 
132  // Check dimension size is 1:
133  if (PyArray_NDIM(ptr) != 1){
134  throw std::exception();
135  }
136 
137  if ((long)(cvec.size()) != PyArray_SIZE(ptr))
138  throw std::exception();
139  npy_intp loc[1];
140  loc[0] = 0;
141  auto fptr = (T *)(PyArray_GetPtr(ptr, loc));
142  for (size_t i = 0; i < size_t(PyArray_SIZE(ptr)); ++i) {
143  // std::cout << fptr[i] << std::endl;
144  fptr[i] = cvec[i];
145  };
146  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template void flashmatch::_copy_array< double > ( PyObject arrayin,
const std::vector< double > &  cvec 
)
template void flashmatch::_copy_array< float > ( PyObject arrayin,
const std::vector< float > &  cvec 
)
template void flashmatch::_copy_array< int > ( PyObject arrayin,
const std::vector< int > &  cvec 
)
template void flashmatch::_copy_array< long long > ( PyObject arrayin,
const std::vector< long long > &  cvec 
)
template void flashmatch::_copy_array< short > ( PyObject arrayin,
const std::vector< short > &  cvec 
)
template void flashmatch::_copy_array< unsigned int > ( PyObject arrayin,
const std::vector< unsigned int > &  cvec 
)
template void flashmatch::_copy_array< unsigned short > ( PyObject arrayin,
const std::vector< unsigned short > &  cvec 
)
PyObject * flashmatch::as_ndarray ( const QCluster_t &  traj)

Definition at line 22 of file PyUtils.cxx.

22  {
23  SetPyUtil();
24  std::vector<size_t> dims(2,0);
25  dims[0] = traj.size();
26  dims[1] = 4;
27  auto pyarray = numpy_array<double>(dims);
28 
29  double **carray;
30  const int dtype = NPY_DOUBLE;
31  PyArray_Descr *descr = PyArray_DescrFromType(dtype);
32  npy_intp pydims[2];
33  if (PyArray_AsCArray(&pyarray, (void **)&carray, pydims, 2, descr) < 0) {
34  std::cerr<<"Failed to create 2D numpy array"<<std::endl;
35  throw std::exception();
36  }
37  assert(pydims[0] == ((int)(dims[0])) && pydims[1] == ((int)(dims[1])));
38 
39  for(size_t idx=0; idx<dims[0]; ++idx) {
40  carray[idx][0] = traj[idx].x;
41  carray[idx][1] = traj[idx].y;
42  carray[idx][2] = traj[idx].z;
43  carray[idx][3] = traj[idx].q;
44  }
45  PyArray_Free(pyarray, (void *)carray);
46  return pyarray;
47  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
BEGIN_PROLOG could also be cerr
PyObject * flashmatch::as_ndarray ( const ::geoalgo::Trajectory traj)

Definition at line 49 of file PyUtils.cxx.

49  {
50  SetPyUtil();
51  std::vector<size_t> dims(2,0);
52  dims[0] = traj.size();
53  dims[1] = 3;
54  auto pyarray = numpy_array<double>(dims);
55 
56  double **carray;
57  const int dtype = NPY_DOUBLE;
58  PyArray_Descr *descr = PyArray_DescrFromType(dtype);
59  npy_intp pydims[2];
60  if (PyArray_AsCArray(&pyarray, (void **)&carray, pydims, 2, descr) < 0) {
61  std::cerr<<"Failed to create 2D numpy array"<<std::endl;
62  throw std::exception();
63  }
64  assert(pydims[0] == ((int)(dims[0])) && pydims[1] == ((int)(dims[1])));
65 
66  for(size_t idx=0; idx<dims[0]; ++idx) {
67  carray[idx][0] = traj[idx][0];
68  carray[idx][1] = traj[idx][1];
69  carray[idx][2] = traj[idx][2];
70  }
71  PyArray_Free(pyarray, (void *)carray);
72  return pyarray;
73  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
BEGIN_PROLOG could also be cerr
PyObject * flashmatch::as_ndarray ( const Flash_t &  flash)

Definition at line 75 of file PyUtils.cxx.

75  {
76  SetPyUtil();
77  std::vector<size_t> dims(1);
78  dims[0] = flash.pe_v.size();
79  auto pyarray = numpy_array<double>(dims);
80 
81  double *carray;
82  const int dtype = NPY_DOUBLE;
83  PyArray_Descr *descr = PyArray_DescrFromType(dtype);
84  npy_intp pydims[1];
85  if (PyArray_AsCArray(&pyarray, (void **)&carray, pydims, 1, descr) < 0) {
86  std::cerr<<"Failed to create 2D numpy array"<<std::endl;
87  throw std::exception();
88  }
89  assert(pydims[0] == ((int)(dims[0])));
90 
91  for(size_t idx=0; idx<dims[0]; ++idx)
92  carray[idx] = flash.pe_v[idx];
93  PyArray_Free(pyarray, (void *)carray);
94  return pyarray;
95  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
BEGIN_PROLOG could also be cerr
PyObject * flashmatch::as_ndarray ( const std::vector< short > &  vec)

Definition at line 217 of file PyUtils.cxx.

217 { return _as_ndarray< short >(vec); }
template PyObject * _as_ndarray< short >(const std::vector< short > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< unsigned short > &  vec)

Definition at line 218 of file PyUtils.cxx.

218 { return _as_ndarray< unsigned short >(vec); }
template PyObject * _as_ndarray< unsigned short >(const std::vector< unsigned short > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< int > &  vec)

Definition at line 219 of file PyUtils.cxx.

219 { return _as_ndarray< int >(vec); }
template PyObject * _as_ndarray< int >(const std::vector< int > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< unsigned int > &  vec)

Definition at line 220 of file PyUtils.cxx.

220 { return _as_ndarray< unsigned int >(vec); }
template PyObject * _as_ndarray< unsigned int >(const std::vector< unsigned int > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< long long > &  vec)

Definition at line 221 of file PyUtils.cxx.

221 { return _as_ndarray< long long >(vec); }
template PyObject * _as_ndarray< long long >(const std::vector< long long > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< unsigned long long > &  vec)

Definition at line 222 of file PyUtils.cxx.

222 { return _as_ndarray< unsigned long long >(vec); }
template PyObject * _as_ndarray< unsigned long long >(const std::vector< unsigned long long > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< float > &  vec)

Definition at line 223 of file PyUtils.cxx.

223 { return _as_ndarray< float >(vec); }
template PyObject * _as_ndarray< float >(const std::vector< float > &vec)
PyObject * flashmatch::as_ndarray ( const std::vector< double > &  vec)

Definition at line 224 of file PyUtils.cxx.

224 { return _as_ndarray< double >(vec); }
template PyObject * _as_ndarray< double >(const std::vector< double > &vec)
std::string flashmatch::ConfigFile2String ( std::string  fname)

Given a configuration string, format to create flashmatch::PSet.

Given a configuration file (full path), read & parse contents to create flashmatch::PSet

Definition at line 9 of file PSetUtils.cxx.

10  {
11  std::ifstream filestrm(fname.c_str());
12  std::string contents;
13  std::string line;
14 
15  while(std::getline(filestrm, line)) {
16 
17  if(line.empty()) continue;
18 
19  std::stringstream linestrm(line);
20  std::string valid_line;
21 
22  std::getline(linestrm, valid_line, '#');
23 
24  if(valid_line.empty()) continue;
25 
26  contents += " " + valid_line;
27  }
28  filestrm.close();
29  return contents;
30  }
string fname
Definition: demo.py:5
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< unsigned short > &  cvec 
)

Definition at line 156 of file PyUtils.cxx.

156 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< unsigned int > &  cvec 
)

Definition at line 157 of file PyUtils.cxx.

157 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< short > &  cvec 
)

Definition at line 158 of file PyUtils.cxx.

158 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< int > &  cvec 
)

Definition at line 159 of file PyUtils.cxx.

159 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< long long > &  cvec 
)

Definition at line 160 of file PyUtils.cxx.

160 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< float > &  cvec 
)

Definition at line 161 of file PyUtils.cxx.

161 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
void flashmatch::copy_array ( PyObject arrayin,
const std::vector< double > &  cvec 
)

Definition at line 162 of file PyUtils.cxx.

162 { _copy_array(arrayin, cvec); }
void _copy_array(PyObject *arrayin, const std::vector< T > &cvec)
copy array
Definition: PyUtils.cxx:124
PSet flashmatch::CreatePSetFromFile ( std::string  fname,
std::string  cfg_name 
)

Given a configuration file (full path), create and return flashmatch::PSet.

Definition at line 32 of file PSetUtils.cxx.

33  {
34  PSet res(cfg_name,ConfigFile2String(fname));
35  return res;
36  }
string fname
Definition: demo.py:5
std::string ConfigFile2String(std::string fname)
Given a configuration string, format to create flashmatch::PSet.
Definition: PSetUtils.cxx:9
template<class T >
int flashmatch::ctype_to_numpy ( )
template<>
int flashmatch::ctype_to_numpy< double > ( )

Definition at line 171 of file PyUtils.cxx.

171 { SetPyUtil(); return NPY_FLOAT64; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< float > ( )

Definition at line 170 of file PyUtils.cxx.

170 { SetPyUtil(); return NPY_FLOAT32; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< int > ( )

Definition at line 166 of file PyUtils.cxx.

166 { SetPyUtil(); return NPY_INT32; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< long long > ( )

Definition at line 168 of file PyUtils.cxx.

168 { SetPyUtil(); return NPY_INT64; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< short > ( )

Definition at line 164 of file PyUtils.cxx.

164 { SetPyUtil(); SetPyUtil(); return NPY_INT16; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< unsigned int > ( )

Definition at line 167 of file PyUtils.cxx.

167 { SetPyUtil(); return NPY_UINT32; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< unsigned long long > ( )

Definition at line 169 of file PyUtils.cxx.

169 { SetPyUtil(); return NPY_UINT64; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
template<>
int flashmatch::ctype_to_numpy< unsigned short > ( )

Definition at line 165 of file PyUtils.cxx.

165 { SetPyUtil(); return NPY_UINT16; }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
void flashmatch::MIN_vtx_qll ( Int_t &  ,
Double_t *  ,
Double_t &  Fval,
Double_t *  Xval,
Int_t   
)

Definition at line 377 of file QLLMatch.cxx.

381  { // flag word
382  //std::cout << "minuit offset : " << Fval << std::endl;
383  //std::cout << "minuit Xval?? : " << *Xval << std::endl;
384 
385  //auto start = high_resolution_clock::now();
386  auto const &hypothesis = QLLMatch::GetME()->ChargeHypothesis(*Xval);
387  //auto end = high_resolution_clock::now();
388  //auto duration = duration_cast<microseconds>(end - start);
389  //std::cout << "Duration ChargeHypothesis = " << duration.count() << "us" << std::endl;
390 
391  //start = high_resolution_clock::now();
392  auto const &measurement = QLLMatch::GetME()->Measurement();
393  //end = high_resolution_clock::now();
394  //duration = duration_cast<microseconds>(end - start);
395  //std::cout << "Duration Measurement = " << duration.count() << "us" << std::endl;
396 
397  //start = high_resolution_clock::now();
398  Fval = QLLMatch::GetME()->QLL(hypothesis, measurement);
399  //end = high_resolution_clock::now();
400  //duration = duration_cast<microseconds>(end - start);
401  //std::cout << "Duration QLL = " << duration.count() << "us" << std::endl;
402 
403  QLLMatch::GetME()->Record(Xval[0]);
404  QLLMatch::GetME()->OneStep();
405 
406  return;
407  }
template<class T >
PyObject * flashmatch::numpy_array ( std::vector< size_t >  dims)

Definition at line 227 of file PyUtils.cxx.

228  {
229  SetPyUtil();
230  int nd_ = dims.size();
231  npy_intp dims_[nd_];
232  for(size_t i=0; i<dims.size(); ++i) dims_[i] = dims[i];
233  /*
234  std::cout<<"NUMPY TYPE " << ctype_to_numpy<T>() << std::endl;
235  std::cout<<"DIMS " << dims.size() << std::endl;
236  std::cout<<"ND " << nd_ << std::endl;
237  std::cout<<"Shape ";
238  for(size_t i=0; i<dims.size(); ++i) std::cout<< " " << dims_[i];
239  std::cout<<std::endl;
240  */
241  //PyObject* res = PyArray_SimpleNew(nd_,dims_,ctype_to_numpy<T>());
242  PyObject* res = PyArray_ZEROS(nd_,dims_,ctype_to_numpy<T>(),0);
243  //Py_INCREF(res);
244  /*
245  std::cout<<PyArray_NDIM((PyArrayObject*)res) << std::endl;
246  std::cout<<PyArray_SIZE((PyArrayObject*)res) << std::endl;
247  */
248  PyArrayObject *ptr = (PyArrayObject*)(res);
249  // Check dimension size is 1:
250  //std::cout<<"ndim " << PyArray_NDIM(ptr) << std::endl;
251  //size_t len = PyArray_SIZE(ptr);
252  //std::cout<<"len " << len <<std::endl;
253  //npy_intp loc[1];
254  //loc[0] = 0;
255  //auto fptr = (T *)(PyArray_GetPtr(ptr, loc));
256  /*
257  std::cout<<"fptr " << fptr << std::endl;
258  for (size_t i = 0; i < len; ++i) {
259  std::cout << fptr[i] << std::endl;
260  fptr[i] = T(1);
261  }
262  */
263  PyArray_INCREF(ptr);
264 
265  return res;
266  }
void SetPyUtil()
Utility function: call one-time-only numpy module initialization (you don&#39;t have to call) ...
Definition: PyUtils.cxx:14
_object PyObject
Definition: PyUtils.h:4
template PyObject* flashmatch::numpy_array< float > ( std::vector< size_t >  dims)
std::ostream & flashmatch::operator<< ( std::ostream &  out,
const flashmatch::QCluster_t obj 
)

streamer override

Definition at line 36 of file OpT0FinderTypes.cxx.

36  {
37  out << "QCluster_t " << obj.size() << " points length=" << obj.length() << " qsum=" << obj.sum() << std::endl;
38  return out;
39  }
double sum() const
returns the sum of &quot;q&quot; from QPoint_t
double length() const
returns the total trajectory length
template<>
PSet flashmatch::PSet::get< flashmatch::PSet > ( const std::string &  key) const

Definition at line 389 of file PSet.cxx.

390  { return this->get_pset(key); }
void flashmatch::SetPyUtil ( )

Utility function: call one-time-only numpy module initialization (you don't have to call)

Definition at line 14 of file PyUtils.cxx.

14  {
15  static bool once = false;
16  if (!once) {
17  _import_array();
18  once = true;
19  }
20  }

Variable Documentation

ChargeAnalyticalFactory flashmatch::__global_ChargeAnalyticalFactory__
static

Definition at line 8 of file ChargeAnalytical.cxx.

CommonAmpsFactory flashmatch::__global_CommonAmpsFactory__
static

Definition at line 11 of file CommonAmps.cxx.

LightPathFactory flashmatch::__global_LightPathFactory__
static

Definition at line 8 of file LightPath.cxx.

MaxNPEWindowFactory flashmatch::__global_MaxNPEWindowFactory__
static

Definition at line 11 of file MaxNPEWindow.cxx.

NPtFilterFactory flashmatch::__global_NPtFilterFactory__
static

Definition at line 8 of file NPtFilter.cxx.

PhotonLibHypothesisFactory flashmatch::__global_PhotonLibHypothesisFactory__
static

Definition at line 16 of file PhotonLibHypothesis.cxx.

QLLMatchFactory flashmatch::__global_QLLMatchFactory__
static

Definition at line 9 of file QLLMatch.cxx.

QWeightPointFactory flashmatch::__global_QWeightPointFactory__
static

Definition at line 8 of file QWeightPoint.cxx.

TimeCompatMatchFactory flashmatch::__global_TimeCompatMatchFactory__
static

Definition at line 12 of file TimeCompatMatch.cxx.

const double flashmatch::kINVALID_DOUBLE = std::numeric_limits<double>::max()

Utility: invalid value for double.

Definition at line 12 of file OpT0FinderConstants.h.

const ID_t flashmatch::kINVALID_ID = kINVALID_SIZE

Invalid ID.

Definition at line 14 of file OpT0FinderTypes.h.

const int flashmatch::kINVALID_INT = std::numeric_limits<int>::max()

Utility: invalid value for int.

Definition at line 15 of file OpT0FinderConstants.h.

const size_t flashmatch::kINVALID_SIZE = std::numeric_limits<size_t>::max()

Utility: invalid value for size.

Definition at line 18 of file OpT0FinderConstants.h.