ATLAS Offline Software
TileNeighbour.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Tile Calorimeter detector description package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: TileNeighbour.h,v 1.6 2007-07-08 19:22:30 solodkov Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 // TileNeighbour.h
14 //
15 // Helper for neighbour search in TileCalorimeter
16 //
17 // Aug-2003 by AS
18 //
19 
20 #ifndef CALOIDENTIFIER_TILENEIGHBOUR_H
21 #define CALOIDENTIFIER_TILENEIGHBOUR_H
22 
24 
25 #include <string>
26 #include <vector>
27 #include <set>
28 
35 class Tile_Base_ID;
36 class Identifier;
37 class IdentifierHash;
38 class IdContext;
39 class MsgStream;
40 
42 
43 public:
44 
45  // default constructor
46  TileNeighbour(void);
47 
48  // default destructor
49  virtual ~TileNeighbour(void);
50 
51  int initialize(const Tile_Base_ID* tileID, const std::string& filename = "TileNeighbour.txt" );
52  int prev_phi (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
53  int next_phi (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
54  int prev_eta (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
55  int next_eta (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
56  int prev_samp (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
57  int next_samp (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
58  int prev_samp_wide (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
59  int next_samp_wide (const IdentifierHash & id, std::vector<IdentifierHash> & neighbourList) const;
60 
61 private:
62 
63  unsigned int m_debug;
64  unsigned int m_length;
65  unsigned int m_maxHash;
66 
67  std::vector<std::vector<short int> > m_prev_eta;
68  std::vector<std::vector<short int> > m_next_eta;
69  std::vector<std::vector<short int> > m_prev_samp;
70  std::vector<std::vector<short int> > m_next_samp;
71  std::vector<std::vector<short int> > m_prev_samp_wide;
72  std::vector<std::vector<short int> > m_next_samp_wide;
73 
74  std::vector<short int> m_phid_index;
75  std::vector<short int> m_cell_index;
76  std::vector<IdentifierHash> m_hashid_vec;
77 
78  int initialize_prev_eta (unsigned int ind, const std::vector<short int> & all_cells);
79  int initialize_next_eta (unsigned int ind, const std::vector<short int> & all_cells);
80  int initialize_prev_samp(unsigned int ind, const std::vector<short int> & all_cells);
81  int initialize_next_samp(unsigned int ind, const std::vector<short int> & all_cells);
82  int initialize_prev_samp_wide(unsigned int ind, const std::vector<short int> & all_cells);
83  int initialize_next_samp_wide(unsigned int ind, const std::vector<short int> & all_cells);
84 
85  int fill_phi_vec (std::set<std::pair<IdentifierHash,int> > & ids,
86  unsigned int hash_max, unsigned int max_phi, MsgStream & log);
87 
88  static void get_id (std::string & strName, Identifier & id, const Tile_Base_ID* tileID);
89 
90  static void get_name (Identifier & id, std::string & section, int & module,
91  std::string & cell, const Tile_Base_ID* tileID, MsgStream & log,
92  const char * end);
93 
94  static void print_list (std::vector<IdentifierHash> & nb_list,
95  const Tile_Base_ID* tileID, const IdContext* context,
96  MsgStream & log, const char * pref, const char * suff);
97 };
98 
99 #endif // CALOIDENTIFIER_TILENEIGHBOUR_H
TileNeighbour::initialize_next_samp
int initialize_next_samp(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:436
TileNeighbour::m_maxHash
unsigned int m_maxHash
Definition: TileNeighbour.h:65
TileNeighbour::next_eta
int next_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:496
TileNeighbour::initialize_prev_eta
int initialize_prev_eta(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:418
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
TileNeighbour::next_samp
int next_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:524
TileNeighbour::initialize_prev_samp_wide
int initialize_prev_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:442
TileNeighbour::m_hashid_vec
std::vector< IdentifierHash > m_hashid_vec
Definition: TileNeighbour.h:76
TileNeighbour::get_id
static void get_id(std::string &strName, Identifier &id, const Tile_Base_ID *tileID)
Definition: TileNeighbour.cxx:566
TileNeighbour::initialize_next_eta
int initialize_next_eta(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:424
TileNeighbour::fill_phi_vec
int fill_phi_vec(std::set< std::pair< IdentifierHash, int > > &ids, unsigned int hash_max, unsigned int max_phi, MsgStream &log)
Definition: TileNeighbour.cxx:371
TileNeighbour::prev_samp
int prev_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:510
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TileNeighbour::prev_eta
int prev_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:482
TileNeighbour::prev_phi
int prev_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:456
TileNeighbour::m_cell_index
std::vector< short int > m_cell_index
Definition: TileNeighbour.h:75
TileNeighbour::initialize
int initialize(const Tile_Base_ID *tileID, const std::string &filename="TileNeighbour.txt")
Definition: TileNeighbour.cxx:61
TileNeighbour::TileNeighbour
TileNeighbour(void)
Definition: TileNeighbour.cxx:51
python.PyAthena.module
module
Definition: PyAthena.py:131
TileNeighbour::initialize_next_samp_wide
int initialize_next_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:449
TileNeighbour::~TileNeighbour
virtual ~TileNeighbour(void)
TileNeighbour::m_prev_eta
std::vector< std::vector< short int > > m_prev_eta
Definition: TileNeighbour.h:67
Tile_Base_ID
This class factors out code common between TileID and Tile_SuperCell_ID.
Definition: Tile_Base_ID.h:39
TileNeighbour::m_next_samp
std::vector< std::vector< short int > > m_next_samp
Definition: TileNeighbour.h:70
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
TileNeighbour::m_prev_samp
std::vector< std::vector< short int > > m_prev_samp
Definition: TileNeighbour.h:69
TileNeighbour::m_next_samp_wide
std::vector< std::vector< short int > > m_next_samp_wide
Definition: TileNeighbour.h:72
TileNeighbour::m_length
unsigned int m_length
Definition: TileNeighbour.h:64
TileNeighbour::prev_samp_wide
int prev_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:538
TileNeighbour::m_prev_samp_wide
std::vector< std::vector< short int > > m_prev_samp_wide
Definition: TileNeighbour.h:71
TileNeighbour::m_debug
unsigned int m_debug
Definition: TileNeighbour.h:63
TileNeighbour::m_next_eta
std::vector< std::vector< short int > > m_next_eta
Definition: TileNeighbour.h:68
TileNeighbour
This class return all neighbours for given hash ID of the cell.
Definition: TileNeighbour.h:41
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
TileNeighbour::get_name
static void get_name(Identifier &id, std::string &section, int &module, std::string &cell, const Tile_Base_ID *tileID, MsgStream &log, const char *end)
Definition: TileNeighbour.cxx:615
TileNeighbour::m_phid_index
std::vector< short int > m_phid_index
Definition: TileNeighbour.h:74
TileNeighbour::next_phi
int next_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:469
TileNeighbour::next_samp_wide
int next_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:552
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArNeighbours.h
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TileNeighbour::print_list
static void print_list(std::vector< IdentifierHash > &nb_list, const Tile_Base_ID *tileID, const IdContext *context, MsgStream &log, const char *pref, const char *suff)
Definition: TileNeighbour.cxx:669
TileNeighbour::initialize_prev_samp
int initialize_prev_samp(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:430
Identifier
Definition: IdentifierFieldParser.cxx:14