Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Analysis/Tasks/PID/qaTOFMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct pidTOFTaskQA {
"nsigmaMCprm/Ka", "nsigmaMCprm/Pr", "nsigmaMCprm/De",
"nsigmaMCprm/Tr", "nsigmaMCprm/He", "nsigmaMCprm/Al"};
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
static constexpr int PDGs[Np] = {11, 13, 211, 321, 2212, 1, 1, 1, 1};
static constexpr int PDGs[Np] = {11, 13, 211, 321, 2212, 1000010020, 1000010030, 1000020030};
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject};

Configurable<int> nBinsP{"nBinsP", 400, "Number of bins for the momentum"};
Expand Down
62 changes: 41 additions & 21 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,14 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID,
const auto& tofInt = tofMatch.getLTIntegralOut();
float intLen = tofInt.getL();
extraInfoHolder.length = intLen;
extraInfoHolder.tofSignal = tofMatch.getSignal();
float mass = o2::constants::physics::MassPionCharged; // default pid = pion
float expSig = tofInt.getTOF(o2::track::PID::Pion);
float expMom = 0.f;
if (expSig > 0 && interactionTime > 0) {
float tof = expSig - interactionTime;
float expBeta = (intLen / tof / cSpeed);
expMom = mass * expBeta / std::sqrt(1.f - expBeta * expBeta);
if (interactionTime > 0) {
extraInfoHolder.tofSignal = static_cast<float>(tofMatch.getSignal() - interactionTime);
}
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));
extraInfoHolder.tofExpMom = mass * expBeta / std::sqrt(1.f - expBeta * expBeta);
}
extraInfoHolder.tofExpMom = expMom;
}
if (src == GIndex::Source::TPCTRD || src == GIndex::Source::ITSTPCTRD) {
const auto& trdOrig = data.getTrack<o2::trd::TrackTRD>(src, contributorsGID[src].getIndex());
Expand Down Expand Up @@ -395,6 +393,28 @@ void AODProducerWorkflowDPL::fillMCParticlesTable(o2::steer::MCKinematicsReader&
if (item != toStore.end()) {
daughterL = item->second;
}
float pX = (float)mcParticles[particle].Px();
float pY = (float)mcParticles[particle].Py();
float pZ = (float)mcParticles[particle].Pz();
float energy = (float)mcParticles[particle].GetEnergy();
// HACK to avoid FPE in expression columns. Affect only particles in the Beam Pipe.
// TO BE REMOVED asap
{
const float limit = 1e-4;
const float mom = TMath::Sqrt(pX * pX + pY * pY + pZ * pZ);
const float eta = 0.5f * TMath::Log((mom + pZ) / (mom - pZ));
if (TMath::Abs(eta) > 0.9) {
if (TMath::Abs((mom - pZ) / pZ) <= limit) {
pX = truncateFloatFraction(TMath::Sqrt((1.f + limit) * (1.f + limit) - 1.f) * pZ * 0.70710678, mMcParticleMom);
pY = truncateFloatFraction(TMath::Sqrt((1.f + limit) * (1.f + limit) - 1.f) * pZ * 0.70710678, mMcParticleMom);
}
if (TMath::Abs(energy - pZ) < limit) {
energy = truncateFloatFraction(pZ + limit, mMcParticleMom);
}
}
}
// End of HACK

mcParticlesCursor(0,
mccolid,
mcParticles[particle].GetPdgCode(),
Expand All @@ -405,10 +425,10 @@ void AODProducerWorkflowDPL::fillMCParticlesTable(o2::steer::MCKinematicsReader&
daughter0,
daughterL,
truncateFloatFraction(weight, mMcParticleW),
truncateFloatFraction((float)mcParticles[particle].Px(), mMcParticleMom),
truncateFloatFraction((float)mcParticles[particle].Py(), mMcParticleMom),
truncateFloatFraction((float)mcParticles[particle].Pz(), mMcParticleMom),
truncateFloatFraction((float)mcParticles[particle].GetEnergy(), mMcParticleMom),
truncateFloatFraction(pX, mMcParticleMom),
truncateFloatFraction(pY, mMcParticleMom),
truncateFloatFraction(pZ, mMcParticleMom),
truncateFloatFraction(energy, mMcParticleMom),
truncateFloatFraction((float)mcParticles[particle].Vx(), mMcParticlePos),
truncateFloatFraction((float)mcParticles[particle].Vy(), mMcParticlePos),
truncateFloatFraction((float)mcParticles[particle].Vz(), mMcParticlePos),
Expand Down Expand Up @@ -743,8 +763,8 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
bcID,
aAmplitudesA,
aAmplitudesC,
truncateFloatFraction(ft0RecPoint.getCollisionTimeA() / 1E3, mT0Time), // ps to ns
truncateFloatFraction(ft0RecPoint.getCollisionTimeC() / 1E3, mT0Time), // ps to ns
truncateFloatFraction(ft0RecPoint.getCollisionTimeA() * 1E-3, mT0Time), // ps to ns
truncateFloatFraction(ft0RecPoint.getCollisionTimeC() * 1E-3, mT0Time), // ps to ns
ft0RecPoint.getTrigger().triggersignals);
}

Expand All @@ -770,11 +790,11 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
for (auto& vertex : primVertices) {
auto& cov = vertex.getCov();
auto& timeStamp = vertex.getTimeStamp();
double tsTimeStamp = timeStamp.getTimeStamp() * 1E3; // mus to ns
uint64_t globalBC = std::round(tsTimeStamp / o2::constants::lhc::LHCBunchSpacingNS);
LOG(DEBUG) << globalBC << " " << tsTimeStamp;
const double interactionTime = timeStamp.getTimeStamp() * 1E3; // mus to ns
uint64_t globalBC = std::round(interactionTime / o2::constants::lhc::LHCBunchSpacingNS);
LOG(DEBUG) << globalBC << " " << interactionTime;
// collision timestamp in ns wrt the beginning of collision BC
tsTimeStamp = globalBC * o2::constants::lhc::LHCBunchSpacingNS - tsTimeStamp;
const float relInteractionTime = static_cast<float>(globalBC * o2::constants::lhc::LHCBunchSpacingNS - interactionTime);
auto item = bcsMap.find(globalBC);
int bcID = -1;
if (item != bcsMap.end()) {
Expand All @@ -798,12 +818,12 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
vertex.getFlags(),
truncateFloatFraction(vertex.getChi2(), mCollisionPositionCov),
vertex.getNContributors(),
truncateFloatFraction(tsTimeStamp, mCollisionPosition),
truncateFloatFraction(relInteractionTime, mCollisionPosition),
truncateFloatFraction(timeStamp.getTimeStampError() * 1E3, mCollisionPositionCov),
collisionTimeMask);
auto& trackRef = primVer2TRefs[collisionID];
// passing interaction time in [ps]
fillTrackTablesPerCollision(collisionID, tsTimeStamp * 1E3, trackRef, primVerGIs, recoData,
fillTrackTablesPerCollision(collisionID, interactionTime * 1E3, trackRef, primVerGIs, recoData,
tracksCursor, tracksCovCursor, tracksExtraCursor, mftTracksCursor);
collisionID++;
}
Expand Down
6 changes: 4 additions & 2 deletions Detectors/TOF/reconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ o2_add_library(TOFReconstruction
src/DecoderBase.cxx
src/Decoder.cxx
src/CTFCoder.cxx
src/EventTimeMaker.cxx
src/CosmicProcessor.cxx
PUBLIC_LINK_LIBRARIES O2::TOFBase O2::DataFormatsTOF
O2::SimulationDataFormat
O2::CommonDataFormat
O2::DataFormatsTOF
O2::rANS O2::DPLUtils
O2::TOFCalibration O2::DetectorsRaw)
O2::TOFCalibration O2::DetectorsRaw)

o2_target_root_dictionary(TOFReconstruction
HEADERS include/TOFReconstruction/DataReader.h
include/TOFReconstruction/Clusterer.h
include/TOFReconstruction/ClustererTask.h
include/TOFReconstruction/Encoder.h
include/TOFReconstruction/DecoderBase.h
include/TOFReconstruction/DecoderBase.h
include/TOFReconstruction/Decoder.h
include/TOFReconstruction/CTFCoder.h
include/TOFReconstruction/EventTimeMaker.h
include/TOFReconstruction/CosmicProcessor.h)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file EventTimeMaker.h
/// \brief Definition of the TOF event time maker

#ifndef ALICEO2_TOF_EVENTTIMEMAKER_H
#define ALICEO2_TOF_EVENTTIMEMAKER_H

namespace o2
{

namespace tof
{

struct eventTimeContainer {
eventTimeContainer(const float& e) : eventTime{e} {};
float eventTime = 0.f;
};

template <typename tTracks>
eventTimeContainer evTimeMaker(const tTracks& tracks)
{
for (auto track : tracks) {
track.tofSignal();
}
return eventTimeContainer{0};
}

} // namespace tof
} // namespace o2

#endif /* ALICEO2_TOF_EVENTTIMEMAKER_H */
24 changes: 24 additions & 0 deletions Detectors/TOF/reconstruction/src/EventTimeMaker.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file EventTimeMaker.cxx
/// \brief Implementation of the TOF event time maker

#include "TOFReconstruction/EventTimeMaker.h"

namespace o2
{

namespace tof
{

} // namespace tof
} // namespace o2