7 #include "CLHEP/Units/SystemOfUnits.h"
18 m_typeName(
"LVL1TriggerTower")
21 declareInterface<IDataRetriever>(
this);
41 return StatusCode::SUCCESS;
45 int numTrigTowers = TTVector->
size();
49 DataVect phi; phi.reserve(numTrigTowers);
50 DataVect eta; eta.reserve(numTrigTowers);
51 DataVect emEnergyVec; emEnergyVec.reserve(numTrigTowers);
52 DataVect hadEnergyVec; hadEnergyVec.reserve(numTrigTowers);
53 DataVect sumEnergyVec; sumEnergyVec.reserve(numTrigTowers);
54 DataVect numADCVec; numADCVec.reserve(numTrigTowers);
55 DataVect emBCIDVec; emBCIDVec.reserve(numTrigTowers);
56 DataVect hadBCIDVec; hadBCIDVec.reserve(numTrigTowers);
57 DataVect isEMSaturated; isEMSaturated.reserve(numTrigTowers);
58 DataVect isHadSaturated; isHadSaturated.reserve(numTrigTowers);
59 DataVect emADCVec; emADCVec.reserve(numTrigTowers);
60 DataVect hadADCVec; hadADCVec.reserve(numTrigTowers);
64 for ( trigTowerIter = TTVector->
begin(); trigTowerIter < TTVector->
end(); ++trigTowerIter ){
67 if ( (*trigTowerIter)->hadEnergy() == 0 && (*trigTowerIter)->emEnergy() == 0 )
continue;
70 <<
" eta:"<<(*trigTowerIter)->eta() <<
", phi:"<<(*trigTowerIter)->phi()
71 <<
", EM energy:"<<(*trigTowerIter)->emEnergy()<<
", Had Energy:"<<(*trigTowerIter)->hadEnergy() <<
endmsg;
83 emEnergy = (*trigTowerIter)->emEnergy();
84 hadEnergy = (*trigTowerIter)->hadEnergy();
86 if ((emEnergy != 255) && (hadEnergy != 255)){
87 sumEnergy = (*trigTowerIter)->emEnergy()+(*trigTowerIter)->hadEnergy();
96 emEnergyVec.push_back( emEnergy );
97 hadEnergyVec.push_back( hadEnergy );
98 sumEnergyVec.push_back( sumEnergy );
101 eta.push_back(
DataType((*trigTowerIter)->eta()));
102 phi.push_back(
DataType((*trigTowerIter)->phi()));
105 emBCIDVec.push_back(
DataType((*trigTowerIter)->emBCID()));
106 hadBCIDVec.push_back(
DataType((*trigTowerIter)->hadBCID()));
109 isEMSaturated.push_back(
DataType( ((*trigTowerIter)->isEMSaturated())? 1 : 0 ));
110 isHadSaturated.push_back(
DataType( ((*trigTowerIter)->isHadSaturated())? 1 : 0 ));
114 if ((*trigTowerIter)->emADC().size() != (*trigTowerIter)->hadADC().size()){
115 if (
msgLvl(MSG::WARNING))
msg(MSG::WARNING) <<
"Number of EmADC and HadADC values do not match"
116 <<
",em:"<< (*trigTowerIter)->emADC().size()
117 <<
",had:" << (*trigTowerIter)->hadADC().size() <<
endmsg;
125 numADCVec.push_back(
DataType( (*trigTowerIter)->emADC().size() ));
128 std::vector<int>::const_iterator emADCItr = ((*trigTowerIter)->emADC()).
begin();
129 for (; emADCItr != ((*trigTowerIter)->emADC()).
end(); ++emADCItr)
130 emADCVec.emplace_back( *emADCItr );
132 std::vector<int>::const_iterator hadADCItr = ((*trigTowerIter)->hadADC()).
begin();
133 for (; hadADCItr != ((*trigTowerIter)->hadADC()).
end(); ++hadADCItr)
134 hadADCVec.emplace_back( *hadADCItr );
139 std::string multiple =
" multiple=\"0.\"";
140 if (emEnergyVec.size() != 0){
141 multiple =
" multiple=\""+
DataType(((
float)emADCVec.size())/((
float)emEnergyVec.size())).toString()+
"\"";
146 myDataMap[
"phi"] = std::move(phi);
147 myDataMap[
"eta"] = std::move(eta);
148 myDataMap[
"emEnergy"] = std::move(emEnergyVec);
149 myDataMap[
"hadEnergy"] = std::move(hadEnergyVec);
150 myDataMap[
"sumEnergy"] = std::move(sumEnergyVec);
151 myDataMap[
"emADC"+multiple] = std::move(emADCVec);
152 myDataMap[
"hadADC"+multiple] = std::move(hadADCVec);
153 myDataMap[
"numADC"] = std::move(numADCVec);
154 myDataMap[
"emBCID"] = std::move(emBCIDVec);
155 myDataMap[
"hadBCID"] = std::move(hadBCIDVec);
156 myDataMap[
"isEMSaturated"] = std::move(isEMSaturated);
157 myDataMap[
"isHadSaturated"] = std::move(isHadSaturated);