-
Notifications
You must be signed in to change notification settings - Fork 433
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
Conversation
Hi @davidrohr , |
files.zip |
There was a problem hiding this 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()))) { |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At https://github.com/AliceO2Group/AliceO2/blob/0f1a1fab34aad357c689472e7f2326d59c205b96/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx#L164, why do you call trkTPC.getClusterReference
? trkTPC.getCluster
called at the next line is enough to fetch the cluster and assign sector, row.
The same is on https://github.com/AliceO2Group/AliceO2/blob/0f1a1fab34aad357c689472e7f2326d59c205b96/Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx#L301
There was a problem hiding this comment.
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}
There was a problem hiding this comment.
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 : 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:
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? |
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. |
Hi @martenole : ok, I have added your commits to my dev branch, and now it runs through without segfault:
I have tried both with 10 pp events and with 4 pb-pb events. |
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. ==13306== Use of uninitialised value of size 8 |
It seems nothing is processed:
|
@martenole : So this is actually really weird.
This indeed looks like something gets corrupted before. |
@martenole : I ran it through valgrind, and I think these warnings might be relevant:
To me it seems, something is not correctly initialized. |
Yes it looks like some initialization fails, but I have no idea which one. |
@martenole you are running with param of Run2 https://github.com/AliceO2Group/AliceO2/blob/bb1bd1db1e29d681a1ab64638d24fc0c1b8bd327/Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibParam.h#L19 |
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. |
you should probably add in the TrackInterpolation.cxx something like
|
Hi @shahor02 , [100%] Building CXX object Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeFiles/O2lib-TPCInterpolationWorkflow.dir/src/TPCInterpolationSpec.cxx.o |
@martenole could you add a dictionary (ClassDefNV... and in the LinkDef and CMakefile) for TPCClusterResiduals and TrackData ? Also, it is worth to do |
Hello @shahor02 , |
@martenole thanks! Will check in details later, meanwhile, could you please check if cherr-picking this PR solves problem of non-completing workflow? |
Yes, I confirm that with your patch the workflow exits automatically after it has finished. |
There was a problem hiding this 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.
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeLists.txt
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/CMakeLists.txt
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx
Outdated
Show resolved
Hide resolved
...ingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCInterpolationSpec.h
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCInterpolationSpec.cxx
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCInterpolationSpec.cxx
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx
Outdated
Show resolved
Hide resolved
Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx
Show resolved
Hide resolved
162dbb3
to
a94798b
Compare
…lier information for thesis plots
…e input for TPC SCD TrackInterpolation
Hi @shahor02 , |
Pinging @davidrohr and @wiechula as code owners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine with me
MatchInfoTof has the index of the matched track stored directly as a member now.