ATLAS Offline Software
Functions
caloCellLookup.cxx File Reference

Command-line utility to decode a calorimeter cell hash. More...

#include "CaloIdentifier/CaloHelpersTest.h"
#include "CxxUtils/checker_macros.h"
#include <cstdlib>
#include <iostream>
#include <memory>
Include dependency graph for caloCellLookup.cxx:

Go to the source code of this file.

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv)
 

Detailed Description

Command-line utility to decode a calorimeter cell hash.

Author
scott snyder
Date
Apr 2020

Definition in file caloCellLookup.cxx.

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int  argc,
char **  argv 
)

Definition at line 19 of file caloCellLookup.cxx.

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) {
37  case CaloCell_ID::LAREM:
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;
63  case CaloCell_ID::TILE:
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 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
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:43
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)
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:495
CaloCell_Base_ID::LARMINIFCAL
@ LARMINIFCAL
Definition: CaloCell_Base_ID.h:43
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:501
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:43
CaloHelpersTest::minifcalID
const LArMiniFCAL_ID & minifcalID() const
Definition: CaloHelpersTest.cxx:86
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
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]
LArMiniFCAL_ID::phi
int phi(const Identifier id) const
phi [0,15]
Definition: LArMiniFCAL_ID.h:515
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
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:43
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:19
calibdata.exit
exit
Definition: calibdata.py:235
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:489
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:108
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:43
LArFCAL_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Definition: LArFCAL_Base_ID.cxx:27
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:508
LArHEC_Base_ID::region
int region(const Identifier id) const
return region [0,1]
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
LArEM_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Definition: LArEM_Base_ID.cxx:38
LArHEC_Base_ID::phi
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part
Identifier
Definition: IdentifierFieldParser.cxx:14