ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
PixelReadoutGeometry
utils
ITkPixelIdentifiersDump.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
9
10
// Framework includes
11
#include <
AthenaBaseComps/AthService.h
>
12
#include <
AthenaBaseComps/AthAlgTool.h
>
13
#include <
AsgMessaging/MessageCheck.h
>
14
#include <GaudiKernel/IAppMgrUI.h>
15
16
// Pixel includes
17
#include <
InDetIdentifier/PixelID.h
>
18
#include <
InDetReadoutGeometry/SiDetectorElement.h
>
19
#include <
PixelReadoutGeometry/PixelModuleDesign.h
>
20
#include <
PixelReadoutGeometry/PixelDetectorManager.h
>
21
22
// std
23
#include <fstream>
24
25
// messaging
26
ANA_MSG_HEADER
(ITkPixel)
27
ANA_MSG_SOURCE
(ITkPixel,
"Identifiers"
)
28
using namespace ITkPixel;
29
30
31
int
main
(
int
argc,
char
*argv[])
32
{
33
ANA_CHECK_SET_TYPE
(
int
);
// makes ANA_CHECK return ints if exiting function
34
35
std::string outFileName{
"ITkPixelIdentifiers.dat"
};
36
if
(argc > 1) {
37
outFileName = argv[1];
38
}
39
40
IAppMgrUI *appMgr = Gaudi::createApplicationMgr();
41
SmartIF<IProperty> propMgr = appMgr;
42
ANA_CHECK
( propMgr->setProperty(
"EvtSel"
,
"NONE"
) );
43
ANA_CHECK
( propMgr->setProperty(
"JobOptionsType"
,
"FILE"
) );
44
ANA_CHECK
( propMgr->setProperty(
"JobOptionsPath"
,
"PixelReadoutGeometry/ITkPixelIdentifiersDumpConfig.txt"
) );
45
46
ANA_CHECK
( appMgr->configure() );
47
ANA_CHECK
( appMgr->initialize() );
48
49
ServiceHandle<StoreGateSvc>
detectorStore(
"DetectorStore"
,
"ITkPixelIdentifiers"
);
50
51
const
InDetDD::PixelDetectorManager
*detManager{};
52
ANA_CHECK
( detectorStore->retrieve(detManager,
"ITkPixel"
) );
53
const
InDetDD::SiDetectorElementCollection
* elements{detManager->
getDetectorElementCollection
()};
54
55
const
PixelID
*pixelID{};
56
ANA_CHECK
( detectorStore->retrieve(pixelID,
"PixelID"
) );
57
58
std::ofstream
fout
{outFileName};
59
fout
<<
"# "
60
<<
"Hash"
<<
"\t"
61
<<
"ID"
<<
"\t"
62
<<
"B/EC"
<<
"\t"
63
<<
"Layer"
<<
"\t"
64
<<
"phi"
<<
"\t"
65
<<
"eta"
<<
"\t"
66
<<
"FEs"
<< std::endl;
67
68
try
{
69
for
(
unsigned
int
moduleHash{}; moduleHash < pixelID->
wafer_hash_max
(); moduleHash++) {
70
IdentifierHash
wafer_hash =
IdentifierHash
(moduleHash);
71
Identifier
wafer_id = pixelID->
wafer_id
(wafer_hash);
72
const
InDetDD::SiDetectorElement
*element = elements->
getDetectorElement
(wafer_hash);
73
const
InDetDD::PixelModuleDesign
*p_design =
static_cast<
const
InDetDD::PixelModuleDesign
*
>
(&element->
design
());
74
75
fout
<< moduleHash <<
"\t"
76
<< wafer_id.
get_compact
() <<
"\t"
77
<< pixelID->
barrel_ec
(wafer_id) <<
"\t"
78
<< pixelID->
layer_disk
(wafer_id) <<
"\t"
79
<< pixelID->
phi_module
(wafer_id) <<
"\t"
80
<< pixelID->
eta_module
(wafer_id) <<
"\t"
81
<< p_design->
numberOfCircuits
() << std::endl;
82
}
83
}
catch
(
const
std::exception& e) {
84
std::cerr <<
"exception: "
<< e.what() <<
"\n"
;
85
fout
.close();
86
return
1;
87
}
88
89
fout
.close();
90
91
ANA_CHECK
( appMgr->finalize() );
92
ANA_CHECK
( appMgr->terminate() );
93
94
return
0;
95
}
AthAlgTool.h
AthService.h
MessageCheck.h
macros for messaging and checking status codes
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
ANA_MSG_HEADER
#define ANA_MSG_HEADER(NAME)
for standalone code this creates a new message category
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:111
ANA_MSG_SOURCE
#define ANA_MSG_SOURCE(NAME, TITLE)
the source code part of ANA_MSG_SOURCE
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:131
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:315
main
int main(int, char **)
Main class for all the CppUnit test classes.
Definition
CppUnit_SGtestdriver.cxx:141
PixelDetectorManager.h
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PixelModuleDesign.h
SiDetectorElement.h
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
Identifier::get_compact
value_type get_compact() const
Get the compact id.
InDetDD::PixelDetectorManager
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Definition
PixelDetectorManager.h:47
InDetDD::PixelDetectorManager::getDetectorElementCollection
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collection via Iterators
Definition
PixelDetectorManager.cxx:99
InDetDD::PixelModuleDesign
Class used to describe the design of a module (diode segmentation and readout scheme).
Definition
PixelModuleDesign.h:45
InDetDD::PixelModuleDesign::numberOfCircuits
int numberOfCircuits() const
Total number of circuits:
Definition
PixelModuleDesign.h:306
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
InDetDD::SiDetectorElementCollection::getDetectorElement
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Definition
SiDetectorElementCollection.cxx:9
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID
This is an Identifier helper class for the Pixel subdetector.
Definition
PixelID.h:69
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition
PixelID.h:602
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition
PixelID.h:355
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
Definition
PixelID.h:595
PixelID::wafer_hash_max
size_type wafer_hash_max() const
Definition
PixelID.cxx:703
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition
PixelID.h:627
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition
PixelID.h:620
ServiceHandle
Definition
ClusterMakerTool.h:36
fout
static TFile * fout
Definition
listroot.cxx:40
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0