Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPC track interpolation as DPL workflow, add TOF reader for matching information #3232

Merged
merged 4 commits into from
Apr 22, 2020

Conversation

martenole
Copy link
Contributor

MatchInfoTof has the index of the matched track stored directly as a member now.

@martenole
Copy link
Contributor Author

Hi @davidrohr ,
I have difficulties with accessing the TPC cluster information for the ITS-TOF interpolation. For some reason I get a segfault when calling o2::tpc::ClusterNative::getTime() for a cluster although it is seemingly correctly defined and has a valid time information. This happens every time, so not by chance. I will update the log here and the macro I use. Could you maybe check what could be wrong?
Cheers,
Ole

@martenole
Copy link
Contributor Author

files.zip
To run the macro I first started a small simulation (10 pp events) and ran the digitizer workflow, ITS reconstruction workflow, TPC reconstruction workflow, ITS-TPC matching and TOF reconstruction..

Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @martenole please see a few comments below.
Perhaps you can start modifying your data access members to be compatible with input from the DPL and not only from the local TTree. Since you used as the prototype for the data access the MatchTPCITS, you may consult this commit which allows to run the matching either from standalone macro or from the workflow

@@ -57,7 +57,7 @@ void TrackInterpolation::process()

for (const auto& trkTOF : *mTOFMatchVecInput) {
// process ITS-TPC-TOF matched tracks
if (!trackPassesQualityCuts(mITSTPCTrackVecInput->at(trkTOF.first.getIndex()))) {
if (!trackPassesQualityCuts(mITSTPCTrackVecInput->at(trkTOF.getTrackIndex()))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at is range-checked, better use []

const auto& matchITSTPC = mITSTPCTrackVecInput->at(matchTOF.first.getIndex());
const auto& clTOF = mTOFClusterVecInput->at(matchTOF.second.getTOFClIndex());
const auto& matchITSTPC = mITSTPCTrackVecInput->at(matchTOF.getTrackIndex());
const auto& clTOF = mTOFClusterVecInput->at(matchTOF.getTOFClIndex());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shahor02 ,
thanks a lot for your comments. I thought that the at is better readable and the performance loss negligible, but I have changed that and also removed the unnecessary call to trkTPC.getClusterReference.
However, I still get weird segmentation falls when calling clTPC.getTime() for the ClusterNative, although according to gdb the cluster is defined in a meaningful way.
This I need to fix somehow.
I am also looking into using DPL input now.
Cheers,
Ole

Below is the error message I get when trying to get the time information from a TPC cluster.

Program received signal SIGSEGV, Segmentation fault.
o2::tpc::TrackInterpolation::interpolateTrackITSTOF (this=0x7fffffff28d0, matchTOF=...) at /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx:173
173 float clTPCtime = clTPC.getTime();
(gdb) bt
#0 o2::tpc::TrackInterpolation::interpolateTrackITSTOF (this=0x7fffffff28d0, matchTOF=...) at /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx:173
#1 0x00007fffe2caecf5 in o2::tpc::TrackInterpolation::process (this=0x7fffffff28d0) at /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx:65
#2 0x00007fffd848a5b1 in run_calib_tpc_sp (path="./", inputTracksITSTPC="o2match_itstpc.root", inputTracksTPC="tpctracks.root", inputClustersTPC="tpc-native-clusters.root", inputTracksITS="o2trac_its.root", inputClustersITS="o2clus_its.root",
inputMatchesTOF="o2match_tof.root", inputClustersTOF="tofclusters.root", outputFile="residuals_tpc.root", inputGeom="O2geometry.root", inputGRP="o2sim_grp.root") at /home/oschmidt/alice/macros/run_calib_tpc_sp.C:96
#3 0x00007fff3ed51262 in ?? ()
#4 0xbe6d88d2ffff6928 in ?? ()
#5 0x00007fffffff6900 in ?? ()
#6 0x00007fffbf21102b in ?? ()
#7 0x00007fffffff68b0 in ?? ()
#8 0x00007fffffff6888 in ?? ()
#9 0x4330c9e45dacfe10 in ?? ()
#10 0x000055555dad8fb0 in ?? ()
#11 0x2ad0045dc33fe8b3 in ?? ()
#12 0x41693a9500000033 in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb) p clTPC
$1 = (const o2::tpc::ClusterNative &) @0x55556c4aee84: {static scaleTimePacked = 64, static scalePadPacked = 64, static scaleSigmaTimePacked = 32, static scaleSigmaPadPacked = 32, timeFlagsPacked = 145587, padPacked = 183, sigmaTimePacked = 28 '\034',
sigmaPadPacked = 22 '\026', qMax = 17, qTot = 64}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @martenole

The overhead of ->at(i) is small but non-0, as for the safety: we don't expect empty slots, if there are, we better get segm.viol. and fix the problem...

For the crash on the cluster access, the code seems to be correct, perhaps you should run valgrind to check it there is no memory corruption before.

@martenole martenole changed the title Adapt to new TOF matching info format [WIP] Adapt to new TOF matching info format Mar 27, 2020
@davidrohr
Copy link
Collaborator

@martenole : Hi Ole, I tried to run your macro, after running TPC, ITS, TPC-ITS-Matching, and TOF reco workflow with the current dev, but for me it fails actually earlier:

====
=
= Start processing
=
===

[INFO] Attached ITS-TPC tracks TPCITS branch with 1 entries
[INFO] Attached TPC tracks Tracks branch with 1 entries
[INFO] Attached TPC tracks cluster indices ClusRefs branch with 1 entries
[INFO] Attached TPC clusters reader with 1entries
[INFO] Attached ITS tracks ITSTrack branch with 1 entries
[INFO] Attached ITS clusters ITSCluster branch with 1 entries
Error in <TChain::SetBranchAddress>: The pointer type given (vector<pair<o2::dataformats::EvIndex<int,int>,o2::dataformats::MatchInfoTOF> >) does not correspond to the class needed (vector<o2::dataformats::MatchInfoTOF>) by the branch: TOFMatchInfo
[INFO] Attached TOF matches TOFMatchInfo branch with 1 entries
[INFO] Attached TOF clusters TOFCluster branch with 1 entries
[INFO] Processing 2049638230412172984 ITS-TPC-TOF matched tracks out of 2153 ITS-TPC matched tracks
terminate called after throwing an instance of 'std::length_error'
  what():  vector::reserve

Program received signal SIGABRT, Aborted.

Apparently it is not reading the ITS-TPC-TOF matches correctly, probably because there is this data type mismatch. However, I cannot see the mismatch error in the log file you profided. Perhaps some format has changed in the meantime?

@martenole
Copy link
Contributor Author

Hi David, thanks for checking. Actually to run the macro you need to add the commits in this PR first to adapt to the new TOF matching data format.
I will also try with valgrind now.

@davidrohr
Copy link
Collaborator

Hi @martenole : ok, I have added your commits to my dev branch, and now it runs through without segfault:

====
=
= Start processing
=
===

[INFO] Attached ITS-TPC tracks TPCITS branch with 1 entries
[INFO] Attached TPC tracks Tracks branch with 1 entries
[INFO] Attached TPC tracks cluster indices ClusRefs branch with 1 entries
[INFO] Attached TPC clusters reader with 1entries
[INFO] Attached ITS tracks ITSTrack branch with 1 entries
[INFO] Attached ITS clusters ITSCluster branch with 1 entries
[INFO] Attached TOF matches TOFMatchInfo branch with 1 entries
[INFO] Attached TOF clusters TOFCluster branch with 1 entries
[INFO] Processing 655 ITS-TPC-TOF matched tracks out of 2153 ITS-TPC matched tracks
TPC reduced chi2 (8.07), ITS reduced chi2 (0.43)
TPC reduced chi2 (8.28), ITS reduced chi2 (0.40)
[INFO] Loaded 440 params from $(O2_ROOT)/share/Common/maps/sol5k.txt
[O2/latest] ~/alitest/o2test3 $> 

I have tried both with 10 pp events and with 4 pb-pb events.
Could you update to the latest dev branch and try again.

@martenole
Copy link
Contributor Author

This is weird. For me is still crashes, also with the latest changes from dev.

I ran valgrind now and got a very large output which I have uploaded to cernbox.
I think the important lines are below (invalid read), but I could not find a reason for it.
@davidrohr could you run the macro again with the logger set to debug level to see if some tracks actually are interpolated?

==13306== Use of uninitialised value of size 8
==13306== at 0x1DB71123: unpackTime (ClusterNative.h:73)
==13306== by 0x1DB71123: getTime (ClusterNative.h:92)
==13306== by 0x1DB71123: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:173)
==13306== by 0x1DB72CF4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==13306== by 0x287875B0: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) (run_calib_tpc_sp.C:96)
==13306== by 0x3E1AAF4C3ED51261: ???
==13306== by 0xBE6D88D2FEFF8E77: ???
==13306== by 0xBE8A8F3CBE9E5A0F: ???
==13306== by 0xBF1F76D7BF21102A: ???
==13306== by 0x1FBF204380: ???
==13306== by 0x1FFEFF8DD7: ???
==13306== by 0x2B7FBF0F: ???
==13306== by 0x2B54863F: ???
==13306== by 0xE27: ???
==13306== Uninitialised value was created by a stack allocation
==13306== at 0x421B004: ???
==13306==
==13306== Invalid read of size 4
==13306== at 0x1DB71123: unpackTime (ClusterNative.h:73)
==13306== by 0x1DB71123: getTime (ClusterNative.h:92)
==13306== by 0x1DB71123: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:173)
==13306== by 0x1DB72CF4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==13306== by 0x287875B0: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) (run_calib_tpc_sp.C:96)
==13306== by 0x3E1AAF4C3ED51261: ???
==13306== by 0xBE6D88D2FEFF8E77: ???
==13306== by 0xBE8A8F3CBE9E5A0F: ???
==13306== by 0xBF1F76D7BF21102A: ???
==13306== by 0x1FBF204380: ???
==13306== by 0x1FFEFF8DD7: ???
==13306== by 0x2B7FBF0F: ???
==13306== by 0x2B54863F: ???
==13306== by 0xE27: ???
==13306== Address 0x4185fef141b9bd16 is not stack'd, malloc'd or (recently) free'd
==13306==

