Retrieve FCal cell location and details.
69 {
70
72 const EventContext& ctx = Gaudi::Hive::currentContext();
73
75
82
86 DataVect feedThrough; feedThrough.reserve(cellContainer->
size());
89
90 DataVect cellTimeVec; cellTimeVec.reserve(cellContainer->
size());
92 DataVect cellPedestal; cellPedestal.reserve(cellContainer->
size());
93 DataVect adc2Mev; adc2Mev.reserve(cellContainer->
size());
94 DataVect BadCell; BadCell.reserve(cellContainer->
size());
95
96 char rndStr[30];
97
100
101 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{
m_cablingKey};
102 const LArOnOffIdMapping*
cabling{*cablingHdl};
103
104 if(!cabling) {
107 }
108
109 const ILArPedestal* larPedestal = nullptr;
111 if( detStore()->
retrieve(larPedestal).isFailure() ){
112 ATH_MSG_ERROR(
"in getFCalData(), Could not retrieve LAr Pedestal" );
113 }
114 }
115
116 const LArOnlineID* onlineId;
117 if ( detStore()->
retrieve(onlineId,
"LArOnlineID").isFailure()) {
118 ATH_MSG_ERROR(
"in getFCalData(),Could not get LArOnlineID!" );
119 }
120
121 const LArADC2MeV* adc2mev = nullptr;
123 SG::ReadCondHandle<LArADC2MeV> adc2mevH (
m_adc2mevKey, ctx);
124 adc2mev = *adc2mevH;
125 }
126
127 double energyGeV, xmm, ymm, zmm, dxmm, dymm, dzmm, cellTime;
128 double energyAllLArFcal = 0.;
129
130 for(;it1!=it2;++it1){
131
132 if((*it1)->badcell()) BadCell.push_back(1);
134 else BadCell.push_back(-1);
135
137 Identifier cellid = (*it1)->ID();
138
139 HWIdentifier LArhwid =
cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
140
141
143 bool maskChannel = false;
146 maskChannel = true;
147 break;
148 }
149 }
150 if (maskChannel) continue;
151 }
152
153 energyGeV = (*it1)->energy()*(1./
GeV);
155 energyAllLArFcal += energyGeV;
156 idVec.emplace_back((Identifier::value_type)(*it1)->ID().get_compact() );
157
158 xmm = (*it1)->x()*0.1;
159 ymm = (*it1)->y()*0.1;
160 zmm = (*it1)->z()*0.1;
161 x.emplace_back( gcvt( xmm, 4, rndStr) );
162 y.emplace_back( gcvt( ymm, 4, rndStr) );
163 z.emplace_back( gcvt( zmm, 4, rndStr) );
164
166 feedThrough.emplace_back(onlineId->
feedthrough(LArhwid));
167 slot.emplace_back(onlineId->
slot(LArhwid));
168
170 cellTime = (*it1)->time();
171 cellTimeVec.emplace_back( gcvt( cellTime,
m_cellTimePrec, rndStr) );
172 cellGain.emplace_back( (*it1)->gain() );
173
174 int fcalgain = (*it1)->gain();
175 float pedestal=larPedestal->
pedestal(LArhwid,fcalgain);
176 float pedvalue=0;
178 else pedvalue = 0;
179 cellPedestal.emplace_back(pedvalue);
180
181 LArVectorProxy polynom_adc2mev = adc2mev->
ADC2MEV(cellid,fcalgain);
182 if (polynom_adc2mev.size()==0){ adc2Mev.emplace_back(-1); }
183 else{ adc2Mev.emplace_back(polynom_adc2mev[1]); }
184 }
185
186 const CaloDetDescrElement* elt = (*it1)->caloDDE();
187
188 dxmm = elt->
dx()*0.1;
189 dymm = elt->
dy()*0.1;
190 dzmm = elt->
dz()*0.1;
191 dx.emplace_back( gcvt( dxmm, 4, rndStr) );
192 dy.emplace_back( gcvt( dymm, 4, rndStr) );
193 dz.emplace_back( gcvt( dzmm, 4, rndStr) );
194
196 sub.emplace_back(1);
197 else
198 sub.emplace_back(0);
199 }
200
201 ATH_MSG_DEBUG(
" Total energy in FCAL (LAr) in GeV : " << energyAllLArFcal );
202
203
211 DataMap[
"energy"] = std::move(energy);
212 DataMap[
"id"] = std::move(idVec);
213 DataMap[
"channel"] = std::move(channel);
214 DataMap[
"feedThrough"] = std::move(feedThrough);
215 DataMap[
"slot"] = std::move(slot);
216
218 DataMap[
"BadCell"] = std::move(BadCell);
219 }
DataMap[
"sub"] = std::move(sub);
220
221
223 DataMap[
"cellTime"] = std::move(cellTimeVec);
224 DataMap[
"cellGain"] = std::move(cellGain);
225 DataMap[
"cellPedestal"] = std::move(cellPedestal);
226 DataMap[
"adc2Mev"] = std::move(adc2Mev);
227 }
228
230
231
233
234 }
#define ATH_MSG_WARNING(x)
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
DataModel_detail::const_iterator< DataVector > const_iterator
size_type size() const noexcept
Returns the number of elements in the collection.
virtual float pedestal(const HWIdentifier &id, int gain) const =0
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
Gaudi::Property< bool > m_doBadFCal
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< int > m_cellTimePrec
Gaudi::Property< bool > m_doMaskLArChannelsM5
Gaudi::Property< int > m_cellEnergyPrec
Gaudi::Property< bool > m_cellConditionCut
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool) override
Retrieve all the data.
Gaudi::Property< double > m_cellThreshold
for properties
const CaloCell_ID * m_calocell_id
virtual std::string dataTypeName() const override
Return the name of the data type.
Gaudi::Property< std::vector< Identifier::value_type > > m_LArChannelsToIgnoreM5
Gaudi::Property< bool > m_doFCalCellDetails
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.