-
Notifications
You must be signed in to change notification settings - Fork 488
Use TOF Utils to subtract BC time to tofSignal #7782
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,7 @@ | |||||
| #include "SimulationDataFormat/MCTrack.h" | ||||||
| #include "SimulationDataFormat/MCTruthContainer.h" | ||||||
| #include "GPUTPCGMMergedTrackHit.h" | ||||||
| #include "TOFBase/Utils.h" | ||||||
| #include "O2Version.h" | ||||||
| #include "TMath.h" | ||||||
| #include "MathUtils/Utils.h" | ||||||
|
|
@@ -301,6 +302,7 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID, | |||||
| // normal tracks table | ||||||
| auto contributorsGID = data.getSingleDetectorRefs(trackIndex); | ||||||
| const auto& trackPar = data.getTrackParam(trackIndex); | ||||||
| extraInfoHolder.flags |= trackPar.getPID() << 28; | ||||||
| if (contributorsGID[GIndex::Source::ITS].isIndexSet()) { | ||||||
| int nClusters = itsTracks[contributorsGID[GIndex::ITS].getIndex()].getNClusters(); | ||||||
| float chi2 = itsTracks[contributorsGID[GIndex::ITS].getIndex()].getChi2(); | ||||||
|
|
@@ -326,10 +328,9 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID, | |||||
| extraInfoHolder.tofChi2 = tofMatch.getChi2(); | ||||||
| const auto& tofInt = tofMatch.getLTIntegralOut(); | ||||||
| const float intLen = tofInt.getL(); | ||||||
| double timeOrbit = static_cast<int>(tofMatch.getSignal() / o2::constants::lhc::LHCOrbitNS * 1E-3) * o2::constants::lhc::LHCOrbitNS * 1E3; | ||||||
| const float tofSignal = static_cast<float>(o2::tof::Utils::subtractInteractionBC(tofMatch.getSignal() - timeOrbit)); | ||||||
| extraInfoHolder.length = intLen; | ||||||
| if (interactionTime > 0) { | ||||||
| extraInfoHolder.tofSignal = static_cast<float>(tofMatch.getSignal() - interactionTime * 1E3); | ||||||
| } | ||||||
| const float mass = o2::constants::physics::MassPionCharged; // default pid = pion | ||||||
| if (tofInt.getTOF(o2::track::PID::Pion) > 0.f) { | ||||||
| const float expBeta = (intLen / (tofInt.getTOF(o2::track::PID::Pion) * cSpeed)); | ||||||
|
|
@@ -339,8 +340,8 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID, | |||||
| const double massZ = o2::track::PID::getMass2Z(trackPar.getPID()); | ||||||
| const double energy = sqrt((massZ * massZ) + (extraInfoHolder.tofExpMom * extraInfoHolder.tofExpMom)); | ||||||
| const double exp = extraInfoHolder.length * energy / (cSpeed * extraInfoHolder.tofExpMom); | ||||||
| extraInfoHolder.trackTime = static_cast<float>((tofMatch.getSignal() - exp) * 1e-3 - interactionTime); // tof time in \mus, FIXME: account for time of flight to R TOF | ||||||
| extraInfoHolder.trackTimeRes = 200e-3; // FIXME: calculate actual resolution (if possible?) | ||||||
| extraInfoHolder.trackTime = static_cast<float>((tofSignal - exp) * 1e-3); // tof time in ns, taken from the definition of Ruben scaled by 1000 to convert from mus to ns to match the collisionTime | ||||||
| extraInfoHolder.trackTimeRes = 200e-3; // FIXME: calculate actual resolution (if possible?) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shahor02 I am in favour of merging this. Unrelated: Don't we have an estimate of the track type already somewhere?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jgrosseo sorry, just saw the question. If you are asking whether we do reco-time PID: no, for that the TPC would need to provide a dedx -> PID algorithm.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shahor02 I wrote track type but mean track time resolution (sorry for this; and that's why I made the comment here).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not for ITS-TPC-TOF tracks: they are somewhat special since their time is given by the TOF signal stored in the match info (while the kinematic comes from ITS-TPC). In the Lines 169 to 170 in ce3e745
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should propagate these values into the AOD (even if you mark them as "overkill" for now). All this info should be available in the AOD converter, so it just requires adjusting the code, right?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TrackTime contains here the track time estimate based on TOF (absolute wrt BC). We do not talk about the estimated time with a momentum and particle hypothesis. Do we talk about the same thing?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Can we add this to the AOD producer already?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. A deltat (t_tof - t_track) is avaliable with the matching info.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does this matter if we speak about the uncertainty?
Do you mean to fill
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes! |
||||||
| } | ||||||
| if (src == GIndex::Source::TPCTRD || src == GIndex::Source::ITSTPCTRD) { | ||||||
| const auto& trdOrig = data.getTrack<o2::trd::TrackTRD>(src, contributorsGID[src].getIndex()); | ||||||
|
|
@@ -1106,11 +1107,17 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) | |||||
| auto caloCellsCursor = caloCellsBuilder.cursor<o2::aod::Calos>(); | ||||||
| auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder.cursor<o2::aod::CaloTriggers>(); | ||||||
|
|
||||||
| std::unique_ptr<o2::steer::MCKinematicsReader> mcReader; | ||||||
| if (mUseMC) { | ||||||
| mcReader = std::make_unique<o2::steer::MCKinematicsReader>("collisioncontext.root"); | ||||||
| std::unique_ptr<o2::steer::MCKinematicsReader> mcReader = std::make_unique<o2::steer::MCKinematicsReader>("collisioncontext.root"); | ||||||
| if (!o2::tof::Utils::hasFillScheme()) { | ||||||
| LOG(debug) << "FOUND " << mcReader->getDigitizationContext()->getEventRecords().size() | ||||||
| << " records" << mcReader->getDigitizationContext()->getEventParts().size() << " parts"; | ||||||
| o2::BunchFilling bcf = mcReader->getDigitizationContext()->getBunchFilling(); | ||||||
| std::bitset<3564> bs = bcf.getBCPattern(); | ||||||
| for (int i = 0; i < bs.size(); i++) { | ||||||
| if (bs.test(i)) { | ||||||
| o2::tof::Utils::addInteractionBC(i); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| std::map<uint64_t, int> bcsMap; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.