Skip to content

Commit

Permalink
Merge 89058ee into sapling-pr-archive-ktf
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored Oct 27, 2023
2 parents 0aa01a8 + 89058ee commit 5dd2c05
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 7 additions & 8 deletions DataFormats/Headers/include/Headers/TimeStamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#include <cassert>
#include <type_traits> // for std::integral_constant

namespace o2
{
namespace header
namespace o2::header
{

// https://lhc-machine-outreach.web.cern.ch/lhc-machine-outreach/collisions.htm
Expand Down Expand Up @@ -140,12 +138,14 @@ class TimeStamp
static_assert(std::is_same<typename T::rep, Rep>::value && std::is_same<typename T::period, Period>::value,
"only clock and duration types defining the rep and period member types are allowed");
using duration = std::chrono::duration<Rep, Period>;
if (mUnit == sClockLHC) {
static_assert(sizeof(mUnit) == sizeof(sClockLHC), "size mismatch of mUnit and sClockLHC");
if (memcmp(&mUnit, &sClockLHC, sizeof(sClockLHC)) == 0) {
// cast each part individually, if the precision of the return type
// is smaller the values are simply truncated
return std::chrono::duration_cast<duration>(LHCOrbitClock::duration(mPeriod) + LHCBunchClock::duration(mBCNumber));
}
if (mUnit == sMicroSeconds) {
static_assert(sizeof(mUnit) == sizeof(sMicroSeconds), "size mismatch of mUnit and sMicroSeconds");
if (memcmp(&mUnit, &sMicroSeconds, sizeof(sMicroSeconds)) == 0) {
// TODO: is there a better way to mark the subticks invalid for the
// micro seconds representation? First step is probably to remove/rename the
// variable
Expand All @@ -159,7 +159,7 @@ class TimeStamp
}

// TODO: implement transformation from one unit to the other
//void transform(const TimeUnitID& unit) {
// void transform(const TimeUnitID& unit) {
// if (mUnit == unit) return;
// ...
//}
Expand All @@ -182,7 +182,6 @@ class TimeStamp
};
};
};
} //namespace header
} //namespace o2
} // namespace o2::header

#endif
13 changes: 8 additions & 5 deletions Framework/AnalysisSupport/src/DataInputDirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@
// 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.
#ifndef o2_framework_DataInputDirector_H_INCLUDED
#define o2_framework_DataInputDirector_H_INCLUDED
#ifndef O2_FRAMEWORK_DATAINPUTDIRECTOR_H_
#define O2_FRAMEWORK_DATAINPUTDIRECTOR_H_

#include "TFile.h"
#include "TTreeReader.h"

#include "Framework/DataDescriptorMatcher.h"
#include "Framework/DataAllocator.h"
#include "Monitoring/Monitoring.h"

#include <regex>
#include "rapidjson/fwd.h"

namespace o2::monitoring
{
class Monitoring;
}

namespace o2::framework
{

Expand Down Expand Up @@ -168,4 +171,4 @@ class DataInputDirector

} // namespace o2::framework

#endif // o2_framework_DataInputDirector_H_INCLUDED
#endif // O2_FRAMEWORK_DATAINPUTDIRECTOR_H_

0 comments on commit 5dd2c05

Please sign in to comment.