ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::DistanceInTrainAugmentationTool Class Reference

#include <DistanceInTrainAugmentationTool.h>

Inheritance diagram for DerivationFramework::DistanceInTrainAugmentationTool:
Collaboration diagram for DerivationFramework::DistanceInTrainAugmentationTool:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

SG::ReadCondHandleKey< BunchCrossingCondDatam_bunchCrossingKey {this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" }
SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDDistanceFrontKey {this, "BCIDDistanceFrontKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceFromFront", "Decoration for BCID distance from front"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDDistanceTailKey {this, "BCIDDistanceTailKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceTail" , "Decoration for BCID distance from tail"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDGapBeforeTrainKey {this, "BCIDGapBeforeTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrain", "Decoration for BCID gap before train"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDGapAfterTrainKey {this, "BCIDGapAfterTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrain", "Decoration for BCID gap after train"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDTypeKey {this, "BCIDTypeKey", m_eventInfo_key, "DFCommonJets_BCIDType", "Decoration for BCID type"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDGapBeforeTrainMinus12Key {this, "BCIDGapBeforeTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrainMinus12", "Decoration for BCID gap before train minus 12 BCIDs"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDGapAfterTrainMinus12Key {this, "BCIDGapAfterTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrainMinus12", "Decoration for BCID gap after train minus 12 BCIDs"}
SG::WriteDecorHandleKey< xAOD::EventInfom_BCIDTypeMinus12Key {this, "BCIDTypeMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDTypeMinus12", "Decoration for BCID type minus 12 BCIDs"}

Detailed Description

Definition at line 22 of file DistanceInTrainAugmentationTool.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::DistanceInTrainAugmentationTool::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 40 of file DistanceInTrainAugmentationTool.cxx.

40 {
41
42 auto eventInfo = SG::makeHandle (m_eventInfo_key, ctx);
43 if (!eventInfo.isValid()){
44 ATH_MSG_WARNING("Invalid xAOD::EventInfo datahandle"
45 << m_eventInfo_key.key());
46 return StatusCode::FAILURE;
47 }
48 auto ei = eventInfo.cptr();
49
50 SG::ReadCondHandle<BunchCrossingCondData> bunchCrossingTool (m_bunchCrossingKey, ctx);
51 ATH_CHECK( bunchCrossingTool.isValid() );
52
53 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDDistanceFront(m_BCIDDistanceFrontKey, ctx);
54 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDDistanceTail(m_BCIDDistanceTailKey, ctx);
55 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDGapBeforeTrain(m_BCIDGapBeforeTrainKey, ctx);
56 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDGapAfterTrain(m_BCIDGapAfterTrainKey, ctx);
57 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDType(m_BCIDTypeKey, ctx);
58 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDGapBeforeTrainMinus12(m_BCIDGapBeforeTrainMinus12Key, ctx);
59 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDGapAfterTrainMinus12(m_BCIDGapAfterTrainMinus12Key, ctx);
60 SG::WriteDecorHandle<xAOD::EventInfo,int> dec_BCIDTypeMinus12(m_BCIDTypeMinus12Key, ctx);
61
62 dec_BCIDDistanceFront(*ei) = bunchCrossingTool->distanceFromFront(ei->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings);
63 dec_BCIDDistanceTail(*ei) = bunchCrossingTool->distanceFromTail(ei->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings);
64 dec_BCIDGapBeforeTrain(*ei) = bunchCrossingTool->gapBeforeTrain(ei->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings);
65 dec_BCIDGapAfterTrain(*ei) = bunchCrossingTool->gapAfterTrain(ei->bcid(), BunchCrossingCondData::BunchDistanceType::BunchCrossings);
66 dec_BCIDType(*ei) = bunchCrossingTool->bcType(ei->bcid());
67 if (ei->bcid()>=12){
68 dec_BCIDTypeMinus12(*ei) = bunchCrossingTool->bcType(ei->bcid()-12);
69 dec_BCIDGapBeforeTrainMinus12(*ei) = bunchCrossingTool->gapBeforeTrain(ei->bcid()-12, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
70 dec_BCIDGapAfterTrainMinus12(*ei) = bunchCrossingTool->gapAfterTrain(ei->bcid()-12, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
71 }else{
72 dec_BCIDTypeMinus12(*ei) = -1;
73 dec_BCIDGapBeforeTrainMinus12(*ei) = 0;
74 dec_BCIDGapAfterTrainMinus12(*ei) = 0;
75 }
76
77 return StatusCode::SUCCESS;
78}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
@ BunchCrossings
Distance in units of 25 nanoseconds.
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDGapBeforeTrainMinus12Key
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDGapBeforeTrainKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDTypeMinus12Key
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDGapAfterTrainMinus12Key
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDDistanceFrontKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDDistanceTailKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_BCIDGapAfterTrainKey
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ initialize()

StatusCode DerivationFramework::DistanceInTrainAugmentationTool::initialize ( )
finaloverridevirtual

Definition at line 19 of file DistanceInTrainAugmentationTool.cxx.

20{
21
22 ATH_CHECK(m_eventInfo_key.initialize());
24 ATH_CHECK(m_BCIDDistanceTailKey.initialize());
27 ATH_CHECK(m_BCIDTypeKey.initialize());
30 ATH_CHECK(m_BCIDTypeMinus12Key.initialize());
31
32 ATH_MSG_VERBOSE("initialize() ..");
33 ATH_CHECK( m_bunchCrossingKey.initialize() );
34 ATH_MSG_INFO("The bunch crossing conditions key being used: " << m_bunchCrossingKey);
35
36 return StatusCode::SUCCESS;
37}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)

Member Data Documentation

◆ m_BCIDDistanceFrontKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDDistanceFrontKey {this, "BCIDDistanceFrontKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceFromFront", "Decoration for BCID distance from front"}
private

Definition at line 38 of file DistanceInTrainAugmentationTool.h.

38{this, "BCIDDistanceFrontKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceFromFront", "Decoration for BCID distance from front"};

◆ m_BCIDDistanceTailKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDDistanceTailKey {this, "BCIDDistanceTailKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceTail" , "Decoration for BCID distance from tail"}
private

Definition at line 39 of file DistanceInTrainAugmentationTool.h.

39{this, "BCIDDistanceTailKey", m_eventInfo_key, "DFCommonJets_BCIDDistanceTail" , "Decoration for BCID distance from tail"};

◆ m_BCIDGapAfterTrainKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDGapAfterTrainKey {this, "BCIDGapAfterTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrain", "Decoration for BCID gap after train"}
private

Definition at line 41 of file DistanceInTrainAugmentationTool.h.

41{this, "BCIDGapAfterTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrain", "Decoration for BCID gap after train"};

◆ m_BCIDGapAfterTrainMinus12Key

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDGapAfterTrainMinus12Key {this, "BCIDGapAfterTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrainMinus12", "Decoration for BCID gap after train minus 12 BCIDs"}
private

Definition at line 44 of file DistanceInTrainAugmentationTool.h.

44{this, "BCIDGapAfterTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapAfterTrainMinus12", "Decoration for BCID gap after train minus 12 BCIDs"};

◆ m_BCIDGapBeforeTrainKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDGapBeforeTrainKey {this, "BCIDGapBeforeTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrain", "Decoration for BCID gap before train"}
private

Definition at line 40 of file DistanceInTrainAugmentationTool.h.

40{this, "BCIDGapBeforeTrainKey", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrain", "Decoration for BCID gap before train"};

◆ m_BCIDGapBeforeTrainMinus12Key

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDGapBeforeTrainMinus12Key {this, "BCIDGapBeforeTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrainMinus12", "Decoration for BCID gap before train minus 12 BCIDs"}
private

Definition at line 43 of file DistanceInTrainAugmentationTool.h.

43{this, "BCIDGapBeforeTrainMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDGapBeforeTrainMinus12", "Decoration for BCID gap before train minus 12 BCIDs"};

◆ m_BCIDTypeKey

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDTypeKey {this, "BCIDTypeKey", m_eventInfo_key, "DFCommonJets_BCIDType", "Decoration for BCID type"}
private

Definition at line 42 of file DistanceInTrainAugmentationTool.h.

42{this, "BCIDTypeKey", m_eventInfo_key, "DFCommonJets_BCIDType", "Decoration for BCID type"};

◆ m_BCIDTypeMinus12Key

SG::WriteDecorHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_BCIDTypeMinus12Key {this, "BCIDTypeMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDTypeMinus12", "Decoration for BCID type minus 12 BCIDs"}
private

Definition at line 45 of file DistanceInTrainAugmentationTool.h.

45{this, "BCIDTypeMinus12Key", m_eventInfo_key, "DFCommonJets_BCIDTypeMinus12", "Decoration for BCID type minus 12 BCIDs"};

◆ m_bunchCrossingKey

SG::ReadCondHandleKey<BunchCrossingCondData> DerivationFramework::DistanceInTrainAugmentationTool::m_bunchCrossingKey {this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" }
private

Definition at line 34 of file DistanceInTrainAugmentationTool.h.

34{this, "BunchCrossingKey", "BunchCrossingData", "Key BunchCrossing CDO" };

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::DistanceInTrainAugmentationTool::m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
private

Definition at line 36 of file DistanceInTrainAugmentationTool.h.

36{this, "EventInfo", "EventInfo", "Input event information"};

The documentation for this class was generated from the following files: