ATLAS Offline Software
Loading...
Searching...
No Matches
TileRDOAnalysis.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include "TileRDOAnalysis.h"
11
17
18#include "TTree.h"
19#include "TString.h"
20#include "TileEvent/TileTTL1.h"
21
22#include <algorithm>
23#include <math.h>
24#include <functional>
25#include <iostream>
26
27TileRDOAnalysis::TileRDOAnalysis(const std::string& name, ISvcLocator* pSvcLocator)
28 : AthAlgorithm(name, pSvcLocator)
29 , m_adcID(0)
30 , m_pmtID(0)
31 , m_cellID(0)
32 , m_ttID(0)
33 , m_mtID(0)
34 , m_fragID(0)
35 , m_rawAmp(0)
36 , m_rawTime(0)
37 , m_rawQual(0)
38 , m_rawPed(0)
39 , m_adcHWID_mu(0)
40 , m_fragID_mu(0)
41 , m_rawAmp_mu(0)
42 , m_rawTime_mu(0)
43 , m_rawQual_mu(0)
44 , m_rawPed_mu(0)
45 , m_muRcvID(0)
46 , m_muRcv_dec(0)
49 , m_muRcv_time(0)
50 , m_ttl1MBTS_ID(0)
52 , m_ttl1_ID(0)
53 , m_ttl1_digits(0)
54 , m_L2ID(0)
55 , m_L2val(0)
56 , m_L2eta(0)
57 , m_L2phi(0)
58 , m_L2energyA(0)
59 , m_L2energyBC(0)
60 , m_L2energyD(0)
61 , m_L2qual(0)
62 , m_L2sumE(0)
63 , m_fragSize(0)
64 , m_fragBCID(0)
65 , m_digits(0)
66 , m_muFragSize(0)
67 , m_muFragBCID(0)
68 , m_muDigits(0)
69
70 , m_h_adcID(0)
71 , m_h_rawAmp(0)
72 , m_h_rawTime(0)
73 , m_h_rawQual(0)
74 , m_h_rawPed(0)
76 , m_h_rawAmp_mu(0)
79 , m_h_rawPed_mu(0)
80 , m_h_muRcvID(0)
81 , m_h_muRcv_dec(0)
87 , m_h_ttl1_ID(0)
89 , m_h_L2ID(0)
90 , m_h_L2val(0)
91 , m_h_L2eta(0)
92 , m_h_L2phi(0)
93 , m_h_L2energyA(0)
95 , m_h_L2energyD(0)
96 , m_h_L2qual(0)
97 , m_h_L2sumE(0)
98 , m_h_digits(0)
99 , m_h_muDigits(0)
100
101 , m_tree(0)
102 , m_thistSvc("THistSvc", name)
103{
104}
105
107 ATH_MSG_DEBUG( "Initializing TileRDOAnalysis" );
108
109
110 // This will check that the properties were initialized
111 // properly by job configuration.
118 ATH_CHECK( m_inputDigitsFltKey.initialize() );
119 ATH_CHECK( m_inputDigitsMuRcvKey.initialize() );
120
121 ATH_CHECK(m_cablingSvc.retrieve());
122
123 // Grab Ntuple and histogramming service for tree
124 ATH_CHECK(m_thistSvc.retrieve());
125
126 if(m_doNtuple){
127 m_tree = new TTree(TString(m_ntupleTreeName.value()), "TileRDOAna");
128 std::string fullNtupleName = "/" + m_ntupleFileName + "/" + m_ntupleDirName + "/" + m_ntupleTreeName;
129 ATH_CHECK(m_thistSvc->regTree(fullNtupleName, m_tree));
130 }
131 if (m_tree) {
132 m_tree->Branch("adcID", &m_adcID);
133 m_tree->Branch("pmtID", &m_pmtID);
134 m_tree->Branch("cellID", &m_cellID);
135 m_tree->Branch("ttID", &m_ttID);
136 m_tree->Branch("mtID", &m_mtID);
137 m_tree->Branch("fragID", &m_fragID);
138 m_tree->Branch("rawAmp", &m_rawAmp);
139 m_tree->Branch("rawTime", &m_rawTime);
140 m_tree->Branch("rawQual", &m_rawQual);
141 m_tree->Branch("rawPed", &m_rawPed);
142 m_tree->Branch("adcHWID_mu", &m_adcHWID_mu);
143 m_tree->Branch("fragID_mu", &m_fragID_mu);
144 m_tree->Branch("rawAmp_mu", &m_rawAmp_mu);
145 m_tree->Branch("rawTime_mu", &m_rawTime_mu);
146 m_tree->Branch("rawQual_mu", &m_rawQual_mu);
147 m_tree->Branch("rawPed_mu", &m_rawPed_mu);
148 m_tree->Branch("muRcvID", &m_muRcvID);
149 m_tree->Branch("muRcv_dec", &m_muRcv_dec);
150 m_tree->Branch("muRcv_thresh", &m_muRcv_thresh);
151 m_tree->Branch("muRcv_energy", &m_muRcv_energy);
152 m_tree->Branch("muRcv_time", &m_muRcv_time);
153 m_tree->Branch("ttl1MBTS_ID", &m_ttl1MBTS_ID);
154 m_tree->Branch("ttl1MBTS_digits", &m_ttl1MBTS_digits);
155 m_tree->Branch("ttl1_ID", &m_ttl1_ID);
156 m_tree->Branch("ttl1_digits", &m_ttl1_digits);
157 m_tree->Branch("L2ID", &m_L2ID);
158 m_tree->Branch("L2val", &m_L2val);
159 m_tree->Branch("L2eta", &m_L2eta);
160 m_tree->Branch("L2phi", &m_L2phi);
161 m_tree->Branch("L2energyA", &m_L2energyA);
162 m_tree->Branch("L2energyBC", &m_L2energyBC);
163 m_tree->Branch("L2energyD", &m_L2energyD);
164 m_tree->Branch("L2qual", &m_L2qual);
165 m_tree->Branch("L2sumE", &m_L2sumE);
166 m_tree->Branch("fragSize", &m_fragSize);
167 m_tree->Branch("fragBCID", &m_fragBCID);
168 m_tree->Branch("digits", &m_digits);
169 m_tree->Branch("muFragSize", &m_muFragSize);
170 m_tree->Branch("muFragBCID", &m_muFragBCID);
171 m_tree->Branch("muDigits", &m_muDigits);
172 }
173 else {
174 if(m_doNtuple) ATH_MSG_ERROR("No tree found!");
175 }
176
177 // HISTOGRAMS
178 m_h_adcID = new TH1F("h_adcID", "adc ID", 100, 0, 9.25e18);
179 m_h_adcID->StatOverflows();
180 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_adcID->GetName(), m_h_adcID));
181
182 m_h_rawAmp = new TH1F("h_rawAmp", "Raw amplitude", 100, -1200, 1200);
183 m_h_rawAmp->StatOverflows();
184 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawAmp->GetName(), m_h_rawAmp));
185
186 m_h_rawTime = new TH1F("h_rawTime", "Raw time", 100, -90, 90);
187 m_h_rawTime->StatOverflows();
188 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawTime->GetName(), m_h_rawTime));
189
190 m_h_rawQual = new TH1F("h_rawQual", "Raw quality", 100, 0, 1100);
191 m_h_rawQual->StatOverflows();
192 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawQual->GetName(), m_h_rawQual));
193
194 m_h_rawPed = new TH1F("h_rawPed", "Raw pedestal", 100, 0, 2e5);
195 m_h_rawPed->StatOverflows();
196 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawPed->GetName(), m_h_rawPed));
197
198 m_h_adcHWID_mu = new TH1F("h_adcHWID_mu", "MuRcv adc HW ID", 100, 0, 9.25e18);
199 m_h_adcHWID_mu->StatOverflows();
201
202 m_h_rawAmp_mu = new TH1F("h_rawAmp_mu", "MuRcv raw amplitude", 100, -1000, 11000);
203 m_h_rawAmp_mu->StatOverflows();
204 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawAmp_mu->GetName(), m_h_rawAmp_mu));
205
206 m_h_rawTime_mu = new TH1F("h_rawTime_mu", "MuRcv raw time", 100, -90, 90);
207 m_h_rawTime_mu->StatOverflows();
209
210 m_h_rawQual_mu = new TH1F("h_rawQual_mu", "MuRcv raw quality", 100, 0, 8e34);
211 m_h_rawQual_mu->StatOverflows();
213
214 m_h_rawPed_mu = new TH1F("h_rawPed_mu", "MuRcv raw pedestal", 100, 0, 13);
215 m_h_rawPed_mu->StatOverflows();
216 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_rawPed_mu->GetName(), m_h_rawPed_mu));
217
218 m_h_muRcvID = new TH1F("h_muRcvID", "Muon receiver object ID", 100, 0, 500);
219 m_h_muRcvID->StatOverflows();
220 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_muRcvID->GetName(), m_h_muRcvID));
221
222 m_h_muRcv_dec = new TH1F("h_muRcv_dec", "Muon receiver object decision", 100, 0, 2);
223 m_h_muRcv_dec->StatOverflows();
224 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_muRcv_dec->GetName(), m_h_muRcv_dec));
225
226 m_h_muRcv_thresh = new TH1F("h_muRcv_thresh", "Muon receiver object threshold", 100, 0, 650);
227 m_h_muRcv_thresh->StatOverflows();
229
230 m_h_muRcv_energy = new TH1F("h_muRcv_energy", "Muon receiver object energy", 100, 0, 20000);
231 m_h_muRcv_energy->StatOverflows();
233
234 m_h_muRcv_time = new TH1F("h_muRcv_time", "Muon receiver object time", 100, -90, 90);
235 m_h_muRcv_time->StatOverflows();
237
238 m_h_ttl1MBTS_ID = new TH1F("h_ttl1MBTS_ID", "TTL1 MBTS ID", 100, 0, 9.25e18);
239 m_h_ttl1MBTS_ID->StatOverflows();
241
242 m_h_ttl1MBTS_digits = new TH1F("h_ttl1MBTS_digits", "TTL1 MBTS digits", 100, 0, 2000);
243 m_h_ttl1MBTS_digits->StatOverflows();
245
246 m_h_ttl1_ID = new TH1F("h_ttl1_ID", "TTL1 ID", 100, 0, 2e19);
247 m_h_ttl1_ID->StatOverflows();
248 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_ttl1_ID->GetName(), m_h_ttl1_ID));
249
250 m_h_ttl1_digits = new TH1F("h_ttl1_digits", "TTL1 digits", 100, 0, 2000);
251 m_h_ttl1_digits->StatOverflows();
253
254 m_h_L2ID = new TH1F("h_L2ID", "L2 ID", 100, 0, 2e19);
255 m_h_L2ID->StatOverflows();
256 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2ID->GetName(), m_h_L2ID));
257
258 m_h_L2val = new TH1F("h_L2val", "L2 data values", 100, 0, 100);
259 m_h_L2val->StatOverflows();
260 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2val->GetName(), m_h_L2val));
261
262 m_h_L2eta = new TH1F("h_L2eta", "L2 eta", 100, -1.5, 1.5);
263 m_h_L2eta->StatOverflows();
264 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2eta->GetName(), m_h_L2eta));
265
266 m_h_L2phi = new TH1F("h_L2phi", "L2 phi", 100, -3.5, 3.5);
267 m_h_L2phi->StatOverflows();
268 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2phi->GetName(), m_h_L2phi));
269
270 m_h_L2energyA = new TH1F("h_L2energyA", "L2 energy in A cells", 100, 0, 12500);
271 m_h_L2energyA->StatOverflows();
272 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2energyA->GetName(), m_h_L2energyA));
273
274 m_h_L2energyBC = new TH1F("h_L2energyBC", "L2 energy in BC cells", 100, 0, 12500);
275 m_h_L2energyBC->StatOverflows();
277
278 m_h_L2energyD = new TH1F("h_L2energyD", "L2 energy in D cells", 100, 0, 12500);
279 m_h_L2energyD->StatOverflows();
280 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2energyD->GetName(), m_h_L2energyD));
281
282 m_h_L2qual = new TH1F("h_L2qual", "L2 quality", 100, 0, 2);
283 m_h_L2qual->StatOverflows();
284 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2qual->GetName(), m_h_L2qual));
285
286 m_h_L2sumE = new TH1F("h_L2sumE", "L2 energy sum", 100, 0, 2.25e5);
287 m_h_L2sumE->StatOverflows();
288 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_L2sumE->GetName(), m_h_L2sumE));
289
290 m_h_digits = new TH1F("h_digits", "Tile digits", 100, 0, 1100);
291 m_h_digits->StatOverflows();
292 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_digits->GetName(), m_h_digits));
293
294 m_h_muDigits = new TH1F("h_muDigits", "Tile muon receiver object digits", 100, 0, 150);
295 m_h_muDigits->StatOverflows();
296 ATH_CHECK(m_thistSvc->regHist(m_path + m_h_muDigits->GetName(), m_h_muDigits));
297
298
299
300 return StatusCode::SUCCESS;
301}
302
304 ATH_MSG_DEBUG( "In TileRDOAnalysis::execute()" );
305
306 if(m_tree){
307 m_adcID->clear();
308 m_pmtID->clear();
309 m_cellID->clear();
310 m_ttID->clear();
311 m_mtID->clear();
312 m_fragID->clear();
313 m_rawAmp->clear();
314 m_rawTime->clear();
315 m_rawQual->clear();
316 m_rawPed->clear();
317 m_adcHWID_mu->clear();
318 m_fragID_mu->clear();
319 m_rawAmp_mu->clear();
320 m_rawTime_mu->clear();
321 m_rawQual_mu->clear();
322 m_rawPed_mu->clear();
323 m_muRcvID->clear();
324 m_muRcv_dec->clear();
325 m_muRcv_thresh->clear();
326 m_muRcv_energy->clear();
327 m_muRcv_time->clear();
328 m_ttl1MBTS_ID->clear();
329 m_ttl1MBTS_digits->clear();
330 m_ttl1_ID->clear();
331 m_ttl1_digits->clear();
332 m_L2ID->clear();
333 m_L2val->clear();
334 m_L2eta->clear();
335 m_L2phi->clear();
336 m_L2energyA->clear();
337 m_L2energyBC->clear();
338 m_L2energyD->clear();
339 m_L2qual->clear();
340 m_L2sumE->clear();
341 m_fragSize->clear();
342 m_fragBCID->clear();
343 m_digits->clear();
344 m_muFragSize->clear();
345 m_muFragBCID->clear();
346 m_muDigits->clear();
347 }
348
349 // Tile Raw Channels
350 // Raw info (pulse height, time, quality) for in-time beam crossing in Tile
351 if (!m_presampling) {
352
353 if (!m_inputRawChKey.empty()) {
355 ATH_CHECK(rawChannelContainer.isValid());
356 // loop over tile raw channels container
357
358 for (const TileRawChannelCollection* rawChannelCollection : *rawChannelContainer) {
359 for (const TileRawChannel* rawChannel : *rawChannelCollection) {
360
361 const Identifier adcID(rawChannel->adc_ID());
362 if (!adcID.is_valid()) continue;
363
364 const Identifier pmtID(rawChannel->pmt_ID());
365 const Identifier cellID(rawChannel->cell_ID());
366 const Identifier ttID(rawChannel->tt_ID());
367 const Identifier mtID(rawChannel->mt_ID());
368 const int fragID(rawChannel->frag_ID());
369
370 const unsigned long long adcID_int = adcID.get_compact();
371 const unsigned long long pmtID_int = pmtID.get_compact();
372 const unsigned long long cellID_int = cellID.get_compact();
373 const unsigned long long ttID_int = ttID.get_compact();
374 const unsigned long long mtID_int = mtID.get_compact();
375
376 if(m_tree){
377 m_adcID->push_back(adcID_int);
378 m_pmtID->push_back(pmtID_int);
379 m_cellID->push_back(cellID_int);
380 m_ttID->push_back(ttID_int);
381 m_mtID->push_back(mtID_int);
382 m_fragID->push_back(fragID);
383 }
384
385 m_h_adcID->Fill(adcID_int);
386
387 for (int ix = 0; ix != rawChannel->size(); ++ix) {
388 if(m_tree) m_rawAmp->push_back(rawChannel->amplitude(ix)); // [ADC counts]
389 m_h_rawAmp->Fill(rawChannel->amplitude(ix));
390 }
391 for (int jx = 0; jx != rawChannel->sizeTime(); ++jx) {
392 if(m_tree) m_rawTime->push_back(rawChannel->time(jx)); // rel to triggering bunch
393 m_h_rawTime->Fill(rawChannel->time(jx));
394 }
395 for (int kx = 0; kx != rawChannel->sizeQuality(); ++kx) {
396 if(m_tree) m_rawQual->push_back(rawChannel->quality(kx)); // sampling distr.
397 m_h_rawQual->Fill(rawChannel->quality(kx));
398 }
399 if(m_tree) m_rawPed->push_back(rawChannel->pedestal()); // reconstructed
400 m_h_rawPed->Fill(rawChannel->pedestal());
401 }
402 }
403 }
404
405 // Muon Receiver Raw Channels
406
407 if (!m_inputMuRcvRawChKey.empty()) {
409 ATH_CHECK(muRawChannelContainer.isValid());
410 // loop over muon receiver raw channels container
411 for (const TileRawChannelCollection* muRawChannelCollection : *muRawChannelContainer) {
412 for (const TileRawChannel* muRawChannel : *muRawChannelCollection) {
413
414 const HWIdentifier adcHWID_mu(muRawChannel->adc_HWID());
415
416 const unsigned long long adcHWID_mu_int = adcHWID_mu.get_compact();
417
418 m_h_adcHWID_mu->Fill(adcHWID_mu_int);
419 if(m_tree) m_adcHWID_mu->push_back(adcHWID_mu_int);
420
421 const int fragID_mu(muRawChannel->frag_ID());
422 if(m_tree) m_fragID_mu->push_back(fragID_mu);
423
424 for (int lx = 0; lx != muRawChannel->size(); ++lx){
425 if(m_tree) m_rawAmp_mu->push_back(muRawChannel->amplitude(lx));
426 m_h_rawAmp_mu->Fill(muRawChannel->amplitude(lx));
427 }
428 for (int mx = 0; mx != muRawChannel->sizeTime(); ++mx) {
429 if(m_tree) m_rawTime_mu->push_back(muRawChannel->time(mx));
430 m_h_rawTime_mu->Fill(muRawChannel->time(mx));
431 }
432 for (int nx = 0; nx != muRawChannel->sizeQuality(); ++nx) {
433 if(m_tree) m_rawQual_mu->push_back(muRawChannel->quality(nx));
434 m_h_rawQual_mu->Fill(muRawChannel->quality(nx));
435 }
436 if(m_tree) m_rawPed_mu->push_back(muRawChannel->pedestal());
437 m_h_rawPed_mu->Fill(muRawChannel->pedestal());
438 }
439 }
440 }
441
442
443 // Tile Container - TileMuonReceiverContainer
444
445 if (!m_inputMuRcvKey.empty()) {
447 ATH_CHECK(muRcvContainer.isValid());
448 // loop over muon receiver container
449
450 for (const TileMuonReceiverObj* muRcv : *muRcvContainer) {
451 const int muRcvID(muRcv->GetID());
452 const std::vector<bool>& dec_vec = muRcv->GetDecision();
453 const std::vector<float>& thresh_vec = muRcv->GetThresholds();
454 const std::vector<float>& ene_vec = muRcv->GetEne();
455 const std::vector<float>& time_vec = muRcv->GetTime();
456
457 if(m_tree) m_muRcvID->push_back(muRcvID);
458
459 for (bool dec : dec_vec) {
460 if(m_tree) m_muRcv_dec->push_back(dec);
461 m_h_muRcv_dec->Fill(dec);
462 }
463 for (float thresh : thresh_vec) {
464 if(m_tree) m_muRcv_thresh->push_back(thresh);
465 m_h_muRcv_thresh->Fill(thresh);
466 }
467 for (float ene : ene_vec) {
468 if(m_tree) m_muRcv_energy->push_back(ene);
469 m_h_muRcv_energy->Fill(ene);
470 }
471 for (float time : time_vec) {
472 if(m_tree) m_muRcv_time->push_back(time);
473 m_h_muRcv_time->Fill(time);
474 }
475
476 m_h_muRcvID->Fill(muRcvID);
477 }
478 }
479
480
481 // Tile Container - TileTTL1Container
482 // Raw Tile L1 Trigger Towers
483
484 if (!m_inputMBTS_TTL1Key.empty()) {
486 ATH_CHECK(ttl1MBTSContainer.isValid());
487 // loop over TTL1 MBTS container
488
489 for (const TileTTL1* ttl1MBTS : *ttl1MBTSContainer) {
490 const Identifier ttl1MBTS_ID(ttl1MBTS->identify());
491 const std::vector<double> ttl1MBTS_digits(ttl1MBTS->samples());
492
493 const unsigned long long ttl1MBTS_ID_int = ttl1MBTS_ID.get_compact();
494 if(m_tree) m_ttl1MBTS_ID->push_back(ttl1MBTS_ID_int); // identifier
495 if(m_tree) m_ttl1MBTS_digits->push_back(ttl1MBTS_digits); // hardware sum of Tile channels; read out in N time slices
496
497 for (double sample : ttl1MBTS_digits) {
498 m_h_ttl1MBTS_digits->Fill(sample);
499 }
500
501 m_h_ttl1MBTS_ID->Fill(ttl1MBTS_ID_int);
502 }
503 }
504
505 if (!m_inputTileTTL1Key.empty()) {
507 ATH_CHECK(ttl1Container.isValid());
508 // loop over TTL1 container
509 for (const TileTTL1* tile_TTL1 : *ttl1Container) {
510
511 const Identifier ttl1ID(tile_TTL1->identify());
512 const std::vector<double> ttl1_digits(tile_TTL1->samples());
513
514 const unsigned long long ttl1ID_int = ttl1ID.get_compact();
515 if(m_tree) m_ttl1_ID->push_back(ttl1ID_int);
516 if(m_tree) m_ttl1_digits->push_back(ttl1_digits);
517
518 for (double sample : ttl1_digits) {
519 m_h_ttl1_digits->Fill(sample);
520 }
521
522 m_h_ttl1_ID->Fill(ttl1ID_int);
523 }
524 }
525
526
527 // Tile Container - TileL2
528 // TileMuId and Et computed at TileCal ROD DSPs (use for L2 trigger)
529 std::vector<unsigned int> val_vec;
530 std::vector<float> eta_vec;
531 std::vector<float> enemu0_vec;
532 std::vector<float> enemu1_vec;
533 std::vector<float> enemu2_vec;
534 std::vector<unsigned int> qual_vec;
535 std::vector<float> sumE_vec;
536
537
538 if (!m_inputL2Key.empty()) {
540 ATH_CHECK(l2Container.isValid());
541 // loop over L2 container
542 for (const TileL2* tile_L2 : *l2Container) {
543 // drawer ID
544 const int L2ID(tile_L2->identify());
545 // packed muon info (32-bit words)
546 for (unsigned int ii = 0; ii != tile_L2->Ndata(); ii++) {
547 val_vec.push_back(tile_L2->val(ii));
548 m_h_L2val->Fill(val_vec.at(ii));
549 }
550 // muon info - energy deposited in TileCal layers, eta, quality flag
551 for (unsigned int jj = 0; jj != tile_L2->NMuons(); jj++) {
552 eta_vec.push_back(tile_L2->eta(jj));
553 enemu0_vec.push_back(tile_L2->enemu0(jj));
554 enemu1_vec.push_back(tile_L2->enemu1(jj));
555 enemu2_vec.push_back(tile_L2->enemu2(jj));
556 qual_vec.push_back(tile_L2->qual(jj));
557
558 m_h_L2eta->Fill(eta_vec.at(jj));
559 m_h_L2energyA->Fill(enemu0_vec.at(jj));
560 m_h_L2energyBC->Fill(enemu1_vec.at(jj));
561 m_h_L2energyD->Fill(enemu2_vec.at(jj));
562 m_h_L2qual->Fill(qual_vec.at(jj));
563 }
564 // drawer phi
565 const float l2phi(tile_L2->phi(0));
566 // vector sumE = [sumEt, sumEz, sumE] per TileCal superdrawer
567 for (unsigned int kk = 0; kk != tile_L2->NsumE(); kk++) {
568 sumE_vec.push_back(tile_L2->sumE(kk));
569 m_h_L2sumE->Fill(sumE_vec.at(kk));
570 }
571
572 if(m_tree){
573 m_L2ID->push_back(L2ID);
574 m_L2val->push_back(val_vec);
575 m_L2eta->push_back(eta_vec);
576 m_L2energyA->push_back(enemu0_vec);
577 m_L2energyBC->push_back(enemu1_vec);
578 m_L2energyD->push_back(enemu2_vec);
579 m_L2qual->push_back(qual_vec);
580 m_L2phi->push_back(l2phi);
581 m_L2sumE->push_back(sumE_vec);
582 }
583
584 m_h_L2ID->Fill(L2ID);
585 m_h_L2phi->Fill(l2phi);
586
587 val_vec.clear();
588 eta_vec.clear();
589 enemu0_vec.clear();
590 enemu1_vec.clear();
591 enemu2_vec.clear();
592 qual_vec.clear();
593 sumE_vec.clear();
594 }
595 }
596 }
597
598 // TileDigitsContainer - TileDigitsFlt
599
600 if (!m_inputDigitsFltKey.empty()) {
602 ATH_CHECK(digitsContainer.isValid());
603 // loop over tile digits container
604 for (const TileDigitsCollection* digitsCollection : *digitsContainer) {
605
606 uint32_t fragSize(digitsCollection->getFragSize());
607 uint32_t fragBCID(digitsCollection->getFragBCID());
608
609 if(m_tree) m_fragSize->push_back(fragSize);
610 if(m_tree) m_fragBCID->push_back(fragBCID);
611
612 for (const TileDigits* tileDigits : *digitsCollection) {
613 const std::vector<double> digits(tileDigits->get_digits());
614 if(m_tree) m_digits->push_back(digits);
615
616 for (const double sample : digits) {
617 m_h_digits->Fill(sample);
618 }
619 }
620 }
621 }
622
623 // TileDigitsContainer - MuRcvDigitsCnt
624
625 if (!m_inputDigitsMuRcvKey.empty()) {
627 ATH_CHECK(muRcvDigitsContainer.isValid());
628 // loop over tile digits container
629 for (const TileDigitsCollection* muRcvDigitsCollection : *muRcvDigitsContainer) {
630 const uint32_t muFragSize(muRcvDigitsCollection->getFragSize());
631 const uint32_t muFragBCID(muRcvDigitsCollection->getFragBCID());
632
633 if(m_tree) m_muFragSize->push_back(muFragSize);
634 if(m_tree) m_muFragBCID->push_back(muFragBCID);
635
636 for (const TileDigits* muRcvDigits : *muRcvDigitsCollection) {
637 const std::vector<double> muDigits(muRcvDigits->get_digits());
638 if(m_tree) m_muDigits->push_back(muDigits);
639 for (const double sample : muDigits) {
640 m_h_muDigits->Fill(sample);
641 }
642 }
643 }
644 }
645
646 if (m_tree) {
647 m_tree->Fill();
648 }
649
650 return StatusCode::SUCCESS;
651}
652
654 return StatusCode::SUCCESS;
655}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
bool is_valid() const
Check if id is in a valid state.
value_type get_compact() const
Get the compact id.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Class to store TileMuId and Et quantities computed at the TileCal ROD DSPs.
Definition TileL2.h:33
std::vector< int > * m_muRcvID
std::vector< float > * m_muRcv_energy
SG::ReadHandleKey< TileDigitsContainer > m_inputDigitsMuRcvKey
std::vector< std::vector< float > > * m_L2sumE
std::vector< std::vector< unsigned int > > * m_L2qual
TileRDOAnalysis(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > * m_rawPed_mu
SG::ReadHandleKey< TileL2Container > m_inputL2Key
std::vector< std::vector< double > > * m_digits
std::vector< unsigned long long > * m_ttl1MBTS_ID
std::vector< unsigned long long > * m_adcID
std::vector< uint32_t > * m_muFragSize
std::vector< std::vector< double > > * m_ttl1_digits
std::vector< unsigned long long > * m_ttID
std::vector< int > * m_fragID
std::vector< float > * m_rawTime
std::vector< uint32_t > * m_muFragBCID
Gaudi::Property< std::string > m_ntupleTreeName
std::vector< float > * m_rawQual_mu
ServiceHandle< ITHistSvc > m_thistSvc
SG::ReadHandleKey< TileRawChannelContainer > m_inputRawChKey
std::vector< float > * m_rawTime_mu
std::vector< uint32_t > * m_fragBCID
std::vector< float > * m_rawQual
Gaudi::Property< std::string > m_path
std::vector< std::vector< double > > * m_ttl1MBTS_digits
std::vector< unsigned long long > * m_cellID
std::vector< float > * m_rawPed
SG::ReadHandleKey< TileMuonReceiverContainer > m_inputMuRcvKey
Gaudi::Property< bool > m_doNtuple
std::vector< bool > * m_muRcv_dec
virtual StatusCode execute() override final
std::vector< float > * m_rawAmp_mu
virtual StatusCode initialize() override final
std::vector< std::vector< float > > * m_L2energyD
SG::ReadHandleKey< TileDigitsContainer > m_inputDigitsFltKey
Gaudi::Property< std::string > m_ntupleFileName
SG::ReadHandleKey< TileTTL1Container > m_inputMBTS_TTL1Key
std::vector< int > * m_L2ID
std::vector< std::vector< float > > * m_L2eta
std::vector< unsigned long long > * m_pmtID
std::vector< int > * m_fragID_mu
std::vector< std::vector< double > > * m_muDigits
std::vector< std::vector< float > > * m_L2energyBC
std::vector< std::vector< float > > * m_L2energyA
std::vector< unsigned long long > * m_adcHWID_mu
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
std::vector< float > * m_L2phi
virtual StatusCode finalize() override final
std::vector< std::vector< unsigned int > > * m_L2val
std::vector< float > * m_muRcv_time
std::vector< uint32_t > * m_fragSize
SG::ReadHandleKey< TileRawChannelContainer > m_inputMuRcvRawChKey
BooleanProperty m_presampling
Gaudi::Property< std::string > m_ntupleDirName
std::vector< float > * m_rawAmp
SG::ReadHandleKey< TileTTL1Container > m_inputTileTTL1Key
std::vector< unsigned long long > * m_ttl1_ID
std::vector< unsigned long long > * m_mtID
std::vector< float > * m_muRcv_thresh