ATLAS Offline Software
CTPDecisionRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <string>
8 
9 #include "CLHEP/Units/SystemOfUnits.h"
10 
12 
13 namespace JiveXML {
14 
15  //--------------------------------------------------------------------------
16 
17  CTPDecisionRetriever::CTPDecisionRetriever(const std::string& type, const std::string& name, const IInterface* parent):
19  m_typeName("LVL1Result")
20  {
21  declareInterface<IDataRetriever>(this);
22  }
23 
24  //--------------------------------------------------------------------------
25 
26  StatusCode CTPDecisionRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
27 
28  DataVect itemListL1Vec;
29  DataVect prescaleListL1Vec;
30  DataVect itemListL2Vec;
31  DataVect prescaleListL2Vec;
32  DataVect itemListEFVec;
33  DataVect prescaleListEFVec;
34  DataVect passedTrigger;
35  DataVect passedL1;
36  DataVect passedL2;
37  DataVect passedEF;
38 
39 // placeholders only ! For backwards compatibility.
40 // Trigger energies moved to TriggerInfoRetriever
41  DataVect energySumEt;
42  DataVect energyEx;
43  DataVect energyEy;
44  DataVect energyEtMiss;
45 
46  energySumEt.push_back(DataType( -1. ) );
47  energyEx.push_back(DataType( -1. ) );
48  energyEy.push_back(DataType( -1. ) );
49  energyEtMiss.push_back(DataType( -1. ) );
50 
51 // CTP_Decision has no 'passed' info
52  passedTrigger.push_back(DataType( -1. ) );
53  passedL1.push_back(DataType( -1. ) );
54  passedL2.push_back(DataType( -1. ) );
55  passedEF.push_back(DataType( -1. ) );
56 
57 // end of placeholders
58 
59  std::string itemListL1="";
60  std::string prescaleListL1="";
61  std::string itemListL2="n_a_CTPDecOnly";
62  std::string prescaleListL2="0";
63  std::string itemListEF="n_a_CTPDecOnly";
64  std::string prescaleListEF="0";
65 
68 
69  const CTP_Decision * ctpDecision;
70 
71  // L1JetObject -not- available
72  if ( evtStore()->retrieve(ctpDecision,"CTP_Decision").isFailure() ) {
73  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "CTP_Decision retrieval from Storegate failed" << endmsg;
74  return StatusCode::SUCCESS;
75  }
76  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found CTP_Decision in StoreGate !" << endmsg;
77 
78  CTP_Decision::items_type::const_iterator itCTP = (ctpDecision->getItems()).begin();
79  CTP_Decision::items_type::const_iterator itCTPe = (ctpDecision->getItems()).end();
80 
81  for (; itCTP != itCTPe; ++itCTP){
82 // if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " CTP item : " << *itCTP << endmsg;
83  itemListL1 += "-"+*itCTP;
84  prescaleListL1 += "-0";
85  }
86 
87  itemListL1Vec.push_back( DataType( itemListL1 ));
88  itemListL2Vec.push_back( DataType( itemListL2 ));
89  itemListEFVec.push_back( DataType( itemListEF ));
90  prescaleListL1Vec.push_back( DataType( prescaleListL1 ));
91  prescaleListL2Vec.push_back( DataType( prescaleListL2 ));
92  prescaleListEFVec.push_back( DataType( prescaleListEF ));
93 
94  DataMap myDataMap;
95  myDataMap["ctpItemList"] = itemListL1Vec;
96  myDataMap["prescaleListL1"] = prescaleListL1Vec;
97  myDataMap["itemListL2"] = itemListL2Vec;
98  myDataMap["prescaleListL2"] = prescaleListL2Vec;
99  myDataMap["itemListEF"] = itemListEFVec;
100  myDataMap["prescaleListEF"] = prescaleListEFVec;
101  myDataMap["passedTrigger"] = passedTrigger;
102  myDataMap["passedL1"] = passedL1;
103  myDataMap["passedL2"] = passedL2;
104  myDataMap["passedEF"] = passedEF;
105  myDataMap["energySumEt"] = energySumEt;
106  myDataMap["energyEx"] = energyEx;
107  myDataMap["energyEy"] = energyEy;
108  myDataMap["energyEtMiss"] = energyEtMiss;
109 
110  if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< itemListL1Vec.size() << endmsg;
111 
112  //forward data to formating tool
113  return FormatTool->AddToEvent(dataTypeName(), "CTP_Decision", &myDataMap);
114  }
115 }
JiveXML::CTPDecisionRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: CTPDecisionRetriever.cxx:26
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CTP_Decision
Legacy data class representing the LVL1 CTP trigger decision.
Definition: CTP_Decision.h:39
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CTP_Decision.h
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
JiveXML::CTPDecisionRetriever::CTPDecisionRetriever
CTPDecisionRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: CTPDecisionRetriever.cxx:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JiveXML::CTPDecisionRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: CTPDecisionRetriever.h:28
CTP_Decision::getItems
const items_type & getItems() const
Get a vector of fired LVL1 items.
Definition: CTP_Decision.h:56
CTPDecisionRetriever.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
AthAlgTool
Definition: AthAlgTool.h:26