@davidrohr
Copy link
Collaborator

It seems nothing is processed:

[DEBUG] Failed on first extrapolation
[DEBUG] Failed to interpolate ITS-TOF track
[DEBUG] Failed to rotate track during first extrapolation
[DEBUG] Failed to interpolate ITS-TOF track

@davidrohr
Copy link
Collaborator

@martenole : So this is actually really weird.
If I just run it without GDB, the interpolation fails.
If I run it in GDB, the interpolation succeeds, and then it crashes at

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe6229999 in o2::tpc::ClusterNative::unpackPad (pad=<optimized out>) at /home/qon/alice/sw/SOURCES/O2/v1.2.0/0/DataFormats/Detectors/TPC/include/DataFormatsTPC/TrackTPC.h:90
90          rowIndex = srIndexArr[nCluster + mClustersReference.getEntries()];
(gdb) bt
#0  0x00007fffe6229999 in o2::tpc::ClusterNative::unpackPad (pad=<optimized out>) at /home/qon/alice/sw/SOURCES/O2/v1.2.0/0/DataFormats/Detectors/TPC/include/DataFormatsTPC/TrackTPC.h:90
#1  o2::tpc::ClusterNative::getPad (this=<optimized out>) at /home/qon/alice/sw/SOURCES/O2/v1.2.0/0/DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNative.h:114
#2  o2::tpc::TrackInterpolation::interpolateTrackITSTOF (this=0x7fffffff4390, matchTOF=...) at /home/qon/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx:172
#3  0x00007fffe622b5e5 in o2::tpc::TrackInterpolation::process (this=this@entry=0x7fffffff4390) at /home/qon/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx:65
#4  0x00007fffe5d84298 in run_calib_tpc_sp (path="./", inputTracksITSTPC=..., inputTracksTPC=..., inputClustersTPC=..., inputTracksITS=..., inputClustersITS=..., inputMatchesTOF="o2match_tof.root", inputClustersTOF=<error reading variable: Cannot access memory at address 0xffff8290ffff83e0>, outputFile=<error reading variable: Cannot access memory at address 0xffff8290ffff8290>, inputGeom=<error reading variable: Cannot access memory at address 0xffff8290c3158427>, inputGRP=<error reading variable: Cannot access memory at address 0x7fff8290ffff8290>) at /home/qon/alitest/o2test3/./run_calib_tpc_sp.C:96

This indeed looks like something gets corrupted before.

@davidrohr
Copy link
Collaborator

@martenole : I ran it through valgrind, and I think these warnings might be relevant:

==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x1A6B6B5F: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:185)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586==    by 0x48B3375: ???
==11586==    by 0x62E58D8: cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (IncrementalExecutor.cpp:339)
==11586==    by 0x625ADBC: cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (Interpreter.cpp:1125)
==11586==    by 0x625CBD1: cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (Interpreter.cpp:1381)
==11586==    by 0x625CDF4: cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (Interpreter.cpp:828)
==11586==    by 0x634937C: cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (MetaProcessor.cpp:341)
==11586==    by 0x61AE83F: HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (TCling.cxx:2285)
==11586==    by 0x61C7AD8: TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (TCling.cxx:2402)
==11586==    by 0x61C7F70: TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (TCling.cxx:3314)
==11586== 
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x1985A8B8: BringToPMPi (Utils.h:54)
==11586==    by 0x1985A8B8: o2::track::TrackParCov::rotate(float) (Track.cxx:737)
==11586==    by 0x1A6B6B6E: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:188)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x546A205: __sincosf_fma (in /lib64/libm-2.30.so)
==11586==    by 0x1985A8DB: o2::track::TrackParCov::rotate(float) (Track.cxx:740)
==11586==    by 0x1A6B6B6E: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:188)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586== 
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x15C6EE3D: o2::base::Propagator::PropagateToXBxByBz(o2::track::TrackParCov&, float, float, float, float, int, o2::track::TrackLTIntegral*, int) const (Propagator.cxx:79)
==11586==    by 0x1A6B6AD6: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:192)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x54185E3: sincos (in /lib64/libm-2.30.so)
==11586==    by 0x15C6EE6B: o2::base::Propagator::PropagateToXBxByBz(o2::track::TrackParCov&, float, float, float, float, int, o2::track::TrackLTIntegral*, int) const (Propagator.cxx:82)
==11586==    by 0x1A6B6AD6: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:192)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x198AC283: o2::field::MagFieldFast::GetSegment(float, float, float, int&, int&, int&) const (MagFieldFast.cxx:228)
==11586==    by 0x198ACDE2: o2::field::MagFieldFast::Field(ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<float>, ROOT::Math::DefaultCoordinateSystemTag>, float*) const (MagFieldFast.cxx:200)
==11586==    by 0x15C6EED4: o2::base::Propagator::PropagateToXBxByBz(o2::track::TrackParCov&, float, float, float, float, int, o2::track::TrackLTIntegral*, int) const (Propagator.cxx:84)
==11586==    by 0x1A6B6AD6: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:192)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)
==11586== 
==11586== Conditional jump or move depends on uninitialised value(s)
==11586==    at 0x19854FC3: o2::track::TrackPar::getPosDirGlo(std::array<float, 9ul>&) const (Track.cxx:112)
==11586==    by 0x1985B3D5: o2::track::TrackParCov::propagateTo(float, std::array<float, 3ul> const&) (Track.cxx:975)
==11586==    by 0x15C6EEE9: o2::base::Propagator::PropagateToXBxByBz(o2::track::TrackParCov&, float, float, float, float, int, o2::track::TrackLTIntegral*, int) const (Propagator.cxx:86)
==11586==    by 0x1A6B6AD6: o2::tpc::TrackInterpolation::interpolateTrackITSTOF(o2::dataformats::MatchInfoTOF const&) (TrackInterpolation.cxx:192)
==11586==    by 0x1A6B85E4: o2::tpc::TrackInterpolation::process() (TrackInterpolation.cxx:65)
==11586==    by 0x1AB47297: run_calib_tpc_sp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (run_calib_tpc_sp.C:96)

To me it seems, something is not correctly initialized.

@martenole
Copy link
Contributor Author

Yes it looks like some initialization fails, but I have no idea which one.
The first entry in the valgrind output pointing to TrackInterpolation.cxx:185 is already not correct (I think), because in TrackInterpolation.cxx:158 the clAvailable member is set to zero.
An instance for the propagator and all its method is only created in the actual track interpolation method when the magnetic field should be available, because
o2::base::GeometryManager::loadGeometry(path + inputGeom, "FAIRGeom") and
o2::base::Propagator::initFieldFromGRP(path + inputGRP)
are called before the processing starts.

@martenole
Copy link
Contributor Author

Oh no you are right! I ran into this bug already one time months ago when I created the TrackInterpolation class, but I didn't properly implement a check for that.
I am sorry about this. Thank you very much for spotting that, now it works for me as well.

@shahor02
Copy link
Collaborator

you should probably add in the TrackInterpolation.cxx something like

#ifdef TPC_RUN2
static_assert(false,"Run2 parameters used")
#endif 

@martenole
Copy link
Contributor Author

Hi @shahor02 ,
at the moment my o2 build fails when I try to add the output of the interpolation procedure as input to the TPCResidualWriterSpec. Although it is simply a const std::vector<TPCClusterResiduals> and TPCClusterResiduals should be trivially messageable.
Do you have an idea what might be the problem? I attach the log of the failing build below. I have no idea what could be wrong. I tried to do everything similar to the TPC-ITS matching workflow, but for a vector of TPCITSTrack it seems to work fine, although I cannot see the difference to TPCClusterResiduals..
Cheers,
Ole

