38 EnergyCMX::EnergyCMX (
const std::string&
name, ISvcLocator* pSvcLocator)
55 return StatusCode::SUCCESS ;
67 return StatusCode::SUCCESS ;
95 bool maskXESet =
false;
96 bool maskTESet =
false;
97 const float moduleEta[8] = {-4.,-2.,-1.2,-0.4,0.4,1.2,2.,4.};
100 std::vector<std::shared_ptr<TrigConf::L1Threshold>> allThresholds = l1Menu->thresholds();
101 for (
const auto&
thresh : allThresholds ) {
102 if ( (
thresh->type() == L1DataDef::xeType() ||
thresh->type() == L1DataDef::teType()) &&
thresh->mapping() > 7 ) {
106 if (maskXE > 0) maskXESet =
true;
107 if (maskTE > 0) maskTESet =
true;
108 if (tvcs.size() == 0) {
109 tvcs.
addRangeValue(thresh_Calo->thrValueCounts(),-49, 49, 1,
true);
111 for (
const auto& tVC : tvcs) {
113 if (tVC.value() >= 0x7fff)
continue;
115 if (
thresh->type() == L1DataDef::xeType() && !maskXESet ) {
116 for (
unsigned int bin = 0;
bin < 8; ++
bin) {
117 if (moduleEta[
bin] > tVC.etaMin()*0.1 && moduleEta[
bin] < tVC.etaMax()*0.1)
121 else if (
thresh->type() == L1DataDef::teType() && !maskTESet ) {
122 for (
unsigned int bin = 0;
bin < 8; ++
bin) {
123 if (moduleEta[
bin] > tVC.etaMin()*0.1 && moduleEta[
bin] < tVC.etaMax()*0.1)
133 m_EtTool->crateSums(jemContainer.
cptr(), cratesTrunc, maskXE, maskTE,
true);
147 std::vector<unsigned int> exVec;
148 std::vector<unsigned int> eyVec;
149 std::vector<unsigned int> etVec;
150 std::vector<int> exErr;
151 std::vector<int> eyErr;
152 std::vector<int> etErr;
157 const int system_crate = 1;
161 for ( ; itCrate != cratesFull->
end(); ++itCrate) {
163 exVec.push_back((*itCrate)->exTC());
165 eyVec.push_back((*itCrate)->eyTC());
167 etVec.push_back((*itCrate)->et());
168 int crate = (*itCrate)->crate();
170 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
173 if (crate != system_crate) {
175 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
182 exVec.push_back(resultsFull.
exTC());
184 eyVec.push_back(resultsFull.
eyTC());
186 etVec.push_back(resultsFull.
et());
188 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
193 for ( ; itTrunc != cratesTrunc->
end(); ++itTrunc) {
195 exVec.push_back((*itTrunc)->exTC());
197 eyVec.push_back((*itTrunc)->eyTC());
199 etVec.push_back((*itTrunc)->et());
200 int crate = (*itTrunc)->crate();
202 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
205 if (crate != system_crate) {
207 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
214 exVec.push_back(resultsTrunc.
exTC());
216 eyVec.push_back(resultsTrunc.
eyTC());
218 etVec.push_back(resultsTrunc.
et());
220 exVec, eyVec, etVec, exErr, eyErr, etErr, peak);
240 return StatusCode::SUCCESS ;
249 const EventContext& ctx)
const {
253 unsigned int roiWord0 = resultsFull.
roiWord0();
254 unsigned int roiWord2 = resultsFull.
roiWord1();
255 unsigned int roiWord4 = resultsFull.
roiWord2();
267 bool added = daqRoI->setRoiWord(roiWord0);
268 if (!added)
ATH_MSG_WARNING(
"Failed to add RoI Word 0: " << MSG::hex << roiWord0 << MSG::dec);
269 added = daqRoI->setRoiWord(
roiWord1);
271 added = daqRoI->setRoiWord(roiWord2);
272 if (!added)
ATH_MSG_WARNING(
"Failed to add RoI Word 2: " << MSG::hex << roiWord2 << MSG::dec );
273 added = daqRoI->setRoiWord(
roiWord3);
275 added = daqRoI->setRoiWord(roiWord4);
276 if (!added)
ATH_MSG_WARNING(
"Failed to add RoI Word 4: " << MSG::hex << roiWord4 << MSG::dec );
277 added = daqRoI->setRoiWord(
roiWord5);
280 return StatusCode::SUCCESS;
285 unsigned int etMissPassed,
286 unsigned int etSumPassed)
const {
288 return ( (metSigPassed<<(L1DataDef::max_TE_Threshold_Number()+L1DataDef::max_XE_Threshold_Number())) +
289 (etMissPassed<<L1DataDef::max_TE_Threshold_Number()) + etSumPassed );
295 const EventContext& ctx)
const {
299 unsigned int etSumHitsFull = resultsFull.
etSumHits();
300 unsigned int etMissHitsFull = resultsFull.
etMissHits();
301 unsigned int metSigHitsFull = resultsFull.
metSigHits();
302 unsigned int etSumHitsTrunc = resultsTrunc.
etSumHits();
303 unsigned int etMissHitsTrunc = resultsTrunc.
etMissHits();
306 unsigned int word0 = ctpWord(metSigHitsFull, etMissHitsFull, etSumHitsFull);
307 unsigned int word1 = ctpWord(0, etMissHitsTrunc, etSumHitsTrunc);
315 ATH_MSG_DEBUG(
"Stored energy CTP object with words "<< std::hex
316 << (energyCTP->cableWord0()) <<
", " << (energyCTP->cableWord1())<< std::dec);
318 return StatusCode::SUCCESS;