ATLAS Offline Software
PileUpHashHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PILEUPTOOLS_PILEUPHASHHELPER_H
6 #define PILEUPTOOLS_PILEUPHASHHELPER_H
7 
14 #include <sstream>
15 
16 #include <uuid/uuid.h>
17 
19 
21 {
22 public:
24 
26  void addToHashSource(const std::string &string);
27 
29  void addToHashSource(const xAOD::EventInfo *eventInfo);
30 
32  void clearHashSource();
33 
35  std::string hashSource() const { return m_stream.str(); }
36 
38  void calculateHash(uuid_t &hash) const;
39 
42 
45  uuid_t &hash);
46 
48  static const uint16_t PILEUP_SIZE_BYTES = 8;
49 
50 private:
51  std::stringstream m_stream;
52 };
53 
54 #endif // PILEUPTOOLS_PILEUPHASHHELPER_H
xAOD::EventInfo_v1::PileUpMixtureID
Unique pile-up mixture identifier definition.
Definition: EventInfo_v1.h:243
PileUpHashHelper::clearHashSource
void clearHashSource()
Clear the stream.
Definition: PileUpHashHelper.cxx:44
PileUpHashHelper::uuidToPileUpMixtureId
static xAOD::EventInfo::PileUpMixtureID uuidToPileUpMixtureId(const uuid_t &hash)
Convert uuid_t to xAOD::EventInfo::PileUpMixtureID.
Definition: PileUpHashHelper.cxx:57
PileUpHashHelper
Definition: PileUpHashHelper.h:21
PileUpHashHelper::PileUpHashHelper
PileUpHashHelper()
Definition: PileUpHashHelper.h:23
PileUpHashHelper::hashSource
std::string hashSource() const
Get the current hash base.
Definition: PileUpHashHelper.h:35
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
PileUpHashHelper::pileUpMixtureIdToUuid
static void pileUpMixtureIdToUuid(const xAOD::EventInfo::PileUpMixtureID &mixture, uuid_t &hash)
xAOD::EventInfo::PileUpMixtureID to uuid_t
Definition: PileUpHashHelper.cxx:69
PileUpHashHelper::addToHashSource
void addToHashSource(const std::string &string)
Add a plain string to the stream.
Definition: PileUpHashHelper.cxx:11
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
PileUpHashHelper::calculateHash
void calculateHash(uuid_t &hash) const
Calculate the hash.
Definition: PileUpHashHelper.cxx:49
PileUpHashHelper::PILEUP_SIZE_BYTES
static const uint16_t PILEUP_SIZE_BYTES
Size of individual low/high bits in bytes.
Definition: PileUpHashHelper.h:48
PileUpHashHelper::m_stream
std::stringstream m_stream
Definition: PileUpHashHelper.h:51