9 #include "CLHEP/Units/SystemOfUnits.h"
13 #include "EventInfo/EventInfo.h"
24 m_typeName(
"TriggerInfo")
27 declareInterface<IDataRetriever>(
this);
40 return StatusCode::SUCCESS;
43 if (trigger_info == 0){
45 return StatusCode::SUCCESS;
49 std::string triggerInfoStrL1=
"0";
50 std::string triggerInfoStrL2=
"0";
51 std::string triggerInfoStrEF=
"0";
52 std::string triggerInfoStreamTag=
"0";
75 triggerInfoStrL1 =
"-";
83 triggerInfoStrL2 =
"-";
91 triggerInfoStrEF =
"-";
98 triggerInfoStreamTag =
"-";
102 <<
" type " << trigger_info->
streamTags()[
i].type()
103 <<
" ObeysLumi " << trigger_info->
streamTags()[
i].obeysLumiblock();
105 triggerInfoStreamTag += trigger_info->
streamTags()[
i].name() +
"_" +
107 if ( trigger_info->
streamTags()[
i].obeysLumiblock() ){
108 triggerInfoStreamTag +=
"ObeysLumi";
110 triggerInfoStreamTag +=
"notObeysLumi";
112 if ( eventInfo->
event_ID()->lumi_block() ){
113 triggerInfoStreamTag +=
"_lumiBlock";
114 triggerInfoStreamTag +=
DataType(eventInfo->
event_ID()->lumi_block()).toString();
116 triggerInfoStreamTag +=
"_lumiBlockUnknown";
118 triggerInfoStreamTag +=
"-";
126 trigInfoL1Vec.emplace_back(std::move(triggerInfoStrL1));
127 trigInfoL2Vec.emplace_back(std::move(triggerInfoStrL2 ));
128 trigInfoEFVec.emplace_back(std::move( triggerInfoStrEF ));
129 trigInfoStreamTagVec.emplace_back(std::move( triggerInfoStreamTag ));
140 energySumEtVec.push_back(
DataType( -1. ) );
141 energyExVec.push_back(
DataType( -1. ) );
142 energyEyVec.push_back(
DataType( -1. ) );
143 energyEtMissVec.push_back(
DataType( -1. ) );
150 for (; itES != itESe; ++itES){
154 energySumEtVec.push_back(
DataType( Et ) );
155 energyExVec.push_back(
DataType( Ex ) );
156 energyEyVec.push_back(
DataType( Ey ) );
157 float EtMiss =
static_cast<long>(sqrt(
static_cast<double>(Ex*Ex + Ey*Ey)));
158 energyEtMissVec.push_back(
DataType( EtMiss ) );
161 << Ey <<
", T:" << Et <<
", ETMiss:" << EtMiss <<
endmsg;
166 energySumEtVec.push_back(
DataType(
"-1" ) );
167 energyExVec.push_back(
DataType(
"-1" ) );
168 energyEyVec.push_back(
DataType(
"-1" ) );
169 energyEtMissVec.push_back(
DataType(
"-1" ) );
174 const int nEntries = trigInfoStatusVec.size();
175 myDataMap[
"energySumEt"] = std::move(energySumEtVec);
176 myDataMap[
"energyEx"] = std::move(energyExVec);
177 myDataMap[
"energyEy"] = std::move(energyEyVec);
178 myDataMap[
"energyEtMiss"] = std::move(energyEtMissVec);
179 myDataMap[
"trigInfoStatus"] = std::move(trigInfoStatusVec);
180 myDataMap[
"trigInfoExtL1ID"] = std::move(trigInfoExtL1IDVec);
181 myDataMap[
"trigInfoLvl1Type"] = std::move(trigInfoLvl1TypeVec);
182 myDataMap[
"trigInfoL1"] = std::move(trigInfoL1Vec);
183 myDataMap[
"trigInfoL2"] = std::move(trigInfoL2Vec);
184 myDataMap[
"trigInfoEF"] = std::move(trigInfoEFVec);
185 myDataMap[
"trigInfoStreamTag"] = std::move(trigInfoStreamTagVec);
190 std::string emptyStr=
"";
191 return FormatTool->AddToEvent(
dataTypeName(), emptyStr, &myDataMap);