Project
Loading...
Searching...
No Matches
IOUtils.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.
15
16#include "ITStracking/IOUtils.h"
17
18#include <gsl/span>
19#include <vector>
20#include <cstdlib>
21
25
26namespace
27{
28constexpr int PrimaryVertexLayerId{-1};
29constexpr int EventLabelsSeparator{-1};
30} // namespace
31
32using namespace o2::its;
33
35void ioutils::convertCompactClusters(gsl::span<const itsmft::CompClusterExt> clusters,
36 gsl::span<const unsigned char>::iterator& pattIt,
37 std::vector<o2::BaseCluster<float>>& output,
39{
40 static const o2::itsmft::ChipMappingITS chmap;
42 bool applyMisalignment = false;
43 const auto& conf = TrackerParamConfig::Instance();
44 for (int il = 0; il < chmap.NLayers; il++) {
45 if (conf.sysErrY2[il] > 0.f || conf.sysErrZ2[il] > 0.f) {
46 applyMisalignment = true;
47 break;
48 }
49 }
50
51 for (const auto& c : clusters) {
52 float sigmaY2{0}, sigmaZ2{0}, sigmaYZ{0};
53 auto locXYZ = extractClusterData(c, pattIt, dict, sigmaY2, sigmaZ2);
54 auto& cl3d = output.emplace_back(c.getSensorID(), geom->getMatrixT2L(c.getSensorID()) ^ locXYZ); // local --> tracking
55 if (applyMisalignment) {
56 auto lrID = chmap.getLayer(c.getSensorID());
57 sigmaY2 += conf.sysErrY2[lrID];
58 sigmaZ2 += conf.sysErrZ2[lrID];
59 }
60 cl3d.setErrors(sigmaY2, sigmaZ2, sigmaYZ);
61 }
62}
Definition of the GeometryTGeo class.
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
uint32_t c
Definition RawData.h:2
const Mat3D & getMatrixT2L(int lay, int hba, int sta, int det) const
static GeometryTGeo * Instance()
static constexpr int getLayer(int chipSW)
static constexpr int NLayers
void convertCompactClusters(gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, std::vector< o2::BaseCluster< float > > &output, const itsmft::TopologyDictionary *dict)
convert compact clusters to 3D spacepoints
Definition IOUtils.cxx:35
o2::math_utils::Point3D< T > extractClusterData(const itsmft::CompClusterExt &c, iterator &iter, const itsmft::TopologyDictionary *dict, T &sig2y, T &sig2z)
Definition IOUtils.h:41
std::vector< Cluster > clusters