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
35 changes: 22 additions & 13 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ void MatchTOF::run(const o2::globaltracking::RecoContainer& inp)

mTimerMatchTPC.Reset();
mTimerMatchITSTPC.Reset();
mTimerTot.Start();

mTimerTot.Stop();
LOGF(INFO, "Timing prepareTOFCluster: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);
mTimerTot.Start();
mTimerTot.Reset();

for (int i = 0; i < trkType::SIZE; i++) {
mMatchedTracks[i].clear();
Expand All @@ -88,18 +84,30 @@ void MatchTOF::run(const o2::globaltracking::RecoContainer& inp)
mSideTPC.clear();
mExtraTPCFwdTime.clear();

if (!prepareTOFClusters()) { // check cluster before of tracks to see also if MC is required
mTimerTot.Start();
bool isPrepareTOFClusters = prepareTOFClusters();
mTimerTot.Stop();
LOGF(INFO, "Timing prepareTOFCluster: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);

if (!isPrepareTOFClusters) { // check cluster before of tracks to see also if MC is required
return;
}

if (!prepareTPCData() || !prepareFITData()) {
mTimerTot.Start();
if (!prepareTPCData()) {
return;
}

mTimerTot.Stop();
LOGF(INFO, "Timing prepare tracks: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);
LOGF(INFO, "Timing prepare TPC tracks: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);

mTimerTot.Start();
if (!prepareFITData()) {
return;
}
mTimerTot.Stop();
LOGF(INFO, "Timing prepare FIT data: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);

mTimerTot.Start();
for (int sec = o2::constants::math::NSectors; sec--;) {
mMatchedTracksPairs.clear(); // new sector
LOG(INFO) << "Doing matching for sector " << sec << "...";
Expand All @@ -126,7 +134,7 @@ void MatchTOF::run(const o2::globaltracking::RecoContainer& inp)
mIsITSTPCTRDused = false;

mTimerTot.Stop();
LOGF(INFO, "Timing Do Matching: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);
LOGF(INFO, "Timing Do Matching: Cpu: %.3e s Real: %.3e s in %d slots", mTimerTot.CpuTime(), mTimerTot.RealTime(), mTimerTot.Counter() - 1);
LOGF(INFO, "Timing Do Matching ITSTPC: Cpu: %.3e s Real: %.3e s in %d slots", mTimerMatchITSTPC.CpuTime(), mTimerMatchITSTPC.RealTime(), mTimerMatchITSTPC.Counter() - 1);
LOGF(INFO, "Timing Do Matching TPC : Cpu: %.3e s Real: %.3e s in %d slots", mTimerMatchTPC.CpuTime(), mTimerMatchTPC.RealTime(), mTimerMatchTPC.Counter() - 1);
}
Expand Down Expand Up @@ -371,6 +379,7 @@ bool MatchTOF::prepareTOFClusters()
int nClusterInCurrentChunk = mTOFClustersArrayInp.size();
LOG(DEBUG) << "nClusterInCurrentChunk = " << nClusterInCurrentChunk;
mNumOfClusters += nClusterInCurrentChunk;
mTOFClusWork.reserve(mTOFClusWork.size() + mNumOfClusters);
for (int it = 0; it < nClusterInCurrentChunk; it++) {
const Cluster& clOrig = mTOFClustersArrayInp[it];
// create working copy of track param
Expand Down Expand Up @@ -483,7 +492,7 @@ void MatchTOF::doMatching(int sec)
detIdTemp[idet] = -1;
}

Geo::getPadDxDyDz(posFloat, detIdTemp, deltaPosTemp);
Geo::getPadDxDyDz(posFloat, detIdTemp, deltaPosTemp, sec);

reachedPoint += step;

Expand Down Expand Up @@ -805,7 +814,7 @@ void MatchTOF::doMatchingForTPC(int sec)
posFloat[2] = pos[2];
}

Geo::getPadDxDyDz(posFloat, detIdTemp, deltaPosTemp);
Geo::getPadDxDyDz(posFloat, detIdTemp, deltaPosTemp, sec);

if (detIdTemp[2] == -1) {
continue;
Expand Down Expand Up @@ -1157,7 +1166,7 @@ bool MatchTOF::propagateToRefX(o2::track::TrackParCov& trc, float xRef, float st
{
// propagate track to matching reference X
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; // material correction method
const float tanHalfSector = tan(o2::constants::math::SectorSpanRad / 2);
static const float tanHalfSector = tan(o2::constants::math::SectorSpanRad / 2);
bool refReached = false;
float xStart = trc.getX();
// the first propagation will be from 2m, if the track is not at least at 2m
Expand Down
15 changes: 13 additions & 2 deletions Detectors/TOF/base/include/TOFBase/Geo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define ALICEO2_TOF_GEO_H

#include "Rtypes.h"
#include <array>
#include <vector>
#include "CommonConstants/LHCConstants.h"
//#include "DetectorsRaw/HBFUtils.h"

Expand All @@ -30,6 +32,7 @@ class Geo

// From AliTOFGeometry
static void translate(Float_t* xyz, Float_t translationVector[3]);
static void translate(Float_t& x, Float_t& y, Float_t& z, Float_t translationVector[3]);
static void rotate(Float_t* xyz, Double_t rotationAngles[6]);

static void rotateToSector(Float_t* xyz, Int_t isector);
Expand All @@ -49,7 +52,7 @@ class Geo
static Float_t getAngles(Int_t iplate, Int_t istrip) { return ANGLES[iplate][istrip]; }
static Float_t getHeights(Int_t iplate, Int_t istrip) { return HEIGHTS[iplate][istrip]; }
static Float_t getDistances(Int_t iplate, Int_t istrip) { return DISTANCES[iplate][istrip]; }
static void getPadDxDyDz(const Float_t* pos, Int_t* det, Float_t* DeltaPos);
static void getPadDxDyDz(const Float_t* pos, Int_t* det, Float_t* DeltaPos, int sector = -1);
enum {
// DAQ characteristics
// cfr. TOF-TDR pag. 105 for Glossary
Expand All @@ -71,13 +74,16 @@ class Geo
static constexpr int BC_IN_ORBIT = o2::constants::lhc::LHCMaxBunches; // N. bunch crossing in 1 orbit

static constexpr Int_t NPADX = 48;
static constexpr Float_t NPADX_INV_INT = 1. / NPADX;
static constexpr Int_t NPADZ = 2;
static constexpr Int_t NPADS = NPADX * NPADZ;
static constexpr Float_t NPADS_INV_INT = 1. / NPADS;
static constexpr Int_t NSTRIPA = 15;
static constexpr Int_t NSTRIPB = 19;
static constexpr Int_t NSTRIPC = 19;
static constexpr Int_t NMAXNSTRIP = 20;
static constexpr Int_t NSTRIPXSECTOR = NSTRIPA + 2 * NSTRIPB + 2 * NSTRIPC;
static constexpr Float_t NSTRIPXSECTOR_INV_INT = 1. / NSTRIPXSECTOR;
static constexpr Int_t NPADSXSECTOR = NSTRIPXSECTOR * NPADS;

static constexpr Int_t NSECTORS = 18;
Expand Down Expand Up @@ -107,6 +113,7 @@ class Geo
static constexpr Float_t SIGMAFORTAIL12 = 0.5; // Sig2 for simulation of TDC tails

static constexpr Float_t PHISEC = 20; // sector Phi width (deg)
static constexpr Float_t PHISECINV = 1. / PHISEC; // sector Phi width (deg)

static constexpr Float_t TDCBIN = o2::constants::lhc::LHCBunchSpacingNS * 1E3 / 1024; ///< TDC bin width [ps]
static constexpr Float_t NTDCBIN_PER_PS = 1. / TDCBIN; ///< number of TDC bins in 1 ns
Expand Down Expand Up @@ -281,6 +288,7 @@ class Geo
static Int_t getCHFromECH(int echan) { return ELCHAN_TO_CHAN[echan]; }

static void Init();
static void InitIndices();

private:
static Int_t getSector(const Float_t* pos);
Expand All @@ -295,14 +303,17 @@ class Geo
static Float_t mRotationMatrixSector[NSECTORS + 1][3][3]; // rotation matrixes
static Float_t mRotationMatrixPlateStrip[NPLATES][NMAXNSTRIP][3][3];
static Float_t mPadPosition[NSECTORS][NPLATES][NMAXNSTRIP][NPADZ][NPADX][3];
static Int_t mPlate[NSTRIPXSECTOR];
static Int_t mStripInPlate[NSTRIPXSECTOR];
static std::array<std::vector<float>, 5> mDistances;

// cable length map
static constexpr Float_t CABLEPROPAGATIONDELAY = 0.0513; // Propagation delay [ns/cm]
static const Float_t CABLELENGTH[kNCrate][10][kNChain][kNTdc / 3]; // not constexpr as we initialize it in CableLength.cxx at run time
static const Int_t CHAN_TO_ELCHAN[NCHANNELS];
static const Int_t ELCHAN_TO_CHAN[N_ELECTRONIC_CHANNELS];

ClassDefNV(Geo, 1);
ClassDefNV(Geo, 2);
};
} // namespace tof
} // namespace o2
Expand Down
Loading