Skip to content

Commit 2785f06

Browse files
Merge branch 'develop' of https://github.com/DeepLearnPhysics/larcv2 into develop
2 parents ed321bb + 7a70433 commit 2785f06

File tree

12 files changed

+162
-7
lines changed

12 files changed

+162
-7
lines changed

Makefile/GNUmakefile.CORE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $(DICT).cxx: $(HEADERS) LinkDef.h
6565
# if ROOTMAP defined, define rule for making it
6666
$(LARCV_LIBDIR)/$(ROOTMAP): $(OBJECTS) $(DICT).o
6767
@echo "<< generating rootmap >>"
68-
@rlibmap -f -o $(LARCV_LIBDIR)/$(ROOTMAP) -l $(LARCV_LIBDIR)/liblarcv.so -c LinkDef.h
68+
@rlibmap -f -shared -o $(LARCV_LIBDIR)/$(ROOTMAP) -l $(LARCV_LIBDIR)/liblarcv.so -c LinkDef.h
6969

7070
# install headers
7171
install_header: .depend #$(OBJECTS) $(DICT).o

bin/libarg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
dirs=[]
66
for d in os.listdir(os.environ['LARCV_BUILDDIR']):
7+
if d==".DS_Store": continue
78
if not len([x for x in os.listdir('%s/%s' % (os.environ['LARCV_BUILDDIR'],d)) if x.endswith('.o')]): continue
89
dirs.append(d)
910
libs=[x for x in subprocess.getoutput('larcv-config --libs').split() if not x.startswith('-llarcv')]

configure.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ if [[ -z $LARCV_BUILDDIR ]]; then
2323
fi
2424

2525
# Check python version compatibility:
26-
export LARCV_PYTHON_CONFIG=python-config
2726
LARCV_PYVERSION=0
2827
if [ `command -v python3` ]; then
2928
export LARCV_PYTHON=`which python3`
29+
export LARCV_PYTHON_CONFIG=`which python3-config`
3030
LARCV_PYVERSION=$($LARCV_PYTHON -c "import sys; print(sys.version_info.major)")
3131
else
3232
export LARCV_PYTHON=`which python`
33+
export LARCV_PYTHON_CONFIG=`which python-config`
3334
LARCV_PYVERSION=$($LARCV_PYTHON -c "import sys; print(sys.version_info.major)")
3435
fi
3536
if [[ $LARCV_PYVERSION -gt 2 ]]

