Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <JTowerMappingDataCondAlg.h>
|
| JTowerMappingDataCondAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~JTowerMappingDataCondAlg () override |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &ctx) const final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 13 of file JTowerMappingDataCondAlg.h.
◆ StoreGateSvc_t
◆ JTowerMappingDataCondAlg()
LVL1::JTowerMappingDataCondAlg::JTowerMappingDataCondAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~JTowerMappingDataCondAlg()
LVL1::JTowerMappingDataCondAlg::~JTowerMappingDataCondAlg |
( |
| ) |
|
|
overridevirtual |
◆ buildForwardMapping()
Implements LVL1::JGTowerMappingDataCondAlgBase.
Definition at line 49 of file JTowerMappingDataCondAlg.cxx.
64 return StatusCode::FAILURE;
66 float superCellEta = dde->
eta_raw();
67 float superCellPhi = dde->
phi_raw();
68 if (std::abs(superCellEta) < 3.1)
70 float superCellDEta = dde->
deta();
71 float superCellDPhi = dde->
dphi();
72 JGTowerHelper
helper(superCellEta, superCellDEta, superCellPhi, superCellDPhi);
73 helper.SetSCIndices(scHashIdx);
76 if (
detName.find(
"FCAL0") != std::string::npos)
78 else if (
detName.find(
"FCAL1") != std::string::npos)
80 else if (
detName.find(
"FCAL2") != std::string::npos)
87 return StatusCode::SUCCESS;
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LVL1::JGTowerMappingDataCondAlgBase::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finalvirtualinherited |
Definition at line 34 of file JGTowerMappingDataCondAlgBase.cxx.
37 if (outputHandle.isValid())
41 return StatusCode::SUCCESS;
47 auto data = std::make_unique<JGTowerMappingData>();
51 std::map<std::tuple<int, int, int, int>, std::vector<std::size_t>> towerGrid;
53 std::map<int, std::tuple<int, int, int>> regionParams;
55 for (std::size_t towerIdx = 0; towerIdx < jgTowerID->
tower_hash_max(); ++towerIdx)
60 int detSide = jgTowerID->
pos_neg(towerID) < 0 ? -1 : +1;
65 int nTowers = (
int)std::ceil(TMath::Pi() / jDPhi);
66 jDPhi = TMath::Pi() / nTowers;
68 float jEta = detSide * ((jgTowerID->
eta(towerID) + 0.5) * jDEta + jgTowerID->
eta0(regionID));
71 data->emplace_back(jEta, jDEta, jPhi, jDPhi);
75 std::vector<std::size_t> &gridLoc = towerGrid[std::make_tuple(
77 jgTowerID->
region(towerID),
78 jgTowerID->
eta(towerID),
79 jgTowerID->
phi(towerID))];
80 regionParams[jgTowerID->
region(towerID)] = std::make_tuple(
86 gridLoc.insert(std::lower_bound(
87 gridLoc.begin(), gridLoc.end(), towerIdx,
88 [&
data](std::size_t lhs, std::size_t rhs) { return data->at(lhs).sampling() < data->at(rhs).sampling(); }),
98 return StatusCode::FAILURE;
105 helper.SetTileIndices(scIdx);
109 float superCellEta = dde->
eta_raw();
111 if (std::abs(superCellEta) > 3.2)
115 if (std::abs(std::abs(superCellEta) - 1.4) < 0.001 &&
118 superCellEta += (superCellEta > 0 ? 0.05 : -0.05);
123 helper.SetSCIndices(scIdx);
128 for (
auto &gridLocPair : towerGrid)
130 std::vector<std::size_t> &towerIndices = gridLocPair.second;
132 int pos_neg = std::get<0>(gridLocPair.first);
133 int region = std::get<1>(gridLocPair.first);
134 int iEta = std::get<2>(gridLocPair.first);
135 int iPhi = std::get<3>(gridLocPair.first);
136 int phiMax = std::get<0>(regionParams[region]);
137 int etaMin = std::get<1>(regionParams[region]);
138 int etaMax = std::get<2>(regionParams[region]);
139 auto nextPhiItr = towerGrid.find(std::make_tuple(pos_neg, region,
iEta,
iPhi == phiMax ? 0 :
iPhi + 1));
140 auto prevPhiItr = towerGrid.find(std::make_tuple(pos_neg, region,
iEta,
iPhi == 0 ? phiMax :
iPhi - 1));
141 auto nextEtaItr = towerGrid.end();
142 auto prevEtaItr = towerGrid.end();
149 auto itr = regionParams.find(region + 1);
150 if (itr != regionParams.end() && std::get<0>(itr->second) == phiMax)
152 (pos_neg > 0 ? nextEtaItr : prevEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region + 1, std::get<1>(itr->second),
iPhi));
155 (pos_neg > 0 ? nextEtaItr : prevEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region,
iEta + 1,
iPhi));
159 (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg * -1, region,
iEta,
iPhi));
162 auto itr = regionParams.find(region - 1);
163 if (itr != regionParams.end() && std::get<0>(itr->second) == phiMax)
165 (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region - 1, std::get<2>(itr->second),
iPhi));
169 (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region,
iEta - 1,
iPhi));
171 std::vector<std::size_t> nextEtaTowers;
172 std::vector<std::size_t> prevEtaTowers;
173 std::vector<std::size_t> nextPhiTowers;
174 std::vector<std::size_t> prevPhiTowers;
175 if (nextEtaItr != towerGrid.end())
176 nextEtaTowers = nextEtaItr->second;
177 if (prevEtaItr != towerGrid.end())
178 prevEtaTowers = prevEtaItr->second;
179 if (nextPhiItr != towerGrid.end())
180 nextPhiTowers = nextPhiItr->second;
181 if (prevPhiItr != towerGrid.end())
182 prevPhiTowers = prevPhiItr->second;
183 nextEtaTowers.resize(towerIndices.size(), SIZE_MAX);
184 prevEtaTowers.resize(towerIndices.size(), SIZE_MAX);
185 nextPhiTowers.resize(towerIndices.size(), SIZE_MAX);
186 prevPhiTowers.resize(towerIndices.size(), SIZE_MAX);
188 std::size_t previousIdx = SIZE_MAX;
189 for (std::size_t iIdx = 0; iIdx < towerIndices.size(); ++iIdx)
193 std::size_t currentIdx = towerIndices.at(iIdx);
196 helper.setNextEtaIndex(nextEtaTowers.at(iIdx));
197 helper.setPreviousEtaIndex(prevEtaTowers.at(iIdx));
198 helper.setNextPhiIndex(nextPhiTowers.at(iIdx));
199 helper.setPreviousPhiIndex(prevPhiTowers.at(iIdx));
201 helper.setIndexInFront(previousIdx);
202 if (previousIdx != SIZE_MAX)
203 data->at(previousIdx).setIndexBehind(currentIdx);
204 previousIdx = currentIdx;
215 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ getJGTowerID()
|
inlineoverrideprivatevirtual |
◆ initialize()
StatusCode LVL1::JTowerMappingDataCondAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Reimplemented from LVL1::JGTowerMappingDataCondAlgBase.
Definition at line 21 of file JTowerMappingDataCondAlg.cxx.
26 std::unique_ptr<TFile>
fIn(TFile::Open(
28 if (!
fIn ||
fIn->IsZombie())
31 return StatusCode::FAILURE;
33 TH1F *areaHist = (
TH1F *)
fIn->Get(
"jTowerArea_final_hist");
37 return StatusCode::FAILURE;
42 float scale = 1.0 / areaHist->GetBinContent(1);
43 for (
int towerIdx = 0; towerIdx < areaHist->GetNbinsX(); ++towerIdx)
46 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
◆ loadTowerAreas()
StatusCode LVL1::JTowerMappingDataCondAlg::loadTowerAreas |
( |
JGTowerMappingData & |
data | ) |
const |
|
overrideprivatevirtual |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_caloSuperCellMgrKey
Initial value:{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}
Definition at line 31 of file JGTowerMappingDataCondAlgBase.h.
◆ m_ccid
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_jtowerID
◆ m_mapTileCells
Gaudi::Property<bool> LVL1::JGTowerMappingDataCondAlgBase::m_mapTileCells {this, "MapTileCells", false} |
|
privateinherited |
◆ m_outputKey
◆ m_scid
◆ m_towerAreas
std::vector<float> LVL1::JTowerMappingDataCondAlg::m_towerAreas |
|
private |
◆ m_towerAreasFile
Gaudi::Property<std::string> LVL1::JTowerMappingDataCondAlg::m_towerAreasFile |
|
private |
Initial value:{
this, "TowerAreasFile", "Run3L1CaloSimulation/Noise/jTowerCorrection.20210209.r11881.root"}
Definition at line 22 of file JTowerMappingDataCondAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
float deta() const
cell deta
def retrieve(aClass, aKey=None)
static std::string find_calib_file(const std::string &logical_file_name)
char data[hepevt_bytes_allocation_ATLAS]
int eta(const Identifier id) const
return eta according to :
const JTower_ID * m_jtowerID
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
float phi0(const Identifier regId) const
Return the minimum phi of region, or NOT_VALID.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::WriteCondHandleKey< JGTowerMappingData > m_outputKey
int phi(const Identifier id) const
return phi according to :
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
int sampling(const Identifier id) const
return sampling according to :
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
int region(const Identifier id) const
return region according to :
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
virtual const JGTowerBase_ID * getJGTowerID() const =0
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
size_type tower_hash_max(void) const
tower hash table max size
__HOSTDEV__ double Phi_mpi_pi(double)
float eta_raw() const
cell eta_raw
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
JGTowerMappingDataCondAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
bool is_em(const Identifier id) const
test if the id belongs to LArEM
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
std::vector< float > m_towerAreas
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
const CaloCell_ID * m_ccid
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
float eta0(const Identifier regId) const
Return the minimum eta of region, or NOT_VALID.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
virtual StatusCode loadTowerAreas(JGTowerMappingData &data) const =0
Gaudi::Property< std::string > m_towerAreasFile
Identifier region_id(int pos_neg, int sampling, int region) const
build a region (of towers) identifier
Gaudi::Property< bool > m_mapTileCells
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
Identifier tower_id(int pos_neg, int sampling, int region, int eta, int phi) const
build a tower identifier
virtual StatusCode initialize() override
float dphi() const
cell dphi
int pos_neg(const Identifier id) const
return pos_neg according to :
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
#define ATH_MSG_WARNING(x)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode buildForwardMapping(JGTowerMappingData &data, const CaloSuperCellDetDescrManager *mgr) const =0
virtual StatusCode sysInitialize() override
Override sysInitialize.
float phiGranularity(const Identifier regId) const
Return the phi granularity of a region, or NOT_VALID.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
setScale setgFexType iEta
float etaGranularity(const Identifier regId) const
Return the eta granularity of a region, or NOT_VALID.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const CaloCell_SuperCell_ID * m_scid
float phi_raw() const
cell phi_raw
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size