ATLAS Offline Software
caloCellLookup.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
13 #include <cstdlib>
14 #include <iostream>
15 
16 
17 int main (int argc, char** argv)
18 {
19  CaloHelpersTest helpers;
20  const CaloCell_ID& caloID = helpers.caloID();
21 
22  for (int i=1; i < argc; i++) {
23  int hash = atoi (argv[i]);
24  Identifier id = caloID.cell_id (hash);
25  std::cout << hash << " " << id << " ";
26  int subcalo = caloID.sub_calo (hash);
27  switch (subcalo) {
28  case CaloCell_ID::LAREM:
29  std::cout << "LAREM " <<
30  "BEC: " << helpers.emID().barrel_ec(id) << " "
31  "Samp: " << helpers.emID().sampling(id) << " "
32  "Reg: " << helpers.emID().region(id) << " "
33  "Eta: " << helpers.emID().eta(id) << " "
34  "Phi: " << helpers.emID().phi(id) << " "
35  "SC: " << helpers.emID().is_supercell(id) << std::endl;
36  break;
38  std::cout << "LARHEC " <<
39  "P/N: " << helpers.hecID().pos_neg(id) << " "
40  "Samp: " << helpers.hecID().sampling(id) << " "
41  "Reg: " << helpers.hecID().region(id) << " "
42  "Eta: " << helpers.hecID().eta(id) << " "
43  "Phi: " << helpers.hecID().phi(id) << " "
44  "SC: " << helpers.hecID().is_supercell(id) << std::endl;
45  break;
47  std::cout << "LARFCAL " <<
48  "P/N: " << helpers.fcalID().pos_neg(id) << " "
49  "Mod: " << helpers.fcalID().module(id) << " "
50  "Eta: " << helpers.fcalID().eta(id) << " "
51  "Phi: " << helpers.fcalID().phi(id) << " "
52  "SC: " << helpers.fcalID().is_supercell(id) << std::endl;
53  break;
54  case CaloCell_ID::TILE:
55  std::cout << "TILE " <<
56  "Reg: " << helpers.tileID().region(id) << " "
57  "Syst: " << helpers.tileID().system(id) << " "
58  "Sect: " << helpers.tileID().section(id) << " "
59  "Side: " << helpers.tileID().side(id) << " "
60  "Mod: " << helpers.tileID().module(id) << " "
61  "Tow: " << helpers.tileID().tower(id) << " "
62  "Samp: " << helpers.tileID().sample(id) << " "
63  "PMT: " << helpers.tileID().pmt(id) << std::endl;
64  break;
66  std::cout << "LARMINIFCAL "
67  "P/N: " << helpers.minifcalID().pos_neg(id) << " "
68  "Mod: " << helpers.minifcalID().module(id) << " "
69  "Dep: " << helpers.minifcalID().depth(id) << " "
70  "Eta: " << helpers.minifcalID().eta(id) << " "
71  "Phi: " << helpers.minifcalID().phi(id) << std::endl;
72  break;
73  default:
74  std::cout << "UNKNOWN ";
75  }
76  }
77 
78  return 0;
79 }
LArEM_Base_ID::phi
int phi(const Identifier id) const
return phi according to :
CaloHelpersTest::hecID
const LArHEC_ID & hecID() const
Definition: CaloHelpersTest.cxx:74
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
LArHEC_Base_ID::eta
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
LArFCAL_Base_ID::pos_neg
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
main
int main(int argc, char **argv)
Definition: caloCellLookup.cxx:17
Tile_Base_ID::pmt
int pmt(const Identifier &id) const
Definition: Tile_Base_ID.cxx:180
LArMiniFCAL_ID::module
int module(const Identifier id) const
module [0]
Definition: LArMiniFCAL_ID.h:496
CaloCell_Base_ID::LARMINIFCAL
@ LARMINIFCAL
Definition: CaloCell_Base_ID.h:46
CaloHelpersTest::tileID
const TileID & tileID() const
Definition: CaloHelpersTest.cxx:92
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArMiniFCAL_ID::depth
int depth(const Identifier id) const
depth [0,3]
Definition: LArMiniFCAL_ID.h:502
LArEM_Base_ID::region
int region(const Identifier id) const
return region according to :
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
CaloHelpersTest::minifcalID
const LArMiniFCAL_ID & minifcalID() const
Definition: CaloHelpersTest.cxx:86
CaloHelpersTest.h
Helper to initialize ID helpers for unit tests.
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
Tile_Base_ID::system
int system(const Identifier &id) const
Definition: Tile_Base_ID.cxx:141
LArEM_Base_ID::eta
int eta(const Identifier id) const
return eta according to :
Tile_Base_ID::region
int region(int section, int side) const
Definition: Tile_Base_ID.cxx:119
LArFCAL_Base_ID::eta
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
LArFCAL_Base_ID::phi
int phi(const Identifier id) const
phi [0,15]
CaloHelpersTest
Helper to initialize ID helpers for unit tests.
Definition: CaloHelpersTest.h:38
LArMiniFCAL_ID::phi
int phi(const Identifier id) const
phi [0,15]
Definition: LArMiniFCAL_ID.h:516
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
CaloCell_Base_ID::sub_calo
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
LArEM_Base_ID::barrel_ec
int barrel_ec(const Identifier id) const
return barrel_ec according to :
CaloCell_Base_ID::cell_id
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,...
CaloHelpersTest::fcalID
const LArFCAL_ID & fcalID() const
Definition: CaloHelpersTest.cxx:80
LArMiniFCAL_ID::pos_neg
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
Definition: LArMiniFCAL_ID.h:490
LArHEC_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
CaloHelpersTest::caloID
const CaloCell_ID & caloID() const
Definition: CaloHelpersTest.cxx:98
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArHEC_Base_ID::sampling
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
LArHEC_Base_ID::pos_neg
int pos_neg(const Identifier id) const
return pos_neg -2 (C side) or 2 (A side)
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
LArFCAL_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Definition: LArFCAL_Base_ID.cxx:34
CaloHelpersTest::emID
const LArEM_ID & emID() const
Definition: CaloHelpersTest.cxx:68
LArMiniFCAL_ID::eta
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
Definition: LArMiniFCAL_ID.h:509
LArHEC_Base_ID::region
int region(const Identifier id) const
return region [0,1]
LArEM_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Definition: LArEM_Base_ID.cxx:46
LArHEC_Base_ID::phi
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part