larcv/core/Base/LArCVTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
namespace larcv {
3434

3535
/// Used as an invalid value identifier for long long
36+
/// Used as an invalid value identifier for unsigned long long
37+
const unsigned long kINVALID_ULONG = std::numeric_limits< unsigned long >::max();
3638
const long long kINVALID_LONGLONG = std::numeric_limits< long long >::max();
3739
/// Used as an invalid value identifier for unsigned long long
3840
const unsigned long long kINVALID_ULONGLONG = std::numeric_limits< unsigned long long >::max();

larcv/core/CVUtil/CVUtil.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ namespace larcv {
123123
Image2D imread(const std::string file_name)
124124
{
125125
::cv::Mat image;
126-
image = ::cv::imread(file_name.c_str(), CV_LOAD_IMAGE_COLOR);
126+
image = ::cv::imread(file_name.c_str(), cv::IMREAD_COLOR);
127127

128128
ImageMeta meta(image.cols,image.rows,image.cols, image.rows, 0., 0.);
129129
Image2D larcv_img(meta);
@@ -147,7 +147,7 @@ namespace larcv {
147147
Image2D imread_gray(const std::string file_name)
148148
{
149149
::cv::Mat image;
150-
image = ::cv::imread(file_name.c_str(), CV_LOAD_IMAGE_GRAYSCALE);
150+
image = ::cv::imread(file_name.c_str(), cv::ImreadModes::IMREAD_GRAYSCALE);
151151

152152
ImageMeta meta(image.cols,image.rows,image.cols, image.rows, 0., 0.);
153153
Image2D larcv_img(meta);

larcv/core/DataFormat/DataFormatTypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ namespace larcv {
1919
/// "ID" of MCTruth in terms of its index number in the collection std::vector
2020
typedef unsigned short MCTIndex_t;
2121
/// "ID" for a set of elements
22-
typedef unsigned short InstanceID_t;
22+
typedef unsigned long InstanceID_t;
2323
/// Invalid rep for InstanceID_t
24-
static const unsigned short kINVALID_INSTANCEID = kINVALID_USHORT;
24+
// yes, SIGNED long. this is because numpy's int64 (which this will get converted to when used with mlreco3d)
25+
// isn't big enough for the unsigned long long value, but it *is* big enough for this one
26+
static const unsigned long kINVALID_INSTANCEID = kINVALID_LONGLONG;
2527
/// Invalid projection id
2628
static const ProjectionID_t kINVALID_PROJECTIONID = kINVALID_USHORT;
2729

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef EVENTTRIGGERCXX
2+
#define EVENTTRIGGERCXX
3+
4+
#include "EventTrigger.h"
5+
6+
namespace larcv{
7+
/// Global larcv::SBClusterFactory to register ClusterAlgoFactory
8+
static EventTriggerFactory __global_EventTriggerFactory__;
9+
10+
}
11+
12+
#endif
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* \file EventTrigger.h
3+
*
4+
* \ingroup DataFormat
5+
*
6+
* \brief Wrapper for making Trigger persistable
7+
*
8+
* @author J. Wolcott <jwolcott@fnal.gov
9+
*/
10+
11+
/** \addtogroup DataFormat
12+
13+
@{*/
14+
#ifndef __LARCV_EVENTTRIGGER_H__
15+
#define __LARCV_EVENTTRIGGER_H__
16+
17+
#include "EventBase.h"
18+
#include "Trigger.h"
19+
#include "DataProductFactory.h"
20+
21+
namespace larcv {
22+
/**
23+
\class EventTrigger
24+
Persistent storage for trigger-related data
25+
*/
26+
class EventTrigger : public EventBase, public larcv::Trigger
27+
{
28+
public:
29+
30+
/// Data clear method
31+
inline void clear()
32+
{ EventBase::clear(); Trigger::clear(); }
33+
34+
};
35+
}
36+
37+
#include "IOManager.h"
38+
namespace larcv {
39+
40+
// Template instantiation for IO
41+
template<> inline std::string product_unique_name<larcv::EventTrigger>() { return "trigger"; }
42+
template EventTrigger& IOManager::get_data<larcv::EventTrigger>(const std::string&);
43+
template EventTrigger& IOManager::get_data<larcv::EventTrigger>(const ProducerID_t);
44+
45+
/**
46+
\class larcv::EventTriggerFactory
47+
\brief A concrete factory class for larcv::EventTrigger
48+
*/
49+
class EventTriggerFactory : public DataProductFactoryBase {
50+
public:
51+
/// ctor
52+
EventTriggerFactory()
53+
{ DataProductFactory::get().add_factory(product_unique_name<larcv::EventTrigger>(),this); }
54+
/// dtor
55+
~EventTriggerFactory() {}
56+
/// create method
57+
EventBase* create() { return new EventTrigger; }
58+
};
59+
60+
61+
}
62+
63+
#endif
64+
/** @} */ // end of doxygen group

larcv/core/DataFormat/LinkDef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
#pragma link C++ class larcv::Meta+;
8585
#pragma link C++ class larcv::EventMeta+;
8686

87+
#pragma link C++ class larcv::Trigger+;
88+
#pragma link C++ class larcv::EventTrigger+;
89+
8790
#pragma link C++ class larcv::FlatTensorContents+;
8891
#pragma link C++ function larcv::as_image2d(const SparseTensor2D&)+;
8992
#pragma link C++ function larcv::as_image2d(const VoxelSet&, const ImageMeta&)+;

larcv/core/DataFormat/Particle.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ namespace larcv {
2626

2727
ss << buf.str() << "Vertex (x, y, z, t) = (" << x() << "," << y() << "," << z() << "," << t() << ")" << std::endl
2828
<< buf.str() << "Momentum (px, py, pz) = (" << px() << "," << py() << "," << pz() << ")" << std::endl
29-
<< buf.str() << "Inittial Energy = " << energy_init() << std::endl
29+
<< buf.str() << "Final Momentum (end_px, end_py, end_pz) = (" << end_px() << "," << end_py() << "," << end_pz() << ")" << std::endl
30+
<< buf.str() << "Initial Energy = " << energy_init() << std::endl
3031
<< buf.str() << "Deposit Energy = " << energy_deposit() << std::endl
3132
<< buf.str() << "Creation Process = " << creation_process() << std::endl
3233
<< buf.str() << "Instance ID = " << id() << std::endl

0 commit comments

Comments
 (0)