16#ifndef ALICEO2_DATA_MCTRACK_H_
17#define ALICEO2_DATA_MCTRACK_H_
24#include "TLorentzVector.h"
25#include "TMCProcess.h"
28#include "TParticlePDG.h"
35namespace MCTrackHelper
55 MCTrackT(Int_t pdgCode, Int_t motherID, Int_t secondMotherID, Int_t firstDaughterID, Int_t lastDaughterID,
56 Double_t px, Double_t py, Double_t pz, Double_t
x, Double_t
y, Double_t
z, Double_t
t,
69 void Print(Int_t iTrack = 0)
const;
88 Double_t
R2()
const {
return Vx() *
Vx() +
Vy() *
Vy(); }
90 Double_t
R()
const {
return std::sqrt(
R2()); }
101 Double_t
Px()
const {
return mStartVertexMomentumX; }
102 Double_t
Py()
const {
return mStartVertexMomentumY; }
103 Double_t
Pz()
const {
return mStartVertexMomentumZ; }
104 Double_t
Vx()
const {
return mStartVertexCoordinatesX; }
105 Double_t
Vy()
const {
return mStartVertexCoordinatesY; }
106 Double_t
Vz()
const {
return mStartVertexCoordinatesZ; }
107 Double_t
T()
const {
return mStartVertexCoordinatesT; }
111 double mx(mStartVertexMomentumX);
112 double my(mStartVertexMomentumY);
113 return std::sqrt(mx * mx + my * my);
118 double mx(mStartVertexMomentumX);
119 double my(mStartVertexMomentumY);
120 double mz(mStartVertexMomentumZ);
121 return std::sqrt(mx * mx + my * my + mz * mz);
126 double mx(mStartVertexMomentumX);
127 double my(mStartVertexMomentumY);
128 return (TMath::Pi() + TMath::ATan2(-my, -mx));
133 double_t pmom =
GetP();
134 double mz(mStartVertexMomentumZ);
135 if (pmom != TMath::Abs(mz)) {
136 return 0.5 * std::log((pmom + mz) / (pmom - mz));
150 double mz(mStartVertexMomentumZ);
151 return (mz == 0) ? TMath::PiOver2() : TMath::ACos(mz /
GetP());
163 Int_t
getHitMask()
const {
return ((PropEncoding)mProp).hitmask; }
176 assert(0 <= iDetBit && iDetBit < o2::detectors::DetID::nDetectors);
177 auto prop = ((PropEncoding)mProp);
178 prop.hitmask |= 1 << iDetBit;
184 return (((PropEncoding)mProp).hitmask & (1 << bit)) > 0;
189 bool leftTrace(Int_t iDet, std::vector<int>
const& detIDtoBit)
const
191 auto bit = detIDtoBit[iDet];
214 auto prop = ((PropEncoding)mProp);
218 bool getStore()
const {
return ((PropEncoding)mProp).storage; }
220 bool hasHits()
const {
return ((PropEncoding)mProp).hitmask != 0; }
224 auto prop = ((PropEncoding)mProp);
230 int getProcess()
const {
return ((PropEncoding)mProp).process; }
237 auto prop = ((PropEncoding)mProp);
241 bool getToBeDone()
const {
return ((PropEncoding)mProp).toBeDone; }
245 auto prop = ((PropEncoding)mProp);
256 auto prop = ((PropEncoding)mProp);
257 prop.contributesToAHit =
f;
267 _T mStartVertexMomentumX, mStartVertexMomentumY, mStartVertexMomentumZ;
270 _T mStartVertexCoordinatesX, mStartVertexCoordinatesY, mStartVertexCoordinatesZ, mStartVertexCoordinatesT;
279 Int_t mMotherTrackId = -1;
280 Int_t mSecondMotherTrackId = -1;
282 Int_t mFirstDaughterTrackId = -1;
283 Int_t mLastDaughterTrackId = -1;
292 PropEncoding(
int a) :
i(
a) {}
298 int contributesToAHit : 1;
307 Int_t mStatusCode = 0;
315 const auto mass = GetMass();
316 Double_t px = mStartVertexMomentumX;
317 Double_t py = mStartVertexMomentumY;
318 Double_t pz = mStartVertexMomentumZ;
319 return std::sqrt(mass * mass + px * px + py * py + pz * pz);
325 momentum.SetXYZ(mStartVertexMomentumX, mStartVertexMomentumY, mStartVertexMomentumZ);
331 momentum.SetXYZT(mStartVertexMomentumX, mStartVertexMomentumY, mStartVertexMomentumZ, GetEnergy());
337 vertex.SetXYZ(mStartVertexCoordinatesX, mStartVertexCoordinatesY, mStartVertexCoordinatesZ);
344 mSecondMotherTrackId(-1),
345 mFirstDaughterTrackId(-1),
346 mLastDaughterTrackId(-1),
347 mStartVertexMomentumX(0.),
348 mStartVertexMomentumY(0.),
349 mStartVertexMomentumZ(0.),
350 mStartVertexCoordinatesX(0.),
351 mStartVertexCoordinatesY(0.),
352 mStartVertexCoordinatesZ(0.),
353 mStartVertexCoordinatesT(0.),
360inline MCTrackT<T>::MCTrackT(Int_t pdgCode, Int_t motherId, Int_t secondMotherId, Int_t firstDaughterId, Int_t lastDaughterId,
361 Double_t px, Double_t py, Double_t pz, Double_t
x,
362 Double_t
y, Double_t
z, Double_t
t, Int_t
mask)
364 mMotherTrackId(motherId),
365 mSecondMotherTrackId(secondMotherId),
366 mFirstDaughterTrackId(firstDaughterId),
367 mLastDaughterTrackId(lastDaughterId),
368 mStartVertexMomentumX(px),
369 mStartVertexMomentumY(py),
370 mStartVertexMomentumZ(pz),
371 mStartVertexCoordinatesX(
x),
372 mStartVertexCoordinatesY(
y),
373 mStartVertexCoordinatesZ(
z),
374 mStartVertexCoordinatesT(
t),
382 : mPdgCode(part.GetPdgCode()),
383 mMotherTrackId(part.GetMother(0)),
384 mSecondMotherTrackId(part.GetMother(1)),
385 mFirstDaughterTrackId(part.GetFirstDaughter()),
386 mLastDaughterTrackId(part.GetLastDaughter()),
387 mStartVertexMomentumX(part.Px()),
388 mStartVertexMomentumY(part.Py()),
389 mStartVertexMomentumZ(part.Pz()),
390 mStartVertexCoordinatesX(part.Vx()),
391 mStartVertexCoordinatesY(part.Vy()),
392 mStartVertexCoordinatesZ(part.Vz()),
393 mStartVertexCoordinatesT(part.T() * 1e09),
394 mWeight(part.GetWeight()),
436 const auto e = GetEnergy();
438 0.5 * std::log((
e +
static_cast<double>(mStartVertexMomentumZ)) / (
e -
static_cast<double>(mStartVertexMomentumZ)));
445 auto procID = getProcess();
447 return TMCProcessName[procID];
449 return TMCProcessName[TMCProcess::kPNoProcess];
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone proc
bool leftTraceGivenBitField(int bit) const
int getProcess() const
get the production process (id) of this track
o2::mcgenstatus::MCGenStatusEncoding getStatusCode() const
get generator status code
Int_t getFirstDaughterTrackId() const
Double_t GetStartVertexMomentumZ() const
void GetMomentum(TVector3 &momentum) const
Double_t GetTheta() const
Double_t R() const
production radius
bool getInhibited() const
void Get4Momentum(TLorentzVector &momentum) const
static constexpr int NHITBITS
Double_t GetStartVertexMomentumX() const
bool getContributesToAHit() const
bool leftTrace(Int_t iDet, std::vector< int > const &detIDtoBit) const
MCTrackT(const MCTrackT &track)=default
Copy constructor.
Int_t getLastDaughterTrackId() const
_T getWeight() const
return particle weight
void SetLastDaughterTrackId(Int_t id)
Double_t GetMass() const
return mass from PDG Database if known (print message in case cannot look up)
void SetMotherTrackId(Int_t id)
Modifiers.
const char * getProdProcessAsString() const
get the string representation of the production process
Double_t GetRapidity() const
void SetFirstDaughterTrackId(Int_t id)
Double_t GetStartVertexCoordinatesY() const
bool isTransported() const
void setInhibited(bool f)
void Print(Int_t iTrack=0) const
Output to screen.
MCTrackT()
Default constructor.
Double_t GetStartVertexCoordinatesZ() const
void setContributesToAHit(bool f=true)
mark that this track deposited into a hit created by another track
void SetSecondMotherTrackId(Int_t id)
Double_t R2() const
production radius squared
Double_t GetStartVertexMomentumY() const
Double_t GetStartVertexCoordinatesT() const
void GetStartVertex(TVector3 &vertex) const
Double_t GetEnergy() const
MCTrackT(const TParticle &particle)
Constructor from TParticle.
MCTrackT(Int_t pdgCode, Int_t motherID, Int_t secondMotherID, Int_t firstDaughterID, Int_t lastDaughterID, Double_t px, Double_t py, Double_t pz, Double_t x, Double_t y, Double_t z, Double_t t, Int_t nPoints)
Standard constructor.
Int_t getSecondMotherTrackId() const
~MCTrackT()=default
Destructor.
void setHit(Int_t iDetBit)
Int_t getHitMask() const
Accessors to the hit mask.
Double_t GetStartVertexCoordinatesX() const
Int_t GetPdgCode() const
Accessors.
bool hasHits() const
determine if this track has hits
void setProcess(int proc)
set process property
Int_t getMotherTrackId() const
static Double_t Mass(int pdg, bool &success, TDatabasePDG *db=O2DatabasePDG::Instance())
GLboolean GLboolean GLboolean GLboolean a
GLdouble GLdouble GLdouble z
void printMassError(int pdg)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...