37namespace fs = std::filesystem;
44 gsl::span<const Cluster> localClusters,
45 std::vector<
Cluster, o2::pmr::polymorphic_allocator<Cluster>>& globalClusters)
48 globalClusters.insert(globalClusters.end(), localClusters.begin(), localClusters.end());
49 for (
auto&
c : localClusters) {
50 auto deId =
c.getDEId();
53 auto global = t(local);
54 auto& gcluster = globalClusters[
i];
55 gcluster.x = global.x();
56 gcluster.y = global.y();
57 gcluster.z = global.z();
79 std::string ext = fs::path(geoFile).extension();
80 std::transform(ext.begin(), ext.begin(), ext.end(), [](
unsigned char c) { return std::tolower(c); });
83 std::ifstream in(geoFile);
85 throw std::invalid_argument(
"cannot open geometry file" + geoFile);
88 }
else if (ext ==
".root") {
92 throw std::invalid_argument(
"Geometry from file can only be in JSON or Root format");
101 auto geoFile = ic.
options().
get<std::string>(
"geometry");
115 auto localClusters = pc.
inputs().
get<gsl::span<Cluster>>(
"clusters");
130 std::string inputConfig = fmt::format(
"rofs:MCH/CLUSTERROFS;clusters:MCH/CLUSTERS");
133 auto ccdbRequest = disableCcdb ? nullptr : std::make_shared<o2::base::GRPGeomRequest>(
false,
143 Outputs{
OutputSpec{{
"globalclusters"},
"MCH",
"GLOBALCLUSTERS", 0, Lifetime::Timeframe}},
144 AlgorithmSpec{adaptFromTask<ClusterTransformerTask>(ccdbRequest)},
Definition of the GeometryManager class.
Helper for geometry and GRP related CCDB requests.
Definition of the Names Generator class.
void checkUpdates(o2::framework::ProcessingContext &pc)
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static void loadGeometry(std::string_view geomFilePath="", bool applyMisalignment=false, bool preferAlignedFile=true)
static std::string getGeomFileName(const std::string_view prefix="")
T get(const char *key) const
decltype(auto) make(const Output &spec, Args... args)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > select(char const *matcher="")
std::vector< OutputSpec > Outputs
TransformationCreator transformationFromJSON(std::istream &in)
TransformationCreator transformationFromTGeoManager(const TGeoManager &geo)
std::function< o2::math_utils::Transform3D(int detElemId)> TransformationCreator
o2::framework::DataProcessorSpec getClusterTransformerSpec(const char *specName="mch-cluster-transformer", bool disableCcdb=false)
void local2global(geo::TransformationCreator transformation, gsl::span< const Cluster > localClusters, std::vector< Cluster, o2::pmr::polymorphic_allocator< Cluster > > &globalClusters)
Defining DataPointCompositeObject explicitly as copiable.
cluster minimal structure