Project
Loading...
Searching...
No Matches
LV.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
12#include "LV.h"
13
16#include "MCHConditions/Plane.h"
19#include "Quadrant.h"
20#include "Slat.h"
21
22namespace o2::mch::dcs
23{
24
25std::set<Cathode> lvAliasToCathode(std::string_view alias)
26{
27 const auto chamber = aliasToChamber(alias);
28 if (dcs::isQuadrant(chamber)) {
29 return {quadrant::lvAliasToCathode(alias)};
30 } else {
31 return slat::lvAliasToCathode(alias);
32 }
33}
34
35std::set<DsIndex> lvAliasToDsIndices(std::string_view alias)
36{
37 auto cathodes = lvAliasToCathode(alias);
38 std::set<DsIndex> dsIndices;
39 for (auto cathode : cathodes) {
40 auto deId = cathode.deId;
41 auto plane = cathode.plane;
42 if (constants::isValidDetElemId(deId)) {
43 auto solarIds = raw::getSolarUIDs<raw::ElectronicMapperGenerated>(deId);
44 for (auto solarId : solarIds) {
45 auto dsDetIds = raw::getDualSampas<raw::ElectronicMapperGenerated>(solarId);
46 for (auto dsDetId : dsDetIds) {
47 if (dsDetId.dsId() >= 1024 && plane == dcs::Plane::Bending ||
48 dsDetId.dsId() < 1024 && plane == dcs::Plane::NonBending) {
49 continue;
50 }
51 dsIndices.emplace(getDsIndex(dsDetId));
52 }
53 }
54 }
55 }
56 return dsIndices;
57}
58} // namespace o2::mch::dcs
Chamber aliasToChamber(std::string_view alias)
Definition Chamber.cxx:100
std::optional< Chamber > chamber(int chamberId)
Definition Chamber.cxx:17
std::set< Cathode > lvAliasToCathode(std::string_view alias)
Definition LV.cxx:25
std::set< DsIndex > lvAliasToDsIndices(std::string_view alias)
Definition LV.cxx:35
DsIndex getDsIndex(const o2::mch::raw::DsDetId &dsDetId)
Definition DsIndex.cxx:79