Project
Loading...
Searching...
No Matches
IOUtils.h
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#ifndef TRACKINGITSU_INCLUDE_EVENTLOADER_H_
17#define TRACKINGITSU_INCLUDE_EVENTLOADER_H_
18
19#include <vector>
20
25#include "DataFormatsITSMFT/ROFRecord.h" // TODO this is just included since the alignment code include it now
26
28{
29
34
35void convertCompactClusters(gsl::span<const itsmft::CompClusterExt> clusters,
36 gsl::span<const unsigned char>::iterator& pattIt,
37 std::vector<o2::BaseCluster<float>>& output,
38 const itsmft::TopologyDictionary* dict);
39
40template <class iterator, typename T>
42{
43 auto pattID = c.getPatternID();
45 sig2z = ioutils::DefClusError2Col; // Dummy COG errors (about half pixel size)
47 sig2y = dict->getErr2X(pattID);
48 sig2z = dict->getErr2Z(pattID);
49 if (!dict->isGroup(pattID)) {
50 return dict->getClusterCoordinates<T>(c);
51 } else {
53 return dict->getClusterCoordinates<T>(c, patt);
54 }
55 } else {
57 return dict->getClusterCoordinates<T>(c, patt, false);
58 }
59}
60
61// same method returning coordinates as an array (suitable for the TGeoMatrix)
62template <class iterator, typename T>
63std::array<T, 3> extractClusterDataA(const itsmft::CompClusterExt& c, iterator& iter, const itsmft::TopologyDictionary* dict, T& sig2y, T& sig2z)
64{
65 auto pattID = c.getPatternID();
67 sig2z = ioutils::DefClusError2Col; // Dummy COG errors (about half pixel size)
69 sig2y = dict->getErr2X(pattID);
70 sig2z = dict->getErr2Z(pattID);
71 if (!dict->isGroup(pattID)) {
72 return dict->getClusterCoordinatesA<T>(c);
73 } else {
75 return dict->getClusterCoordinatesA<T>(c, patt);
76 }
77 } else {
79 return dict->getClusterCoordinatesA<T>(c, patt, false);
80 }
81}
82
83} // namespace o2::its::ioutils
84
85#endif /* TRACKINGITSU_INCLUDE_EVENTLOADER_H_ */
Definition of the ITSMFT compact cluster.
Definition of the ClusterTopology class.
Definition of the ITSMFT ROFrame (trigger) record.
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
uint32_t c
Definition RawData.h:2
Definition of the SegmentationAlpide class.
static constexpr unsigned short InvalidPatternID
Definition CompCluster.h:46
static constexpr float PitchCol
static constexpr float PitchRow
std::array< T, 3 > getClusterCoordinatesA(const CompCluster &cl) const
Returns the local position of a compact cluster.
math_utils::Point3D< T > getClusterCoordinates(const CompCluster &cl) const
float getErr2X(int n) const
Returns the error^2 on the x position of the COG for the n_th element.
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
float getErr2Z(int n) const
Returns the error^2 on the z position of the COG for the n_th element.
std::array< T, 3 > extractClusterDataA(const itsmft::CompClusterExt &c, iterator &iter, const itsmft::TopologyDictionary *dict, T &sig2y, T &sig2z)
Definition IOUtils.h:63
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
constexpr float DefClusErrorCol
Definition IOUtils.h:31
constexpr float DefClusErrorRow
Definition IOUtils.h:30
constexpr float DefClusError2Col
Definition IOUtils.h:33
constexpr float DefClusError2Row
Definition IOUtils.h:32
std::vector< Cluster > clusters