ATLAS Offline Software
Loading...
Searching...
No Matches
caloCellLookup.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
10
11
14#include <cstdlib>
15#include <iostream>
16#include <memory>
17
18
19int main ATLAS_NOT_THREAD_SAFE (int argc, char** argv)
20{
21 std::unique_ptr<CaloHelpersTest> helpers;
22 try {
23 helpers = std::make_unique<CaloHelpersTest>();
24
25 const CaloCell_ID& caloID = helpers->caloID();
26
27 for (int i=1; i < argc; i++) {
28 int hash = atoi (argv[i]);
29 Identifier id = caloID.cell_id (hash);
30 std::cout << hash << " " << id << " ";
31 int subcalo = caloID.sub_calo (hash);
32 switch (subcalo) {
34 std::cout << "LAREM " <<
35 "BEC: " << helpers->emID().barrel_ec(id) << " "
36 "Samp: " << helpers->emID().sampling(id) << " "
37 "Reg: " << helpers->emID().region(id) << " "
38 "Eta: " << helpers->emID().eta(id) << " "
39 "Phi: " << helpers->emID().phi(id) << " "
40 "SC: " << helpers->emID().is_supercell(id) << std::endl;
41 break;
43 std::cout << "LARHEC " <<
44 "P/N: " << helpers->hecID().pos_neg(id) << " "
45 "Samp: " << helpers->hecID().sampling(id) << " "
46 "Reg: " << helpers->hecID().region(id) << " "
47 "Eta: " << helpers->hecID().eta(id) << " "
48 "Phi: " << helpers->hecID().phi(id) << " "
49 "SC: " << helpers->hecID().is_supercell(id) << std::endl;
50 break;
52 std::cout << "LARFCAL " <<
53 "P/N: " << helpers->fcalID().pos_neg(id) << " "
54 "Mod: " << helpers->fcalID().module(id) << " "
55 "Eta: " << helpers->fcalID().eta(id) << " "
56 "Phi: " << helpers->fcalID().phi(id) << " "
57 "SC: " << helpers->fcalID().is_supercell(id) << std::endl;
58 break;
60 std::cout << "TILE " <<
61 "Reg: " << helpers->tileID().region(id) << " "
62 "Syst: " << helpers->tileID().system(id) << " "
63 "Sect: " << helpers->tileID().section(id) << " "
64 "Side: " << helpers->tileID().side(id) << " "
65 "Mod: " << helpers->tileID().module(id) << " "
66 "Tow: " << helpers->tileID().tower(id) << " "
67 "Samp: " << helpers->tileID().sample(id) << " "
68 "PMT: " << helpers->tileID().pmt(id) << std::endl;
69 break;
71 std::cout << "LARMINIFCAL "
72 "P/N: " << helpers->minifcalID().pos_neg(id) << " "
73 "Mod: " << helpers->minifcalID().module(id) << " "
74 "Dep: " << helpers->minifcalID().depth(id) << " "
75 "Eta: " << helpers->minifcalID().eta(id) << " "
76 "Phi: " << helpers->minifcalID().phi(id) << std::endl;
77 break;
78 default:
79 std::cout << "UNKNOWN ";
80 }
81 }
82 }
83 catch (const LArID_Exception& e) {
84 std::cerr << "Caught exception: " << std::string(e) << "\n";
85 return 1;
86 }
87 catch (const std::exception& e) {
88 std::cerr << "Caught exception: " << e.what() << "\n";
89 return 1;
90 }
91 return 0;
92}
Helper to initialize ID helpers for unit tests.
int main(int, char **)
Main class for all the CppUnit test classes.
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Exception class for LAr Identifiers.