Skip to content

Commit 319207e

Browse files
committed
Merge branch 'dev' into MFTSup_Sept2019
2 parents 675fa6e + a8504ec commit 319207e

1,486 files changed

Lines changed: 77624 additions & 84825 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.travis.yml‎

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,53 @@ matrix:
99
include:
1010
- os: linux
1111
dist: xenial
12-
env: TOOL=clang-format
12+
env: JOB=clang-format
1313
addons:
1414
apt:
1515
sources:
1616
- llvm-toolchain-xenial-8
1717
packages:
1818
- clang-format-8
1919
compiler: clang
20+
script: |
21+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
22+
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH)
23+
echo "Running clang-format-8 against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
24+
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -ivE 'LinkDef|Utilities/PCG/')
25+
RESULT_OUTPUT="$(git-clang-format-8 --commit $BASE_COMMIT --diff --binary `which clang-format-8` $COMMIT_FILES)"
26+
27+
for x in $COMMIT_FILES; do
28+
case $x in
29+
*.h|*.cxx)
30+
# We remove the header from the diff as it contains +++ then
31+
# we only select the added lines to check for the long ones.
32+
# We do not need to check for the lines which have been removed
33+
# and we do not want to check for the lines which were not changed
34+
# to avoid extra work.
35+
# 120 characters are allowed, meaning the error should start with 122,
36+
# to allow for the starting + at the end of the line.
37+
git diff $x | tail -n +5 | grep -e '^+' | grep '.\{122,\}' && { echo "Line longer than 120 chars in $x." && exit 1; } || true ;;
38+
*.hxx|*.cc|*.hpp) echo "$x uses non-allowed extension." && exit 1 ;;
39+
*) ;;
40+
esac
41+
done
42+
43+
if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
44+
|| [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then
45+
echo "clang-format passed."
46+
exit 0
47+
else
48+
echo "clang-format failed."
49+
echo "To reproduce it locally please run"
50+
echo -e "\tgit checkout $TRAVIS_BRANCH"
51+
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
52+
echo "$RESULT_OUTPUT"
53+
exit 1
54+
fi
55+
fi
2056
- os: linux
21-
env: TOOL=doxygen
57+
dist: bionic
58+
env: JOB=doxygen
2259
addons:
2360
apt:
2461
packages:
@@ -28,59 +65,16 @@ matrix:
2865
- doxygen-gui
2966
- graphviz
3067
- cmake
68+
script: |
69+
cat > CMakeLists.txt <<\EOF
70+
add_subdirectory(doc)
71+
EOF
72+
cmake .
73+
make doc
3174
deploy:
3275
provider: pages
3376
skip_cleanup: true
3477
github_token: $GITHUB_API_TOKEN # Set in travis-ci.org dashboard
3578
local_dir: doc/html
3679
on:
3780
branch: dev
38-
script: |
39-
if [[ $TOOL == "doxygen" ]]; then
40-
cat > CMakeLists.txt <<\EOF
41-
add_subdirectory(doc)
42-
EOF
43-
# This is required because of differences between doxygen and github
44-
# markdown syntax for code blocks. The committed code should use
45-
# the github flavour and we generate the doxygen one on the fly.
46-
git grep -l '^```[a-zA-Z]' | xargs sed -i .old -e 's|```\([a-zA-Z][a-zA-Z]*\)|\n```{.\1}\n|g;s|[.]bash|.sh|g;s|```|~~~~~~~|g'
47-
find . -name "*.old" -delete
48-
cmake .
49-
make doc
50-
elif [[ $TOOL == "clang-format" ]]; then
51-
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
52-
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH)
53-
echo "Running clang-format-8 against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
54-
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -ivE 'LinkDef|Utilities/PCG/')
55-
RESULT_OUTPUT="$(git-clang-format-8 --commit $BASE_COMMIT --diff --binary `which clang-format-8` $COMMIT_FILES)"
56-
57-
for x in $COMMIT_FILES; do
58-
case $x in
59-
*.h|*.cxx)
60-
# We remove the header from the diff as it contains +++ then
61-
# we only select the added lines to check for the long ones.
62-
# We do not need to check for the lines which have been removed
63-
# and we do not want to check for the lines which were not changed
64-
# to avoid extra work.
65-
# 120 characters are allowed, meaning the error should start with 122,
66-
# to allow for the starting + at the end of the line.
67-
git diff $x | tail -n +5 | grep -e '^+' | grep '.\{122,\}' && { echo "Line longer than 120 chars in $x." && exit 1; } || true ;;
68-
*.hxx|*.cc|*.hpp) echo "$x uses non-allowed extension." && exit 1 ;;
69-
*) ;;
70-
esac
71-
done
72-
73-
if [ "$RESULT_OUTPUT" == "no modified files to format" ] \
74-
|| [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then
75-
echo "clang-format passed."
76-
exit 0
77-
else
78-
echo "clang-format failed."
79-
echo "To reproduce it locally please run"
80-
echo -e "\tgit checkout $TRAVIS_BRANCH"
81-
echo -e "\tgit-clang-format --commit $BASE_COMMIT --diff --binary $(which clang-format)"
82-
echo "$RESULT_OUTPUT"
83-
exit 1
84-
fi
85-
fi
86-
fi

‎Algorithm/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!-- doxy
12
\page refAlgorithm Module 'Algorithm'
3+
/doxy -->
4+
5+
# Algorithm
26

37
A description of this module is not yet available.
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
# granted to it by virtue of its status as an Intergovernmental Organization or
99
# submit itself to any jurisdiction.
1010

11-
o2_add_test(01
12-
SOURCES test/test_Arrow01.cxx
13-
COMPONENT_NAME arrow
14-
PUBLIC_LINK_LIBRARIES arrow::arrow_shared
15-
LABELS arrow)
11+
#add_subdirectory(Core)
12+
#add_subdirectory(Tools)
13+
#add_subdirectory(Tasks)
14+
add_subdirectory(Tutorials)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ o2_add_executable(track-iteration
2525
PUBLIC_LINK_LIBRARIES O2::Framework
2626
COMPONENT_NAME AnalysisTutorial)
2727

28+
o2_add_executable(full-track-iteration
29+
SOURCES src/fullTrackIteration.cxx
30+
PUBLIC_LINK_LIBRARIES O2::Framework
31+
COMPONENT_NAME AnalysisTutorial)
32+
2833
o2_add_executable(collision-tracks-iteration
2934
SOURCES src/collisionTracksIteration.cxx
3035
PUBLIC_LINK_LIBRARIES O2::Framework
@@ -35,6 +40,11 @@ o2_add_executable(new-collections
3540
PUBLIC_LINK_LIBRARIES O2::Framework
3641
COMPONENT_NAME AnalysisTutorial)
3742

43+
o2_add_executable(associated-derived
44+
SOURCES src/associatedExample.cxx
45+
PUBLIC_LINK_LIBRARIES O2::Framework
46+
COMPONENT_NAME AnalysisTutorial)
47+
3848
o2_add_executable(dynamic-columns
3949
SOURCES src/dynamicColumns.cxx
4050
PUBLIC_LINK_LIBRARIES O2::Framework
@@ -44,3 +54,8 @@ o2_add_executable(histograms
4454
SOURCES src/histograms.cxx
4555
PUBLIC_LINK_LIBRARIES O2::Framework
4656
COMPONENT_NAME AnalysisTutorial)
57+
58+
o2_add_executable(filters
59+
SOURCES src/filters.cxx
60+
PUBLIC_LINK_LIBRARIES O2::Framework
61+
COMPONENT_NAME AnalysisTutorial)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
#include "Framework/runDataProcessing.h"
11+
#include "Framework/AnalysisTask.h"
12+
#include "Framework/AnalysisDataModel.h"
13+
14+
namespace o2::aod
15+
{
16+
namespace etaphi
17+
{
18+
DECLARE_SOA_COLUMN(Eta, etas, float, "fEta");
19+
DECLARE_SOA_COLUMN(Phi, phis, float, "fPhi");
20+
DECLARE_SOA_COLUMN(Pt, pts, float, "fPt");
21+
} // namespace etaphi
22+
DECLARE_SOA_TABLE(EtaPhi, "AOD", "ETAPHI",
23+
etaphi::Eta, etaphi::Phi);
24+
DECLARE_SOA_TABLE(EtaPhiPt, "AOD", "ETAPHIPT",
25+
etaphi::Eta, etaphi::Phi, etaphi::Pt);
26+
} // namespace o2::aod
27+
28+
using namespace o2;
29+
using namespace o2::framework;
30+
31+
// This is a very simple example showing how to iterate over tracks
32+
// and create a new collection for them.
33+
// FIXME: this should really inherit from AnalysisTask but
34+
// we need GCC 7.4+ for that
35+
struct ATask {
36+
Produces<aod::EtaPhi> etaphi;
37+
Produces<aod::EtaPhiPt> etaphipt;
38+
39+
void process(aod::Tracks const& tracks)
40+
{
41+
for (auto& track : tracks) {
42+
float phi = asin(track.snp()) + track.alpha() + static_cast<float>(M_PI);
43+
float eta = log(tan(0.25f * static_cast<float>(M_PI) - 0.5f * atan(track.tgl())));
44+
float pt = 1.f / track.signed1Pt();
45+
etaphi(eta, phi);
46+
etaphipt(eta, phi, pt);
47+
}
48+
}
49+
};
50+
51+
struct BTask {
52+
void process(aod::Collision const& collision, soa::Join<aod::Tracks, aod::EtaPhi> const& extTracks)
53+
{
54+
// LOG(INFO) << "TF: " << collision.timeframeID() << std::endl;
55+
LOG(INFO) << "Rows: " << extTracks.asArrowTable()->num_rows() << std::endl;
56+
for (auto& track : extTracks) {
57+
LOGF(INFO, "(%f, %f) - (%f, %f)", track.eta(), track.phi(), track.etas(), track.phis());
58+
}
59+
}
60+
};
61+
62+
struct CTask {
63+
void process(aod::Collision const& collision, soa::Concat<aod::EtaPhi, aod::EtaPhiPt> const& concatenated)
64+
{
65+
// LOG(INFO) << "TF: " << collision.timeframeID() << std::endl;
66+
LOG(INFO) << "Rows: " << concatenated.asArrowTable()->num_rows() << std::endl;
67+
}
68+
};
69+
70+
WorkflowSpec defineDataProcessing(ConfigContext const&)
71+
{
72+
return WorkflowSpec{
73+
adaptAnalysisTask<ATask>("produce-etaphi"),
74+
adaptAnalysisTask<BTask>("consume-etaphi"),
75+
adaptAnalysisTask<CTask>("consume-etaphi-twice")};
76+
}

Framework/AnalysisTutorial/src/collisionTracksIteration.cxx renamed to Analysis/Tutorials/src/collisionTracksIteration.cxx

File renamed without changes.

Framework/AnalysisTutorial/src/dynamicColumns.cxx renamed to Analysis/Tutorials/src/dynamicColumns.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DECLARE_SOA_COLUMN(Alpha, alpha, float, "fAlpha");
2121
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float tgl) { return log(tan(0.25 * M_PI - 0.5 * atan(tgl))); });
2222
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float snp, float alpha) { return asin(snp) + alpha + M_PI; });
2323
} // namespace etaphi
24-
DECLARE_SOA_TABLE(EtaPhis, "RN2", "ETAPHI",
24+
DECLARE_SOA_TABLE(EtaPhis, "AOD", "ETAPHI",
2525
etaphi::Tgl, etaphi::Snp, etaphi::Alpha,
2626
etaphi::Eta<etaphi::Tgl>,
2727
etaphi::Phi<etaphi::Snp, etaphi::Alpha>);

‎Analysis/Tutorials/src/filters.cxx‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
#include "Framework/runDataProcessing.h"
11+
#include "Framework/AnalysisTask.h"
12+
#include "Framework/AnalysisDataModel.h"
13+
14+
namespace o2::aod
15+
{
16+
namespace etaphi
17+
{
18+
DECLARE_SOA_COLUMN(Eta, eta, float, "fEta");
19+
DECLARE_SOA_COLUMN(Phi, phi, float, "fPhi");
20+
} // namespace etaphi
21+
DECLARE_SOA_TABLE(EtaPhi, "AOD", "ETAPHI",
22+
etaphi::Eta, etaphi::Phi);
23+
} // namespace o2::aod
24+
25+
using namespace o2;
26+
using namespace o2::framework;
27+
using namespace o2::framework::expressions;
28+
29+
// This is a very simple example showing how to iterate over tracks
30+
// and create a new collection for them.
31+
// FIXME: this should really inherit from AnalysisTask but
32+
// we need GCC 7.4+ for that
33+
struct ATask {
34+
Produces<aod::EtaPhi> etaphi;
35+
36+
void process(aod::Tracks const& tracks)
37+
{
38+
for (auto& track : tracks) {
39+
etaphi(track.phi(), track.eta());
40+
}
41+
}
42+
};
43+
44+
struct BTask {
45+
Filter ptFilter = (aod::etaphi::phi > 1.f) && (aod::etaphi::phi < 2.f);
46+
47+
void process(soa::Filtered<aod::EtaPhi> const& etaPhis)
48+
{
49+
for (auto& etaPhi : etaPhis) {
50+
LOGF(INFO, "(%f, 1 < %f < 2)", etaPhi.eta(), etaPhi.phi());
51+
}
52+
}
53+
};
54+
55+
WorkflowSpec defineDataProcessing(ConfigContext const&)
56+
{
57+
return WorkflowSpec{
58+
adaptAnalysisTask<ATask>("produce-etaphi"),
59+
adaptAnalysisTask<BTask>("consume-etaphi")};
60+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
#include "Framework/runDataProcessing.h"
11+
#include "Framework/AnalysisTask.h"
12+
13+
#include <TFile.h>
14+
#include <TH1F.h>
15+
16+
using namespace o2;
17+
using namespace o2::framework;
18+
19+
// Another example
20+
// FIXME: this should really inherit from AnalysisTask but
21+
// we need GCC 7.4+ for that
22+
struct ATask {
23+
void init(InitContext&)
24+
{
25+
count = 0;
26+
}
27+
28+
void process(soa::Join<aod::Tracks, aod::TracksExtra> const& fullTracks)
29+
{
30+
for (auto& track : fullTracks) {
31+
LOGF(info, "%d, %f %f", count, track.alpha(), track.tpcSignal());
32+
count++;
33+
}
34+
}
35+
36+
size_t count = 2016927;
37+
};
38+
39+
WorkflowSpec defineDataProcessing(ConfigContext const&)
40+
{
41+
return WorkflowSpec{
42+
adaptAnalysisTask<ATask>("track-iteration-tutorial")};
43+
}

0 commit comments

Comments
 (0)