Project
Loading...
Searching...
No Matches
TrackMCHMID.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
18
19#include <iostream>
20
22#include "Framework/Logger.h"
23
24namespace o2
25{
26namespace dataformats
27{
28
29//__________________________________________________________________________
31std::ostream& operator<<(std::ostream& os, const o2::dataformats::TrackMCHMID& track)
32{
33 os << track.getMCHRef() << " + " << track.getMIDRef() << " = "
34 << track.getIR() << " matching chi2/NDF: " << track.getMatchChi2OverNDF();
35 return os;
36}
37
38//__________________________________________________________________________
41{
42 std::cout << *this << std::endl;
43}
44
45//__________________________________________________________________________
49std::pair<TrackMCHMID::Time, bool> TrackMCHMID::getTimeMUS(const InteractionRecord& startIR, uint32_t nOrbits,
50 bool printError) const
51{
52 auto bcDiff = mIR.differenceInBC(startIR);
53 float tMean = (bcDiff + 0.5) * o2::constants::lhc::LHCBunchSpacingMUS;
55 bool isInTF = bcDiff >= 0 && bcDiff < nOrbits * o2::constants::lhc::LHCMaxBunches;
56 if (printError && !isInTF) {
57 LOGP(alarm, "ATTENTION: wrong bunches diff. {} for current IR {} wrt 1st TF orbit {}, source:MCH-MID",
58 bcDiff, mIR.asString(), startIR.asString());
59 }
60 return std::make_pair(Time(tMean, tErr), isInTF);
61}
62
63} // namespace dataformats
64} // namespace o2
Header to collect LHC related constants.
Definition of the MUON track.
MUON track external format.
Definition TrackMCHMID.h:33
InteractionRecord getIR() const
get the interaction record associated to this track
Definition TrackMCHMID.h:64
std::pair< Time, bool > getTimeMUS(const InteractionRecord &startIR, uint32_t nOrbits=128, bool printError=false) const
double getMatchChi2OverNDF() const
get the MCH-MID matching chi2/ndf
Definition TrackMCHMID.h:72
GlobalTrackID getMCHRef() const
get the reference to the MCH track entry in its original container
Definition TrackMCHMID.h:50
void print() const
write the content of the track to the standard output
GlobalTrackID getMIDRef() const
get the reference to the MID track entry in its original container
Definition TrackMCHMID.h:57
constexpr double LHCBunchSpacingMUS
constexpr int LHCMaxBunches
std::ostream & operator<<(std::ostream &os, const o2::dataformats::MeanVertexObject &o)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string asString() const
int64_t differenceInBC(const InteractionRecord &other) const