[100%] Building CXX object Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TPCInterpolationSpec.cxx.o
[100%] Building CXX object Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TrackInterpolationReaderSpec.cxx.o
[100%] Building CXX object Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TPCResidualWriterSpec.cxx.o
[100%] Building CXX object Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TrackInterpolationWorkflow.cxx.o
[100%] Built target O2exe-tof-reco-workflow
In file included from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/ProcessingContext.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/AlgorithmSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataProcessorSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCResidualWriterSpec.h:18,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:20:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: error: no matching function for call to ‘o2::framework::DataRefUtils::as(o2::framework::DataRef&)’
319 | auto object = DataRefUtils::as(ref);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:14,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/ProcessingContext.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/AlgorithmSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataProcessorSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCResidualWriterSpec.h:18,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:20:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: note: candidate: ‘template static typename std::enable_if<(o2::framework::is_messageable::value == true), gsl::span<ElementType, -1> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
40 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<(o2::framework::is_messageable::value == true), gsl::span<ElementType, -1> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with T = std::vectoro2::tpc::TPCClusterResiduals]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: error: no type named ‘type’ in ‘struct std::enable_if<false, gsl::span<std::vectoro2::tpc::TPCClusterResiduals, -1> >’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: note: candidate: ‘template static typename std::enable_if<((o2::framework::has_root_dictionary::value == true) && (o2::framework::is_messageable::value == false)), std::unique_ptr<_Tp> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
65 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<((o2::framework::has_root_dictionary::value == true) && (o2::framework::is_messageable::value == false)), std::unique_ptr<_Tp> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with T = std::vectoro2::tpc::TPCClusterResiduals]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: error: no type named ‘type’ in ‘struct std::enable_if<false, std::unique_ptr<std::vectoro2::tpc::TPCClusterResiduals, std::default_delete<std::vectoro2::tpc::TPCClusterResiduals > > >’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: note: candidate: ‘template static typename std::enable_if<(o2::framework::is_specialization<W, o2::framework::ROOTSerialized>::value == true), std::unique_ptr >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
133 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<(o2::framework::is_specialization<W, o2::framework::ROOTSerialized>::value == true), std::unique_ptr >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with W = std::vectoro2::tpc::TPCClusterResiduals]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TPCClusterResiduals; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:44:81: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: error: no type named ‘wrapped_type’ in ‘class std::vectoro2::tpc::TPCClusterResiduals’
In file included from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/ProcessingContext.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/AlgorithmSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataProcessorSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCResidualWriterSpec.h:18,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:20:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: error: no matching function for call to ‘o2::framework::DataRefUtils::as(o2::framework::DataRef&)’
319 | auto object = DataRefUtils::as(ref);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:14,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/ProcessingContext.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/AlgorithmSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataProcessorSpec.h:13,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCResidualWriterSpec.h:18,
from /home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:20:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: note: candidate: ‘template static typename std::enable_if<(o2::framework::is_messageable::value == true), gsl::span<ElementType, -1> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
40 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<(o2::framework::is_messageable::value == true), gsl::span<ElementType, -1> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with T = std::vectoro2::tpc::TrackData]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:40:5: error: no type named ‘type’ in ‘struct std::enable_if<false, gsl::span<std::vectoro2::tpc::TrackData, -1> >’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: note: candidate: ‘template static typename std::enable_if<((o2::framework::has_root_dictionary::value == true) && (o2::framework::is_messageable::value == false)), std::unique_ptr<_Tp> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
65 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<((o2::framework::has_root_dictionary::value == true) && (o2::framework::is_messageable::value == false)), std::unique_ptr<_Tp> >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with T = std::vectoro2::tpc::TrackData]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:65:5: error: no type named ‘type’ in ‘struct std::enable_if<false, std::unique_ptr<std::vectoro2::tpc::TrackData, std::default_delete<std::vectoro2::tpc::TrackData > > >’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h: In instantiation of ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: note: candidate: ‘template static typename std::enable_if<(o2::framework::is_specialization<W, o2::framework::ROOTSerialized>::value == true), std::unique_ptr >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&)’
133 | as(DataRef const& ref)
| ^~
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: note: template argument deduction/substitution failed:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h: In substitution of ‘template static typename std::enable_if<(o2::framework::is_specialization<W, o2::framework::ROOTSerialized>::value == true), std::unique_ptr >::type o2::framework::DataRefUtils::as(const o2::framework::DataRef&) [with W = std::vectoro2::tpc::TrackData]’:
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/InputRecord.h:319:52: required from ‘decltype(auto) o2::framework::InputRecord::get(R, int) const [with T = const std::vectoro2::tpc::TrackData; R = const char*]’
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx:46:77: required from here
/home/oschmidt/alice/sw/SOURCES/O2/v1.2.0/0/Framework/Core/include/Framework/DataRefUtils.h:133:5: error: no type named ‘wrapped_type’ in ‘class std::vectoro2::tpc::TrackData’
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/build.make:92: recipe for target 'Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TPCResidualWriterSpec.cxx.o' failed
make[2]: *** [Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TPCResidualWriterSpec.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:23029: recipe for target 'Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/all' failed
make[1]: *** [Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/all] Error 2
Makefile:179: recipe for target 'all' failed
make: *** [all] Error 2
~/alice

@shahor02
Copy link
Collaborator

shahor02 commented Apr 9, 2020

@martenole could you add a dictionary (ClassDefNV... and in the LinkDef and CMakefile) for TPCClusterResiduals and TrackData ?

Also, it is worth to do auto tracks = std::move( pc.inputs().get<const std::vector<TPCClusterResiduals>>("tracks") );, same for residuals. This will avoid extra copy of the vector which is anyway created on your requests. I'll need to do the same in the matching code.

@martenole martenole changed the title [WIP] Adapt to new TOF matching info format TPC track interpolation as DPL workflow, add TOF reader for matching information Apr 11, 2020
@martenole
Copy link
Contributor Author

Hello @shahor02 ,
thanks a lot for your help. For me it works now to run the track interpolation as a DPL workflow via the command
o2-tpc-interpolation-workflow -b --tpc-track-reader tpctracks.root --tpc-native-cluster-reader "--infile tpc-native-clusters.root" --disable-mc
The output is written to a file and looks good to me. Only the workflow does not terminate itself, I have to use Ctrl-c for that.
I have also added a reader for the matching information from TOF.
And the commits are a bit cleaner now. So I think this could be merged now.
Cheers,
Ole

@shahor02
Copy link
Collaborator

@martenole thanks! Will check in details later, meanwhile, could you please check if cherr-picking this PR solves problem of non-completing workflow?

@martenole
Copy link
Contributor Author

Yes, I confirm that with your patch the workflow exits automatically after it has finished.
Thanks!

Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martenole Thanks! Please see a few comments below.
Once the example of reading from the multi-TF tree is ready, I'll let you know.

@martenole martenole force-pushed the tpccalib branch 2 times, most recently from 162dbb3 to a94798b Compare April 16, 2020 08:31
@martenole
Copy link
Contributor Author

Hi @shahor02 ,
yes, I have cleaned the commit history and now this PR can be merged.
Cheers,
Ole

@martenole
Copy link
Contributor Author

Pinging @davidrohr and @wiechula as code owners.
This PR adds the possibility to run the TPC interpolation for the SCD correction as a DPL workflow. Could you please approve it, if it is fine with you?
Cheers,
Ole

Copy link
Collaborator

@davidrohr davidrohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine with me

@shahor02 shahor02 merged commit 421507c into AliceO2Group:dev Apr 22, 2020
@martenole martenole deleted the tpccalib branch April 22, 2020 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants