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 catch (const LArID_Exception& e) {
26 std::cerr << "Caught exception: " << std::string(e) << "\n";
27 exit(1);
28 }
29 const CaloCell_ID& caloID = helpers->caloID();
30
31 for (int i=1; i < argc; i++) {
32 int hash = atoi (argv[i]);
33 Identifier id = caloID.cell_id (hash);
34 std::cout << hash << " " << id << " ";
35 int subcalo = caloID.sub_calo (hash);
36 switch (subcalo) {
38 std::cout << "LAREM " <<
39 "BEC: " << helpers->emID().barrel_ec(id) << " "
40 "Samp: " << helpers->emID().sampling(id) << " "
41 "Reg: " << helpers->emID().region(id) << " "
42 "Eta: " << helpers->emID().eta(id) << " "
43 "Phi: " << helpers->emID().phi(id) << " "
44 "SC: " << helpers->emID().is_supercell(id) << std::endl;
45 break;
47 std::cout << "LARHEC " <<
48 "P/N: " << helpers->hecID().pos_neg(id) << " "
49 "Samp: " << helpers->hecID().sampling(id) << " "
50 "Reg: " << helpers->hecID().region(id) << " "
51 "Eta: " << helpers->hecID().eta(id) << " "
52 "Phi: " << helpers->hecID().phi(id) << " "
53 "SC: " << helpers->hecID().is_supercell(id) << std::endl;
54 break;
56 std::cout << "LARFCAL " <<
57 "P/N: " << helpers->fcalID().pos_neg(id) << " "
58 "Mod: " << helpers->fcalID().module(id) << " "
59 "Eta: " << helpers->fcalID().eta(id) << " "
60 "Phi: " << helpers->fcalID().phi(id) << " "
61 "SC: " << helpers->fcalID().is_supercell(id) << std::endl;
62 break;
64 std::cout << "TILE " <<
65 "Reg: " << helpers->tileID().region(id) << " "
66 "Syst: " << helpers->tileID().system(id) << " "
67 "Sect: " << helpers->tileID().section(id) << " "
68 "Side: " << helpers->tileID().side(id) << " "
69 "Mod: " << helpers->tileID().module(id) << " "
70 "Tow: " << helpers->tileID().tower(id) << " "
71 "Samp: " << helpers->tileID().sample(id) << " "
72 "PMT: " << helpers->tileID().pmt(id) << std::endl;
73 break;
75 std::cout << "LARMINIFCAL "
76 "P/N: " << helpers->minifcalID().pos_neg(id) << " "
77 "Mod: " << helpers->minifcalID().module(id) << " "
78 "Dep: " << helpers->minifcalID().depth(id) << " "
79 "Eta: " << helpers->minifcalID().eta(id) << " "
80 "Phi: " << helpers->minifcalID().phi(id) << std::endl;
81 break;
82 default:
83 std::cout << "UNKNOWN ";
84 }
85 }
86
87 return 0;
88}
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.