109 DataVect energy; energy.reserve(tileMBTSCellContainer->
size());
113 DataVect sampling; sampling.reserve(tileMBTSCellContainer->
size());
114 DataVect timeVec; timeVec.reserve(tileMBTSCellContainer->
size());
115 DataVect quality; quality.reserve(tileMBTSCellContainer->
size());
117 DataVect channel; channel.reserve(tileMBTSCellContainer->
size());
118 DataVect module;
module.reserve(tileMBTSCellContainer->size());
119 DataVect cellPedestal; cellPedestal.reserve(tileMBTSCellContainer->
size());
120 DataVect cellRawAmplitude; cellRawAmplitude.reserve(tileMBTSCellContainer->
size());
121 DataVect cellRawTime; cellRawTime.reserve(tileMBTSCellContainer->
size());
122 DataVect adcCounts; adcCounts.reserve(tileMBTSCellContainer->
size() * 10);
124 std::string adcCountsStr=
"adcCounts multiple=\"0\"";
130 bool offlineRch =
false;
133 ATH_MSG_ERROR(
"in getMBTSData(), Could not retrieve m_tileTBID" );
137 ATH_MSG_ERROR(
"in getMBTSData(), Could not retrieve TileHWID" );
141 ATH_MSG_ERROR(
"in getMBTSData(), Could not retrieve TileInfo" );
151 RChUnit = RawChannelCnt->get_unit();
171 double energyMeV = 0.;
173 double amplitude = 0.;
174 unsigned long int cellid;
175 std::map<unsigned long int,double> theMbtspedestal;
176 std::map<unsigned long int,double> theMbtsrawamp;
177 std::map<unsigned long int,double> theMbtsrawtime;
178 std::map<unsigned long int,std::vector<float> > theMbtsdigit;
179 std::string myCellRawTimeStr =
"0.";
186 for (
const auto rawChannel : *RawChannelCnt) {
187 for (
const auto cell : *rawChannel) {
191 cellid =
id.get_identifier32().get_compact();
193 int adc = tileHWID->
adc(hwid);
194 int channel = tileHWID->
channel(hwid);
195 int drawer = tileHWID->
drawer(hwid);
196 int ros = tileHWID->
ros(hwid);
199 amplitude = cell->amplitude();
204 amplitude =
m_tileToolEmscale->undoOnlCalib(drawerIdx, channel, adc, amplitude, RChUnit);
206 theMbtspedestal.insert(std::make_pair( cellid, cell->pedestal() ) );
207 theMbtsrawamp.insert(std::make_pair( cellid, amplitude ));
208 theMbtsrawtime.insert(std::make_pair( cellid, cell->time(cell->uncorrTime()) ));
223 for (
const auto digitChannel : *tileDigits) {
225 for (
const auto cell : *digitChannel) {
231 cellid =
id.get_identifier32().get_compact();
233 nTileSamples = cell->NtimeSamples();
234 std::vector<float> tileSamples = cell->samples();
235 theMbtsdigit.insert(std::make_pair( cellid, tileSamples));
244 for (
const auto cell : *tileMBTSCellContainer) {
246 int qual = cell->quality();
247 if (cell->badcell()) qual = -qual;
249 timeVec.push_back(
DataType( cell->time() ));
250 quality.push_back(
DataType( qual ));
253 energyMeV = cell->energy();
257 energy.push_back(
DataType( energyMeV ));
267 module.push_back(DataType( m_tileTBID->module(id) ));
283 cellPedestal.push_back(
DataType( theMbtspedestal[
id.get_identifier32().get_compact()] ));
284 cellRawAmplitude.push_back(
DataType( theMbtsrawamp[
id.get_identifier32().get_compact()] ));
285 myCellRawTimeStr =
DataType(theMbtsrawtime[
id.get_identifier32().get_compact()]).toString();
287 if ( myCellRawTimeStr.find(
'n') == 1 ) myCellRawTimeStr=
"0.";
288 cellRawTime.push_back( myCellRawTimeStr );
295 int gain = cell->gain();
297 if (gain<0 || gain>1) {
298 cellRawAmplitude.push_back(
DataType(0));
300 cellPedestal.push_back(
DataType(0));
305 int adc = tileHWID->
adc(hwid);
306 int channel = tileHWID->
channel(hwid);
307 int drawer = tileHWID->
drawer(hwid);
308 int ros = tileHWID->
ros(hwid);
316 float time = cell->time();
318 if ((qual != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
322 cellRawAmplitude.push_back(
DataType(amp));
323 cellRawTime.push_back(
DataType(time));
324 cellPedestal.push_back(
DataType(0));
331 if ( !theMbtsdigit[
id.get_identifier32().get_compact()].
empty() ) {
332 for (
int i=0; i<nTileSamples; i++) {
333 adcCountsStr=
"adcCounts multiple=\""+
DataType(nTileSamples).toString()+
"\"";
334 adcCounts.push_back(
DataType(
int(theMbtsdigit[
id.get_identifier32().get_compact()][i]) ));
338 for (
int i=0; i<nTileSamples; i++) {
339 adcCountsStr=
"adcCounts multiple=\""+
DataType(nTileSamples).toString()+
"\"";
346 ATH_MSG_DEBUG(
"MBTS no: " << nchan <<
", type_chan_mod: " << MBTS_ID
347 <<
", energy MeV pC: " << energyMeV );
355 if (!theMbtspedestal.empty()) theMbtspedestal.clear();
356 if (!theMbtsrawamp.empty() ) theMbtsrawamp.clear();
357 if (!theMbtsrawtime.empty()) theMbtsrawtime.clear();
360 const auto nentries =
phi.size();
361 DataMap[
"energy"] = std::move(energy);
365 DataMap[
"sampling"] = std::move(sampling);
366 DataMap[
"time"] = std::move(timeVec);
367 DataMap[
"quality"] = std::move(quality);
369 DataMap[
"channel"] = std::move(channel);
370 DataMap[
"module"] = std::move(module);
371 DataMap[
"cellPedestal"] = std::move(cellPedestal);
372 DataMap[
"cellRawAmplitude"] = std::move(cellRawAmplitude);
373 DataMap[
"cellRawTime"] = std::move(cellRawTime);
374 DataMap[adcCountsStr] = std::move(adcCounts);