|
ATLAS Offline Software
|
Go to the documentation of this file.
26 m_detStore(
"DetectorStore",
name),
27 m_par_strawstatuscontainerkey(
"/TRT/Cond/Status"),
28 m_par_strawstatuspermanentcontainerkey(
"/TRT/Cond/StatusPermanent"),
29 m_par_strawstatusHTcontainerkey(
"/TRT/Cond/StatusHT"),
30 m_par_stattextfile(
""),
31 m_par_stattextfilepermanent(
""),
32 m_par_stattextfileHT(
""),
34 m_status(
"TRT_StrawStatusSummaryTool",this)
48 if (StatusCode::SUCCESS!=
m_detStore.retrieve()) {
50 return StatusCode::FAILURE;
56 return StatusCode::FAILURE;
63 if(
sc!=StatusCode::SUCCESS) {
65 return StatusCode::FAILURE;
76 if(
sc!=StatusCode::SUCCESS) {
77 ATH_MSG_ERROR(
" Could not read TRT StrawStatus permanent objects ");
78 return StatusCode::FAILURE;
89 if(
sc!=StatusCode::SUCCESS) {
91 return StatusCode::FAILURE;
98 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
108 return StatusCode::SUCCESS;
119 unsigned int org_stat =
int((*strawstatuscontainer).get(
id).getstatus());
120 const unsigned int statusbitmask = 1 << 8;
123 if (
set) { (*strawstatuscontainer).set(
id, (org_stat|statusbitmask)); }
else{ (*strawstatuscontainer).set(
id, (org_stat & (~statusbitmask) )); }
134 unsigned int org_stat =
int((*strawstatuspermanentcontainer).get(
id).getstatus());
135 const unsigned int statusbitmask = 1 << 8;
137 if (
set) { (*strawstatuspermanentcontainer).set(
id, (org_stat|statusbitmask)); }
else{ (*strawstatuspermanentcontainer).set(
id, (org_stat & (~statusbitmask) )); }
147 strawstatus->
clear();
148 ATH_MSG_INFO(
" ***************** TRTStrawStatusWrite ************************ ");
152 if ((
m_detStore->retrieve(TRTDetectorManager)).isFailure()) {
164 for(
int i=0;
i<32;
i++){
172 for(
int i=0;
i<14;
i++){
177 for(
int l=0;
l<3;
l++) {
183 for(
int l=0;
l<14;
l++) {
194 return StatusCode::FAILURE;
196 std::ifstream ifs(
filename.c_str()) ;
205 return StatusCode::FAILURE;
217 if(
bec==-1 && sector>=0 && sector <32) {
218 if(
layer==0) deadbc0[sector]++;
219 if(
layer==1) deadbc1[sector]++;
220 if(
layer==2) deadbc2[sector]++;
222 if(
bec==1 && sector>=0 && sector <32) {
223 if(
layer==0) deadba0[sector]++;
224 if(
layer==1) deadba1[sector]++;
225 if(
layer==2) deadba2[sector]++;
230 ATH_MSG_INFO(
"Entire Module dead: bec: " <<
bec <<
" layer: " <<
layer <<
" phi: " << sector <<
" stl: " << strawlayer <<
" stw: " <<
straw <<
" level " <<
level);
238 strawstatus->
set(
id,1);
245 ATH_MSG_INFO (
"deadba0[] = { " << deadba0[0] <<
", " << deadba0[1] <<
", " << deadba0[2] <<
", " << deadba0[3] <<
", " <<
246 deadba0[4] <<
", " << deadba0[5] <<
", " << deadba0[6] <<
", " << deadba0[7] <<
", " <<
247 deadba0[8] <<
", " << deadba0[9] <<
", " << deadba0[10] <<
", " << deadba0[11] <<
", " <<
248 deadba0[12] <<
", " << deadba0[13] <<
", " << deadba0[14] <<
", " << deadba0[15] <<
", " <<
249 deadba0[16] <<
", " << deadba0[17] <<
", " << deadba0[18] <<
", " << deadba0[19] <<
", " <<
250 deadba0[20] <<
", " << deadba0[21] <<
", " << deadba0[22] <<
", " << deadba0[23] <<
", " <<
251 deadba0[24] <<
", " << deadba0[25] <<
", " << deadba0[26] <<
", " << deadba0[27] <<
", " <<
252 deadba0[28] <<
", " << deadba0[29] <<
", " << deadba0[30] <<
", " << deadba0[31] <<
"}; " );
254 ATH_MSG_INFO (
"deadba1[] = { " << deadba1[0] <<
", " << deadba1[1] <<
", " << deadba1[2] <<
", " << deadba1[3] <<
", " <<
255 deadba1[4] <<
", " << deadba1[5] <<
", " << deadba1[6] <<
", " << deadba1[7] <<
", " <<
256 deadba1[8] <<
", " << deadba1[9] <<
", " << deadba1[10] <<
", " << deadba1[11] <<
", " <<
257 deadba1[12] <<
", " << deadba1[13] <<
", " << deadba1[14] <<
", " << deadba1[15] <<
", " <<
258 deadba1[16] <<
", " << deadba1[17] <<
", " << deadba1[18] <<
", " << deadba1[19] <<
", " <<
259 deadba1[20] <<
", " << deadba1[21] <<
", " << deadba1[22] <<
", " << deadba1[23] <<
", " <<
260 deadba1[24] <<
", " << deadba1[25] <<
", " << deadba1[26] <<
", " << deadba1[27] <<
", " <<
261 deadba1[28] <<
", " << deadba1[29] <<
", " << deadba1[30] <<
", " << deadba1[31] <<
"};");
263 ATH_MSG_INFO (
"deadba2[]= { " << deadba2[0] <<
", " << deadba2[1] <<
", " << deadba2[2] <<
", " << deadba2[3] <<
", " <<
264 deadba2[4] <<
", " << deadba2[5] <<
", " << deadba2[6] <<
", " << deadba2[7] <<
", " <<
265 deadba2[8] <<
", " << deadba2[9] <<
", " << deadba2[10] <<
", " << deadba2[11] <<
", " <<
266 deadba2[12] <<
", " << deadba2[13] <<
", " << deadba2[14] <<
", " << deadba2[15] <<
", " <<
267 deadba2[16] <<
", " << deadba2[17] <<
", " << deadba2[18] <<
", " << deadba2[19] <<
", " <<
268 deadba2[20] <<
", " << deadba2[21] <<
", " << deadba2[22] <<
", " << deadba2[23] <<
", " <<
269 deadba2[24] <<
", " << deadba2[25] <<
", " << deadba2[26] <<
", " << deadba2[27] <<
", " <<
270 deadba2[28] <<
", " << deadba2[29] <<
", " << deadba2[30] <<
", " << deadba2[31] <<
"}; ");
273 ATH_MSG_INFO (
"deadbc0[] = { " << deadbc0[0] <<
", " << deadbc0[1] <<
", " << deadbc0[2] <<
", " << deadbc0[3] <<
", " <<
274 deadbc0[4] <<
", " << deadbc0[5] <<
", " << deadbc0[6] <<
", " << deadbc0[7] <<
", " <<
275 deadbc0[8] <<
", " << deadbc0[9] <<
", " << deadbc0[10] <<
", " << deadbc0[11] <<
", " <<
276 deadbc0[12] <<
", " << deadbc0[13] <<
", " << deadbc0[14] <<
", " << deadbc0[15] <<
", " <<
277 deadbc0[16] <<
", " << deadbc0[17] <<
", " << deadbc0[18] <<
", " << deadbc0[19] <<
", " <<
278 deadbc0[20] <<
", " << deadbc0[21] <<
", " << deadbc0[22] <<
", " << deadbc0[23] <<
", " <<
279 deadbc0[24] <<
", " << deadbc0[25] <<
", " << deadbc0[26] <<
", " << deadbc0[27] <<
", " <<
280 deadbc0[28] <<
", " << deadbc0[29] <<
", " << deadbc0[30] <<
", " << deadbc0[31] <<
"}; " );
282 ATH_MSG_INFO (
"deadbc1[] = { " << deadbc1[0] <<
", " << deadbc1[1] <<
", " << deadbc1[2] <<
", " << deadbc1[3] <<
", " <<
283 deadbc1[4] <<
", " << deadbc1[5] <<
", " << deadbc1[6] <<
", " << deadbc1[7] <<
", " <<
284 deadbc1[8] <<
", " << deadbc1[9] <<
", " << deadbc1[10] <<
", " << deadbc1[11] <<
", " <<
285 deadbc1[12] <<
", " << deadbc1[13] <<
", " << deadbc1[14] <<
", " << deadbc1[15] <<
", " <<
286 deadbc1[16] <<
", " << deadbc1[17] <<
", " << deadbc1[18] <<
", " << deadbc1[19] <<
", " <<
287 deadbc1[20] <<
", " << deadbc1[21] <<
", " << deadbc1[22] <<
", " << deadbc1[23] <<
", " <<
288 deadbc1[24] <<
", " << deadbc1[25] <<
", " << deadbc1[26] <<
", " << deadbc1[27] <<
", " <<
289 deadbc1[28] <<
", " << deadbc1[29] <<
", " << deadbc1[30] <<
", " << deadbc1[31] <<
"};");
291 ATH_MSG_INFO (
"deadbc2[]= { " << deadbc2[0] <<
", " << deadbc2[1] <<
", " << deadbc2[2] <<
", " << deadbc2[3] <<
", " <<
292 deadbc2[4] <<
", " << deadbc2[5] <<
", " << deadbc2[6] <<
", " << deadbc2[7] <<
", " <<
293 deadbc2[8] <<
", " << deadbc2[9] <<
", " << deadbc2[10] <<
", " << deadbc2[11] <<
", " <<
294 deadbc2[12] <<
", " << deadbc2[13] <<
", " << deadbc2[14] <<
", " << deadbc2[15] <<
", " <<
295 deadbc2[16] <<
", " << deadbc2[17] <<
", " << deadbc2[18] <<
", " << deadbc2[19] <<
", " <<
296 deadbc2[20] <<
", " << deadbc2[21] <<
", " << deadbc2[22] <<
", " << deadbc2[23] <<
", " <<
297 deadbc2[24] <<
", " << deadbc2[25] <<
", " << deadbc2[26] <<
", " << deadbc2[27] <<
", " <<
298 deadbc2[28] <<
", " << deadbc2[29] <<
", " << deadbc2[30] <<
", " << deadbc2[31] <<
"}; ");
301 ATH_MSG_INFO (
"deadea[] = { " << deadea[0] <<
", " << deadea[1] <<
", " << deadea[2] <<
", " << deadea[3] <<
", " <<
302 deadea[4] <<
", " << deadea[5] <<
", " << deadea[6] <<
", " << deadea[7] <<
", " <<
303 deadea[8] <<
", " << deadea[9] <<
", " << deadea[10] <<
", " << deadea[11] <<
", " <<
304 deadea[12] <<
", " << deadea[13] <<
"}; ");
306 ATH_MSG_INFO (
"deadec[] = { " << deadec[0] <<
", " << deadec[1] <<
", " << deadec[2] <<
", " << deadec[3] <<
", " <<
307 deadec[4] <<
", " << deadec[5] <<
", " << deadec[6] <<
", " << deadec[7] <<
", " <<
308 deadec[8] <<
", " << deadec[9] <<
", " << deadec[10] <<
", " << deadec[11] <<
", " <<
309 deadec[12] <<
", " << deadec[13] <<
"}; " );
311 ATH_MSG_INFO(
"Recording StrawStatus Container. Number of dead straws " <<
line <<
" straws" );
314 return StatusCode::FAILURE;
320 return StatusCode::SUCCESS;
329 strawstatusHT->
clear();
331 ATH_MSG_INFO(
" ***************** TRTStrawStatusWrite ************************ ");
335 std::ifstream ifsHT(
filename.c_str()) ;
339 if ((
m_detStore->retrieve(TRTDetectorManager)).isFailure()) {
348 for(
int l=0;
l<3;
l++) {
356 for(
int l=0;
l<14;
l++) {
404 ATH_MSG_FATAL(
" The HT Status: " <<
status <<
" IS NOT ACCEPTED, 4 for Argon, 5 for Krypton!! "
405 <<
" Or 6 or 7 for emulated types!" );
406 return StatusCode::FAILURE;
411 ATH_MSG_INFO(
"HT Status. Read " <<
line <<
" layers. " <<
" Xenon: " << lineXe <<
" Argon: "<< lineAr <<
" Krypton: " << lineKr <<
" EmulateArgon: " << lineEAr <<
" EmulateKrypton: " << lineEKr );
415 return StatusCode::FAILURE;
426 return StatusCode::SUCCESS;
434 strawstatuspermanent->
clear();
440 std::ifstream ifspermanent(
filename.c_str()) ;
452 for (
int i=0;
i<=nStrawsInLayer;
i++) {
465 ATH_MSG_FATAL(
" The Status Permanent: " <<
status <<
" IS NOT ACCEPTED, Use 1 for dead " );
466 return StatusCode::FAILURE;
474 std::cout <<
" Read permanent dead module from txt: " <<
bec <<
" ,sector " << sector <<
" ,straw " <<
straw <<
" ,strawlayer " << strawlayer <<
" ,layer " <<
layer <<
" ,status " <<
status << std::endl;
484 for (
int i=0;
i<=nStrawsInLayer;
i++) {
496 ATH_MSG_DEBUG(
"Permanent dead ids: bec: " <<
bec <<
" layer: " <<
layer <<
" phi: " << sector <<
" stl: " << strawlayer <<
" stw: " <<
straw );
501 ATH_MSG_INFO(
" Record Permanent Straw Status. Dead modules : " << nmodu <<
" Number of lines: " <<
line <<
" of dead identifiers " );
504 return StatusCode::FAILURE;
510 return StatusCode::SUCCESS ;
int straw_max(const Identifier &id) const
std::string m_par_strawstatusHTcontainerkey
std::vector< Identifier > ID
void setStatus(const ExpandedIdentifier &id, unsigned int status)
set t0
void set(const ExpandedIdentifier &id, const typename DaughterContainer::value_type &t)
set a value
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual StatusCode readStatFromTextFile(const std::string &filename)
std::string m_par_strawstatuspermanentcontainerkey
void clear()
clear all layercontainers
TRTStrawStatusWrite(const std::string &name, ISvcLocator *pSvcLocator)
std::string m_par_strawstatuscontainerkey
const_id_iterator straw_layer_end(void) const
std::string m_par_stattextfileHT
int straw(const Identifier &id) const
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual void set_status_temp(StrawStatusContainer *ssc, Identifier offlineID, bool set)
std::string m_par_stattextfile
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
virtual StatusCode readStatPermFromTextFile(const std::string &filename)
int layer_or_wheel(const Identifier &id) const
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.
ToolHandle< ITRT_StrawStatusSummaryTool > m_status
virtual void set_status_permanent(StrawStatusContainer *ssc, Identifier offlineID, bool set)
int phi_module(const Identifier &id) const
ServiceHandle< StoreGateSvc > m_detStore
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
#define ATH_MSG_WARNING(x)
virtual StatusCode readStatHTFromTextFile(const std::string &filename)
virtual StatusCode finalize() override
const_id_iterator straw_layer_begin(void) const
Iterators over full set of straw_layer ids. Straw_layer ids are sorted.
Identifier for TRT detector elements in the conditions code.
virtual StatusCode initialize() override
std::string m_par_stattextfilepermanent
virtual StatusCode execute() override
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: