ATLAS Offline Software
Loading...
Searching...
No Matches
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
34
35class Tile_Base_ID;
36class Identifier;
37class IdentifierHash;
38class IdContext;
39class MsgStream;
40
42
43public:
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
61private:
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
static Double_t * pref
void section(const std::string &sec)
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
This is a "hash" representation of an Identifier.
unsigned int m_debug
int initialize_next_eta(unsigned int ind, const std::vector< short int > &all_cells)
std::vector< short int > m_phid_index
std::vector< std::vector< short int > > m_next_samp_wide
unsigned int m_length
std::vector< std::vector< short int > > m_prev_samp
unsigned int m_maxHash
std::vector< short int > m_cell_index
static void get_name(Identifier &id, std::string &section, int &module, std::string &cell, const Tile_Base_ID *tileID, MsgStream &log, const char *end)
int next_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int next_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int prev_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int fill_phi_vec(std::set< std::pair< IdentifierHash, int > > &ids, unsigned int hash_max, unsigned int max_phi, MsgStream &log)
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)
virtual ~TileNeighbour(void)
int prev_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
std::vector< std::vector< short int > > m_prev_samp_wide
std::vector< std::vector< short int > > m_next_samp
int next_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int initialize_prev_eta(unsigned int ind, const std::vector< short int > &all_cells)
int initialize_next_samp(unsigned int ind, const std::vector< short int > &all_cells)
int prev_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int next_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
int initialize_next_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
static void get_id(std::string &strName, Identifier &id, const Tile_Base_ID *tileID)
int prev_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
std::vector< IdentifierHash > m_hashid_vec
int initialize_prev_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
int initialize_prev_samp(unsigned int ind, const std::vector< short int > &all_cells)
std::vector< std::vector< short int > > m_next_eta
std::vector< std::vector< short int > > m_prev_eta
This class factors out code common between TileID and Tile_SuperCell_ID.
void initialize()