From 92f7e430811f0c7623260b84a9096a0e90339831 Mon Sep 17 00:00:00 2001 From: matthias Date: Thu, 27 Oct 2016 15:06:04 +0200 Subject: [PATCH 01/13] fixed number of rows in laser data file --- python/LaserData.py | 4 ++-- python/test/test_LaserData.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/LaserData.py b/python/LaserData.py index 28479eb..5f5e73b 100644 --- a/python/LaserData.py +++ b/python/LaserData.py @@ -7,7 +7,7 @@ def __init__(self, laser_id=-1): # id, status, rotary_deg, linear_tick, attenuator, time_s, time_usec, aperture, ?, mirror1_x / y, ,mirror2_x / y # 2 -1.0 155.322006226 8188568.0 12342.0 -9999.0 1471587789.0 714883.0 0.0 1.0 -1.0 4374.0 1833.0 -3673.0 4477.0 - self.n_cols = 13 + self.n_cols = 15 self.laser_id = laser_id @@ -69,7 +69,7 @@ def expand_data(self, data): return expanded_data def write(self, filename, data): - np.savetxt(filename, self.expand_data(data), fmt=2*('%i',) + ('%f',) + 10*('%i',)) + np.savetxt(filename, self.expand_data(data), fmt=2*('%i',) + ('%f',) + 12*('%i',)) if __name__ == "__main__": diff --git a/python/test/test_LaserData.py b/python/test/test_LaserData.py index 48e46bd..9cf3c69 100644 --- a/python/test/test_LaserData.py +++ b/python/test/test_LaserData.py @@ -33,9 +33,9 @@ def test_expand_data(): [ 11, 22, 33, 44, 55, 66], [111, 222, 333, 444, 555, 666]]) exp_data = laser.expand_data(data) - assert_array_almost_equal(exp_data, np.array([[ 1., 0., 2., 3., 4., 0., 5., 6., 0., 0., 0., 0., 0.], - [ 11., 0., 22., 33., 44., 0., 55., 66., 1., 0., 0., 0., 0.], - [111., 0., 222., 333., 444., 0., 555., 666., 2., 0., 0., 0., 0.]])) + assert_array_almost_equal(exp_data, np.array([[ 1., 0., 2., 3., 4., 0., 5., 6., 0., 0., 0., 0., 0., 0., 0.], + [ 11., 0., 22., 33., 44., 0., 55., 66., 1., 0., 0., 0., 0., 0., 0.], + [111., 0., 222., 333., 444., 0., 555., 666., 2., 0., 0., 0., 0., 0., 0.]])) def test_read_data(): laser = Laser() From 63c267368fd038f121ce5c25da4016ab7c4808cb Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 16 Nov 2016 13:43:25 +0100 Subject: [PATCH 02/13] add reading of entry and exit points --- python/datadefs/laserdef.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/datadefs/laserdef.py b/python/datadefs/laserdef.py index 26fcca3..7e91a3d 100644 --- a/python/datadefs/laserdef.py +++ b/python/datadefs/laserdef.py @@ -13,7 +13,7 @@ def __init__(self): self.producer = "RecoDataMinimal" self.producer = "LaserHitAna" - self.branch = "lasercal::LaserBeam_LaserMerger_LaserBeam_" + self.producer + ".obj." + self.branch = "lasercal::LaserBeam_LaserDataMerger_LaserBeam_" + self.producer + ".obj." self.XYZ = ["X", "Y", "Z"] def pos(self): @@ -22,6 +22,12 @@ def pos(self): def dir(self): return self.gen_string("fDirection.f", self.XYZ) + def entry_point(self): + return self.gen_string("fEntryPoint", self.XYZ) + + def exit_point(self): + return self.gen_string("fExitPoint", self.XYZ) + def power(self): return self.gen_string("fPower") From 4640a19837bcf0f43e78aa5e57d064c9f8e90e43 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:35:39 +0100 Subject: [PATCH 03/13] an utility directory for small scripts and notebooks without any dependencies. --- python/utils/plot_tracks.ipynb | 117 +++++++++++++++++++++++++++++++++ python/utils/plot_tracks.py | 38 +++++++++++ 2 files changed, 155 insertions(+) create mode 100644 python/utils/plot_tracks.ipynb create mode 100644 python/utils/plot_tracks.py diff --git a/python/utils/plot_tracks.ipynb b/python/utils/plot_tracks.ipynb new file mode 100644 index 0000000..6fee89f --- /dev/null +++ b/python/utils/plot_tracks.ipynb @@ -0,0 +1,117 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from root_numpy import root2array\n", + "%matplotlib inline\n", + "import matplotlib\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "\n", + "filename = \"~/Downloads/sync_gpvm/LaserReco-7205-0790.root\"\n", + "tree = \"Events\"\n", + "branch = \"recob::Tracks_pandoraCosmic__Laser.obj.fXYZ.f\"" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "x = root2array(filename, treename=tree, branches=branch + \"X\", start=0,stop=1,)\n", + "y = root2array(filename, treename=tree, branches=branch + \"Y\", start=0,stop=1,)\n", + "z = root2array(filename, treename=tree, branches=branch + \"Z\", start=0,stop=1,)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 218.4752655 , 218.46939087, 218.43965149, ..., 115.72761536,\n 115.81684113, 116.10250092])" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEACAYAAABGYoqtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztvX2UVPWd4P35VlVXd9MdEKRbFBRQQbtnZRUT4aww6cGI\nZB4RZ+MRHM1AdnKeZ3A0mUDWl2xoUeZshFnczRMFz8ZsZEP7NibrCycaNKRnhF1wHtHgY3cQVxQh\nQvOiJLw33b/943dv35e61V3dXa9d3885derWr+699a1bt+73fl9/YoxBURRFUaKIFVoARVEUpXhR\nJaEoiqKkRZWEoiiKkhZVEoqiKEpaVEkoiqIoaVEloSiKoqRl0EpCRCpFZJuIvC0i74nIf3TGR4rI\nRhHZKSK/EpERvm3uF5FdItIuIrMHK4OiKIqSGyQbdRIiMsw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8YmITHaGrgPeowSOvcNOYLqIVDn/v+uwNVHFLr+QWvS7yFnuU94iuO4E5M/bdTMf\nkfkMIve7sC07tjuPNb737sdG59uB2b7xq7GtyncBPyz0dwh9nznYP9Iu4L5Cy5NGxmuBLmz21dvO\ncZ8DjAJed+TfCJzT129R4O/xZbzsppKRHfjX2BuKd4BfYLObSkn+f49VbDuwQd+KYpYfeAr4PXAa\nG0v5BjCyv/IW6rqTRv68XDe1mE5RFEVJS1G4mxRFUZTiRJWEoiiKkhZVEoqiKEpaVEkoiqIoaVEl\noSiKoqRFlYSiKIqSFlUSiqIoSlpUSSiKoihp+T/Dld3lm5JEVwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plt.scatter(z[0], x[0])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2.0 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/python/utils/plot_tracks.py b/python/utils/plot_tracks.py new file mode 100644 index 0000000..450d84d --- /dev/null +++ b/python/utils/plot_tracks.py @@ -0,0 +1,38 @@ +import root_numpy as rn +import numpy as np +import matplotlib.pyplot as plt + +filename = "~/workspace/laser/runs/tracks/Tracks-7205-790.root" +tree = 'TimeMapProducer/Tracks' + +data = rn.root2array(filename, treename=tree) + +laser = np.array([1036, 109]) +in_range = 25 + + +for entry in range(len(data)): + print entry, data[entry][4] + x, y, z = data[entry][1], data[entry][2], data[entry][3] + + m = abs((x[-1] - x[0]) / (z[-1] - z[0])) + + print m + + closest = np.argmax(z) + closest_point = np.array([z[closest], x[closest]]) + + in_region = 50 > np.sqrt(np.sum(np.power(closest_point - laser,2))) + print in_region + + if m < 0.2 and len(z) > 1500 and in_region: + plt.subplot(211) + plt.scatter(z,x) + plt.xlim([0,1100]) + plt.ylim([0,256]) + + plt.subplot(212) + plt.scatter(z,y) + plt.xlim([0,1100]) + plt.ylim([-128,128]) +plt.show() From 526b495f2b8d21d318dfecf9e0ddb918bf2dc2fd Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:36:32 +0100 Subject: [PATCH 04/13] some attepts on hit reco, clustering and similar stuff. --- python/RANSAC_hits.py | 47 ++++++++++++++++++++++++++++++++++++++++++ python/cluster_hits.py | 42 +++++++++++++++++++++++++++++++++++++ python/collect_hits.py | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 python/RANSAC_hits.py create mode 100644 python/cluster_hits.py create mode 100755 python/collect_hits.py diff --git a/python/RANSAC_hits.py b/python/RANSAC_hits.py new file mode 100644 index 0000000..11f729d --- /dev/null +++ b/python/RANSAC_hits.py @@ -0,0 +1,47 @@ + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + + + +import numpy as np +import matplotlib.pyplot as plt +from sklearn import linear_model, datasets + +def my_metric(x, y): + return np.sqrt(np.sum((1.1*x-y)**2)) + +import hdbscan +plot_kwds = {'alpha' : 0.5, 's' : 80, 'linewidths':0} + +filename = "~/data/uboone/laser/7205/hits/90deg/LaserHit-7205-0789.root" +data = LarData(filename) +meta = MetaData() +#data.get_info() +for i in range(50): + data.read_hits(planes="y") + hit = data.get_hits(i) + test_data = np.transpose([hit.wire[:], hit.tick[:]]) + print hit.tick.shape + print hit.wire.shape + # Robustly fit linear model with RANSAC algorithm + model_ransac = linear_model.RANSACRegressor(linear_model.LinearRegression()) + model_ransac.fit(hit.wire, hit.tick) + inlier_mask = model_ransac.inlier_mask_ + outlier_mask = np.logical_not(inlier_mask) + + X, y, coef = datasets.make_regression(n_samples=1000, n_features=1, + n_informative=1, noise=10, + coef=True, random_state=0) + print X,y + + plt.scatter(X[inlier_mask], y[inlier_mask], color='yellowgreen', marker='.', + label='Inliers') + plt.scatter(X[outlier_mask], y[outlier_mask], color='gold', marker='.', + label='Outliers') + + + plt.xlim([0, 3500]) + plt.ylim([2000, 10000]) + plt.show() \ No newline at end of file diff --git a/python/cluster_hits.py b/python/cluster_hits.py new file mode 100644 index 0000000..014eed7 --- /dev/null +++ b/python/cluster_hits.py @@ -0,0 +1,42 @@ + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + + + +import numpy as np +import matplotlib.pyplot as plt +import seaborn as sns + +def my_metric(x, y): + return np.sqrt(np.sum((1.1*x-y)**2)) + +import hdbscan +plot_kwds = {'alpha' : 0.5, 's' : 80, 'linewidths':0} + +filename = "~/data/uboone/laser/7205/hits/90deg/LaserHit-7205-0790.root" +data = LarData(filename) +meta = MetaData() +#data.get_info() +for i in range(50): + data.read_hits(planes="y") + hit = data.get_hits(i) + + test_data = np.transpose([hit.wire[:], hit.tick[:]]) + + + clusterer = hdbscan.HDBSCAN(min_cluster_size=100, gen_min_span_tree=True,alpha=1.) + clusterer.fit_predict(test_data) + print clusterer.outlier_scores_ + palette = sns.color_palette(n_colors=max(clusterer.labels_)+1) + + cluster_colors = [sns.desaturate(palette[col], sat) + if col >= 0 and sat>0.8 else (0.5, 0.5, 0.5) for col, sat, out in + zip(clusterer.labels_, clusterer.probabilities_, clusterer.outlier_scores_)] + + + plt.scatter(test_data.T[0], test_data.T[1], c=cluster_colors, **plot_kwds) + plt.xlim([0, 3500]) + plt.ylim([2000, 10000]) + plt.show() \ No newline at end of file diff --git a/python/collect_hits.py b/python/collect_hits.py new file mode 100755 index 0000000..905aeac --- /dev/null +++ b/python/collect_hits.py @@ -0,0 +1,42 @@ +#!/usr/bin/python + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + +import hdbscan + +import argparse + + +parser = argparse.ArgumentParser(description='Little script to plot y-plane reconstructed laser hits.') +parser.add_argument('files',nargs='+', type=str, help='path to data file') +parser.add_argument('-e', nargs='+', type=int, + dest='events', required=False, help='particular event number to be shown, relative in file') +args = parser.parse_args() + +for file in args.files: + + data = LarData(file) + meta = MetaData() + #data.get_info() + + data.read_hits(planes="y") + + hit = [] + if args.events is None: + + fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20, 5)) + + for i in range(0, data.n_entries): + + hit = data.get_hits(i) + ax.errorbar(hit.wire, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') + + plt.xlabel("Wire Number") + plt.ylabel("Time Tick") + + plt.xlim([0, 3500]) + plt.ylim([2000, 10000]) + + plt.show() \ No newline at end of file From e87faa26b4869d1e806ee25bc8f9dbc7428dac8b Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:37:10 +0100 Subject: [PATCH 05/13] everzthing changed here. You should commit more often here! --- python/datadefs/base.py | 2 +- python/datadefs/lar_data.py | 42 +++++++++++++++++++-------- python/datadefs/laserdef.py | 5 ++-- python/datadefs/recobhits.py | 54 +++++++++++++++++++++++++++-------- python/datadefs/recobtrack.py | 24 ++++++++++++++++ 5 files changed, 100 insertions(+), 27 deletions(-) create mode 100644 python/datadefs/recobtrack.py diff --git a/python/datadefs/base.py b/python/datadefs/base.py index 71eae3b..facd24d 100644 --- a/python/datadefs/base.py +++ b/python/datadefs/base.py @@ -1,5 +1,5 @@ __author__ = 'matthias' - +import root_numpy as rn class Base(object): def __init__(self): diff --git a/python/datadefs/lar_data.py b/python/datadefs/lar_data.py index 368ec52..90d0910 100644 --- a/python/datadefs/lar_data.py +++ b/python/datadefs/lar_data.py @@ -2,6 +2,7 @@ from datadefs.laserdef import * from datadefs.recobhits import * +from datadefs.recobtrack import * from datadefs.metadata import * import numpy as np import root_numpy as rn @@ -16,9 +17,10 @@ def __init__(self, filename): self.laser = None self.hits = None + self.tracks = None self.n_entries = None - + self.planes = {"u": 0, "v": 1, "y": 2, "U": 0, "V": 1, "Y": 2, 0: 0, 1: 1, 2: 2 } self.read_ids() def read_ids(self): @@ -28,25 +30,33 @@ def read_ids(self): def read_laser(self): laserdefs = Laseref() tree = laserdefs.tree - branches = [laserdefs.pos(), laserdefs.dir(), laserdefs.power(), laserdefs.id()] + branches = [laserdefs.pos(), laserdefs.dir(), laserdefs.power(), laserdefs.id(), laserdefs.entry_point(), laserdefs.exit_point()] self.laser = self.read(tree, branches) def read_hits(self, planes=None): - if planes is None: - recodef = RecobHits(plane="Y") - else: - recodef = RecobHits(plane=planes) + recodef = RecobHits.with_branch(planes, self.find_product("recob::Hits")) hit_branches = [recodef.channel(), recodef.peak_time(), recodef.peak_amplitude(), recodef.start_tick(), - recodef.end_tick()] + recodef.end_tick(), recodef.wire(), recodef.plane()] self.hits = self.read(recodef.tree, hit_branches) + # hits.dtype.names = ["channel", "peak_tick", "peak_amp", "start_tick", "end_tick"] + + def read_track(self, id): + # unfortunately reading tracks is not very well supported by root numpy and therefore slow! + recodef = RecobTrack() + track_branches = [recodef.x(),recodef.y(), recodef.z()] + return self.read(recodef.tree, track_branches, start=id, stop=id+1) + # hits.dtype.names = ["channel", "peak_tick", "peak_amp", "start_tick", "end_tick"] - def read(self, tree, branches): + def read(self, tree, branches, start=None, stop=None): branch = [item for sublist in branches for item in sublist if isinstance(sublist, list)] \ + [item for item in branches if isinstance(item, str)] # handling lists and strings only - data = rn.root2array(self.file, treename=tree, branches=branch).view(np.recarray) + if start is None: + data = rn.root2array(self.file, treename=tree, branches=branch).view(np.recarray) + else: + data = rn.root2array(self.file, treename=tree, branches=branch, start=start, stop=stop).view(np.recarray) if self.n_entries is None: self.n_entries = len(data) @@ -58,16 +68,20 @@ def get_laser(self, event): raise ValueError("only integers allowed as event number") data = self.laser[event] - data.dtype.names= ("pos_x", "pos_y", "pos_z", "dir_x", "dir_y", "dir_z", "power", "id") + data.dtype.names= ("pos_x", "pos_y", "pos_z", + "dir_x", "dir_y", "dir_z", + "entry_x", "entry_y", "entry_z", + "exit_x", "exit_y", "exit_z", + "power", "id",) return data - def get_hits(self, event): + def get_hits(self, event, plane='y'): if type(event) is not int: raise ValueError("only integers allowed as event number") data = self.hits[event] - data.dtype.names = ("channel", "tick", "peak_amp", "start_tick", "end_tick") + data.dtype.names = ("channel", "tick", "peak_amp", "start_tick", "end_tick", "wire", "plane") return data @@ -82,6 +96,10 @@ def get_index(self, event): return int(idx[0]) + def find_product(self, product, tree="Events"): + branches = rn.list_branches(self.file, treename=tree) + return [branch for branch in branches if str.lower(product) in str.lower(branch)] + def get_info(self): trees = rn.list_trees(self.file) for tree in trees: diff --git a/python/datadefs/laserdef.py b/python/datadefs/laserdef.py index 7e91a3d..3675bcd 100644 --- a/python/datadefs/laserdef.py +++ b/python/datadefs/laserdef.py @@ -13,6 +13,7 @@ def __init__(self): self.producer = "RecoDataMinimal" self.producer = "LaserHitAna" + #self.branch = "lasercal::LaserBeam_LaserMerger_LaserBeam_" + self.producer + ".obj." self.branch = "lasercal::LaserBeam_LaserDataMerger_LaserBeam_" + self.producer + ".obj." self.XYZ = ["X", "Y", "Z"] @@ -23,10 +24,10 @@ def dir(self): return self.gen_string("fDirection.f", self.XYZ) def entry_point(self): - return self.gen_string("fEntryPoint", self.XYZ) + return self.gen_string("fEntryPoint.f", self.XYZ) def exit_point(self): - return self.gen_string("fExitPoint", self.XYZ) + return self.gen_string("fExitPoint.f", self.XYZ) def power(self): return self.gen_string("fPower") diff --git a/python/datadefs/recobhits.py b/python/datadefs/recobhits.py index d5a4d26..79052ae 100644 --- a/python/datadefs/recobhits.py +++ b/python/datadefs/recobhits.py @@ -5,22 +5,46 @@ class RecobHits(Base): - def __init__(self, plane): + def __init__(self, plane, branch=None): """ plane: Either U,V,Y for the different views """ super(RecobHits, self).__init__() - self.data_product = "recob::Hit" self.tree = "Events" - if plane not in ["U", "V", "Y", "u", "v", "y"]: - raise ValueError("Only U, V or Y allowed as planes") - self.plane = plane - print "Plane: " + plane - self.producer = "LaserHitReco" # from grid jobs - self.producer = "LaserHitAna" + # try to figure out the branch name manually + if branch is None: + self.data_product = "recob::Hits" + + if plane not in ["U", "V", "Y", "u", "v", "y"]: + raise ValueError("Only U, V or Y allowed as planes") + self.plane = plane + print "Plane: " + plane + + self.producer = "LaserHitAna" # from grid jobs + #self.producer = "LaserHitAna" + + self.branch = self.data_product + "_" + self.producer + + self.branch = "recob::Hits_LaserReco_" \ + + str.capitalize(self.plane) \ + + "PlaneLaserHits_" + self.producer + ".obj." + else: + if plane is not None and len(branch) > 1: + # select the branch based on the plane label supplied + branch = next(br for br in branch if str.lower(plane) in str.lower(br)) + print branch + self.branch = branch + "obj." + else: + print branch + self.branch = branch[0] + "obj." + + print branch + + + + @classmethod + def with_branch(cls, plane, branchname): + return cls(plane, branch=branchname) - self.branch = "recob::Hits_LaserReco_" \ - + str.capitalize(self.plane) \ - + "PlaneLaserHits_" + self.producer + ".obj." def channel(self): return self.gen_string("fChannel") @@ -35,4 +59,10 @@ def start_tick(self): return self.gen_string("fStartTick") def end_tick(self): - return self.gen_string("fEndTick") \ No newline at end of file + return self.gen_string("fEndTick") + + def wire(self): + return self.gen_string("fWireID.Wire") + + def plane(self): + return self.gen_string("fWireID.Plane") \ No newline at end of file diff --git a/python/datadefs/recobtrack.py b/python/datadefs/recobtrack.py new file mode 100644 index 0000000..5fcf8c8 --- /dev/null +++ b/python/datadefs/recobtrack.py @@ -0,0 +1,24 @@ +__author__ = 'matthias' + +from base import Base + + +class RecobTrack(Base): + + def __init__(self, branch=None): + """ plane: Either U,V,Y for the different views """ + super(RecobTrack, self).__init__() + self.tree = "Events" + self.data_product = "recob::Track" + + self.branch = "recob::Tracks_pandoraCosmic__Laser." + + + def x(self): + return self.gen_string("fTraj.fPositions.x()") + + def y(self): + return self.gen_string("fTraj.fPositions.y()") + + def z(self): + return self.gen_string("fTraj.fPositions.z()") From 9bfb341164c84a6b7371ea76b1c0c789f94109ed Mon Sep 17 00:00:00 2001 From: Matthias Luethi Date: Wed, 8 Feb 2017 01:38:34 +0100 Subject: [PATCH 06/13] these values should become parameters. --- python/TrackProducer/LaserTrackProducer.py | 57 +++++++++++++-------- python/TrackProducer/SingleTrackProducer.py | 1 + 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/python/TrackProducer/LaserTrackProducer.py b/python/TrackProducer/LaserTrackProducer.py index edc4161..d534364 100644 --- a/python/TrackProducer/LaserTrackProducer.py +++ b/python/TrackProducer/LaserTrackProducer.py @@ -1,7 +1,8 @@ from SingleTrackProducer import ProduceSingleTrack import numpy as np -import pylab as pl +import matplotlib.pyplot as plt from matplotlib import collections as mc +import matplotlib as mpl from LaserData import Laser from root_numpy import array2root @@ -9,7 +10,7 @@ # laser positions in z-x plane in cm laser_positions = np.array([[103., -20.], [103., 1056.8]]) -laserid = 1 +laserid = 2 laser_pos = laser_positions[laserid-1] @@ -29,13 +30,22 @@ def cm_to_wire(pos): return int(pos / wire_pitch) # track definitions: -track_len = 100 +track_len = 1036 + + +# horizontal steps (azimuthal angle) +steps = 2.5 # deg +start = -5 +stop = 5 +hor_steps = np.linspace(start, stop, (stop - start)/steps + 1) -steps = 0.1 # deg -start = -1 -stop = 1 start_z = cm_to_wire(tpc[laserid-1][1]) end_z = cm_to_wire(abs(tpc[laserid-1][1] - track_len)) + +# vertical steps (polar angle) +start = 90 +step = 0.00001 +ver_step = np.linspace(start, start + step*len(hor_steps), len(hor_steps)) edges = [] @@ -44,41 +54,46 @@ def cm_to_wire(pos): laser = Laser(laserid) -for step in np.linspace(start, stop, (stop - start)/steps + 1 ): +for idx, step in enumerate(hor_steps): # hit definition production laser_offset = abs(tpc[laserid - 1][1] - laser_pos[1]) - offset = np.tan( np.deg2rad(step) ) * laser_offset - print offset + laser_pos[0], cm_to_tick(offset + laser_pos[0]) + offset = np.tan( -np.deg2rad(step) ) * laser_offset start_x = cm_to_tick(offset + laser_pos[0]) end_x = cm_to_tick(offset / laser_offset * (laser_offset + track_len) + laser_pos[0]) - print [(start_z, start_x), (end_z, end_x)] - edges.append([(start_z, start_x), (end_z, end_x)]) # laser r_un definition - laser_data.append([laserid, laser.theta_to_deg(step), laser.phi_to_lin(90), 0, 0, 0]) + laser_data.append([laserid, laser.theta_to_deg(step), laser.phi_to_lin(ver_step[idx]), 0, 0, 0]) map = np.arange(0, len(edges)) - -run_number = 8888 +run_number = 10003 arr = np.array(map, dtype=[("map", np.uint32)]) array2root(arr, "TimeMap-" + str(run_number) + ".root", mode='recreate') laser_data = np.array(laser_data) laser.write("Run-" + str(run_number) + ".txt", laser_data) - -lc = mc.LineCollection(edges, linewidths=2) -fig, ax = pl.subplots() -ax.add_collection(lc) -ax.autoscale() -ax.margins(0.1) -pl.show() +col = mpl.colors.Colormap(len(laser_data[:,1])) +lc = mc.LineCollection(edges, array=map, linewidths=2) + +fig = plt.figure(figsize=plt.figaspect(.5)) +ax1 = fig.add_subplot(1,2,1) +ax1.add_collection(lc) +ax1.autoscale() +ax1.margins(0.1) +plt.xlim([0, cm_to_wire(tpc[1][1])]) +plt.ylim([cm_to_tick(tpc[0][0]), cm_to_tick(tpc[1][0])]) + +ax2 = fig.add_subplot(1,2,2, projection="polar") +ax2.scatter(np.deg2rad(laser.deg_to_theta(laser_data[:,1])), np.ones(laser_data[:,1].shape), c=map, s=50) +ax2.scatter(np.deg2rad(laser.lin_to_phi(laser_data[:,2])), 0.8*np.ones(laser_data[:,2].shape), c=map,s=50, marker='*') +plt.ylim([0,1.1]) +plt.show() planes = len(edges) * [2] hit_defs = len(edges) * [[4, 25, 1]] diff --git a/python/TrackProducer/SingleTrackProducer.py b/python/TrackProducer/SingleTrackProducer.py index 3ab8649..de9a632 100644 --- a/python/TrackProducer/SingleTrackProducer.py +++ b/python/TrackProducer/SingleTrackProducer.py @@ -25,6 +25,7 @@ def Track(Plane, StartPosition, EndPosition, RawHitDef): # handle inverted case if EndWire < StartWire: EndWire, StartWire = StartWire, EndWire + EndTick, StartTick = StartTick, EndTick wire_range = abs(EndWire - StartWire) From 6a88524b8ecc4c3913abfd4649914bf6d23e45c4 Mon Sep 17 00:00:00 2001 From: Matthias Luethi Date: Wed, 8 Feb 2017 01:40:06 +0100 Subject: [PATCH 07/13] some trivial changes --- python/Merger.py | 18 +++++++++++------- python/MergerIO.py | 4 ++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/python/Merger.py b/python/Merger.py index 82ebb97..1b93484 100644 --- a/python/Merger.py +++ b/python/Merger.py @@ -40,6 +40,8 @@ def __init__(self, run_number): self.NLaser = len(self.LaserArray[1, :]) self.NEvent = len(self.EventArray[1, :]) + self.LastEvent = self.EventArray[0, -1] + self.NMin = np.min([self.NLaser, self.NEvent]) self.NMax = np.max([self.NLaser, self.NEvent]) @@ -58,7 +60,7 @@ def __init__(self, run_number): self.offsets = [] # define the mapping of the laser array to the event array - self.map = -1 * np.zeros((self.NEvent, 1)).astype(int) + self.map = -1 * np.zeros((int(self.LastEvent) + 1, 1)).astype(int) self.preprocess() @@ -103,14 +105,14 @@ def align(self): for idx in range(self.NEvent): # loop over entries in event time array - search_size = 100 + search_size = 200 for idy in range(search_size): #print idx, idy, self.EventArray[1, idx], self.LaserArray[1, idx + idy] #self.log.debug("Event Time: " + str(self.EventArray[1, idx])) #self.log.debug("Laser Time: " + str(self.LaserArray[1, idx + idy])) if self.check_time(self.EventArray[1, idx], self.LaserArray[1, idx + idy]): - self.map[idx] = idx + idy + self.map[int(self.EventArray[0, idx])] = self.LaserArray[0, idx + idy] if idy > self.idx_offset: self.idx_offset += 1 @@ -134,7 +136,7 @@ def align(self): self.log.info("Found " + str(self.idx_offset) + " jumps, they are at:") self.log.info(str(self.offsets)) - self.delta = self.EventArray[1, :] - np.transpose(self.LaserArray[1, self.map]).flatten() + self.delta = self.map def write(self): self.io.write_map(self.map) @@ -155,12 +157,13 @@ def plot(self): plt.grid() plt.show() - if False: + if True: fig2, ax2 = plt.subplots() - plt.plot(self.LaserArray[0, :], self.LaserArray[1, :] + self.LaserStartTime, "r-*") - plt.plot(self.EventArray[0, :], self.EventArray[1, :] + self.EventStartTime, "b*-") + plt.plot(self.LaserArray[0, :], self.LaserArray[1, :] + self.LaserStartTime, "r-*", label="Laser Data") + plt.plot(self.EventArray[0, :], self.EventArray[1, :] + self.EventStartTime, "b*-", label="TPC Data") plt.xlabel("Event ID") plt.ylabel("Time [s]") + plt.legend() plt.show() # plot time deltas of laser vs daq triggers @@ -179,6 +182,7 @@ def plot(self): merger = Merger(int(sys.argv[1])) merger.log.level == logging.ERROR merger.align() + print merger.map[39501] merger.plot() merger.write() diff --git a/python/MergerIO.py b/python/MergerIO.py index 3ab27df..f471ea4 100644 --- a/python/MergerIO.py +++ b/python/MergerIO.py @@ -52,3 +52,7 @@ def write_map(self, array): self.log.info("writing map to " + self.OutFile) arr = np.array(array, dtype=[("map", np.uint32)]) array2root(arr, self.OutFile, mode='recreate') + + def write_map_to_file(self, array): + pass + From 901bfa5610b181845337d56211360c3e1f35ca4b Mon Sep 17 00:00:00 2001 From: Matthias Luethi Date: Wed, 8 Feb 2017 01:40:52 +0100 Subject: [PATCH 08/13] restarted, so this stuff works. --- python/count_hits.py | 43 +++++++++++++++++++++++++++++++++ python/plot_hits.py | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100755 python/count_hits.py create mode 100755 python/plot_hits.py diff --git a/python/count_hits.py b/python/count_hits.py new file mode 100755 index 0000000..865a19f --- /dev/null +++ b/python/count_hits.py @@ -0,0 +1,43 @@ +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + +from matplotlib import cm + +import argparse + +parser = argparse.ArgumentParser(description='Little script to plot y-plane reconstructed laser hits.') +parser.add_argument('files',nargs='+', type=str, help='path to data file') + +args = parser.parse_args() + +hit_count = [] +id = [] +dir_x = [] +dir_y = [] + +for file in args.files: + + data = LarData(file) + meta = MetaData() + + data.read_hits(planes="y") + data.read_ids() + data.get_info() + data.read_laser() + + for i in range(0, data.n_entries): + + hits = data.get_hits(i) + hit_count.append(len(hits.wire)) + laser = data.get_laser(i) + dir_x.append(laser.dir_x) + dir_y.append(laser.dir_y) + + +color = ["%.3f" % (abs(item*10)) for item in dir_y] +fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,5)) +ax.scatter(dir_x, hit_count, c=color) +plt.xlabel("Direction", fontsize=20) +plt.ylabel("#Hits", fontsize=20) +plt.show() \ No newline at end of file diff --git a/python/plot_hits.py b/python/plot_hits.py new file mode 100755 index 0000000..450d28d --- /dev/null +++ b/python/plot_hits.py @@ -0,0 +1,57 @@ +#!/usr/bin/python + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + +import argparse + +def view(data, eventid): + + laser_tick_mean = 5400 + laser_tick_offset = 1200 + + hit = data.get_hits(eventid) + #if hit[1].size == 0: + # return + + fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,5)) + + ax.errorbar(hit.wire, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') + plt.xlabel("Wire Number") + plt.ylabel("Time Tick") + + #plt.xlim([0,3500]) + #plt.ylim([2000,10000]) + + plt.title("Event " + str(eventid)) + plt.show() + + +parser = argparse.ArgumentParser(description='Little script to plot y-plane reconstructed laser hits.') +parser.add_argument('files',nargs='+', type=str, help='path to data file') +parser.add_argument('-e', nargs='+', type=int, + dest='events', required=False, help='particular event number to be shown, relative in file') +args = parser.parse_args() + + +for file in args.files: + + data = LarData(file) + meta = MetaData() + + data.get_info() + data.read_ids() + data.read_hits(planes="y") + + + + if args.events is None: + for i in range(0, data.n_entries): + view(data, i) + print "Event " + str(data.ids[i]) + else: + for event in args.events: + + view(data, event) + From 081e874c899e2bc201c377289bd4f9c7b5234c79 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:41:41 +0100 Subject: [PATCH 09/13] don't know if this is good. --- python/LaserData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/LaserData.py b/python/LaserData.py index 5f5e73b..f0852b0 100644 --- a/python/LaserData.py +++ b/python/LaserData.py @@ -44,7 +44,7 @@ def deg_to_theta(self, rotary_meas): def theta_to_deg(self, rotary_meas): # returns rotary angle - return rotary_meas - self.rot_offset[self.laser_id - 1] + return (rotary_meas - self.rot_offset[self.laser_id - 1]) def assemble_time(self, sec, usec): return sec + usec / 1000000 From 409f1e1661725cbe072585e33c396773918ae7b8 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:42:49 +0100 Subject: [PATCH 10/13] this is the strange stuff. --- python/PrintInfo.py | 2 +- python/ReadLaser.py | 4 +- python/plotHits.py | 94 ++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 88 insertions(+), 12 deletions(-) diff --git a/python/PrintInfo.py b/python/PrintInfo.py index 8eb7e1a..659c9e1 100644 --- a/python/PrintInfo.py +++ b/python/PrintInfo.py @@ -1,7 +1,7 @@ from datadefs.lar_data import * import matplotlib.pyplot as plt -filename = "/mnt/lheppc46/data/larsoft/userdev/maluethi/laser_v05_08_00/prod/3165/LaserHitAna-3165.root" +filename = "/home/matthias/workspace/laser/runs/test_reco/test.root" data = LarData(filename) data.read_laser() diff --git a/python/ReadLaser.py b/python/ReadLaser.py index e316ee9..b4122d3 100755 --- a/python/ReadLaser.py +++ b/python/ReadLaser.py @@ -17,12 +17,12 @@ laser = Laser() LaserFile = args.filepath -colums = [laser.rot] +colums = [laser.col_rotary] rotary_deg = np.loadtxt(fname=LaserFile, usecols=colums) -test = laser.deg_to_theta(rotary_deg, 1) +test = laser.deg_to_theta(rotary_deg) if args.entries: for entry in args.entries: diff --git a/python/plotHits.py b/python/plotHits.py index a9423c8..788a382 100644 --- a/python/plotHits.py +++ b/python/plotHits.py @@ -24,24 +24,100 @@ def view(data, eventid): laser_tick_limits = [laser_tick_mean - laser_tick_offset, laser_tick_mean + laser_tick_offset] hit = data.get_hits(eventid) + if hit[1].size == 0: + return - hit = crop_view(laser_tick_limits, hit) + #hit = crop_view(laser_tick_limits, hit) fig, ax = plt.subplots(nrows=1, ncols=1, sharex=True) - ax.errorbar(hit.channel, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') + ax.errorbar(hit.wire, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') plt.xlabel("Wire Number") plt.ylabel("Time Tick") + + plt.xlim([0,3500]) + plt.ylim([3000,10000]) + + plt.title("Event " + str(eventid)) + plt.show() + +def make_histo(data, shape, bin_size): + start_x, end_x = shape[0] + bin_size_x = bin_size[0] + start_y, end_y = shape[1] + bin_size_y = bin_size[1] + + wire = np.arange(start_x, end_x, bin_size_x) + tick = np.arange(start_y, end_y, bin_size_y) + X, Y = np.meshgrid(wire, tick) + + print wire + print tick + + hist = np.zeros((len(tick)-1, len(wire)-1)) + + + for i in range(0, data.n_entries): + hits = data.get_hits(i) + + #H, xedges, yedges = np.histogram2d(hits.wire, hits.tick, (wire, tick)) + H, xedges, yedges = np.histogram2d(hits.tick, hits.wire, (tick, wire)) + hist = hist + H + + + fig = plt.figure() + + + plt.imshow(hist) plt.show() + + +# def plot_histo(): +# fig = plt.figure() +# extent = [xedges[-1], xedges[0], yedges[0], yedges[-1]] +# plt.imshow(H, extent=extent) +# +# +# plt.show() + + filename = "/home/matthias/data/uboone/laser/LaserHitAna-3007-020.root" filename = "/home/matthias/data/uboone/laser/3007/all.root" -data = LarData(filename) -meta = MetaData() +filename = "/home/matthias/workspace/laser/runs/test_reco/test.root" +filename = "/home/matthias/workspace/laser/runs/roi/LaserHit-7205-0_99.root" +filename = "/home/matthias/data/uboone/laser/7205/hits/nospot/LaserHit-7205-0786.root"#filename = "/home/matthias/workspace/laser/runs/roi/LaserHit-10003-0000.root" + + + + + +start = 790 +end = 825 +basename = "/home/matthias/data/uboone/laser/7205/hits/nospot/LaserHit-7205-0" +for file_number in range(start, end): + print file_number + filename = basename + str(file_number) + ".root" + try: + data = LarData(filename) + except: + print "file does not exist" + continue + + + meta = MetaData() + #data.get_info() + + data.read_hits(planes="y") + data.read_laser() + + #make_histo(data, ((2500, 3500), (3000, 8000)), (1, 1)) + for i in range(0, data.n_entries): + laser = data.get_laser(i) + print laser.pos_x, laser.pos_y, laser.pos_z + print laser.entry_x, laser.entry_y, laser.entry_z -data.read_hits(planes="y") -print data.read(meta.tree, meta.id()) + print laser.dir_x, laser.dir_y, laser.dir_z + print laser.id, laser.power -#idx = data.get_index(1169) -for i in range(150, data.n_entries): - view(data, i) \ No newline at end of file + view(data, i) \ No newline at end of file From be4353e83a29a0fcfcef979746592bc47da03c34 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 01:43:09 +0100 Subject: [PATCH 11/13] this is really slow! --- python/plot_tracks.py | 74 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 python/plot_tracks.py diff --git a/python/plot_tracks.py b/python/plot_tracks.py new file mode 100644 index 0000000..b2b4631 --- /dev/null +++ b/python/plot_tracks.py @@ -0,0 +1,74 @@ +#!/usr/bin/python + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + +import argparse + +def view(data, eventid): + + laser_tick_mean = 5400 + laser_tick_offset = 1200 + + hit = data.get_hits(eventid) + #if hit[1].size == 0: + # return + + fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,5)) + + ax.errorbar(hit.wire, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') + plt.xlabel("Wire Number") + plt.ylabel("Time Tick") + + #plt.xlim([0,3500]) + #plt.ylim([2000,10000]) + + plt.title("Event " + str(eventid)) + plt.show() + +#!/usr/bin/python + +from datadefs.lar_data import * +import matplotlib.pyplot as plt +from datadefs.metadata import * + +import argparse + +def view(data, eventid): + + laser_tick_mean = 5400 + laser_tick_offset = 1200 + + hit = data.get_hits(eventid) + #if hit[1].size == 0: + # return + + fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,5)) + + ax.errorbar(hit.wire, hit.tick, yerr=[hit.tick - hit.start_tick, hit.end_tick - hit.tick], fmt='o') + plt.xlabel("Wire Number") + plt.ylabel("Time Tick") + + #plt.xlim([0,3500]) + #plt.ylim([2000,10000]) + + plt.title("Event " + str(eventid)) + plt.show() + + +parser = argparse.ArgumentParser(description='Little script to plot reconstructed tracks') +parser.add_argument('files',nargs='+', type=str, help='path to data file') +parser.add_argument('-e', nargs='+', type=int, + dest='events', required=False, help='particular event number to be shown, relative in file') +args = parser.parse_args() + +for file in args.files: + + data = LarData(file) + meta = MetaData() + + print data.read_track(0) + exit(0) + + From c41631aad1203a7441d5a5639f6e2db93bc34d99 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 8 Feb 2017 19:23:26 +0100 Subject: [PATCH 12/13] this code was used to produce the first version of the distortion map. --- python/utils/plot_distortion.py | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 python/utils/plot_distortion.py diff --git a/python/utils/plot_distortion.py b/python/utils/plot_distortion.py new file mode 100644 index 0000000..ed8e4e5 --- /dev/null +++ b/python/utils/plot_distortion.py @@ -0,0 +1,71 @@ +import numpy as np +import matplotlib.pyplot as plt +from scipy.interpolate import griddata, interp2d + +tpc = [[0, 0], [256, 1036]] # cm (x, z) + +def get_line(point1, point2): + point2 = [1056.8, 103.] + m = (point2[1] - point1[1]) / (point2[0] - point1[0]) + b = point1[1] - m * point1[0] + return m, b + +def calc_residual(track): + # these are uboone coordinates! + x, y, z = track[1], track[2], track[3] + middle_point = int(len(z)/2) - 150 + m, b = get_line([z[middle_point], x[middle_point]], [z[-1],x[-1]]) + + #plot_line(m, b, z[0], z[-1]) + #plot_track(track) + + r = np.abs(m*z + b - x) + #plot_residuals(z, x, r) + #plt.show() + + return np.array([z, x, r]) + +def plot_track(track): + x, y, z = track[1], track[2], track[3] + plt.scatter(z, x) + +def plot_line(m, b, start_z=0, stop_z=1036): + x = np.linspace(0, 1056.8, 100) + plt.plot(x, m*x + b) + +def plot_residuals(z, x, residuals): + plt.scatter(z, x, c=residuals*10) + +filename = "laser_tracks.npy" +tracks = np.load(filename) +residuals = np.array([[0],[0],[0]]) + +for track in tracks: + res = calc_residual(track) + residuals = np.append(residuals, res, axis=1) + +residuals = np.delete(residuals, 0, 1) + +z = residuals[0] +x = residuals[1] +res = residuals[2] +grid_z, grid_x = np.mgrid[0:1057:8,0:257:8 ] + + +grid_z2 = griddata((z, x), res, (grid_z, grid_x), method='nearest') +#print grid_z2.T +print np.max(grid_z2) + +v = np.linspace(0, 40, 9) +CS = plt.contourf(grid_z, grid_x, grid_z2, v, cmap=plt.viridis()) + + +plt.colorbar(CS, label="Distrortion [cm]") + +plt.scatter(z, x, alpha=.01, s=2) + +plt.xlim([0,1036]) +plt.ylim([0,250]) +plt.xlabel("z [cm]") +plt.ylabel("x (drift) [cm]") +plt.show() \ No newline at end of file From ce8309b201a8e480b116dacf2ba936dc3a69b97f Mon Sep 17 00:00:00 2001 From: "Usher, Tracy L" Date: Tue, 14 Mar 2017 09:52:33 -0400 Subject: [PATCH 13/13] updates to build with larsoft v06_26_02 --- CMakeLists.txt | 8 +- HitAna/CMakeLists.txt | 14 +- HitAna/HitAna_module.cc | 19 +- LaserCalibration/LaserCalibration_module.cc | 16 +- LaserDataMerger/CMakeLists.txt | 14 +- LaserDataMerger/LaserDataMerger_module.cc | 79 +++--- LaserDataMerger/TimeMapProducer.fcl | 0 LaserDataMerger/TimeMapProducer_module.cc | 10 +- LaserDataMerger/WireInfo_module.cc | 11 +- LaserObjects/CMakeLists.txt | 21 +- LaserObjects/Laser.cxx | 0 LaserObjects/Laser.h | 0 LaserObjects/LaserBeam.cxx | 64 ++++- LaserObjects/LaserBeam.h | 56 ++-- LaserObjects/LaserHits.cxx | 48 +++- LaserObjects/LaserHits.h | 27 +- LaserObjects/LaserParameters.h | 4 +- LaserObjects/LaserROI.cxx | 283 ++++++++++---------- LaserObjects/LaserROI.h | 12 +- LaserObjects/LaserTrack.cxx | 0 LaserObjects/LaserTrack.h | 0 LaserObjects/LaserUtils.cxx | 26 +- LaserObjects/LaserUtils.h | 18 +- LaserObjects/classes.h | 11 +- LaserObjects/classes_def.xml | 15 +- LaserObjects/classes_def.xml~ | 3 - LaserReco/CMakeLists.txt | 14 +- LaserReco/LaserReco_module.cc | 178 ++++-------- LaserReco/LaserSpotter_module.cc | 81 ++++-- LaserReco/LaserWireMap.fcl | 82 ++++++ LaserReco/LaserWireMap_module.cc | 150 +++++++++++ LaserReco/README.txt | 26 -- LaserReco/laserreco.fcl | 8 +- LaserReco/laserspotter.fcl | 15 +- LaserReco/setkdev.sh | 49 ---- PowerAna/CMakeLists.txt | 14 +- PowerAna/PowerAna_module.cc | 20 +- SECAna/CMakeLists.txt | 16 +- SECAna/SECAna_module.cc | 31 ++- test/CMakeLists.txt | 218 +++++++++------ test/LaserBeamTest_module.cc | 108 ++++++++ test/LaserMergerTest_module.cc | 49 +++- test/LaserRawDigitGenerator_module.cc | 37 +-- test/LaserSpotterGenTest_module.cc | 9 +- test/LaserSpotterTest_module.cc | 8 +- ups/product_deps | 14 +- 46 files changed, 1177 insertions(+), 709 deletions(-) mode change 100644 => 100755 CMakeLists.txt mode change 100644 => 100755 HitAna/CMakeLists.txt mode change 100644 => 100755 HitAna/HitAna_module.cc mode change 100644 => 100755 LaserCalibration/LaserCalibration_module.cc mode change 100644 => 100755 LaserDataMerger/CMakeLists.txt mode change 100644 => 100755 LaserDataMerger/LaserDataMerger_module.cc mode change 100644 => 100755 LaserDataMerger/TimeMapProducer.fcl mode change 100644 => 100755 LaserDataMerger/TimeMapProducer_module.cc mode change 100644 => 100755 LaserDataMerger/WireInfo_module.cc mode change 100644 => 100755 LaserObjects/CMakeLists.txt mode change 100644 => 100755 LaserObjects/Laser.cxx mode change 100644 => 100755 LaserObjects/Laser.h mode change 100644 => 100755 LaserObjects/LaserBeam.cxx mode change 100644 => 100755 LaserObjects/LaserBeam.h mode change 100644 => 100755 LaserObjects/LaserHits.cxx mode change 100644 => 100755 LaserObjects/LaserHits.h mode change 100644 => 100755 LaserObjects/LaserParameters.h mode change 100644 => 100755 LaserObjects/LaserROI.cxx mode change 100644 => 100755 LaserObjects/LaserROI.h mode change 100644 => 100755 LaserObjects/LaserTrack.cxx mode change 100644 => 100755 LaserObjects/LaserTrack.h mode change 100644 => 100755 LaserObjects/LaserUtils.cxx mode change 100644 => 100755 LaserObjects/LaserUtils.h mode change 100644 => 100755 LaserObjects/classes.h mode change 100644 => 100755 LaserObjects/classes_def.xml delete mode 100644 LaserObjects/classes_def.xml~ mode change 100644 => 100755 LaserReco/CMakeLists.txt mode change 100644 => 100755 LaserReco/LaserReco_module.cc mode change 100644 => 100755 LaserReco/LaserSpotter_module.cc create mode 100755 LaserReco/LaserWireMap.fcl create mode 100755 LaserReco/LaserWireMap_module.cc delete mode 100644 LaserReco/README.txt mode change 100644 => 100755 LaserReco/laserreco.fcl mode change 100644 => 100755 LaserReco/laserspotter.fcl delete mode 100644 LaserReco/setkdev.sh mode change 100644 => 100755 PowerAna/CMakeLists.txt mode change 100644 => 100755 PowerAna/PowerAna_module.cc mode change 100644 => 100755 SECAna/CMakeLists.txt mode change 100644 => 100755 SECAna/SECAna_module.cc mode change 100644 => 100755 test/CMakeLists.txt create mode 100755 test/LaserBeamTest_module.cc mode change 100644 => 100755 test/LaserMergerTest_module.cc mode change 100644 => 100755 test/LaserRawDigitGenerator_module.cc mode change 100644 => 100755 test/LaserSpotterGenTest_module.cc mode change 100644 => 100755 test/LaserSpotterTest_module.cc mode change 100644 => 100755 ups/product_deps diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 2765477..7aec68c --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ IF (NOT CETBUILDTOOLS_VERSION) MESSAGE (FATAL_ERROR "ERROR: setup cetbuildtools to get the cmake modules") ENDIF() -set(CMAKE_MODULE_PATH $ENV{ART_DIR}/Modules +set(CMAKE_MODULE_PATH $ENV{CANVAS_DIR}/Modules $ENV{CETBUILDTOOLS_DIR}/Modules ${CMAKE_MODULE_PATH}) @@ -36,6 +36,7 @@ cet_set_compiler_flags(DIAGS CAUTIOUS NO_UNDEFINED ALLOW_DEPRECATIONS EXTRA_FLAGS -pedantic -Wno-unused-local-typedefs + -std=c++14 ) cet_report_compiler_flags() @@ -63,11 +64,10 @@ add_subdirectory(HitAna) add_subdirectory(PowerAna) add_subdirectory(fcl) #add_subdirectory(ApplyField) -add_subdirectory(SECAna) +#add_subdirectory(SECAna) # tests -add_subdirectory(test) - +#add_subdirectory(test) # ups - table and config files add_subdirectory(ups) diff --git a/HitAna/CMakeLists.txt b/HitAna/CMakeLists.txt old mode 100644 new mode 100755 index 95475b2..1f104c5 --- a/HitAna/CMakeLists.txt +++ b/HitAna/CMakeLists.txt @@ -3,18 +3,18 @@ simple_plugin(HitAna "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} diff --git a/HitAna/HitAna_module.cc b/HitAna/HitAna_module.cc old mode 100644 new mode 100755 index 3af609a..591b342 --- a/HitAna/HitAna_module.cc +++ b/HitAna/HitAna_module.cc @@ -4,19 +4,18 @@ // LArSoft includes // #include "Simulation/SimChannel.h" // #include "Simulation/LArG4Parameters.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" -#include "lardata/RecoBaseArt/HitCreator.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Cluster.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" +#include "lardata/ArtDataHelper/WireCreator.h" +#include "lardata/ArtDataHelper/HitCreator.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" // #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Principal/Event.h" @@ -24,10 +23,8 @@ #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" diff --git a/LaserCalibration/LaserCalibration_module.cc b/LaserCalibration/LaserCalibration_module.cc old mode 100644 new mode 100755 index 4d1df79..86e6854 --- a/LaserCalibration/LaserCalibration_module.cc +++ b/LaserCalibration/LaserCalibration_module.cc @@ -30,8 +30,8 @@ #include "Simulation/LArG4Parameters.h" #include "RawData/RawDigit.h" #include "RawData/raw.h" -#include "RecoBaseArt/WireCreator.h" -#include "RecoBaseArt/HitCreator.h" +#include "lardata/ArtDataHelper/WireCreator.h" +#include "lardata/ArtDataHelper/HitCreator.h" #include "RecoBase/Hit.h" #include "RecoBase/Cluster.h" #include "RecoBase/Wire.h" @@ -42,7 +42,7 @@ #include "SimpleTypesAndConstants/geo_types.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" // #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Principal/Event.h" @@ -58,10 +58,10 @@ // uBooNE includes #include "Utilities/AssociationUtil.h" // #include "uboone/Utilities/SignalShapingServiceMicroBooNE.h" -#include "CalibrationDBI/Interface/IDetPedestalService.h" -#include "CalibrationDBI/Interface/IDetPedestalProvider.h" -#include "CalibrationDBI/Interface/IChannelStatusService.h" -#include "CalibrationDBI/Interface/IChannelStatusProvider.h" +#include "CalibrationDBI/Interface/DetPedestalService.h" +#include "CalibrationDBI/Interface/DetPedestalProvider.h" +#include "CalibrationDBI/Interface/ChannelStatusService.h" +#include "CalibrationDBI/Interface/ChannelStatusProvider.h" // ROOT includes. Note: To look up the properties of the ROOT classes, // use the ROOT web site; e.g., @@ -429,7 +429,7 @@ namespace LaserCalibration { unsigned UWireNumber = 1026; unsigned VWireNumber = 196; - const lariov::IDetPedestalProvider& PedestalRetrievalAlg = art::ServiceHandle()->GetPedestalProvider(); + const lariov::DetPedestalProvider& PedestalRetrievalAlg = art::ServiceHandle()->GetPedestalProvider(); TH1F* SingleWire = new TH1F("You","Fuck",DigitVecHandle->at(UMap.at(UWireNumber)).Samples(),0,DigitVecHandle->at(UMap.at(UWireNumber)).Samples()-1); std::vector RawADC; diff --git a/LaserDataMerger/CMakeLists.txt b/LaserDataMerger/CMakeLists.txt old mode 100644 new mode 100755 index 9cf836a..504e333 --- a/LaserDataMerger/CMakeLists.txt +++ b/LaserDataMerger/CMakeLists.txt @@ -3,18 +3,18 @@ art_make( MODULE_LIBRARIES LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} diff --git a/LaserDataMerger/LaserDataMerger_module.cc b/LaserDataMerger/LaserDataMerger_module.cc old mode 100644 new mode 100755 index aeb6195..b5fd458 --- a/LaserDataMerger/LaserDataMerger_module.cc +++ b/LaserDataMerger/LaserDataMerger_module.cc @@ -26,15 +26,15 @@ // on LArSoft headers too -- if they can't be loaded by their own, it's a bug! // LArSoft includes -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Principal/Event.h" @@ -42,10 +42,8 @@ #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" @@ -99,13 +97,13 @@ class LaserDataMerger : public art::EDProducer // The analysis routine, called once per event. virtual void produce(art::Event& event) override; - float LinearRawToAngle(float Angles); + double LinearRawToAngle(double Angles); float AttenuatorTickToPercentage(float Tick); private: - bool DEBUG = false; + bool fDebug = false; // All this goes into the root tree TTree* fTimeAnalysis; @@ -114,7 +112,7 @@ class LaserDataMerger : public art::EDProducer unsigned int time_ms; std::map< Long64_t, unsigned int > timemap; ///< Key value: index of event, corresponding index in laser data file - std::vector< std::vector > laser_values; ///< line by line csv container + std::vector< std::vector > laser_values; ///< line by line csv container bool fReadTimeMap = false; bool fGenerateTimeInfo = false; @@ -220,17 +218,17 @@ void LaserDataMerger::beginRun(art::Run& run) tree->GetEntry(idx); timemap.insert(std::pair< Long64_t, unsigned int >(idx, map_root)); - if (DEBUG) - { - std::cout << "idx: " << idx << " mapped to: " << timemap.at(idx) << std::endl; - } + //if (fDebug) + //{ + // std::cout << "idx: " << idx << " mapped to: " << timemap.at(idx) << std::endl; + //} } delete InputFile; // read the laser data file into a vector std::string LaserFile = "Run-" + std::to_string(RunNumber) + ".txt"; - fstream file(LaserFile, std::ios::in); + std::fstream file(LaserFile, std::ios::in); if (file) { @@ -241,7 +239,7 @@ void LaserDataMerger::beginRun(art::Run& run) while (getline(file, line)) { Tokenizer info(line, sep); // tokenize the line of data - std::vector values; + std::vector values; for (Tokenizer::iterator it = info.begin(); it != info.end(); ++it) { @@ -252,13 +250,13 @@ void LaserDataMerger::beginRun(art::Run& run) // store array of values laser_values.push_back(values); - if (DEBUG) + if (fDebug) { for (unsigned int idx = 0; idx < 15; idx++) { - std::cout << laser_values.back().at(idx) << " "; + //std::cout << laser_values.back().at(idx) << " "; } - std::cout << std::endl; + //std::cout << std::endl; } } @@ -300,6 +298,7 @@ void LaserDataMerger::reconfigure(fhicl::ParameterSet const& parameterSet) PositionLCS1.SetXYZ(fPositionLCS1[0], fPositionLCS1[1], fPositionLCS1[2]); PositionLCS2.SetXYZ(fPositionLCS2[0], fPositionLCS2[1], fPositionLCS2[2]); + fDebug = parameterSet.get< bool >("Debug", false); //fLaserSystemFile = parameterSet.get< bool >("LaserSystemFile"); } @@ -314,7 +313,7 @@ void LaserDataMerger::produce(art::Event& event) time_s = (unsigned int) event.time().timeHigh(); time_ms = (unsigned int) event.time().timeLow(); - if (DEBUG) + if (fDebug) { std::cout << "Event ID: " << fEvent << std::endl; std::cout << "Event Time (low): " << time_s << std::endl; @@ -325,37 +324,48 @@ void LaserDataMerger::produce(art::Event& event) } else if (fReadTimeMap) { - int laser_id = timemap.at(fEvent); - if (DEBUG) std::cout << "Event idx: " << fEvent << " Laser idx: " << laser_id << std::endl; + uint laser_id = timemap.at(fEvent); + if (fDebug) std::cout << "Event idx: " << fEvent << " Laser idx: " << laser_id << std::endl; //auto LaserAA = std::make_unique; std::unique_ptr < lasercal::LaserBeam > LaserAA(new lasercal::LaserBeam()); // This is just for convinience, the TVector2 holds only the two angles - float Theta; - float Phi; - - float Theta_raw = laser_values.at(laser_id).at(DataStructure::LinearPosition); - float Phi_raw = laser_values.at(laser_id).at(DataStructure::RotaryPosition); - - + double Theta; + double Phi; + double Theta_raw = laser_values.at(laser_id).at(DataStructure::LinearPosition); + double Phi_raw = laser_values.at(laser_id).at(DataStructure::RotaryPosition); + TVector3 Position; TVector2 CalibratedAngles; if (LCS_ID == 1){ // The downstream laser system (sitting at z = -20) - Theta = TMath::DegToRad() * (90 - LinearRawToAngle(Theta_raw - fDirCalLCS1[1])); + Theta = TMath::DegToRad() * (90.0 - LinearRawToAngle(Theta_raw - fDirCalLCS1[1])); Phi = TMath::DegToRad() * Phi_raw - fDirCalLCS1[0]; Position = PositionLCS1; } else if (LCS_ID == 2) { // The upstream laser system (sitting at z = 1020) - Theta = TMath::DegToRad() * (90 - LinearRawToAngle(Theta_raw - fDirCalLCS2[1])); - Phi = TMath::DegToRad() * (Phi_raw - fDirCalLCS2[0]); + Theta = TMath::DegToRad() * (90.0 - LinearRawToAngle( Theta_raw - fDirCalLCS2[1])); + Phi = - TMath::DegToRad() * (Phi_raw - fDirCalLCS2[0]); Position = PositionLCS2; } else { std::cerr << "Laser System not recognized " << std::endl; } + + if (fDebug){ + time_s = (unsigned int) event.time().timeHigh(); + time_ms = (unsigned int) event.time().timeLow(); + + std::cout << "Positions from entry: " << laser_id << std::endl; + std::cout << "rot: (raw / calib): " << Theta_raw << " / " << Theta << std::endl; + std::cout << "lin: (raw / calib): " << Phi_raw << " / " << Phi << std::endl; + std::cout << "Event Time (low): " << time_s << std::endl; + std::cout << "Event Time (hig): " << time_ms << std::endl; + } + + //CalibratedAngles.Set(TMath::DegToRad() * 45, TMath::DegToRad() * 190); lasercal::LaserBeam Laser(Position, Phi, Theta); Laser.SetLaserID(LCS_ID); @@ -364,7 +374,7 @@ void LaserDataMerger::produce(art::Event& event) Laser.SetPower(AttenuatorTickToPercentage(laser_values.at(laser_id).at(DataStructure::AttenuatorPosition))); Laser.SetTime(laser_values.at(laser_id).at(DataStructure::TriggerTimeSec), laser_values.at(laser_id).at(DataStructure::TriggerTimeUsec)); - if (DEBUG) Laser.Print(); + if (fDebug) Laser.Print(); *LaserAA = Laser; @@ -387,13 +397,12 @@ float LaserDataMerger::AttenuatorTickToPercentage(float Tick){ else return -999.; } -float LaserDataMerger::LinearRawToAngle( float RawTicks ){ +double LaserDataMerger::LinearRawToAngle( double RawTicks ){ float linear2angle = 0.3499; ///< conversion constant of linear encoder to angle (mm/deg) float TickLength = 0.00001; ///< Tick length in mm //float err_linear2angle = 0.0002; ///< error of conversion factor - - return RawTicks * TickLength / linear2angle;; + return RawTicks * TickLength / linear2angle; } DEFINE_ART_MODULE(LaserDataMerger) diff --git a/LaserDataMerger/TimeMapProducer.fcl b/LaserDataMerger/TimeMapProducer.fcl old mode 100644 new mode 100755 diff --git a/LaserDataMerger/TimeMapProducer_module.cc b/LaserDataMerger/TimeMapProducer_module.cc old mode 100644 new mode 100755 index fe03e64..64f3bc5 --- a/LaserDataMerger/TimeMapProducer_module.cc +++ b/LaserDataMerger/TimeMapProducer_module.cc @@ -26,15 +26,15 @@ // on LArSoft headers too -- if they can't be loaded by their own, it's a bug! // LArSoft includes -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" #include "art/Framework/Core/EDProducer.h" #include "art/Framework/Principal/Event.h" @@ -42,10 +42,8 @@ #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" diff --git a/LaserDataMerger/WireInfo_module.cc b/LaserDataMerger/WireInfo_module.cc old mode 100644 new mode 100755 index 72d48ee..7a61078 --- a/LaserDataMerger/WireInfo_module.cc +++ b/LaserDataMerger/WireInfo_module.cc @@ -3,17 +3,16 @@ // LArSoft includes -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" -#include "lardata/RecoBaseArt/HitCreator.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" +#include "lardata/ArtDataHelper/WireCreator.h" +#include "lardata/ArtDataHelper/HitCreator.h" #include "larcore/Geometry/Geometry.h" // Framework includes #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" // C++ Includes #include @@ -124,4 +123,4 @@ namespace WireInfo { DEFINE_ART_MODULE(WireInfo) } // namespace WireInfo -#endif // WireInfor_Module \ No newline at end of file +#endif // WireInfor_Module diff --git a/LaserObjects/CMakeLists.txt b/LaserObjects/CMakeLists.txt old mode 100644 new mode 100755 index 82aeaba..5408a80 --- a/LaserObjects/CMakeLists.txt +++ b/LaserObjects/CMakeLists.txt @@ -6,9 +6,9 @@ art_make( BASENAME_ONLY LIBRARY_NAME LaserObjects LIB_LIBRARIES larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData ${ROOT_BASIC_LIB_LIST} ${ROOT_EG} ${Boost_SYSTEM_LIBRARY} @@ -17,16 +17,19 @@ art_make( BASENAME_ONLY ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} - DICT_LIBRARIES - LaserObjects +# DICT_LIBRARIES +# LaserObjects ) + +#art_dictionary( DICTIONARY_LIBRARIES laser_LaserObjects ) + install_headers() install_fhicl() -install_source() \ No newline at end of file +install_source() diff --git a/LaserObjects/Laser.cxx b/LaserObjects/Laser.cxx old mode 100644 new mode 100755 diff --git a/LaserObjects/Laser.h b/LaserObjects/Laser.h old mode 100644 new mode 100755 diff --git a/LaserObjects/LaserBeam.cxx b/LaserObjects/LaserBeam.cxx old mode 100644 new mode 100755 index 5bf5417..3b14d30 --- a/LaserObjects/LaserBeam.cxx +++ b/LaserObjects/LaserBeam.cxx @@ -69,10 +69,15 @@ void lasercal::LaserBeam::SetTime(const float& sec, const float& usec) // TODO: Fix class compilation if including GeometryCore.h and others!!! void lasercal::LaserBeam::SetIntersectionPoints() -{ +{ + // Load detector properties + detinfo::DetectorProperties const *DetProperties = lar::providerFrom(); + // Load geometry core - geo::GeometryCore const* Geometry = &*(art::ServiceHandle()); - + + //geo::GeometryCore const* Geometry = &*(art::ServiceHandle()); + auto const* Geometry = lar::providerFrom(); + // Create the active Volume geo::BoxBoundedGeo ActiveVolume( 0,2*Geometry->TPC().ActiveHalfWidth(), // xmin, xmax -Geometry->TPC().ActiveHalfHeight(),Geometry->TPC().ActiveHalfHeight(), // ymin, ymax @@ -93,6 +98,20 @@ void lasercal::LaserBeam::SetIntersectionPoints() fEntryPoint = IntersectionPoints.front(); fExitPoint = IntersectionPoints.back(); } + + // Entry ticks should be the same on all wires + fEntryTick = (uint) DetProperties->ConvertXToTicks(fEntryPoint.X(), geo::PlaneID(0, 0, 0)); + fExitTick = (uint) DetProperties->ConvertXToTicks(fExitPoint.X(), geo::PlaneID(0, 0, 0)); + + // Fill entry wires for all planes based on the calculated entry and exit points + for (unsigned int plane = 0; plane < Geometry->Nplanes(); plane++) { + auto plane_id = geo::PlaneID(0, 0, plane); + auto entry_wire = Geometry->NearestWire(fEntryPoint, plane_id); + auto exit_wire = Geometry->NearestWire(fExitPoint, plane_id); + + fEntryWire.push_back(geo::WireID(plane_id, entry_wire)); + fExitWire.push_back(geo::WireID(plane_id, exit_wire)); + } } void lasercal::LaserBeam::Print() const @@ -101,12 +120,15 @@ void lasercal::LaserBeam::Print() const << "Laser Event ID " << fLaserEventID << "\n" << "Associate Event ID " << fAssosiateEventID << "\n" << "Attenuator Position " << fPower * 100 << " %\n" - << "Aperture Position " << fAperturePosition << "\n" - << "Mirror Position ";// << std::endl; - fLaserPosition.Print(); - std::cout << "Mirror Direction ";// << std::endl; - fDirection.Print(); - std::cout << "\n" << std::endl; + << "Aperture Position " << fAperturePosition << "\n"; + std::cout << "Mirror Position "; fLaserPosition.Print(); + std::cout << "Mirror Direction "; fDirection.Print(); + std::cout << "EntryPoint "; fEntryPoint.Print(); + std::cout << "ExitPoint "; fExitPoint.Print(); + std::cout << "EntryTick " << fEntryTick << std::endl; + std::cout << "ExitTick " << fExitTick << std::endl; + + std::cout << std::endl; } TVector3 lasercal::LaserBeam::GetEntryPoint() const @@ -128,3 +150,27 @@ TVector3 lasercal::LaserBeam::GetLaserPosition() const { return fLaserPosition; } + +const std::vector &lasercal::LaserBeam::getEntryWire() const { + return fEntryWire; +} + +const geo::WireID &lasercal::LaserBeam::getEntryWire(uint plane_id) const { + return fEntryWire.at(plane_id); +} + +const std::vector &lasercal::LaserBeam::getExitWire() const { + return fExitWire; +} + +const geo::WireID &lasercal::LaserBeam::getExitWire(uint plane_id) const { + return fExitWire.at(plane_id); +} + +uint lasercal::LaserBeam::getEntryTick() const { + return fEntryTick; +} + +uint lasercal::LaserBeam::getExitTick() const { + return fExitTick; +} diff --git a/LaserObjects/LaserBeam.h b/LaserObjects/LaserBeam.h old mode 100644 new mode 100755 index 6df5cb0..01a1183 --- a/LaserObjects/LaserBeam.h +++ b/LaserObjects/LaserBeam.h @@ -10,6 +10,7 @@ #include #include + /// Root library #include #include @@ -19,17 +20,17 @@ /// LArSoft #ifndef __GCCXML__ -#include "art/Framework/Services/Registry/ServiceHandle.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" #include "larcore/Geometry/BoxBoundedGeo.h" -#endif - -#include "larcore/SimpleTypesAndConstants/geo_types.h" - -// Framework includes +#include "lardata/DetectorInfoServices/DetectorPropertiesService.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" +#ifndef uint +using uint = unsigned int; +#endif +#endif #ifndef LASERBEAM_H @@ -50,32 +51,37 @@ namespace lasercal class LaserBeam { protected: + ///< Laser start position (last mirror before the TPC) TVector3 fLaserPosition; ///< Laser start position (last mirror before the TPC) TVector3 fDirection; ///< Direction of the Laser beam TVector3 fEntryPoint; ///< First Point in TPC TVector3 fExitPoint; ///< Last Point in TPC - + + uint fEntryTick; ///< Entry time tick + uint fExitTick; ///< Exit Time tick + /// Errors TVector3 fLaserPositionError; TVector3 fDirectionError; TVector3 fEntryPointError; TVector3 fExitPointError; - + Time fTime; ///< Trigger time recorded by laser server unsigned int fLaserID; ///< Laser System identifier (1 = upstream, 2 = downstream) unsigned int fLaserEventID; ///< Laser event id (not daq) unsigned int fAssosiateEventID; ///< ID of the assosiate event id () float fAperturePosition; ///< Aperture position float fPower; ///< Attenuator setting (not measured pulse energy) - - #ifndef __GCCXML__ - void SetIntersectionPoints(); - #endif - - + +#ifndef __GCCXML__ + void SetIntersectionPoints(); + std::vector fEntryWire; ///< Entry wire on each plane + std::vector fExitWire; ///< Exit wire on each plane +#endif + public: - +#ifndef __GCCXML__ /** * @brief Default constructor: sets an empty volume * @see SetPosition @@ -112,7 +118,7 @@ namespace lasercal LaserBeam(const TVector3& LaserPosition, const float& Phi, const float& Theta); - #ifndef __GCCXML__ + /** * @brief Sets laser Position * @param LaserPosition start position of the laser @@ -172,17 +178,25 @@ namespace lasercal * @brief Print all protected value to stdout */ void Print() const; - + TVector3 GetLaserPosition() const; TVector3 GetLaserDirection() const; TVector3 GetEntryPoint() const; TVector3 GetExitPoint() const; - - #endif + + + const std::vector &getEntryWire() const; + const geo::WireID &getEntryWire(uint) const; + + const std::vector &getExitWire() const; + const geo::WireID &getExitWire(uint) const; + + uint getEntryTick() const; + uint getExitTick() const; //Anydatatype GetErrors(); - +#endif }; } -#endif \ No newline at end of file +#endif diff --git a/LaserObjects/LaserHits.cxx b/LaserObjects/LaserHits.cxx old mode 100644 new mode 100755 index b264749..dbcacc6 --- a/LaserObjects/LaserHits.cxx +++ b/LaserObjects/LaserHits.cxx @@ -35,6 +35,34 @@ lasercal::LaserHits::LaserHits(const std::vector &Wires, const lase } // Constructor using all wire signals and geometry purposes +lasercal::LaserHits::LaserHits(const art::Handle< std::vector> WireHandle, const lasercal::LaserRecoParameters &ParameterSet, + const lasercal::LaserBeam &LaserBeam) { + + fGeometry = &*(art::ServiceHandle()); + fParameters = ParameterSet; + + fLaserROI = lasercal::LaserROI(fParameters.HitBoxSize, LaserBeam); + + // Reserve space for hit container + for (auto &MapVector : fHitMapsByPlane) { + MapVector.reserve(WireHandle->size()); + } + + // Loop over all wires + for (const auto &SingleWire : *WireHandle) { + // Get channel information + raw::ChannelID_t Channel = SingleWire.Channel(); + unsigned Plane = fGeometry->ChannelToWire(Channel).front().Plane; + + // Get Single wire hits + std::map HitMap = FindSingleWireHits(SingleWire, Plane); + + // Fill map data by pushing back the wire vector + fHitMapsByPlane.at(Plane).push_back(HitMap); + }// end loop over wires + +} // Constructor using all wire signals and geometry purposes + //------------------------------------------------------------------------------------------------------------------- lasercal::LaserHits::LaserHits(const std::vector &Wires, const lasercal::LaserRecoParameters &ParameterSet, @@ -128,6 +156,25 @@ std::unique_ptr > lasercal::LaserHits::GetPlaneHits(size //------------------------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------- + +std::unique_ptr > lasercal::LaserHits::GetHits() { + std::unique_ptr > HitVector(new std::vector); + for (size_t plane = 0; plane < fNumberOfPlanes; plane++ ) { + // Loop over all hit maps in a vector of a certain plane + for (const auto &HitMaps : fHitMapsByPlane.at(plane)) { + // Loop through map + for (const auto &HitMap : HitMaps) { + HitVector->push_back(HitMap.second); + }// loop through map + }// loop over hit map vector + + } + return std::move(HitVector); +} + +//------------------------------------------------------------------------------------------------------------------- + std::map lasercal::LaserHits::FindSingleWireHits(const recob::Wire &Wire, unsigned Plane) { // Initialize hit map std::map HitMap; @@ -198,7 +245,6 @@ std::map lasercal::LaserHits::UPlaneHitFinder(const recob::Wi if (fParameters.UseROI) { if (!fLaserROI.IsWireInRange(SingleWire)) { - return LaserHits; } } diff --git a/LaserObjects/LaserHits.h b/LaserObjects/LaserHits.h old mode 100644 new mode 100755 index 98c4511..b864568 --- a/LaserObjects/LaserHits.h +++ b/LaserObjects/LaserHits.h @@ -1,11 +1,11 @@ #ifndef lasercal_LaserHits_H #define lasercal_LaserHits_H -#include "larcore/SimpleTypesAndConstants/RawTypes.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Wire.h" -#include "lardata/RecoBaseArt/HitCreator.h" +#include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" +#include "lardata/ArtDataHelper/HitCreator.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" @@ -27,6 +27,8 @@ namespace lasercal class LaserHits { public: + LaserHits() = default; + // Constructor with geometry and thresholds for the hit finder. // It just initializes the object. There is no hit finding or filling of data. LaserHits(const lasercal::LaserRecoParameters& ParameterSet); @@ -35,6 +37,10 @@ namespace lasercal // It already runs the hit finder algorithms and fills the map data. LaserHits(const std::vector& Wires, const lasercal::LaserRecoParameters& ParameterSet, const lasercal::LaserBeam& LaserBeam); + // Alternative constructor accepting art data products as an input. Use this in case you want to process raw data independantly (e.g. calroi) from + // this algorithm + LaserHits(const art::Handle< std::vector>, const lasercal::LaserRecoParameters& ParameterSet, const lasercal::LaserBeam& LaserBeam); + /// Alternative constructor where the user can supply a predefined ROI. LaserHits(const std::vector& Wires, const lasercal::LaserRecoParameters& ParameterSet, lasercal::LaserROI& LaserROI); @@ -47,16 +53,21 @@ namespace lasercal // Get all hits of a certain plane std::unique_ptr< std::vector > GetPlaneHits(size_t PlaneIndex); + + // Get all hits + std::unique_ptr< std::vector > GetHits(); // Remove hits without time match void TimeMatchFilter(); protected: - + + static const size_t fNumberOfPlanes = 3; + // Hit data member, it is an array for all planes cantainig vectors with all wire entries lasercal::LaserRecoParameters fParameters; - std::array< std::vector>, 3 > fHitMapsByPlane; + std::array< std::vector>, fNumberOfPlanes > fHitMapsByPlane; const geo::GeometryCore* fGeometry; // std::array fUVYThresholds; lasercal::LaserROI fLaserROI; @@ -72,4 +83,4 @@ namespace lasercal } // namespace LaserOjects -#endif // LaserObjects_LaserHits_H \ No newline at end of file +#endif // LaserObjects_LaserHits_H diff --git a/LaserObjects/LaserParameters.h b/LaserObjects/LaserParameters.h old mode 100644 new mode 100755 index 0429c53..a8c706f --- a/LaserObjects/LaserParameters.h +++ b/LaserObjects/LaserParameters.h @@ -1,7 +1,7 @@ #ifndef lasercal_LaserParameters_H #define lasercal_LaserParameters_H -#include "art/Utilities/InputTag.h" +#include "canvas/Utilities/InputTag.h" #include @@ -88,4 +88,4 @@ namespace lasercal { -#endif \ No newline at end of file +#endif diff --git a/LaserObjects/LaserROI.cxx b/LaserObjects/LaserROI.cxx old mode 100644 new mode 100755 index f28dea4..bfee52a --- a/LaserObjects/LaserROI.cxx +++ b/LaserObjects/LaserROI.cxx @@ -1,118 +1,138 @@ #include "LaserObjects/LaserROI.h" -lasercal::LaserROI::LaserROI() -{ +lasercal::LaserROI::LaserROI() { fGeometry = &*(art::ServiceHandle()); fRanges.resize(fGeometry->Nplanes()); } // Default constructor //------------------------------------------------------------------------------------------------------------------- -lasercal::LaserROI::LaserROI(const float& BoxSize, const lasercal::LaserBeam& LaserBeamInfo ) : fBoxSize ( BoxSize ), fLaserBeam ( LaserBeamInfo ) -{ +lasercal::LaserROI::LaserROI(const float &BoxSize, const lasercal::LaserBeam &LaserBeamInfo) : fBoxSize(BoxSize), + fLaserBeam( + LaserBeamInfo) { fGeometry = &*(art::ServiceHandle()); - + // Get Detector properties - detinfo::DetectorProperties const* DetProperties = lar::providerFrom(); - + detinfo::DetectorProperties const *DetProperties = lar::providerFrom(); + TVector3 EntryPoint = fLaserBeam.GetEntryPoint(); TVector3 ExitPoint = fLaserBeam.GetExitPoint(); - + // EntryPoint.Print(); // ExitPoint.Print(); - + TVector3 BeamVector = EntryPoint - ExitPoint; - + // Calculate box size in wire coordinates - fWireBoxSize = BoxSize/fGeometry->WirePitch(); - + fWireBoxSize = BoxSize / fGeometry->WirePitch(); + // Calculate the scale factor of the ROI box x-coordinate - fXScaleFactor = sqrt ( BeamVector.Mag2() ) *BoxSize/ fabs ( BeamVector[2] ); - + fXScaleFactor = sqrt(BeamVector.Mag2()) * BoxSize / fabs(BeamVector[2]); + // Get wire ranges for all planes - auto RawRanges = WireRanges ( fLaserBeam.GetEntryPoint(),fLaserBeam.GetExitPoint() ); - + auto RawRanges = WireRanges(fLaserBeam.GetEntryPoint(), fLaserBeam.GetExitPoint()); + + std::cout << "entry: "; + fLaserBeam.GetEntryPoint().Print(); + std::cout << "exit: "; + fLaserBeam.GetExitPoint().Print(); + // Initilize Extended ranges auto BoxRanges = RawRanges; - + // Prepare time range vector fRanges.resize(fGeometry->Nplanes()); - + // Loop over all planes - for(unsigned int plane_no = 0; plane_no < fGeometry->Nplanes(); plane_no++) - { - // The following stuff is complicated because the authors wanted to make the code work - // without knowing where the laser is positioned, sorry but this is the way it is! - - // Initialize x-coordinate of exit and entry points - float XEntry = EntryPoint[0]; - float XExit = ExitPoint[0]; - - // If the wire number of the entry point is higher than the one of the exit point - if(RawRanges.at(plane_no).first.Wire > RawRanges.at(plane_no).second.Wire) - { - // Swap them if order is decending - std::swap(RawRanges.at(plane_no).first, RawRanges.at(plane_no).second); - // Also swap entry and exit points for right sign - std::swap(XEntry,XExit); - } - - // If the entry point - box is in the wire plane range fill the new range point - if((int)RawRanges.at(plane_no).first.Wire - (int)fWireBoxSize > 0) - { - BoxRanges.at(plane_no).first.Wire = RawRanges.at(plane_no).first.Wire - (int)fWireBoxSize; - } - else // else fill minimum wire number = 0 - { - BoxRanges.at(plane_no).first.Wire = 0; - } - - // If the exit point + box is in the wire plane range fill the new range point - if((int)RawRanges.at(plane_no).second.Wire + (int)fWireBoxSize < fGeometry->Nwires(plane_no)) - { - BoxRanges.at(plane_no).second.Wire = RawRanges.at(plane_no).second.Wire + (int)fWireBoxSize; - } - else // else fill the maximum wire number - - { - BoxRanges.at(plane_no).second.Wire = fGeometry->Nwires(plane_no) - 1; - } - - // Slope of beam in X (drift coordinate) - float XSlope = (XExit - XEntry) / (RawRanges.at(plane_no).second.Wire - RawRanges.at(plane_no).first.Wire); - - // Loop over wire range - for(unsigned int wire_no = BoxRanges.at(plane_no).first.Wire; wire_no <= BoxRanges.at(plane_no).second.Wire; wire_no++) - { - // Linear function to calculate central x value in ROIBox - float CentralX = XEntry + ((float)wire_no - (float)RawRanges.at(plane_no).first.Wire)*XSlope; - - // Fill x limits of this specific wire - std::pair TickLimitsOfWire = std::make_pair(CentralX-fXScaleFactor,CentralX+fXScaleFactor); - - // Convert x coordinates to time ticks - TickLimitsOfWire.first = DetProperties->ConvertXToTicks(TickLimitsOfWire.first,plane_no,0,0); - TickLimitsOfWire.second = DetProperties->ConvertXToTicks(TickLimitsOfWire.second,plane_no,0,0); - - // Fill hit limit object - fRanges.at(plane_no).insert( std::make_pair(wire_no, std::move(TickLimitsOfWire)) ); - } // loop over wires - - // Fill entry point and exit point in wire coordinate - fEntryWire.push_back(fRanges.at(plane_no).begin()->first); - fExitWire.push_back(fRanges.at(plane_no).rbegin()->first); + for (unsigned int plane_no = 0; plane_no < fGeometry->Nplanes(); plane_no++) { + // The following stuff is complicated because the authors wanted to make the code work + // without knowing where the laser is positioned, sorry but this is the way it is! + + // Initialize x-coordinate of exit and entry points + float XEntry = EntryPoint[0]; + float XExit = ExitPoint[0]; + + // If the wire number of the entry point is higher than the one of the exit point + if (RawRanges.at(plane_no).first.Wire > RawRanges.at(plane_no).second.Wire) { + // Swap them if order is decending + std::swap(RawRanges.at(plane_no).first, RawRanges.at(plane_no).second); + // Also swap entry and exit points for right sign + std::swap(XEntry, XExit); + } + + // If the entry point - box is in the wire plane range fill the new range point + if ((int) RawRanges.at(plane_no).first.Wire - (int) fWireBoxSize > 0) { + BoxRanges.at(plane_no).first.Wire = RawRanges.at(plane_no).first.Wire - (int) fWireBoxSize; + } else // else fill minimum wire number = 0 + { + BoxRanges.at(plane_no).first.Wire = 0; + } + + // If the exit point + box is in the wire plane range fill the new range point + if ((int) RawRanges.at(plane_no).second.Wire + (int) fWireBoxSize < (int) fGeometry->Nwires(plane_no)) { + BoxRanges.at(plane_no).second.Wire = RawRanges.at(plane_no).second.Wire + (int) fWireBoxSize; + } else // else fill the maximum wire number + + { + BoxRanges.at(plane_no).second.Wire = fGeometry->Nwires(plane_no) - 1; + } + + // Slope of beam in X (drift coordinate) + float XSlope = (XExit - XEntry) / (RawRanges.at(plane_no).second.Wire - RawRanges.at(plane_no).first.Wire); + + // Loop over wire range + for (unsigned int wire_no = BoxRanges.at(plane_no).first.Wire; + wire_no <= BoxRanges.at(plane_no).second.Wire; wire_no++) { + // Linear function to calculate central x value in ROIBox + float CentralX = XEntry + ((float) wire_no - (float) RawRanges.at(plane_no).first.Wire) * XSlope; + + // Fill x limits of this specific wire + std::pair TickLimitsOfWire = std::make_pair(CentralX - fXScaleFactor, + CentralX + fXScaleFactor); + + // Convert x coordinates to time ticks + TickLimitsOfWire.first = DetProperties->ConvertXToTicks(TickLimitsOfWire.first, plane_no, 0, 0); + TickLimitsOfWire.second = DetProperties->ConvertXToTicks(TickLimitsOfWire.second, plane_no, 0, 0); + + // Fill hit limit object + fRanges.at(plane_no).insert(std::make_pair(wire_no, std::move(TickLimitsOfWire))); + + + } // loop over wires + + auto entry = fRanges.at(plane_no).begin(); + auto exit = fRanges.at(plane_no).rbegin(); + + std::cout << "ROI at plane " << plane_no << std::endl; + std::cout << "ROI Entry: wire / start_tick / end_tick " << entry->first << "/" << entry->second.first << "/" << entry->second.second << std::endl; + std::cout << "ROI Exit: wire / start_tick / end_tick " << exit->first << "/" << exit->second.first << "/" << exit->second.second << std::endl; + + + // Fill entry point and exit point in wire coordinate + fEntryWire.push_back(fRanges.at(plane_no).begin()->first); + fExitWire.push_back(fRanges.at(plane_no).rbegin()->first); } // Loop over planes } // Constructor using all wire signals and geometry purposes //---------------------------------------------------------------------------------------------------------------- -void lasercal::LaserROI::setRanges(int BoxTickCenter, int BoxTickWidth, unsigned int Plane, std::pair Wires){ +void lasercal::LaserROI::setRanges(int BoxTickCenter, int BoxTickWidth, unsigned int Plane, + std::pair Wires) { - std::pair TickLimitsOfWire = std::make_pair(float(BoxTickCenter-BoxTickWidth/2), float(BoxTickCenter+BoxTickWidth/2)); + std::pair TickLimitsOfWire = std::make_pair(float(BoxTickCenter - BoxTickWidth / 2), + float(BoxTickCenter + BoxTickWidth / 2)); - for (unsigned int wire = Wires.first; wire <= Wires.second; wire++){ - fRanges.at(Plane).insert( std::make_pair(wire, std::move(TickLimitsOfWire)) ); + if (Wires.second < Wires.first) + { + // flip? + unsigned int first = Wires.first; + Wires.first = Wires.second; + Wires.second = first; + } + + for (unsigned int wire = Wires.first; wire <= Wires.second; wire++) { + fRanges.at(Plane).insert(std::make_pair(wire, std::move(TickLimitsOfWire))); } } @@ -122,98 +142,91 @@ std::vector > > lasercal::LaserRO //---------------------------------------------------------------------------------------------------------------- -bool lasercal::LaserROI::IsWireInRange( const recob::Wire& WireToCheck ) const -{ +bool lasercal::LaserROI::IsWireInRange(const recob::Wire &WireToCheck) const { std::vector WireIDs = fGeometry->ChannelToWire(WireToCheck.Channel()); - + unsigned int WireNo = WireIDs.front().Wire; unsigned int PlaneNo = WireIDs.front().Plane; auto WireRange = fRanges.at(PlaneNo); if (WireRange.empty()) return false; - if( WireRange.begin()->first <= WireNo && WireRange.rbegin()->first >= WireNo ) { + if (WireRange.begin()->first <= WireNo && WireRange.rbegin()->first >= WireNo) { return true; - } - else // if not in inverval + } else // if not in inverval { - return false; + return false; } } -bool lasercal::LaserROI::IsHitInRange( const recob::Hit& HitToCheck ) const -{ +bool lasercal::LaserROI::IsHitInRange(const recob::Hit &HitToCheck) const { // Get wire information first unsigned int WireNo = HitToCheck.WireID().Wire; unsigned int PlaneNo = HitToCheck.WireID().Plane; - if (fRanges.at(PlaneNo).empty() ) return false; + if (fRanges.at(PlaneNo).empty()) return false; auto TickLimits = fRanges.at(PlaneNo).find(WireNo)->second; - if( TickLimits.first <= HitToCheck.PeakTime() && TickLimits.second >= HitToCheck.PeakTime() ){ + if (TickLimits.first <= HitToCheck.PeakTime() && TickLimits.second >= HitToCheck.PeakTime()) { return true; - } - else // if wire or time tick of hit is not in inverval + } else // if wire or time tick of hit is not in inverval { - return false; + return false; } - + } //----------------------------------------------------------------------------------------------------------- -unsigned int lasercal::LaserROI::GetEntryWire(const unsigned int& PlaneNo) const -{ +unsigned int lasercal::LaserROI::GetEntryWire(const unsigned int &PlaneNo) const { return fEntryWire.at(PlaneNo); } //---------------------------------------------------------------------------------------------------------------- -unsigned int lasercal::LaserROI::GetExitWire(const unsigned int& PlaneNo) const -{ +unsigned int lasercal::LaserROI::GetExitWire(const unsigned int &PlaneNo) const { return fExitWire.at(PlaneNo); } //---------------------------------------------------------------------------------------------------------------- -float lasercal::LaserROI::GetEntryTimeTick(const unsigned int& PlaneNo) const -{ - return 0.5*(fRanges.at(PlaneNo).find(fEntryWire.at(PlaneNo))->second.first + fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.second); +float lasercal::LaserROI::GetEntryTimeTick(const unsigned int &PlaneNo) const { + return 0.5 * (fRanges.at(PlaneNo).find(fEntryWire.at(PlaneNo))->second.first + + fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.second); } //---------------------------------------------------------------------------------------------------------------- -float lasercal::LaserROI::GetExitTimeTick(const unsigned int& PlaneNo) const -{ - return 0.5*(fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.first + fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.second); +float lasercal::LaserROI::GetExitTimeTick(const unsigned int &PlaneNo) const { + return 0.5 * (fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.first + + fRanges.at(PlaneNo).find(fExitWire.at(PlaneNo))->second.second); } //---------------------------------------------------------------------------------------------------------------- -std::vector< std::pair > lasercal::LaserROI::WireRanges( const TVector3& StartPosition, const TVector3& EndPosition ) -{ - // Initialize start and end point of wire - double Start[] = {StartPosition[0],StartPosition[1],StartPosition[2]}; - double End[] = {EndPosition[0],EndPosition[1],EndPosition[2]}; - - // Initialize the return pair vector - std::vector< std::pair > CrossingWireRangeVec; - - for(unsigned int plane_no = 0; plane_no < fGeometry->Nplanes(); plane_no++) - { - // Generate PlaneID for microboone (cryostatID = 0, TPCID = 0, plane number) - auto TargetPlaneID = geo::PlaneID ( 0,0,plane_no ); - - // Get the closest wire on the target plane to the wire start position - auto FirstWireID = fGeometry->NearestWireID ( Start, TargetPlaneID ); - - // Get the closest wire on the target plane to the wire end postion - auto LastWireID = fGeometry->NearestWireID ( End, TargetPlaneID ); - - // First and last wire ID into vector - CrossingWireRangeVec.push_back ( std::make_pair ( FirstWireID,LastWireID ) ); - } - - // Return the entr and exit wire IDs as a pair - return CrossingWireRangeVec; +std::vector > +lasercal::LaserROI::WireRanges(const TVector3 &StartPosition, const TVector3 &EndPosition) { + // Initialize start and end point of wire + double Start[] = {StartPosition[0], StartPosition[1], StartPosition[2]}; + double End[] = {EndPosition[0], EndPosition[1], EndPosition[2]}; + + // Initialize the return pair vector + std::vector > CrossingWireRangeVec; + + for (unsigned int plane_no = 0; plane_no < fGeometry->Nplanes(); plane_no++) { + // Generate PlaneID for microboone (cryostatID = 0, TPCID = 0, plane number) + auto TargetPlaneID = geo::PlaneID(0, 0, plane_no); + + // Get the closest wire on the target plane to the wire start position + auto FirstWireID = fGeometry->NearestWireID(Start, TargetPlaneID); + + // Get the closest wire on the target plane to the wire end postion + auto LastWireID = fGeometry->NearestWireID(End, TargetPlaneID); + + // First and last wire ID into vector + CrossingWireRangeVec.push_back(std::make_pair(FirstWireID, LastWireID)); + } + + // Return the entr and exit wire IDs as a pair + return CrossingWireRangeVec; } diff --git a/LaserObjects/LaserROI.h b/LaserObjects/LaserROI.h old mode 100644 new mode 100755 index 4eece8b..a105460 --- a/LaserObjects/LaserROI.h +++ b/LaserObjects/LaserROI.h @@ -1,11 +1,11 @@ #ifndef lasercal_LaserROI_H #define lasercal_LaserROI_H -#include "larcore/SimpleTypesAndConstants/RawTypes.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Wire.h" -#include "lardata/RecoBaseArt/HitCreator.h" +#include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" +#include "lardata/ArtDataHelper/HitCreator.h" #include "larcore/Geometry/GeometryCore.h" #include "larcore/Geometry/Geometry.h" @@ -86,4 +86,4 @@ namespace lasercal } // namespace lasercal -#endif // LaserObjects_LaserHits_H \ No newline at end of file +#endif // LaserObjects_LaserHits_H diff --git a/LaserObjects/LaserTrack.cxx b/LaserObjects/LaserTrack.cxx old mode 100644 new mode 100755 diff --git a/LaserObjects/LaserTrack.h b/LaserObjects/LaserTrack.h old mode 100644 new mode 100755 diff --git a/LaserObjects/LaserUtils.cxx b/LaserObjects/LaserUtils.cxx old mode 100644 new mode 100755 index d85ab3c..36fd14e --- a/LaserObjects/LaserUtils.cxx +++ b/LaserObjects/LaserUtils.cxx @@ -63,7 +63,7 @@ std::vector lasercal::GetWires(art::ValidHandle>> lasercal::ReadHitDefs(std::string Filename, bool DEBUG) +std::unique_ptr>>> lasercal::ReadHitDefs(std::string Filename, bool DEBUG) /* * Reads hit definitions from csv file * @@ -77,21 +77,12 @@ std::vector>> lasercal::ReadHitDefs(std::string F */ { - std::vector > > RawDigitValues; ///< line by line csv container + std::unique_ptr > > > RawDigitValues( new std::vector > >); ///< line by line csv container std::fstream stream(Filename, std::ios::in); - - if (stream) { - typedef boost::tokenizer > Tokenizer; - boost::char_separator sep(", "); - std::string line; - - std::vector> Hits; - // Reading of RawDigit config file int EventIdx = -2; // read the hit data file into a vector - std::fstream stream(Filename, std::ios::in); if (stream) { typedef boost::tokenizer > Tokenizer; boost::char_separator sep(", "); @@ -102,7 +93,7 @@ std::vector>> lasercal::ReadHitDefs(std::string F while (getline(stream, line)) { // skip comments if (line[0] == '#') { - if (EventIdx > -1) RawDigitValues.push_back(Hits); + if (EventIdx > -1) RawDigitValues->push_back(Hits); Hits.clear(); EventIdx++; continue; @@ -130,8 +121,9 @@ std::vector>> lasercal::ReadHitDefs(std::string F stream.close(); } else { stream.close(); - throw art::Exception(art::errors::FileOpenError) << " File does not exist: " << Filename << std::endl; - } - } - return RawDigitValues; -} \ No newline at end of file + //throw art::Exception(art::errors::FileOpenError) << " File does not exist: " << Filename << std::endl; + throw std::runtime_error("File seems not to exist"); + } + + return std::move(RawDigitValues); +} diff --git a/LaserObjects/LaserUtils.h b/LaserObjects/LaserUtils.h old mode 100644 new mode 100755 index 8136c9a..31b5089 --- a/LaserObjects/LaserUtils.h +++ b/LaserObjects/LaserUtils.h @@ -9,15 +9,15 @@ #include "fhiclcpp/ParameterSet.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" +#include "lardata/ArtDataHelper/WireCreator.h" #include "art/Framework/Principal/Event.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" #include "larevt/CalibrationDBI/Interface/DetPedestalService.h" #include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h" @@ -30,7 +30,7 @@ #include #include -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" struct RawDigitDefinition{ enum Value { @@ -50,5 +50,5 @@ namespace lasercal lasercal::LaserRecoParameters &fParameterSet, bool SubstractPedestal=true); - std::vector > > ReadHitDefs(std::string Filename, bool DEBUG = false); -} \ No newline at end of file + std::unique_ptr > > > ReadHitDefs(std::string Filename, bool DEBUG = false); +} diff --git a/LaserObjects/classes.h b/LaserObjects/classes.h old mode 100644 new mode 100755 index 62307ca..b038d9d --- a/LaserObjects/classes.h +++ b/LaserObjects/classes.h @@ -6,12 +6,15 @@ // #include "LaserBeam.h" -#include "art/Persistency/Common/Wrapper.h" +#include "canvas/Persistency/Common/Wrapper.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" + // // Only include objects that we would like to be able to put into the event. // Do not include the objects they contain internally. // +/* namespace { struct dictionary { lasercal::Time tm; @@ -19,3 +22,9 @@ namespace { art::Wrapper laser; }; } +*/ + +//template class std::vector< lasercal::LaserBeam >; +//template class art::Wrapper< lasercal::LaserBeam >; +//template class art::Wrapper< std::vector >; + diff --git a/LaserObjects/classes_def.xml b/LaserObjects/classes_def.xml old mode 100644 new mode 100755 index a116c84..068ce0a --- a/LaserObjects/classes_def.xml +++ b/LaserObjects/classes_def.xml @@ -1,5 +1,12 @@ - - - - \ No newline at end of file + + + + + + + + + + + diff --git a/LaserObjects/classes_def.xml~ b/LaserObjects/classes_def.xml~ deleted file mode 100644 index d59ce88..0000000 --- a/LaserObjects/classes_def.xml~ +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/LaserReco/CMakeLists.txt b/LaserReco/CMakeLists.txt old mode 100644 new mode 100755 index 4175d88..4c18251 --- a/LaserReco/CMakeLists.txt +++ b/LaserReco/CMakeLists.txt @@ -3,18 +3,18 @@ art_make( MODULE_LIBRARIES LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} diff --git a/LaserReco/LaserReco_module.cc b/LaserReco/LaserReco_module.cc old mode 100644 new mode 100755 index 8b752c1..6babeeb --- a/LaserReco/LaserReco_module.cc +++ b/LaserReco/LaserReco_module.cc @@ -4,31 +4,24 @@ #define LaserReco_Module // LArSoft includes -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" -#include "lardata/RecoBaseArt/HitCreator.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Cluster.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" + #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" #include "larcore/CoreUtils/ServiceUtil.h" // Framework includes -#include "art/Utilities/Exception.h" -// #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Core/EDProducer.h" + #include "art/Framework/Principal/Event.h" #include "art/Framework/Principal/Handle.h" #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" @@ -64,6 +57,7 @@ // Laser Module Classes #include "LaserObjects/LaserHits.h" +#include "LaserObjects/LaserUtils.h" #include "LaserObjects/LaserBeam.h" #include "LaserObjects/LaserParameters.h" @@ -112,6 +106,8 @@ namespace LaserReco { unsigned short fLCSNumber; bool fPedestalStubtract; + bool fUseCalData; + art::InputTag fCalDataTag; }; // class LaserReco @@ -127,9 +123,10 @@ namespace LaserReco { this->reconfigure(pset); // produces< std::vector >("blibla"); - produces >("UPlaneLaserHits"); - produces >("VPlaneLaserHits"); - produces >("YPlaneLaserHits"); + //produces >("UPlaneLaserHits"); + //produces >("VPlaneLaserHits"); + //produces >("YPlaneLaserHits"); + produces >(""); } @@ -171,10 +168,12 @@ namespace LaserReco { //Read ficl parameterSet fPedestalStubtract = parameterSet.get ("PedestalSubtract", true); + fUseCalData = parameterSet.get ("UseCalData", false); + fCalDataTag = parameterSet.get("CalDataTag", ""); // Switches fParameterSet.WireMapGenerator = parameterSet.get("GenerateWireMap"); - fParameterSet.UseROI = parameterSet.get("GenerateWireMap"); + fParameterSet.UseROI = parameterSet.get("UseROI"); fParameterSet.HitBoxSize = parameterSet.get("HitBoxSize"); // Tag for reading raw digit data @@ -212,142 +211,53 @@ namespace LaserReco { //----------------------------------------------------------------------- void LaserReco::produce(art::Event &event) { // This is the handle to the raw data of this event (simply a pointer to std::vector) - art::ValidHandle > DigitVecHandle = event.getValidHandle>( - fParameterSet.RawDigitTag); + + art::ValidHandle > DigitVecHandle = event.getValidHandle>(fParameterSet.RawDigitTag); + + art::Handle > WireVecHandle; art::ValidHandle LaserBeamHandle = event.getValidHandle( fParameterSet.GetLaserBeamTag()); -// LaserBeamHandle->GetEntryPoint().Print(); -// LaserBeamHandle->GetExitPoint().Print(); - -// LaserBeamHandle->GetLaserPosition().Print(); -// LaserBeamHandle->GetLaserDirection().Print(); + if (fUseCalData) { - // Prepairing the wire signal vector. It will be just the raw signal with subtracted pedestial - std::vector WireVec; + } // Prepairing the hit vectors for all planes - std::unique_ptr > UHitVec(new std::vector); - std::unique_ptr > VHitVec(new std::vector); - std::unique_ptr > YHitVec(new std::vector); - - // Preparing WireID vector - std::vector WireIDs; - - // Reserve space for wire vector - WireVec.reserve(DigitVecHandle->size()); - - // Get Service providers - const lariov::DetPedestalProvider &PedestalRetrievalAlg = art::ServiceHandle()->GetPedestalProvider(); - const lariov::ChannelStatusProvider &ChannelFilter = art::ServiceHandle()->GetProvider(); - - // Initialize raw time tick vectors - std::vector RawADC; - std::vector RawROI; - RawADC.resize(DigitVecHandle->at(0).Samples()); - RawROI.resize(DigitVecHandle->at(0).Samples()); - - // Prepare laser hits object -// lasercal::LaserHits YROIHits(fUVYThresholds); + //std::unique_ptr > UHitVec(new std::vector); + //std::unique_ptr > VHitVec(new std::vector); + //std::unique_ptr > YHitVec(new std::vector); - // Set region of interest limits for first hit scan - unsigned int StartROI = 4500; - unsigned int EndROI = 5500; + std::unique_ptr > HitVec(new std::vector); // Initialize Regions of interest recob::Wire::RegionsOfInterest_t RegionOfInterestFirst; recob::Wire::RegionsOfInterest_t RegionOfInterest; - // Loop over downstream laser system -// if(fLCSNumber == 2) -// { -// // Loop over N collection wires at the edge of the TPC based on the wire map -// for(unsigned int WireIndex = WireMaps.back().size()-1; WireIndex >= WireMaps.back().size() - 13; WireIndex--) -// { -// // Get the raw data for this particular wire -// auto RawDigit = DigitVecHandle->at(WireMaps.back().at(WireIndex)); -// -// // Get Channel number -// raw::ChannelID_t channel = RawDigit.Channel(); -// -// // Skip channel if dead or noisy -// if( ChannelFilter.Status(channel) < fParameterSet.MinAllowedChanStatus || !ChannelFilter.IsPresent(channel) ) -// { -// continue; -// } -// -// // Uncompress raw digits into RawADC vector -// raw::Uncompress(RawDigit.ADCs(), RawADC, RawDigit.Compression()); -// -// // copy only the region of interest into the the RawROI vector TODO Watch commented stuff -// std::copy(RawADC.begin()+StartROI, RawADC.begin()+EndROI, RawROI.begin()); -// -// // Subtract pedestal from samples in ROI -// for(auto & RawSample : RawROI) -// { -// RawSample -= PedestalRetrievalAlg.PedMean(channel); -// } -// -// // Create a wire from the selected ROI (1. copy raw into ROI container, 2. copy the ROI vector into a wire container) -// RegionOfInterestFirst.add_range(StartROI,RawROI.begin(),RawROI.end()); -// -// // Search for hits with the created wire -// YROIHits.AddHitsFromWire(recob::WireCreator( std::move(RegionOfInterestFirst), RawDigit ).move()); -// -// }// end for over endge collection wires -// -// // Check if there are more than x hits in the selected area and jump event if there are less -// if( YROIHits.NumberOfWiresWithHits().at(2) < 7 ) -// { -// event.put(std::move(UHitVec), "UPlaneLaserHits"); -// event.put(std::move(VHitVec), "VPlaneLaserHits"); -// event.put(std::move(YHitVec), "YPlaneLaserHits"); -// return; -// } -// }// end if laser system number two - - - // Loop over all raw digit entries - for (auto const &RawDigit : *DigitVecHandle) { - // Get channel ID - raw::ChannelID_t channel = RawDigit.Channel(); - - // Skip channel if dead or noisy - if (ChannelFilter.Status(channel) < fParameterSet.MinAllowedChanStatus || - !ChannelFilter.IsPresent(channel)) { - continue;// jump to next iterator in RawDigit loop - } - - // Extract data into RawADC vector and uncompress it - raw::Uncompress(RawDigit.ADCs(), RawADC, RawDigit.Compression()); - - // Copy the Raw ADC digit (short) into the signal vector (float) - std::copy(RawADC.begin(), RawADC.end(), RawROI.begin()); - - if (fPedestalStubtract) { - for (auto &RawSample : RawROI) { - RawSample -= PedestalRetrievalAlg.PedMean(channel); - } - } - // Create the region of interest (in this case the whole wire) - RegionOfInterest.add_range(0, RawROI.begin(), RawROI.end()); + std::vector Wires; - // Create a Wire object with the raw signal - WireVec.emplace_back(recob::WireCreator(std::move(RegionOfInterest), RawDigit).move()); + lasercal::LaserHits AllLaserHits; - } // end loop over raw digit entries + if (fUseCalData){ + event.getByLabel(fCalDataTag, WireVecHandle); + AllLaserHits = lasercal::LaserHits(WireVecHandle, fParameterSet, *LaserBeamHandle); + } + else { + auto Wires = lasercal::GetWires(DigitVecHandle, fParameterSet, fPedestalStubtract); + AllLaserHits = lasercal::LaserHits(Wires, fParameterSet, *LaserBeamHandle); + } // Create Laser Hits out of Wires - lasercal::LaserHits AllLaserHits(WireVec, fParameterSet, *LaserBeamHandle); // Filter for time matches of at least two planes // AllLaserHits.TimeMatchFilter(); // Fill plane specific hit vectors - UHitVec = AllLaserHits.GetPlaneHits(0); - VHitVec = AllLaserHits.GetPlaneHits(1); - YHitVec = AllLaserHits.GetPlaneHits(2); + //UHitVec = AllLaserHits.GetPlaneHits(0); + //VHitVec = AllLaserHits.GetPlaneHits(1); + //YHitVec = AllLaserHits.GetPlaneHits(2); + + HitVec = AllLaserHits.GetHits(); // std::cout << fDetProperties->ConvertXToTicks(100,2,0,0) << std::endl; @@ -356,9 +266,11 @@ namespace LaserReco { // std::cout << YHitVec->size() << std::endl; // Fill Hits of all planes into the new - event.put(std::move(UHitVec), "UPlaneLaserHits"); - event.put(std::move(VHitVec), "VPlaneLaserHits"); - event.put(std::move(YHitVec), "YPlaneLaserHits"); + //event.put(std::move(UHitVec), "UPlaneLaserHits"); + //event.put(std::move(VHitVec), "VPlaneLaserHits"); + //event.put(std::move(YHitVec), "YPlaneLaserHits"); + + event.put(std::move(HitVec)); } // LaserReco::analyze() // Gives out a vector of WireIDs which cross a certain input wire diff --git a/LaserReco/LaserSpotter_module.cc b/LaserReco/LaserSpotter_module.cc old mode 100644 new mode 100755 index d6db832..84e5c56 --- a/LaserReco/LaserSpotter_module.cc +++ b/LaserReco/LaserSpotter_module.cc @@ -7,9 +7,9 @@ #include "art/Framework/Core/EDFilter.h" #include "art/Framework/Principal/Event.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" #include "larevt/CalibrationDBI/Interface/DetPedestalService.h" #include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h" @@ -46,6 +46,8 @@ * */ +auto laser_sign = [] (int x) { return -2 * x + 3; }; // no fuking ifs! + namespace LaserSpotter { class LaserSpotter : public art::EDFilter { @@ -64,12 +66,24 @@ namespace LaserSpotter { void reconfigure(fhicl::ParameterSet const &p); private: + bool fManualBox; + + // for automatic mode + uint fTickWidth; + uint fWireWidth; + + // for manual mode lasercal::LaserRecoParameters fParameterSet; ///< ficl parameter structure std::vector fCenterTicks, fTickWidths; std::vector< std::pair < unsigned int, unsigned int> >fWireBoxes; + // filter parameters unsigned int fMinHits; + + + bool fPedestalStubtract; + bool fDebug; protected: }; @@ -92,11 +106,17 @@ namespace LaserSpotter { fPedestalStubtract = pset.get ("PedestalSubtract", true); // --------------------------------------------- Spotter Parameters ---------------------------------------------- // - fCenterTicks = pset_box.get >("CenterTicks"); - fTickWidths = pset_box.get >("TickWidths"); - fWireBoxes = pset_box.get>>("WireBoxes"); - fMinHits = pset_box.get ("MinHits"); + fDebug = pset_box.get("Debug", false); + + fTickWidth = pset_box.get("TickWidth", 100); + fWireWidth = pset_box.get("WireWidth", 100); + fMinHits = pset_box.get("MinHits", 10); + fManualBox = pset_box.get("ManualBox", false); + // in manual mode + fCenterTicks = pset_box.get >("CenterTicks", std::vector ()); + fTickWidths = pset_box.get >("TickWidths", std::vector ()); + fWireBoxes = pset_box.get>>("WireBoxes", std::vector> ()); // --------------------------------------------- File Handling Parameters --------------------------------------- // // Tag for reading raw digit data @@ -146,7 +166,7 @@ namespace LaserSpotter { // Get the necessary products art::ValidHandle > DigitVecHandle = evt.getValidHandle>(fParameterSet.RawDigitTag); - art::ValidHandle LaserBeamHandle = evt.getValidHandle(fParameterSet.GetLaserBeamTag()); + art::ValidHandle LaserBeam = evt.getValidHandle(fParameterSet.GetLaserBeamTag()); //TODO: Implement adjustements of box due to drift field @@ -157,24 +177,37 @@ namespace LaserSpotter { fParameterSet.UseROI = true; std::pair WireRange; - auto laserid = LaserBeamHandle->GetLaserID(); + auto laserid = LaserBeam->GetLaserID(); int Plane = 2; - if (0 < laserid < 2) { - CenterTick = fCenterTicks.at(laserid - 1); - TickWidth = fTickWidths.at(laserid - 1); - WireRange.first = fWireBoxes.at(laserid-1).first; - WireRange.second = fWireBoxes.at(laserid-1).second; - - //std::cout << "Box Definitions for LCS" << laserid << std::endl;; - //std::cout << "Wires range: [" << WireRange.first << ", " << WireRange.second << "]" << std::endl; - //std::cout << "Tick range: [" << CenterTick - TickWidth/2 << ", " << CenterTick + TickWidth/2 << "]" << std::endl; - - } else { - // TODO: Emmit proper error message within the art framework - std::cout << "laser ID not recoginized" << std::endl; - exit(-1); + + + if (fManualBox) { + if (0 < laserid && laserid < 2) { + CenterTick = fCenterTicks.at(laserid - 1); + TickWidth = fTickWidths.at(laserid - 1); + WireRange.first = fWireBoxes.at(laserid - 1).first; + WireRange.second = fWireBoxes.at(laserid - 1).second; + } else { + // TODO: Emmit proper error message within the art framework + std::cout << "laser ID not recoginized" << std::endl; + exit(-1); + } + } + else { + lasercal::LaserBeam DummyLaserBeam(LaserBeam->GetLaserPosition(), TVector3(0,0,1)); + CenterTick = DummyLaserBeam.getEntryTick(); + TickWidth = fTickWidth; + WireRange.first = DummyLaserBeam.getEntryWire().at(Plane).Wire; + WireRange.second = DummyLaserBeam.getEntryWire().at(Plane).Wire + laser_sign(laserid) * fWireWidth; } + if (fDebug) { + std::cout << "Box Definitions for LCS" << laserid << std::endl;; + std::cout << "Wires range: [" << WireRange.first << ", " << WireRange.second << "]" << std::endl; + std::cout << "Tick range: [" << CenterTick - TickWidth/2 << ", " << CenterTick + TickWidth/2 << "]" << std::endl; + } + + auto wires = lasercal::GetWires(DigitVecHandle, fParameterSet, fPedestalStubtract); auto laser_roi = lasercal::LaserROI(); @@ -199,4 +232,4 @@ namespace LaserSpotter { DEFINE_ART_MODULE(LaserSpotter) } -#endif //LaserSpotter_Module \ No newline at end of file +#endif //LaserSpotter_Module diff --git a/LaserReco/LaserWireMap.fcl b/LaserReco/LaserWireMap.fcl new file mode 100755 index 0000000..0fa36bd --- /dev/null +++ b/LaserReco/LaserWireMap.fcl @@ -0,0 +1,82 @@ +## +## A "minimal" Reconstruction for uboone data +## +#include "services_microboone.fcl" +#include "reco_uboone_data_minimal.fcl" + +process_name: RecoDataMinimal + +services: +{ + scheduler: { defaultExceptions: false } # Make all uncaught exceptions fatal. + # Load the service that manages root files for histograms. + message: @local::microboone_message_services_prod_debug + FileCatalogMetadata: @local::art_file_catalog_data + @table::microboone_reco_minimal_services +} +services.DatabaseUtil.ShouldConnect: false + + + +#source is now a root file +source: +{ + module_type: RootInput + maxEvents: 1 # Number of events to create +} + +# Define and configure some modules to do work on each event. +# First modules are defined; they are scheduled later. +# Modules are grouped by type. +physics: +{ + producers: + { + LaserCalibration: + { + module_type: "LaserWireMap" + } + } + + # define the producer and filter modules for this path, order matters, + # filters reject all following items. see lines starting physics.producers below + reco: [ LaserCalibration ] + + # trigger_paths is a keyword and contains the paths that modify the art::event, + # ie filters and producers + trigger_paths: [reco] + +} + +services.message.destinations : +{ + STDCOUT: + { + type: "cout" #tells the message service to output this destination to cout + threshold: "WARNING" #tells the message service that this destination applies to WARNING and higher level messages + append: true #says to append all messages to the output + categories: + { + ChannelFilter: + { + limit: 0 + reportEvery: 0 + } + TrackStitcher: + { + limit: 0 + reportEvery: 0 + } + CRHitRemoval: + { + limit: 0 + reportEvery: 0 + } + default: + { + limit: -1 #don't print anything at the infomsg level except the explicitly named categories + reportEvery: 1 + } + } + } +} diff --git a/LaserReco/LaserWireMap_module.cc b/LaserReco/LaserWireMap_module.cc new file mode 100755 index 0000000..ee9f427 --- /dev/null +++ b/LaserReco/LaserWireMap_module.cc @@ -0,0 +1,150 @@ +// LaserWireMap_module.cc + +#ifndef LaserWireMap_Module +#define LaserWireMap_Module + +// LArSoft includes +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" + +#include "larcore/Geometry/Geometry.h" +#include "larcore/Geometry/GeometryCore.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" +#include "larcore/CoreUtils/ServiceUtil.h" + +// Framework includes +#include "art/Framework/Core/EDProducer.h" + +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "art/Framework/Services/Optional/TFileService.h" +#include "art/Framework/Core/ModuleMacros.h" +#include "messagefacility/MessageLogger/MessageLogger.h" +#include "fhiclcpp/ParameterSet.h" + + +// uBooNE includes +#include "lardata/Utilities/AssociationUtil.h" +#include "lardata/DetectorInfoServices/DetectorPropertiesService.h" + +// #include "uboone/Utilities/SignalShapingServiceMicroBooNE.h" +#include "larevt/CalibrationDBI/Interface/DetPedestalService.h" +#include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h" +#include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" +#include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" + +// ROOT includes. Note: To look up the properties of the ROOT classes, +// use the ROOT web site; e.g., +// +#include "TH1.h" +#include "TH2.h" +#include "TCanvas.h" +#include "TTree.h" +#include "TLorentzVector.h" +#include "TVector3.h" +#include "TFile.h" + +// C++ Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Laser Module Classes +#include "LaserObjects/LaserHits.h" +#include "LaserObjects/LaserUtils.h" +#include "LaserObjects/LaserBeam.h" +#include "LaserObjects/LaserParameters.h" + +namespace { + +} // local namespace + + +namespace LaserWireMap { + + class LaserWireMap : public art::EDProducer { + public: + explicit LaserWireMap(fhicl::ParameterSet const ¶meterSet); + + virtual void beginJob() /*override*/; + + virtual void endJob() /*override*/; + + virtual void reconfigure(fhicl::ParameterSet const ¶meterSet) /*override*/; + + // The analysis routine, called once per event. + virtual void produce(art::Event &event) /*override*/; + + private: + geo::GeometryCore const *fGeometry; ///< pointer to Geometry provider + + std::string fFileName = "WireIndexMap.root"; + + std::map UMap; + std::map VMap; + std::map YMap; + + }; // class LaserWireMap + + + + // Constructor + LaserWireMap::LaserWireMap(fhicl::ParameterSet const &pset) { + fGeometry = &*(art::ServiceHandle()); + this->reconfigure(pset); + + } + + + //----------------------------------------------------------------------- + void LaserWireMap::beginJob() { + + } + + + void LaserWireMap::endJob() { + TFile* OutputFile = new TFile(fFileName.c_str(), "RECREATE"); + + OutputFile->WriteObject(&UMap,"UMap"); + OutputFile->WriteObject(&VMap,"VMap"); + OutputFile->WriteObject(&YMap,"YMap"); + } + +//----------------------------------------------------------------------- + + void LaserWireMap::reconfigure(fhicl::ParameterSet const ¶meterSet) { + + } + + //----------------------------------------------------------------------- + void LaserWireMap::produce(art::Event &event) { + art::ValidHandle > DigitVecHandle = event.getValidHandle>( + "daq"); + + unsigned int Index = 0; + for (auto const &RawDigit : *DigitVecHandle) { + raw::ChannelID_t channel = RawDigit.Channel(); + if (fGeometry->ChannelToWire(channel).front().Plane == 2) // If wire plane is Y-plane + { + YMap[fGeometry->ChannelToWire(channel).front().Wire] = Index; + } else if (fGeometry->ChannelToWire(channel).front().Plane == 1) // If wire plane is V-plane + { + VMap[fGeometry->ChannelToWire(channel).front().Wire] = Index; + } else if (fGeometry->ChannelToWire(channel).front().Plane == 0) // If wire plane is U-plane + { + UMap[fGeometry->ChannelToWire(channel).front().Wire] = Index; + } + } + } // LaserWireMap::analyze() + + DEFINE_ART_MODULE(LaserWireMap) +} // namespace LaserWireMap + +#endif // LaserWireMap_Module diff --git a/LaserReco/README.txt b/LaserReco/README.txt deleted file mode 100644 index aa7a055..0000000 --- a/LaserReco/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -README.txt - -12-Mar-2012 - -This directory is intended to be part of a soup-to-nuts example of how -to run a LArSoft program to perform an analysis task. - -For directions on how to set up and compile this example, see the LArSoft wiki: - - -The example program in package AnalysisExample does the following: - -- reads a file of simulated and perhaps partially-reconstructed events; - -- creates a few example histograms; - -- creates two example n-tuples; - -- has a couple of brief examples of how to use associations. - -There are comments (perhaps too many!) in every file to explain what -everything does. - -If you want to understand what you're supposed to learn from all this, -read ADDITIONAL_NOTES.txt in this directory. - diff --git a/LaserReco/laserreco.fcl b/LaserReco/laserreco.fcl old mode 100644 new mode 100755 index db0ed18..bf61786 --- a/LaserReco/laserreco.fcl +++ b/LaserReco/laserreco.fcl @@ -5,11 +5,15 @@ laserreco: module_type: "LaserReco" GenerateWireMap: false - UseROI: false - HitBoxSize: 10 #cm + UseROI: true + HitBoxSize: 25 #cm MinAllowedChannelStatus: 4 + LaserRecoModuleLabel: "daq" + LaserDataMergerModuleLabel: "LaserDataMerger" + LaserBeamInstanceLabel: "LaserBeam" + # High amplitude threshold for high signal exceptions for all planes HighAmplThreshold: 1000 diff --git a/LaserReco/laserspotter.fcl b/LaserReco/laserspotter.fcl old mode 100644 new mode 100755 index 6a5cd84..8146bd1 --- a/LaserReco/laserspotter.fcl +++ b/LaserReco/laserspotter.fcl @@ -12,20 +12,25 @@ laserspotter: spotter: { # Box definitions for both laser systems - CenterTicks: [5063, 5130] - TickWidths: [200, 200] - WireBoxes: [[0,100],[3354,3455]] + TickWidth: 200 + WireRange: 100 + + ManualBox: false # Filter criterias: MinHits: 10 # minimal amout of Wires with hit + + # only used in case if ManualBox is enabled. Here you can select the box size and position by hand + CenterTicks: [5063, 5130] + WireBoxes: [[0,100],[3354,3455]] } hitfinder: { # Hit Finder Definitons (only Y Hit Finder is used) GenerateWireMap: false - UseROI: false - HitBoxSize: 10 #cm + UseROI: false + HitBoxSize: 25 #cm MinAllowedChannelStatus: 4 diff --git a/LaserReco/setkdev.sh b/LaserReco/setkdev.sh deleted file mode 100644 index 03033b8..0000000 --- a/LaserReco/setkdev.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -echo $ART_INC > .kdev_include_paths -echo $LARSIM_INC >> .kdev_include_paths -echo $LARDATA_INC >> .kdev_include_paths -echo $BOOST_INC >> .kdev_include_paths -echo $LAREXAMPLES_INC >> .kdev_include_paths -echo $NUTOOLS_INC >> .kdev_include_paths -echo $LHAPDF_INC >> .kdev_include_paths -echo $UBOONEDAQ_DATATYPES_INC >> .kdev_include_paths -echo $XROOTD_INC >> .kdev_include_paths -echo $FFTW_INC >> .kdev_include_paths -echo $CETLIB_INC >> .kdev_include_paths -echo $LARRECO_INC >> .kdev_include_paths -echo $TBB_INC >> .kdev_include_paths -echo $POSTGRESQL_INCLUDE_DIR >> .kdev_include_paths -echo $GENIE_INC >> .kdev_include_paths -echo $LAREVENTDISPLAY_INC >> .kdev_include_paths -echo $LARPANDORA_INC >> .kdev_include_paths -echo $GSL_INC >> .kdev_include_paths -echo $MESSAGEFACILITY_INC >> .kdev_include_paths -echo $PANDORA_INC >> .kdev_include_paths -echo $FHICLCPP_INC >> .kdev_include_paths -echo $LAREVT_INC >> .kdev_include_paths -echo $LARSIM_INC >> .kdev_include_paths -echo $LIBWDA_INC >> .kdev_include_paths -echo $FFTW_INCLUDE_DIR >> .kdev_include_paths -echo $UBOONECODE_INC >> .kdev_include_paths -echo $CPPUNIT_INC >> .kdev_include_paths -echo $CPP0X_INC >> .kdev_include_paths -echo $XERCES_C_INC >> .kdev_include_paths -echo $LIBXML2_INC >> .kdev_include_paths -echo $MYSQL_CLIENT_INC >> .kdev_include_paths -echo $LARCORE_INC >> .kdev_include_paths -echo $LARPANDORACONTENT_INC >> .kdev_include_paths -echo $CLHEP_INCLUDE_DIR >> .kdev_include_paths -echo $ARTEXTENSIONS_INC >> .kdev_include_paths -echo $LOG4CPP_INC >> .kdev_include_paths -echo $ART_INC >> .kdev_include_paths -echo $CLHEP_INC >> .kdev_include_paths -echo $POSTGRESQL_INC >> .kdev_include_paths -echo $SQLITE_INC >> .kdev_include_paths -echo $LARANA_INC >> .kdev_include_paths -echo $LARDATA_INC >> .kdev_include_paths -echo $ROOT_INC >> .kdev_include_paths -echo $IFDH_ART_INC >> .kdev_include_paths -echo $PYTHIA_INC >> .kdev_include_paths -echo $PYTHON_INCLUDE >> .kdev_include_paths -echo $MRB_SOURCE/laserana >> .kdev_include_paths diff --git a/PowerAna/CMakeLists.txt b/PowerAna/CMakeLists.txt old mode 100644 new mode 100755 index f65d05d..94645dc --- a/PowerAna/CMakeLists.txt +++ b/PowerAna/CMakeLists.txt @@ -3,18 +3,18 @@ simple_plugin(PowerAna "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} diff --git a/PowerAna/PowerAna_module.cc b/PowerAna/PowerAna_module.cc old mode 100644 new mode 100755 index 388592e..a050a85 --- a/PowerAna/PowerAna_module.cc +++ b/PowerAna/PowerAna_module.cc @@ -8,19 +8,19 @@ // LArSoft includes // #include "Simulation/SimChannel.h" // #include "Simulation/LArG4Parameters.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" -#include "lardata/RecoBaseArt/HitCreator.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Cluster.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" +#include "lardata/ArtDataHelper/WireCreator.h" +#include "lardata/ArtDataHelper/HitCreator.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Cluster.h" +#include "lardataobj/RecoBase/Wire.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" // #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Principal/Event.h" @@ -28,10 +28,8 @@ #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" diff --git a/SECAna/CMakeLists.txt b/SECAna/CMakeLists.txt old mode 100644 new mode 100755 index 9378105..5c29a04 --- a/SECAna/CMakeLists.txt +++ b/SECAna/CMakeLists.txt @@ -3,19 +3,19 @@ simple_plugin(SECAna "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - lardata_MCBase - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + lardataobj_MCBase + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} diff --git a/SECAna/SECAna_module.cc b/SECAna/SECAna_module.cc old mode 100644 new mode 100755 index adbc9d4..6beabeb --- a/SECAna/SECAna_module.cc +++ b/SECAna/SECAna_module.cc @@ -28,24 +28,25 @@ // LArSoft includes // #include "Simulation/SimChannel.h" // #include "Simulation/LArG4Parameters.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" -#include "lardata/RecoBaseArt/WireCreator.h" -#include "lardata/RecoBaseArt/HitCreator.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Cluster.h" -#include "lardata/RecoBase/Wire.h" -#include "lardata/RecoBase/Track.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" +#include "lardata/ArtDataHelper/WireCreator.h" +#include "lardata/ArtDataHelper/HitCreator.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Cluster.h" +#include "lardataobj/RecoBase/Wire.h" +#include "lardataobj/RecoBase/Track.h" #include "larcore/Geometry/Geometry.h" #include "larcore/Geometry/GeometryCore.h" -#include "larcore/SimpleTypesAndConstants/geo_types.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_types.h" -#include "SimulationBase/MCParticle.h" -#include "SimulationBase/MCTruth.h" -#include "lardata/MCBase/MCTrack.h" + +//#include "SimulationBase/MCParticle.h" +//#include "SimulationBase/MCTruth.h" +#include "lardataobj/MCBase/MCTrack.h" // Framework includes -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" // #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Core/EDAnalyzer.h" #include "art/Framework/Principal/Event.h" @@ -53,10 +54,8 @@ #include "art/Framework/Services/Registry/ServiceHandle.h" #include "art/Framework/Services/Optional/TFileService.h" #include "art/Framework/Core/ModuleMacros.h" -#include "art/Framework/Core/FindManyP.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "fhiclcpp/ParameterSet.h" -#include "art/Persistency/Common/Ptr.h" // uBooNE includes #include "lardata/Utilities/AssociationUtil.h" @@ -227,7 +226,7 @@ namespace SECAna { std::vector fTrackTag; ///< Track tags art::InputTag fMCTrackTag; //std::array fUVYThresholds; ///< U,V,Y-plane threshold in ADC counts for the laser hit finder - ofstream OFile; + std::ofstream OFile; }; // class SECAna diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt old mode 100644 new mode 100755 index 8cafa1f..9ff8386 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,18 +9,18 @@ simple_plugin(LaserUtilsTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -32,18 +32,18 @@ simple_plugin(LaserHitFinderTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -55,18 +55,18 @@ simple_plugin(LaserObjectsTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -78,18 +78,18 @@ simple_plugin(LaserSpotterTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -101,18 +101,18 @@ simple_plugin(LaserHitGenerator "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -124,18 +124,18 @@ simple_plugin(LaserRawDigitGenerator "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -147,18 +147,18 @@ simple_plugin(LaserRawDigitGenTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -170,18 +170,18 @@ simple_plugin(LaserSpotterGenTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -193,18 +193,18 @@ simple_plugin(LaserRecoTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -216,18 +216,18 @@ simple_plugin(LaserMergerTest "module" LaserObjects larcore_Geometry_Geometry_service larcore_Geometry - lardata_RecoBaseArt - lardata_RecoBase - lardata_RawData - ${SIMULATIONBASE} + lardata_ArtDataHelper + lardataobj_RecoBase + lardataobj_RawData + nusimdata_SimulationBase ${ART_FRAMEWORK_CORE} ${ART_FRAMEWORK_PRINCIPAL} ${ART_FRAMEWORK_SERVICES_REGISTRY} ${ART_FRAMEWORK_SERVICES_OPTIONAL} ${ART_FRAMEWORK_SERVICES_OPTIONAL_TFILESERVICE_SERVICE} - ${ART_PERSISTENCY_COMMON} - ${ART_PERSISTENCY_PROVENANCE} - ${ART_UTILITIES} + art_Persistency_Common canvas_Persistency_Common + art_Persistency_Provenance canvas_Persistency_Provenance + art_Utilities canvas_Utilities ${MF_MESSAGELOGGER} ${MF_UTILITIES} ${CETLIB} @@ -235,6 +235,21 @@ simple_plugin(LaserMergerTest "module" BASENAME_ONLY ) +simple_plugin(LaserBeamTest "module" + LaserObjects + larcore_Geometry_Geometry_service + larcore_Geometry + lardata_ArtDataHelper + nusimdata_SimulationBase + ${ART_FRAMEWORK_CORE} + ${ART_FRAMEWORK_PRINCIPAL} + ${ART_FRAMEWORK_SERVICES_REGISTRY} + ${CETLIB} + ${ROOT_BASIC_LIB_LIST} + BASENAME_ONLY + ) + + #cet_test( LaserUtilsTest HANDBUILT # TEST_EXEC lar # TEST_ARGS -c LaserUtilsTest.fcl $ENV{MRB_TOP}/runs/TestEvent.root @@ -253,39 +268,67 @@ simple_plugin(LaserMergerTest "module" cet_test( RawDigit_SingleGeneration HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserRawDigitGeneratorTest1.fcl - DATAFILES RawDigits_Test_SingleGeneration.txt + DATAFILES ./spotter/RawDigits_Test_SingleGeneration.txt ) cet_test( RawDigit_MultiGeneration HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserRawDigitGeneratorTest2.fcl - DATAFILES RawDigits_Test_MultiGeneration.txt + DATAFILES ./spotter/RawDigits_Test_MultiGeneration.txt ) cet_test( RawDigit_MultiplicityGeneration HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserRawDigitGeneratorTest3.fcl - DATAFILES RawDigits_Test_MultiplicityGeneration.txt + DATAFILES ./spotter/RawDigits_Test_MultiplicityGeneration.txt ) cet_test( RawDigit_MultiplicityError HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserRawDigitGeneratorTest4.fcl - DATAFILES RawDigits_Test_MultiplicityError.txt + DATAFILES ./spotter/RawDigits_Test_MultiplicityError.txt ) set_tests_properties(RawDigit_MultiplicityError PROPERTIES PASS_REGULAR_EXPRESSION Multiplicity error @) +cet_test( LaserBeam_Test HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserBeamTest.fcl + ) + +cet_test( LaserMerger_Merging_LCS1 HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserMerger_TestMerging_LCS1.fcl + DATAFILES ./merger/WireIndexMap.root ./merger/HitDefs-10000.txt ./merger/Run-10000.txt ./merger/TimeMap-10000.root + ) + +cet_test( LaserMerger_Merging_LCS2 HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserMerger_TestMerging_LCS2.fcl + DATAFILES ./merger/WireIndexMap.root ./merger/HitDefs-10001.txt ./merger/Run-10001.txt ./merger/TimeMap-10001.root + ) + +cet_test( LaserMerger_Mapping HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserMerger_TestMapping.fcl + DATAFILES ./merger/WireIndexMap.root ./merger/HitDefs-10002.txt ./merger/Run-10002.txt ./merger/TimeMap-10002.root + ) cet_test( LaserSpotter_HitLevels HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserSpotterGenHitsTest_Levels.fcl - DATAFILES RawDigits_HitLevel.txt ./spotter/TimeMap-999999.root ./spotter/Run-999999.txt + DATAFILES ./spotter/RawDigits_HitLevel.txt ./spotter/TimeMap-999999.root ./spotter/Run-999999.txt + ) + +cet_test( LaserSpotter_ManualBox HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserSpotterGenHitsManual.fcl + DATAFILES ./spotter/RawDigits_Threshold.txt ./spotter/TimeMap-999999.root ./spotter/Run-999999.txt ) cet_test( LaserSpotter_Threshold HANDBUILT TEST_EXEC lar TEST_ARGS -c LaserSpotterGenHitsTest_Threshold.fcl - DATAFILES RawDigits_Threshold.txt ./spotter/TimeMap-999999.root ./spotter/Run-999999.txt + DATAFILES ./spotter/RawDigits_Threshold.txt ./spotter/TimeMap-999999.root ./spotter/Run-999999.txt ) cet_test( LaserReco_SingleTrack HANDBUILT @@ -294,12 +337,27 @@ cet_test( LaserReco_SingleTrack HANDBUILT DATAFILES ./reco/WireIndexMap.root ./reco/HitDefs-10000.txt ./reco/Run-10000.txt ./reco/TimeMap-10000.root ) -cet_test( LaserMerger_Merging HANDBUILT +cet_test( LaserReco_VerticalSpread HANDBUILT TEST_EXEC lar - TEST_ARGS -c LaserMerger_TestMerging.fcl - DATAFILES ./merger/WireIndexMap.root ./merger/HitDefs-10000.txt ./merger/Run-10000.txt ./merger/TimeMap-10000.root + TEST_ARGS -c LaserReco_TestVerticalSpread.fcl + DATAFILES ./reco/WireIndexMap.root ./reco/HitDefs-10001.txt ./reco/Run-10001.txt ./reco/TimeMap-10001.root ) +cet_test( LaserReco_TestHorizontalSpread HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserReco_TestHorizontalSpread.fcl + DATAFILES ./reco/WireIndexMap.root ./reco/HitDefs-10002.txt ./reco/Run-10002.txt ./reco/TimeMap-10002.root + ) + +cet_test( LaserReco_TestROI HANDBUILT + TEST_EXEC lar + TEST_ARGS -c LaserReco_TestROI.fcl + DATAFILES ./reco/WireIndexMap.root ./reco/HitDefs-10003.txt ./reco/Run-10003.txt ./reco/TimeMap-10003.root + ) + + +#cet_test( LaserBeamTest LIBRARIES LaserObjects ) + # Add test items here #cet_test( LaserSpotterTest1 HANDBUILT # TEST_EXEC lar @@ -330,7 +388,7 @@ cet_test( LaserMerger_Merging HANDBUILT # $ENV{MRB_SOURCE}/laserana/test/spotter/LaserRun-3007-151.root # $ENV{MRB_SOURCE}/laserana/test/spotter/LaserRun-3007-154.root # ) -#cet_test( LaserUtils_test LIBRARIES LaserObjects ) + install_headers() install_fhicl() diff --git a/test/LaserBeamTest_module.cc b/test/LaserBeamTest_module.cc new file mode 100755 index 0000000..9431b73 --- /dev/null +++ b/test/LaserBeamTest_module.cc @@ -0,0 +1,108 @@ +//////////////////////////////////////////////////////////////////////// +// Class: LaserBeamTest +// Module Type: analyzer +// File: LaserBeamTest_module.cc +// +// Generated at Fri Oct 28 13:49:04 2016 by matthias,,, using artmod +// from cetpkgsupport v1_10_01. +//////////////////////////////////////////////////////////////////////// + +#include "art/Framework/Core/EDAnalyzer.h" +#include "art/Framework/Core/ModuleMacros.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Principal/Run.h" +#include "art/Framework/Principal/SubRun.h" +#include "canvas/Utilities/InputTag.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" +#include "LaserObjects/LaserHits.h" +#include "LaserObjects/LaserBeam.h" + +#include "LaserObjects/LaserUtils.h" +#include "TMath.h" +class LaserBeamTest; + +class LaserBeamTest : public art::EDAnalyzer { +public: + explicit LaserBeamTest(fhicl::ParameterSet const &p); + // The destructor generated by the compiler is fine for classes + // without bare pointers or other resource use. + + // Plugins should not be copied or assigned. + LaserBeamTest(LaserBeamTest const &) = delete; + + LaserBeamTest(LaserBeamTest &&) = delete; + + LaserBeamTest &operator=(LaserBeamTest const &) = delete; + + LaserBeamTest &operator=(LaserBeamTest &&) = delete; + + // Required functions. + void analyze(art::Event const &e) override; + + void reconfigure(fhicl::ParameterSet const &pset) override; + + void beginJob() override; + +private: + +}; + + +LaserBeamTest::LaserBeamTest(fhicl::ParameterSet const &pset) + : + EDAnalyzer(pset) // , +{ + this->reconfigure(pset); +} + +void LaserBeamTest::analyze(art::Event const &event) { + + detinfo::DetectorProperties const *DetProperties = lar::providerFrom(); + geo::GeometryCore const* Geometry = &*(art::ServiceHandle()); + + TVector3 Position(120., 0., -10.); + TVector3 Direction(0., 0., 1.); + + lasercal::LaserBeam LaserBeam(Position, Direction); + + LaserBeam.Print(); + + std::cout << "==> Testing Laser Beam" << std::endl; + std::cout << "tick entry / exit " << LaserBeam.getEntryTick() << " / " << LaserBeam.getExitTick() << std::endl; + std::cout << "(U) entry / exit wire: " << LaserBeam.getEntryWire().at(0) << " / " << LaserBeam.getExitWire().at(0) << std::endl; + std::cout << "(V) entry / exit wire: " << LaserBeam.getEntryWire().at(1) << " / " << LaserBeam.getExitWire().at(1) << std::endl; + std::cout << "(Y) entry / exit wire: " << LaserBeam.getEntryWire().at(2) << " / " << LaserBeam.getExitWire().at(2) << std::endl; + + auto sample_rate = DetProperties->SamplingRate() / 1000; // in us + auto tick_offset = DetProperties->TriggerOffset(); // in ticks + auto drift_speed = DetProperties->DriftVelocity(); // in cm/us + + auto expected_entry_tick = (int) ((Position.X()) / drift_speed / sample_rate) + tick_offset; + assert(LaserBeam.getEntryTick() == (int)expected_entry_tick); + assert(LaserBeam.getExitTick() == (int)expected_entry_tick); + + // entry positions + assert(LaserBeam.getEntryWire().at(0).Wire == 338); + assert(LaserBeam.getEntryWire().at(1).Wire == 333); + assert(LaserBeam.getEntryWire().at(2).Wire == 0); + + // exit positions + assert(LaserBeam.getExitWire().at(0).Wire == 2066); + assert(LaserBeam.getExitWire().at(1).Wire == 2061); + assert(LaserBeam.getExitWire().at(2).Wire == 3455); + + + + +} + +void LaserBeamTest::reconfigure(fhicl::ParameterSet const &pset) { +} + +void LaserBeamTest::beginJob() { +} + + +DEFINE_ART_MODULE(LaserBeamTest) diff --git a/test/LaserMergerTest_module.cc b/test/LaserMergerTest_module.cc old mode 100644 new mode 100755 index 8b6cd38..d31ed20 --- a/test/LaserMergerTest_module.cc +++ b/test/LaserMergerTest_module.cc @@ -13,14 +13,14 @@ #include "art/Framework/Principal/Handle.h" #include "art/Framework/Principal/Run.h" #include "art/Framework/Principal/SubRun.h" -#include "art/Utilities/InputTag.h" +#include "canvas/Utilities/InputTag.h" #include "fhiclcpp/ParameterSet.h" #include "messagefacility/MessageLogger/MessageLogger.h" #include "LaserObjects/LaserHits.h" #include "LaserObjects/LaserBeam.h" #include "LaserObjects/LaserUtils.h" - +#include "TMath.h" class LaserMergerTest; class LaserMergerTest : public art::EDAnalyzer { @@ -69,10 +69,34 @@ void LaserMergerTest::analyze(art::Event const &event) { art::ValidHandle LaserBeam = event.getValidHandle(DigitTag); + double precision = 0.0001; if (fTestConfigFile.compare("HitDefs-10000.txt") == 0) { std::cout << "==> Testing Merging Laser 1 " << id << std::endl; assert(LaserBeam->GetLaserID() == 1); + assert(LaserBeam->GetTime().sec == (int)id); + assert(LaserBeam->GetTime().usec == (int)id); + assert(LaserBeam->GetLaserEventID() == (int)id); + assert(LaserBeam->GetAssID() == (int)id); + assert(LaserBeam->GetPower() == (float) id / 4.); + + TVector3 Position = LaserBeam->GetLaserPosition(); + TVector3 Pos(0, 0, 0); + assert(Position == Pos); + + TVector3 Direction = LaserBeam->GetLaserDirection(); + + auto reminder = Direction.X() - TMath::Sin(TMath::DegToRad() * (id - 2.)); + assert(-precision < reminder && reminder < precision); + + reminder = Direction.Z() - TMath::Cos(TMath::DegToRad() * (id - 2.)); + assert(-precision < reminder && reminder < precision); + + } + + if (fTestConfigFile.compare("HitDefs-10001.txt") == 0) { + std::cout << "==> Testing Merging Laser 2 " << id << std::endl; + assert(LaserBeam->GetLaserID() == 2); assert(LaserBeam->GetTime().sec == id); assert(LaserBeam->GetTime().usec == id); assert(LaserBeam->GetLaserEventID() == id); @@ -80,13 +104,28 @@ void LaserMergerTest::analyze(art::Event const &event) { assert(LaserBeam->GetPower() == (float) id / 4.); TVector3 Position = LaserBeam->GetLaserPosition(); - TVector3 Pos(0, 0, 0); + TVector3 Pos(1., 1., 1.); assert(Position == Pos); TVector3 Direction = LaserBeam->GetLaserDirection(); - assert(Direction.Theta() - id - 2.0 < 0.0001); - assert(std::fmod(Direction.Phi(), 90.) < 0.0001); + auto reminder = TMath::RadToDeg() * Direction.Theta() - (double) abs(id - 2.) * 10.; + assert(-precision < reminder && reminder < precision); + + if (id < 3){ + reminder = TMath::RadToDeg() * Direction.Phi() + 90; + assert(-precision < reminder && reminder < precision); + } + else if (id >= 3){ + reminder = TMath::RadToDeg() * Direction.Phi() - 90; + assert(-precision < reminder && reminder < precision); + } + } + if (fTestConfigFile.compare("HitDefs-10002.txt") == 0) { + std::cout << "==> Testing Mapping " << id << std::endl; + // order should be [3, 2, 4, 0, 1] + assert(LaserBeam->GetTime().sec == id); + assert(LaserBeam->GetAssID() == LaserBeam->GetLaserEventID()); } } diff --git a/test/LaserRawDigitGenerator_module.cc b/test/LaserRawDigitGenerator_module.cc old mode 100644 new mode 100755 index 32203ad..ba84185 --- a/test/LaserRawDigitGenerator_module.cc +++ b/test/LaserRawDigitGenerator_module.cc @@ -13,14 +13,14 @@ #include "art/Framework/Principal/Handle.h" #include "art/Framework/Principal/Run.h" #include "art/Framework/Principal/SubRun.h" -#include "art/Utilities/InputTag.h" +#include "canvas/Utilities/InputTag.h" #include "fhiclcpp/ParameterSet.h" #include "messagefacility/MessageLogger/MessageLogger.h" -#include "art/Utilities/Exception.h" +#include "canvas/Utilities/Exception.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RawData/raw.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RawData/raw.h" #include "larcore/Geometry/Geometry.h" #include "lardata/DetectorInfoServices/DetectorPropertiesService.h" @@ -35,6 +35,13 @@ #include "LaserObjects/LaserUtils.h" +namespace { +#ifndef uint + using uint = unsigned int; +#endif + +} + class LaserRawDigitGenerator; /* This module produces Gaussian hits which can be specified in the RawDigit file. It fills the rest of @@ -88,7 +95,7 @@ class LaserRawDigitGenerator : public art::EDProducer { // inner most vector is configuration for hit // middle vector contains all hits for the specific event // outer vector contians hits over all events - std::vector > > RawDigitValues; ///< line by line csv container + std::unique_ptr< std::vector > > > RawDigitValues; ///< line by line csv container bool DEBUG = false; @@ -115,13 +122,13 @@ void LaserRawDigitGenerator::produce(art::Event &event) { std::unique_ptr > RawWires(new std::vector); // Handle config vs events - if (id > RawDigitValues.size() - 1) { + if (id > RawDigitValues->size() - 1) { event.put(std::move(RawWires), fRawDigitLabel); return; }; boost::random::mt19937 gen; - auto RawDigitsInThisEvent = RawDigitValues.at(id); + auto RawDigitsInThisEvent = RawDigitValues->at(id); //std::vector RawWires; // create all hits in this event @@ -185,14 +192,14 @@ void LaserRawDigitGenerator::produce(art::Event &event) { RawWires->emplace_back(std::move(RawDigit)); WireADCSignal.clear(); } - if (DEBUG) { - for (auto Wire : *RawWires) { - std::cout << "channel: " << Wire.Channel() << std::endl; - for (auto ADC : Wire.ADCs()) { - std::cout << ADC << " "; - } - } - } + //if (DEBUG) { + // for (auto Wire : *RawWires) { + // std::cout << "channel: " << Wire.Channel() << std::endl; + // for (auto ADC : Wire.ADCs()) { + // std::cout << ADC << " "; + // } + // } + //} event.put(std::move(RawWires), fRawDigitLabel); diff --git a/test/LaserSpotterGenTest_module.cc b/test/LaserSpotterGenTest_module.cc old mode 100644 new mode 100755 index 4b9c02d..871c069 --- a/test/LaserSpotterGenTest_module.cc +++ b/test/LaserSpotterGenTest_module.cc @@ -13,10 +13,17 @@ #include "art/Framework/Principal/Handle.h" #include "art/Framework/Principal/Run.h" #include "art/Framework/Principal/SubRun.h" -#include "art/Utilities/InputTag.h" +#include "canvas/Utilities/InputTag.h" #include "fhiclcpp/ParameterSet.h" #include "messagefacility/MessageLogger/MessageLogger.h" +namespace { + +#ifndef uint + using uint = unsigned int; +#endif + +} class LaserSpotterGenTest; diff --git a/test/LaserSpotterTest_module.cc b/test/LaserSpotterTest_module.cc old mode 100644 new mode 100755 index bf2a52a..045746d --- a/test/LaserSpotterTest_module.cc +++ b/test/LaserSpotterTest_module.cc @@ -7,9 +7,9 @@ #include "art/Framework/Core/EDFilter.h" #include "art/Framework/Principal/Event.h" -#include "lardata/RawData/RawDigit.h" -#include "lardata/RecoBase/Hit.h" -#include "lardata/RecoBase/Wire.h" +#include "lardataobj/RawData/RawDigit.h" +#include "lardataobj/RecoBase/Hit.h" +#include "lardataobj/RecoBase/Wire.h" #include "larevt/CalibrationDBI/Interface/DetPedestalService.h" #include "larevt/CalibrationDBI/Interface/DetPedestalProvider.h" @@ -153,7 +153,7 @@ namespace LaserSpotter { auto laserid = LaserBeamHandle->GetLaserID(); int Plane = 2; - if (0 < laserid < 2) { + if (0 < laserid && laserid < 2) { CenterTick = fCenterTicks.at(laserid - 1); TickWidth = fTickWidths.at(laserid - 1); WireRange.first = fWireBoxes.at(laserid-1).first; diff --git a/ups/product_deps b/ups/product_deps old mode 100644 new mode 100755 index f0cb179..43ad78f --- a/ups/product_deps +++ b/ups/product_deps @@ -3,7 +3,7 @@ # The *parent* line must the first non-commented line and defines this product and version # The version should be of the form vxx_yy_zz (e.g. v01_02_03) parent lasercalibration v04_32_01 -defaultqual e9 +defaultqual e10 # These optional lines define the installed directories where headers, # libraries, and executables will be found. @@ -32,17 +32,17 @@ flcdir product_dir fcl # Add the dependent product and version product version -larsoft v05_08_00 -gcc v4_9_3 -cetbuildtools v4_18_04 - only_for_build +larsoft v06_26_02 +gcc v4_9_3a +cetbuildtools v5_01_03 - only_for_build end_product_list # We now define allowed qualifiers and the corresponding qualifiers for the depdencies. # Make a table by adding columns before "notes". qualifier larsoft gcc notes -e9:debug e9:debug -nq- -e9:opt e9:opt -nq- -e9:prof e9:prof -nq- +e10:debug e10:debug -nq- +e10:opt e10:opt -nq- +e10:prof e10:prof -nq- end_qualifier_list # Preserve tabs and formatting in emacs and vi / vim: