 |
ATLAS Offline Software
|
#include <SCEmulation.h>
|
| SCEmulation (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~SCEmulation () override |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &ctx) const override |
|
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 28 of file SCEmulation.h.
◆ StoreGateSvc_t
◆ SCEmulation()
LVL1::SCEmulation::SCEmulation |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~SCEmulation()
LVL1::SCEmulation::~SCEmulation |
( |
| ) |
|
|
overridevirtual |
◆ cardinality()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
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 55 of file AthReentrantAlgorithm.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::SCEmulation::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 209 of file SCEmulation.cxx.
212 auto superCells = std::make_unique<CaloCellContainer>();
215 if (!
cells.isValid())
218 return StatusCode::FAILURE;
226 if (!handle.isValid())
229 return StatusCode::FAILURE;
231 caloBCIDAvg = handle.cptr();
236 if (!handle.isValid())
239 return StatusCode::FAILURE;
241 caloNoiseSigmaDiff = handle.cptr();
248 if (!evtInfo.isValid())
251 return StatusCode::FAILURE;
255 generator.seed(evtInfo->eventNumber() * evtInfo->runNumber());
264 std::vector<float> energies(nSuperCells, 0.0);
265 std::vector<float> enTime(nSuperCells, 0.0);
266 std::vector<float> enForTime(nSuperCells, 0.0);
267 std::vector<char> timeDef(nSuperCells,
false);
268 std::vector<uint16_t> qualities(nSuperCells, 0);
269 std::vector<float> sigmaNoisePerSuperCell(nSuperCells, 0.0);
286 energies[scIDHash] +=
energy;
288 sigmaNoisePerSuperCell[scIDHash] += (*caloNoiseSigmaDiff)[cellIDHash];
292 bool isTile_BAD =
s >= 9 &&
s < 21;
293 if (
cell->provenance() & 0x2000)
295 if (
cell->energy() > 256)
298 timeDef[scIDHash] |=
true;
299 enForTime[scIDHash] +=
cell->energy();
300 enTime[scIDHash] +=
cell->energy() *
cell->time();
302 else if (!isTile_BAD)
309 if (
iEta == SIZE_MAX)
312 return StatusCode::FAILURE;
318 return StatusCode::FAILURE;
321 timeDef.at(scIDHash) |=
true;
322 enForTime.at(scIDHash) +=
cell->energy();
323 enTime.at(scIDHash) +=
cell->energy() * cellTime;
326 uint16_t &quality = qualities.at(scIDHash);
331 quality +=
cell->quality();
337 int side = tileCellID->
side(cellID);
339 int tower = tileCellID->
tower(cellID);
347 int tower2 = tower - 1;
355 else if (tower == 10)
370 for (std::size_t
idx = 0;
idx < energies.size(); ++
idx)
380 bool isTile_BAD =
s >= 9 &&
s < 21;
384 float sigmaNoise = sigmaNoisePerSuperCell.at(dde->
calo_hash());
385 if (!dde->
is_tile() && sigmaNoise > 0.0)
387 std::normal_distribution<double> distribution(0.0, sigmaNoise);
390 auto superCell = std::make_unique<CaloCell>();
391 superCell->setCaloDDE(dde);
392 superCell->setEnergy(
energy);
394 if (timeDef.at(
idx) && enForTime.at(
idx) != 0)
396 float time = enTime.at(
idx) / enForTime.at(
idx);
397 superCell->setTime(time);
398 float et = superCell->et();
400 if ((
et > 10
e3 && time > -8 && time < 18) || (
et <= 10
e3 && std::abs(time) < 8))
404 superCell->setTime(999.0);
405 superCell->setProvenance(prov);
407 superCells->push_back(superCell.release());
410 ATH_CHECK(superCellHandle.record(std::move(superCells)));
411 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()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ getEtaIndex()
◆ getEtIndex()
◆ initialize()
StatusCode LVL1::SCEmulation::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 90 of file SCEmulation.cxx.
105 if (!timingFile || timingFile->IsZombie())
108 return StatusCode::FAILURE;
110 TDirectory *tdir = timingFile->GetDirectory(
"CellTiming");
114 return StatusCode::FAILURE;
118 std::regex pattern(
"Layer(\\d+)_([\\d.]+)eta([\\d.]+)_([\\d.-]+)ET([\\d.-]+)_midtrain");
119 std::map<CaloSampling::CaloSample, std::set<std::pair<float, float>>>
etaBins;
120 std::map<CaloSampling::CaloSample, std::set<std::pair<float, float>>> etBins;
121 std::map<CaloSampling::CaloSample, std::map<std::pair<std::pair<float, float>, std::pair<float, float>>,
TH1F *>> tmpHistMap;
122 std::set<CaloSampling::CaloSample> samples;
123 for (TObject *
obj : *tdir->GetListOfKeys())
125 TKey *
key =
dynamic_cast<TKey *
>(
obj);
129 return StatusCode::FAILURE;
136 if (std::strcmp(
key->GetClassName(),
"TH1F") != 0)
138 ATH_MSG_ERROR(
"Object " <<
key->GetName() <<
" not histogram as expected!");
139 return StatusCode::FAILURE;
144 auto etaBin = std::make_pair(std::stof(
match.str(2)), std::stof(
match.str(3)));
145 auto etBin = std::make_pair(std::stof(
match.str(4)), std::stof(
match.str(5)));
148 etBins[
sample].insert(etBin);
160 for (; itr !=
end; ++itr)
166 return StatusCode::FAILURE;
171 itr = etBins[
sample].begin();
177 for (; itr !=
end; ++itr)
183 return StatusCode::FAILURE;
189 for (
const auto &
p : tmpHistMap[
sample])
194 auto mapKey = std::make_tuple(
sample, etaIndex, etIndex);
196 float cumulativeSum = 0;
197 TAxis *
axis =
p.second->GetXaxis();
198 integrals[cumulativeSum] =
axis->GetBinLowEdge(1);
201 cumulativeSum +=
p.second->GetBinContent(
idx);
202 integrals[cumulativeSum] =
axis->GetBinUpEdge(
idx);
206 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()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, InDet::SiSPGNNTrackMaker, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ 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()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
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 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
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 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 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_caloBCIDAverageKey
Initial value:{
this, "CaloBCIDAverage", "CaloBCIDAverage"}
Definition at line 40 of file SCEmulation.h.
◆ m_caloIdMgr
◆ m_caloNoiseSigmaDiffKey
Initial value:{
this, "CaloNoiseSigmaDiff", "CaloNoiseSigmaDiff"}
Definition at line 42 of file SCEmulation.h.
◆ m_caloSuperCellMgrKey
Initial value:{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}
Super cell manager key.
Definition at line 45 of file SCEmulation.h.
◆ m_cellTimingFile
std::string LVL1::SCEmulation::m_cellTimingFile |
|
private |
◆ m_detStore
◆ m_etaBins
eta binning read from timing file
Definition at line 60 of file SCEmulation.h.
◆ m_etBins
Et binning read from timing file.
Definition at line 62 of file SCEmulation.h.
◆ m_evtInfoKey
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_inputCellsKey
◆ m_outputSuperCellsKey
◆ m_scidTool
Offline<->supercell mapping tool.
Definition at line 50 of file SCEmulation.h.
◆ m_timingSamples
std::map<std::tuple<CaloSampling::CaloSample, std::size_t, std::size_t>, std::map<float, float> > LVL1::SCEmulation::m_timingSamples |
|
private |
◆ m_useBCID
bool LVL1::SCEmulation::m_useBCID |
|
private |
◆ m_useNoise
bool LVL1::SCEmulation::m_useNoise |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
static std::string find_calib_file(const std::string &logical_file_name)
std::vector< float > CaloNoiseSigmaDiff
NAME : CaloNoiseSigmaDiff.h PACKAGE : Calorimeter/CaloConditions.
Extra patterns decribing particle interation process.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
std::map< CaloSampling::CaloSample, std::vector< float > > m_etBins
Et binning read from timing file.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ToolHandle< ICaloSuperCellIDTool > m_scidTool
Offline<->supercell mapping tool.
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 side(const Identifier &id) const
std::map< std::tuple< CaloSampling::CaloSample, std::size_t, std::size_t >, std::map< float, float > > m_timingSamples
Timing distributions.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class for Tile offline identifiers for supercells.
int tower(const Identifier &id) const
const Tile_SuperCell_ID * getTile_SuperCell_ID(void) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadCondHandleKey< CaloNoiseSigmaDiff > m_caloNoiseSigmaDiffKey
std::size_t getEtIndex(CaloSampling::CaloSample sample, float et) const
bool is_valid() const
Check if id is in a valid state.
std::size_t getEtaIndex(CaloSampling::CaloSample sample, float eta) const
std::string m_cellTimingFile
The cell timing file.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const TileID * getTileID(void) const
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
IdentifierHash calo_hash() const
cell calo hash
AthReentrantAlgorithm()
Default constructor:
int module(const Identifier &id) const
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Helper class for offline supercell identifiers.
Helper class for TileCal offline identifiers.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool m_useNoise
Use noise values.
int sampling(const Identifier &id) const
Helper class for offline cell identifiers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
def getRandom(smk, lhcRun)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool is_tile() const
cell belongs to Tile
SG::WriteHandleKey< CaloCellContainer > m_outputSuperCellsKey
const CaloCell_ID * getCaloCell_ID(void) const
Access to IdHelper.
virtual StatusCode sysInitialize() override
Override sysInitialize.
StatusCode initialize(bool used=true)
SG::ReadHandleKey< CaloBCIDAverage > m_caloBCIDAverageKey
std::map< CaloSampling::CaloSample, std::vector< float > > m_etaBins
eta binning read from timing file
SG::ReadHandleKey< CaloCellContainer > m_inputCellsKey
float average(const Identifier &id) const
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Data object for each calorimeter readout cell.
def time(flags, cells_name, *args, **kw)
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
const CaloCell_SuperCell_ID * getCaloCell_SuperCell_ID(void) const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
int section(const Identifier &id) const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool m_useBCID
Compensate for BCIDs.
Identifier cell_id(const Identifier &any_id) const
setScale setgFexType iEta
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const CaloIdManager * m_caloIdMgr
Calo ID helpers.
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
Super cell manager key.
bool match(std::string s1, std::string s2)
match the individual directories of two strings
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size