Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
LHCb
Commits
ecb1ea97
Commit
ecb1ea97
authored
3 years ago
by
Sebastien Ponce
Browse files
Options
Downloads
Patches
Plain Diff
made CaloDetTestAlgorithm functional
And dropped its header file
parent
a538ff88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3001
Towards dropping GaudiAlgorithm from LHCb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Det/CaloDet/src/component/CaloDetTestAlgorithm.cpp
+35
-74
35 additions, 74 deletions
Det/CaloDet/src/component/CaloDetTestAlgorithm.cpp
Det/CaloDet/src/component/CaloDetTestAlgorithm.h
+0
-50
0 additions, 50 deletions
Det/CaloDet/src/component/CaloDetTestAlgorithm.h
with
35 additions
and
124 deletions
Det/CaloDet/src/component/CaloDetTestAlgorithm.cpp
+
35
−
74
View file @
ecb1ea97
...
...
@@ -8,84 +8,45 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
// ============================================================================
// Include files
// from Gaudi
#include
"GaudiKernel/MsgStream.h"
#include
"GaudiKernel/SmartDataPtr.h"
// local
#include
"CaloDetTestAlgorithm.h"
// ============================================================================
/** @file CaloDetTestAlgorithm.cpp
*
* Implementation file for class : CaloDetTestAlgorithm
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 02/11/2001
*/
// ============================================================================
#include
"CaloDet/DeCalorimeter.h"
#include
"DetDesc/GenericConditionAccessorHolder.h"
// ============================================================================
/** Declaration of the Algorithm Factory
*/
// ============================================================================
DECLARE_COMPONENT
(
CaloDetTestAlgorithm
)
// ============================================================================
/** Standard constructor
* @param name algorithm name
* @param svcloc pointer to service locator
*/
// ============================================================================
CaloDetTestAlgorithm
::
CaloDetTestAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
svcloc
)
:
GaudiAlgorithm
(
name
,
svcloc
)
{
declareProperty
(
"DetDataLocation"
,
m_DetData
);
#include
"GaudiAlg/Consumer.h"
int
index
=
name
.
find_last_of
(
"."
)
+
1
;
// return 0 if '.' not found --> OK !!
std
::
string
detectorName
=
(
name
.
compare
(
index
,
3
,
"Prs"
)
==
0
?
"Prs"
:
name
.
compare
(
index
,
3
,
"Spd"
)
==
0
?
"Spd"
:
name
.
substr
(
index
,
4
)
);
if
(
"Ecal"
==
detectorName
)
{
m_DetData
=
DeCalorimeterLocation
::
Ecal
;
}
else
if
(
"Hcal"
==
detectorName
)
{
m_DetData
=
DeCalorimeterLocation
::
Hcal
;
}
else
if
(
"Prs"
==
detectorName
)
{
m_DetData
=
DeCalorimeterLocation
::
Prs
;
}
else
if
(
"Spd"
==
detectorName
)
{
m_DetData
=
DeCalorimeterLocation
::
Spd
;
}
}
#include
<mutex>
#include
<string>
// ============================================================================
/** standard algorithm initialization
* @return status code
/**
* Simple Test Algorithm
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 14/12/2001
*/
// ============================================================================
StatusCode
CaloDetTestAlgorithm
::
initialize
()
{
if
(
UNLIKELY
(
msgLevel
(
MSG
::
DEBUG
)
)
)
debug
()
<<
"==> Initialize"
<<
endmsg
;
StatusCode
sc
=
GaudiAlgorithm
::
initialize
();
if
(
sc
.
isFailure
()
)
{
return
Error
(
"Could not initialize the base class!"
,
sc
);
}
auto
*
calo
=
getDet
<
DeCalorimeter
>
(
m_DetData
);
if
(
UNLIKELY
(
msgLevel
(
MSG
::
DEBUG
)
)
)
debug
()
<<
"Detector element found at "
<<
calo
<<
endmsg
;
// channel
const
CaloVector
<
CellParam
>&
cells
=
calo
->
cellParams
();
for
(
const
auto
&
cell
:
cells
)
{
LHCb
::
CaloCellID
id
=
(
cell
).
cellID
();
int
card
=
(
cell
).
cardNumber
();
info
()
<<
" | "
<<
id
<<
" | "
<<
id
.
all
()
<<
" | "
<<
format
(
"0x%04X"
,
id
.
all
()
)
<<
" | "
<<
(
cell
).
cardColumn
()
<<
"/"
<<
(
cell
).
cardRow
()
<<
" | "
<<
(
cell
).
cardNumber
()
<<
" ( "
<<
calo
->
cardCode
(
card
)
<<
") | "
<<
calo
->
cardCrate
(
card
)
<<
" | "
<<
calo
->
cardSlot
(
card
)
<<
" | "
<<
calo
->
cardToTell1
(
card
)
<<
" | "
<<
endmsg
;
}
struct
CaloDetTestAlgorithm
:
public
Gaudi
::
Functional
::
Consumer
<
void
(
const
DeCalorimeter
&
),
LHCb
::
DetDesc
::
usesConditions
<
DeCalorimeter
>>
{
void
operator
()(
const
DeCalorimeter
&
)
const
override
;
CaloDetTestAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
svcloc
);
// used to run only one first event
mutable
std
::
once_flag
m_onlyFirstEvent
;
};
/// Declaration of the Algorithm Factory
DECLARE_COMPONENT
(
CaloDetTestAlgorithm
)
return
StatusCode
::
SUCCESS
;
CaloDetTestAlgorithm
::
CaloDetTestAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
svcloc
)
:
Consumer
(
name
,
svcloc
,
{
KeyValue
{
"DetDataLocation"
,
""
}}
)
{}
void
CaloDetTestAlgorithm
::
operator
()(
const
DeCalorimeter
&
calo
)
const
{
std
::
call_once
(
m_onlyFirstEvent
,
[
&
]()
{
const
CaloVector
<
CellParam
>&
cells
=
calo
.
cellParams
();
for
(
const
auto
&
cell
:
cells
)
{
LHCb
::
CaloCellID
id
=
(
cell
).
cellID
();
int
card
=
(
cell
).
cardNumber
();
info
()
<<
" | "
<<
id
<<
" | "
<<
id
.
all
()
<<
" | "
<<
format
(
"0x%04X"
,
id
.
all
()
)
<<
" | "
<<
(
cell
).
cardColumn
()
<<
"/"
<<
(
cell
).
cardRow
()
<<
" | "
<<
(
cell
).
cardNumber
()
<<
" ( "
<<
calo
.
cardCode
(
card
)
<<
") | "
<<
calo
.
cardCrate
(
card
)
<<
" | "
<<
calo
.
cardSlot
(
card
)
<<
" | "
<<
calo
.
cardToTell1
(
card
)
<<
" | "
<<
endmsg
;
}
}
);
}
// ============================================================================
// The End
// ============================================================================
This diff is collapsed.
Click to expand it.
Det/CaloDet/src/component/CaloDetTestAlgorithm.h
deleted
100644 → 0
+
0
−
50
View file @
a538ff88
/*****************************************************************************\
* (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration *
* *
* This software is distributed under the terms of the GNU General Public *
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
* *
* In applying this licence, CERN does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
// ============================================================================
#ifndef CALODET_CALODETTESTALGORITHM_H
#define CALODET_CALODETTESTALGORITHM_H
// Include files
// from STL
#include
<string>
// from CaloKernel
#include
"GaudiAlg/GaudiAlgorithm.h"
// CaloDet
#include
"CaloDet/DeCalorimeter.h"
/** @class CaloDetTestAlgorithm CaloDetTestAlgorithm.h
*
* Simple Test Algorithm
*
* @author Vanya Belyaev Ivan.Belyaev@itep.ru
* @date 14/12/2001
*/
class
CaloDetTestAlgorithm
:
public
GaudiAlgorithm
{
public:
/** standard algorithm initialization
* @return status code
*/
StatusCode
initialize
()
override
;
/** Standard constructor
* @param name algorithm name
* @param svcloc pointer to service locator
*/
CaloDetTestAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
svcloc
);
private:
std
::
string
m_DetData
;
};
// ============================================================================
// The End
// ============================================================================
#endif // CaloDetTestAlgorithm_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment