ATLAS Offline Software
Loading...
Searching...
No Matches
LArNoiseBursts.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
10
11#include "GaudiKernel/ThreadLocalContext.h"
13
15
20
21
24
28
35
36#include <utility>
37
38
39
41
42#include "TTree.h"
43
45
47
49
50
51
53int n_noisy_cell_part[8] = {0,0,0,0,0,0,0,0};
54int n_cell_part[8] = {0,0,0,0,0,0,0,0};
57std::vector<short> v_layer;
60std::vector<float> v_phicell, v_etacell;
61std::vector<bool> v_isbadcell;
62std::vector<IdentifierHash> v_IdHash;
63std::vector<int> v_cellpartlayerindex;
64std::vector<Identifier> v_cellIdentifier;
65std::vector<HWIdentifier> v_onlIdentifier;
66
69
70
71LArNoiseBursts::LArNoiseBursts(const std::string& name,
72 ISvcLocator* pSvcLocator)
73 : AthAlgorithm(name, pSvcLocator),
74 m_tree(nullptr),
75 m_LArOnlineIDHelper(nullptr),
76 m_LArHVLineIDHelper(nullptr),
78 m_LArEM_IDHelper(nullptr),
79 m_LArFCAL_IDHelper(nullptr),
80 m_LArHEC_IDHelper(nullptr),
81 m_CosmicCaloStream(false),
82 m_nb_sat(0),
83 m_lowqfactor(0),
84 m_medqfactor(0),
85 m_hiqfactor(0),
86 m_noisycell(0),
89 m_nt_run(0),
90 m_nt_evtId(0),
91 m_nt_evtTime(0),
93 m_nt_lb(0),
94 m_nt_bcid(0),
95 //m_nt_ntracks(0),
117 m_nt_L1_J75(false),
118 m_nt_L1_J10_EMPTY(false),
120 m_nt_L1_J30_EMPTY(false),
121 m_nt_L1_XE40(false),
122 m_nt_L1_XE50(false),
123 m_nt_L1_XE50_BGRP7(false),
124 m_nt_L1_XE70(false),
141 m_nt_nCellA(0),
142 m_nt_nCellC(0),
145 m_nt_phicell(0),
146 m_nt_etacell(0),
148 //m_nt_noisycellpercent(0),
151 m_nt_ft_noisy(0),
160 m_nt_samples(0),
161 m_nt_gain(0),
164 m_nt_layer(0),
168 m_nt_ft_sat(0),
169 m_nt_slot_sat(0),
177 {
178
179 //event cuts
180 declareProperty("SigmaCut", m_sigmacut = 3.0);
181 declareProperty("NumberOfBunchesInFront",m_frontbunches = 36);
182
183 // Keep cell properties
184 declareProperty("KeepOnlyCellID", m_keepOnlyCellID = false);
185 }
186
188
189 ATH_MSG_DEBUG ( "Initializing LArNoiseBursts" );
190
191 // Trigger Decision Tool
192 ATH_CHECK( m_trigDec.retrieve() );
193
194 ATH_CHECK( m_cablingKey.initialize() );
195 ATH_CHECK( m_BCKey.initialize() );
196 ATH_CHECK( m_totalNoiseKey.initialize() );
197 ATH_CHECK( m_bcDataKey.initialize() );
198 ATH_CHECK( m_NoisyROKey.initialize() );
199
200 // Retrieve online ID helper
201 const LArOnlineID* LArOnlineIDHelper = nullptr;
202 ATH_CHECK( detStore()->retrieve(LArOnlineIDHelper, "LArOnlineID") );
203 m_LArOnlineIDHelper = LArOnlineIDHelper;
204 ATH_MSG_DEBUG( " Found LArOnline Helper");
205
206 // Retrieve HV line ID helper
207 const LArHVLineID* LArHVLineIDHelper = nullptr;
208 ATH_CHECK( detStore()->retrieve(LArHVLineIDHelper, "LArHVLineID") );
209 m_LArHVLineIDHelper = LArHVLineIDHelper;
210 ATH_MSG_DEBUG( " Found LArOnlineIDHelper Helper");
211
212 // Retrieve HV electrode ID helper
213 const LArElectrodeID* LArElectrodeIDHelper = nullptr;
214 ATH_CHECK( detStore()->retrieve(LArElectrodeIDHelper, "LArElectrodeID") );
215 m_LArElectrodeIDHelper = LArElectrodeIDHelper;
216 ATH_MSG_DEBUG( " Found LArElectrodeIDHelper Helper");
217
218 ATH_CHECK(m_caloMgrKey.initialize());
219
220 // Retrieve ID helpers
221 const CaloCell_ID* idHelper = nullptr;
222 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
223 m_LArEM_IDHelper = idHelper->em_idHelper();
224 m_LArHEC_IDHelper = idHelper->hec_idHelper();
225 m_LArFCAL_IDHelper = idHelper->fcal_idHelper();
226
228 ATH_CHECK( m_thistSvc.retrieve() );
229
231 m_tree = new TTree( "CollectionTree", "CollectionTree" );
232 std::string treeName = "/TTREE/CollectionTree" ;
233 ATH_CHECK( m_thistSvc->regTree(treeName, m_tree) );
234
235 // General properties of events
236 m_tree->Branch("Run",&m_nt_run,"Run/I");// Event ID
237 m_tree->Branch("EventId",&m_nt_evtId,"EventId/l");// Event ID
238 m_tree->Branch("EventTime",&m_nt_evtTime,"EventTime/I");// Event time
239 m_tree->Branch("EventTime_ns",&m_nt_evtTime_ns,"EventTime_ns/I");// Event time in nanosecond
240 m_tree->Branch("LumiBlock",&m_nt_lb,"LumiBlock/I"); // LB
241 m_tree->Branch("BCID",&m_nt_bcid,"BCID/I"); // BCID
242 m_tree->Branch("StreamTagName",&m_nt_streamTagName);// stream tag name
243 m_tree->Branch("StreamTagType",&m_nt_streamTagType); // stream tag type
244 m_tree->Branch("IsBCIDFilled", &m_nt_isbcidFilled,"IsBCIDFilled/I"); // check if bunch is filled
245 m_tree->Branch("IsBCIDInTrain",&m_nt_isbcidInTrain,"ISBCIDInTrain/I"); // check if bunch belong to a train
246 m_tree->Branch("BunchesInFront",&m_nt_isBunchesInFront); // check front bunches
247 m_tree->Branch("BunchType",&m_nt_bunchtype,"BunchType/I");// Empty = 0, FirstEmpty=1,&middleEmpty=2, Single=100,Front=200,&middle=201,Tail=202
248 m_tree->Branch("TimeAfterBunch",&m_nt_bunchtime,"TimeAfterBunch/F"); //time "distance" between the colliding bunch and the nearest one.
249 m_tree->Branch("ATLASIsReady",&m_nt_atlasready,"AtlasIsReady/I"); //check if atlas is ready for physics
250 m_tree->Branch("StableBeams",&m_nt_stablebeams,"StableBeams/I");//check stablebeams
251
252 // LAr event bit info
253 m_tree->Branch("larflag_badFEBs",&m_nt_larflag_badFEBs,"larflag_badFEBs/O");
254 m_tree->Branch("larflag_mediumSaturatedDQ",&m_nt_larflag_mediumSaturatedDQ,"larflag_mediumSaturatedDQ/O");
255 m_tree->Branch("larflag_tightSaturatedDQ",&m_nt_larflag_tightSaturatedDQ,"larflag_tightSaturatedDQ/O");
256 m_tree->Branch("larflag_noiseBurstVeto",&m_nt_larflag_noiseBurstVeto,"larflag_noiseBurstVeto/O");
257 m_tree->Branch("larflag_dataCorrupted",&m_nt_larflag_dataCorrupted,"larflag_dataCorrupted/O");
258 m_tree->Branch("larflag_dataCorruptedVeto",&m_nt_larflag_dataCorruptedVeto,"larflag_dataCorruptedVeto/O");
259 m_tree->Branch("larflag_badFEBS_w",&m_nt_larflag_badFEBS_w,"larflag_badFEBS_w/O");
260 m_tree->Branch("larflag_mnbLoose",&m_nt_larflag_mnbLoose,"larflag_mnbLoose/O");
261 m_tree->Branch("larflag_mnbTight",&m_nt_larflag_mnbTight,"larflag_mnbTight/O");
262 m_tree->Branch("larflag_mnbTight_psveto",&m_nt_larflag_mnbTight_psveto,"larflag_mnbTight_psveto/O");
263 m_tree->Branch("larflag_badHVlines",&m_nt_larflag_badHVlines,"larflag_badHVlines/O");
264
265 m_tree->Branch("badHVlinesPartitions",&m_nt_badHVPartitions,"badHVlinesPartitions/b");
266 // Bad HVlines vector
267 m_tree->Branch("badHVlines",&m_nt_badHVlines);
268
269 // trigger flags
270 m_tree->Branch("L1_J75",&m_nt_L1_J75,"L1_J75/O");
271 m_tree->Branch("L1_J10_EMPTY",&m_nt_L1_J10_EMPTY,"L1_J10_EMPTY/O");
272 m_tree->Branch("L1_J30_FIRSTEMPTY",&m_nt_L1_J30_FIRSTEMPTY,"L1_J30_FIRSTEMPTY/O");
273 m_tree->Branch("L1_J30_EMPTY",&m_nt_L1_J30_EMPTY,"L1_J30_EMPTY/O");
274 m_tree->Branch("L1_XE40",&m_nt_L1_XE40,"L1_XE40/O");
275 m_tree->Branch("L1_XE50",&m_nt_L1_XE50,"L1_XE50/O");
276 m_tree->Branch("L1_XE50_BGRP7",&m_nt_L1_XE50_BGRP7,"L1_XE50_BGRP7/O");
277 m_tree->Branch("L1_XE70",&m_nt_L1_XE70,"L1_XE70/O");
278
279 m_tree->Branch("EF_j165_u0uchad_LArNoiseBurst",&m_nt_EF_j165_u0uchad_LArNoiseBurst,"EF_j165_u0uchad_LArNoiseBurst/O");
280 m_tree->Branch("EF_j30_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j30_u0uchad_empty_LArNoiseBurst,"EF_j30_u0uchad_empty_LArNoiseBurst/O");
281 m_tree->Branch("EF_j55_u0uchad_firstempty_LArNoiseBurst",&m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurst,"EF_j55_u0uchad_firstempty_LArNoiseBurst/O");
282 m_tree->Branch("EF_j55_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j55_u0uchad_empty_LArNoiseBurst,"EF_j55_u0uchad_empty_LArNoiseBurst/O");
283 m_tree->Branch("EF_xe45_LArNoiseBurst",&m_nt_EF_xe45_LArNoiseBurst,"EF_xe45_LArNoiseBurst/O");
284 m_tree->Branch("EF_xe55_LArNoiseBurst",&m_nt_EF_xe55_LArNoiseBurst,"EF_xe55_LArNoiseBurst/O");
285 m_tree->Branch("EF_xe60_LArNoiseBurst",&m_nt_EF_xe60_LArNoiseBurst,"EF_xe60_LArNoiseBurst/O");
286 m_tree->Branch("EF_j55_u0uchad_firstempty_LArNoiseBurstT",&m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurstT,"EF_j55_u0uchad_firstempty_LArNoiseBurstT/O");
287 m_tree->Branch("EF_j100_u0uchad_LArNoiseBurstT",&m_nt_EF_j100_u0uchad_LArNoiseBurstT,"EF_j100_u0uchad_LArNoiseBurstT/O");
288 m_tree->Branch("EF_j165_u0uchad_LArNoiseBurstT",&m_nt_EF_j165_u0uchad_LArNoiseBurstT,"EF_j165_u0uchad_LArNoiseBurstT/O");
289 m_tree->Branch("EF_j130_u0uchad_LArNoiseBurstT",&m_nt_EF_j130_u0uchad_LArNoiseBurstT,"EF_j130_u0uchad_LArNoiseBurstT/O");
290 m_tree->Branch("EF_j35_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j35_u0uchad_empty_LArNoiseBurst,"EF_j35_u0uchad_empty_LArNoiseBurst/O");
291 m_tree->Branch("EF_j35_u0uchad_firstempty_LArNoiseBurst",&m_nt_EF_j35_u0uchad_firstempty_LArNoiseBurst,"EF_j35_u0uchad_firstempty_LArNoiseBurst/O");
292 m_tree->Branch("EF_j80_u0uchad_LArNoiseBurstT",&m_nt_EF_j80_u0uchad_LArNoiseBurstT,"EF_j80_u0uchad_LArNoiseBurstT/O");
293
294 //
295 m_tree->Branch("LArCellSize", &m_nt_larcellsize,"LArCellSize/I"); // NEW number of online conected LAr cells
296 m_tree->Branch("CaloCellSize",&m_nt_cellsize,"CaloCellSize/I");// NEW number of total cells.
297 // LAr time difference as computed by LArCollisionTime info
298 m_tree->Branch("LArTime_Diff",&m_nt_ECTimeDiff,"LArTime_Diff/F"); // time diff between 2 endcaps
299 m_tree->Branch("LArTime_Avg",&m_nt_ECTimeAvg,"LArTime_Avg/F"); // time average of 2 endcaps
300 m_tree->Branch("LArTime_nCellA",&m_nt_nCellA,"LArTime_nCellA/I"); // nb of cells used to compute endcap A time
301 m_tree->Branch("LArTime_nCellC",&m_nt_nCellC,"LArTime_nCellC/I"); // nb of cells used to compute endcap C time
302
303 // Event properties related to yield of channels in 3 sigma tails
304 //m_tree->Branch("PerCentNoisyCell",&m_nt_noisycellpercent,"PerCentNoisyCell/F"); // Yield of channels in 3sigma tails in whole LAr
305 m_tree->Branch("PerCentNoisyCellPartition",&m_nt_noisycellpart); // Yield in each partition:0:embc 1:emba 2:emecc 3:emeca 4:fcalc 5:fcala 6:hecc 7:heca
306
307
308 // Properties of cells with fabs(energy/noise)>3
309 m_tree->Branch("NoisyCellPartitionLayerIndex",&m_nt_cellpartlayerindex);
310 m_tree->Branch("NoisyCellIdentifier",&m_nt_cellIdentifier); // Identifier of the noisy cell
311 m_tree->Branch("NoisyCellOnlineIdentifier",&m_nt_onlIdentifier); // Identifier of the noisy cell
312 m_tree->Branch("NoisyCellPartition",&m_nt_partition); // Partition in 1 integer: 0:embc 1:emba 2:emecc 3:emeca 4:fcalc 5:fcala 6:hecc 7:heca
313 m_tree->Branch("NoisyCellBarrelEc",&m_nt_barrelec_noisy); // BC
314 m_tree->Branch("NoisyCellPosNeg",&m_nt_posneg_noisy); // side
315 m_tree->Branch("NoisyCellFT",&m_nt_ft_noisy); // FT
316 m_tree->Branch("NoisyCellSlot",&m_nt_slot_noisy); // Slot
317 m_tree->Branch("NoisyCellChannel",&m_nt_channel_noisy); // Channel
318 m_tree->Branch("NoisyCellADCvalues", &m_nt_samples); // ADC values
319 m_tree->Branch("NoisyCellGain",&m_nt_gain); // Gain
320 m_tree->Branch("NoisyCellPhi",&m_nt_phicell); // Phi
321 m_tree->Branch("NoisyCellEta",&m_nt_etacell); // Eta
322 m_tree->Branch("NoisyCellLayer", &m_nt_layer); // layer
323 m_tree->Branch("NoisyCellHVphi", &m_nt_noisycellHVphi); // Phi of HV
324 m_tree->Branch("NoisyCellHVeta", &m_nt_noisycellHVeta); // Eta of HV
325 m_tree->Branch("NoisyCellEnergy",&m_nt_energycell); // Energy
326 m_tree->Branch("NoisyCellSignificance",&m_nt_signifcell); // Significance (energy/noise)
327 m_tree->Branch("NoisyCellQFactor",&m_nt_qfactorcell); // Q factor
328 m_tree->Branch("NoisyCellIsBad",&m_nt_isbadcell); // Bad channel status
329 // Event properties related to q factor
330 m_tree->Branch("nbLowQFactor", &m_lowqfactor,"m_lowqfactor/i"); // Nb of cells per event with q factor<1000
331 m_tree->Branch("nbMedQFactor", &m_medqfactor,"m_medqfactor/i"); // Nb of cells per event with 1000<q factor<10000
332 m_tree->Branch("nbHighQFactor", &m_hiqfactor,"m_hiqfactor/i"); // Nb of cells per event with q 10000<factor<65535
333 m_tree->Branch("nbSatQFactor",&m_nb_sat,"nbSat/i"); // Nb of cells per event with saturated q factor (65535)
334 // Properties of cells with q factor saturated
335 m_tree->Branch("SatCellPartition",&m_nt_partition_sat);
336 m_tree->Branch("SatCellBarrelEc",&m_nt_barrelec_sat);
337 m_tree->Branch("SatCellPosNeg",&m_nt_posneg_sat);
338 m_tree->Branch("SatCellFT",&m_nt_ft_sat);
339 m_tree->Branch("SatCellSlot",&m_nt_slot_sat);
340 m_tree->Branch("SatCellChannel",&m_nt_channel_sat);
341 m_tree->Branch("SatCellEnergy",&m_nt_energy_sat);
342 m_tree->Branch("SatCellPhi", &m_nt_phicell_sat);
343 m_tree->Branch("SatCellEta",&m_nt_etacell_sat);
344 m_tree->Branch("SatCellLayer",&m_nt_layer_sat);
345 m_tree->Branch("SatCellIsBad", &m_nt_isbadcell_sat);
346 m_tree->Branch("SatCellOnlineIdentifier",&m_nt_cellIdentifier_sat);
347
348
349 ATH_MSG_DEBUG ( "End of Initializing LArNoiseBursts" );
350
351 return StatusCode::SUCCESS;
352}
353
356
358 ATH_MSG_DEBUG ( "in finalize()" );
359 return StatusCode::SUCCESS;
360}
361
366
367 ATH_MSG_DEBUG ( "start clearing variables " );
368
369 m_nb_sat = 0;
370 m_noisycell = 0;
371 m_lowqfactor = 0;
372 m_medqfactor = 0;
373 m_hiqfactor = 0;
374
375 m_nt_run = 0;
376 m_nt_evtId = 0;
377 m_nt_evtTime = 0;
378 m_nt_evtTime_ns = 0;
379 m_nt_lb = 0;
380 m_nt_bcid = -1;
381
382 m_nt_streamTagName.clear();
383 m_nt_streamTagType.clear();
386 m_nt_isBunchesInFront.clear();
387 m_nt_bunchtype = -1;
388 m_nt_bunchtime = -1.0;
389 m_nt_atlasready = -1;
390 m_nt_stablebeams = -1;
391
392
393 ATH_MSG_DEBUG ( "clearing LAr event flags " );
394
395 // lar bit event info
396 m_nt_larflag_badFEBs = false;
403 m_nt_larflag_mnbLoose = false;
404 m_nt_larflag_mnbTight = false;
407
409 m_nt_badHVlines.clear();
410
411 ATH_MSG_DEBUG ( "clearing Pixel variables " );
412
413 // Trigger flags
414 m_nt_L1_J75 = true; // turned on for tests
415 m_nt_L1_J10_EMPTY = false;
417 m_nt_L1_J30_EMPTY = false;
418 m_nt_L1_XE40 = false;
419 m_nt_L1_XE50 = false;
420 m_nt_L1_XE50_BGRP7 = false;
421 m_nt_L1_XE70 = false;
422
437
438 ATH_MSG_DEBUG ( "clearing noisy cells variables " );
439
440 //Quantities for noisy cells
441 m_nt_energycell.clear();
442 m_nt_qfactorcell.clear();
443 m_nt_phicell.clear();
444 m_nt_etacell.clear();
445 m_nt_signifcell.clear();
446 m_nt_isbadcell.clear();
447 m_nt_partition.clear();
448 m_nt_layer.clear();
449 //m_nt_noisycellpercent = -1;
450 m_nt_barrelec_noisy.clear();
451 m_nt_posneg_noisy.clear();
452 m_nt_ft_noisy.clear();
453 m_nt_slot_noisy.clear();
454 m_nt_channel_noisy.clear();
455 m_nt_larcellsize = -1;
456 m_nt_cellsize = -1;
458 m_nt_cellIdentifier.clear();
459 m_nt_onlIdentifier.clear();
460 m_nt_noisycellpart.clear();
461 m_nt_samples.clear();
462 m_nt_gain.clear();
463
465 m_nt_noisycellHVphi.clear();
466 m_nt_noisycellHVeta.clear();
467
468 ATH_MSG_DEBUG ( "clearing saturated cell variables " );
469
470 //clearing quantities for sat cells
471 m_nt_barrelec_sat.clear();
472 m_nt_posneg_sat.clear();
473 m_nt_ft_sat.clear();
474 m_nt_slot_sat.clear();
475 m_nt_channel_sat.clear();
476 m_nt_partition_sat.clear();
477 m_nt_energy_sat.clear();
478 m_nt_phicell_sat.clear();
479 m_nt_etacell_sat.clear();
480 m_nt_layer_sat.clear();
482 m_nt_isbadcell_sat.clear();
483
484 ATH_MSG_DEBUG ( "clearing LArTimeDiff variables " );
485
486 //DiffTime computed with LAR
487 m_nt_ECTimeDiff = 9999;
488 m_nt_ECTimeAvg = 9999;
489 m_nt_nCellA = -1;
490 m_nt_nCellC = -1;
491
492 return StatusCode::SUCCESS;
493}
494
497
498StatusCode LArNoiseBursts::execute(const EventContext& /*ctx*/) {
499 ATH_MSG_DEBUG ( "in execute()" );
500
501 StatusCode sc = clear();
502 if(sc.isFailure()) {
503 ATH_MSG_WARNING ( "The method clear() failed" );
504 return StatusCode::SUCCESS;
505 }
506
507 if(!m_trigDec.empty()){
508
509 sc = doTrigger();
510 if(sc.isFailure()) {
511 ATH_MSG_WARNING ( "The method doTrigger() failed" );
512 return StatusCode::SUCCESS;
513 }
514 }
515
517 if(sc.isFailure()) {
518 ATH_MSG_WARNING ( "The method doEventProperties() failed" );
519 return StatusCode::SUCCESS;
520 }
521
523 if (sc.isFailure()) {
524 ATH_MSG_WARNING ( "The method doLArNoiseBursts() failed" );
525 return StatusCode::SUCCESS;
526 }
527
528// sc = doPhysicsObjects();
529// if (sc.isFailure()) {
530// ATH_MSG_WARNING ( "The method doPhysicsObjects() failed" );
531// return StatusCode::SUCCESS;
532// }
533
534 m_tree->Fill();
535
536 return StatusCode::SUCCESS;
537}
538
543 ATH_MSG_DEBUG ("in doTrigger ");
544
545 std::string mychain( "L1_J75" );
546 if( ! m_trigDec->getListOfTriggers(mychain).empty() ){
547 m_nt_L1_J75 = m_trigDec->isPassed( mychain );
548 }
549 mychain = "L1_J10_EMPTY";
550 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
551 m_nt_L1_J10_EMPTY = m_trigDec->isPassed( mychain );
552 }
553 mychain = "L1_J30_FIRSTEMPTY";
554 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
555 m_nt_L1_J30_FIRSTEMPTY = m_trigDec->isPassed( mychain );
556 }
557 mychain = "L1_J30_EMPTY";
558 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
559 m_nt_L1_J30_EMPTY = m_trigDec->isPassed( mychain );
560 }
561 mychain = "L1_XE40";
562 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
563 m_nt_L1_XE40 = m_trigDec->isPassed( mychain );
564 }
565 mychain = "L1_XE50";
566 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
567 m_nt_L1_XE50 = m_trigDec->isPassed( mychain );
568 }
569 mychain = "L1_XE50_BGRP7";
570 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
571 m_nt_L1_XE50_BGRP7 = m_trigDec->isPassed( mychain );
572 }
573 mychain = "L1_XE70";
574 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
575 m_nt_L1_XE70 = m_trigDec->isPassed( mychain );
576 }
577
578 // EF
579 mychain = "EF_j165_u0uchad_LArNoiseBurst";
580 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
581 m_nt_EF_j165_u0uchad_LArNoiseBurst = m_trigDec->isPassed( mychain );
582 }
583 mychain = "EF_j30_u0uchad_empty_LArNoiseBurst";
584 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
586 }
587 mychain = "EF_j55_u0uchad_firstempty_LArNoiseBurst";
588 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
590 }
591 mychain = "EF_j55_u0uchad_empty_LArNoiseBurst";
592 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
594 }
595 mychain = "EF_xe45_LArNoiseBurst";
596 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
597 m_nt_EF_xe45_LArNoiseBurst = m_trigDec->isPassed( mychain );
598 }
599 mychain = "EF_xe55_LArNoiseBurst";
600 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
601 m_nt_EF_xe55_LArNoiseBurst = m_trigDec->isPassed( mychain );
602 }
603 mychain = "EF_xe60_LArNoiseBurst";
604 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
605 m_nt_EF_xe60_LArNoiseBurst = m_trigDec->isPassed( mychain );
606 }
607 mychain = "EF_j55_u0uchad_firstempty_LArNoiseBurstT";
608 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
610 }
611 mychain = "EF_j100_u0uchad_LArNoiseBurstT";
612 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
613 m_nt_EF_j100_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
614 }
615 mychain = "EF_j165_u0uchad_LArNoiseBurstT";
616 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
617 m_nt_EF_j165_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
618 }
619 mychain = "EF_j130_u0uchad_LArNoiseBurstT";
620 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
621 m_nt_EF_j130_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
622 }
623 mychain = "EF_j35_u0uchad_empty_LArNoiseBurst";
624 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
626 }
627 mychain = "EF_j35_u0uchad_firstempty_LArNoiseBurst";
628 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
630 }
631 mychain = "EF_j80_u0uchad_LArNoiseBurstT";
632 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
633 m_nt_EF_j80_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
634 }
635
636 return StatusCode::SUCCESS;
637}
638
643 ATH_MSG_DEBUG ("in doEventProperties ");
644
645
647 // Retrieve event info
648 const xAOD::EventInfo* eventInfo = nullptr;
649 ATH_CHECK( evtStore()->retrieve(eventInfo) );
650
651 int run = eventInfo->runNumber();
652 m_nt_run = eventInfo->runNumber();
653 m_nt_evtId = eventInfo->eventNumber();
654 m_nt_evtTime = eventInfo->timeStamp();
655 m_nt_evtTime_ns = eventInfo->timeStampNSOffset();
656 m_nt_lb = eventInfo->lumiBlock();
657 m_nt_bcid = eventInfo->bcid();
658
659 ATH_MSG_DEBUG("Run Number: "<<run<<", event Id "<<m_nt_evtId<<", bcid = "<<m_nt_bcid);
660
662 const BunchCrossingCondData* bunchCrossing=*bccd;
663 if (!bunchCrossing) {
664 ATH_MSG_ERROR("Failed to retrieve Bunch Crossing obj");
665 return StatusCode::FAILURE;
666 }
667
668 m_nt_isbcidFilled = bunchCrossing->isFilled(m_nt_bcid);
669 m_nt_isbcidInTrain = bunchCrossing->isInTrain(m_nt_bcid);
670 m_nt_bunchtype = bunchCrossing->bcType(m_nt_bcid);
671 ATH_MSG_DEBUG("BCID is Filled: "<<m_nt_isbcidFilled);
672 ATH_MSG_DEBUG("BCID is in Train: "<<m_nt_isbcidInTrain);
673 ATH_MSG_DEBUG("bunch type "<<m_nt_bunchtype);
674 //this function may return -1
675 int distFromFront = bunchCrossing->distanceFromFront(m_nt_bcid,BunchCrossingCondData::BunchCrossings);
676 if (distFromFront < 0)[[unlikely]]{
677 ATH_MSG_ERROR("distanceFromFront returned "<<distFromFront);
678 return StatusCode::FAILURE;
679 }
680 if(std::cmp_less(m_frontbunches, distFromFront)) distFromFront=static_cast<int>(m_frontbunches);
681
682 bool checkfirstbunch = true;
683 for(int i=1;i<=distFromFront;i++){
684 bool isFilled=bunchCrossing->isFilled(m_nt_bcid-i);
685 ATH_MSG_DEBUG("bunch "<<i<<" is Filled "<<isFilled);
686 m_nt_isBunchesInFront.push_back(isFilled);
687 if(isFilled){
688 if(i!=1){ //is this correct??
689 if(checkfirstbunch){
690 float time = 25.0*i;
691 m_nt_bunchtime = time;
692 ATH_MSG_DEBUG("next bunch time: "<<time<<" ns ");
693 checkfirstbunch = false;
694 }
695 }
696 }
697 }
698
699 m_CosmicCaloStream = false;
700
701 for (const auto& streamInfo : eventInfo->streamTags()) {
702 const std::string& stream_name = streamInfo.name();
703 const std::string& stream_type = streamInfo.type();
704 m_nt_streamTagName.push_back(stream_name);
705 m_nt_streamTagType.push_back(stream_type);
706 ATH_MSG_DEBUG("event stream tag name "<<streamInfo.name());
707 ATH_MSG_DEBUG("event stream tag type "<<streamInfo.type());
708 if(streamInfo.name()=="CosmicCalo" && streamInfo.type()=="physics"){
709 m_CosmicCaloStream = true;
710 }
711 }
712
713
714 // LArEventInfo
715
719
731
732
733
734 // Retrieve LArCollision Timing information
735 const LArCollisionTime * larTime=nullptr;
736 if (evtStore()->contains<LArCollisionTime>("LArCollisionTime")) {
737 StatusCode sc = evtStore()->retrieve(larTime,"LArCollisionTime");
738 if( sc.isFailure()){
739 ATH_MSG_WARNING ( "Unable to retrieve LArCollisionTime event store" );
740 //return StatusCode::SUCCESS; // Check if failure shd be returned. VB
741 }else {
742 ATH_MSG_DEBUG ( "LArCollisionTime successfully retrieved from event store" );
743 }
744 }
745
746 if (larTime) {
747 m_nt_nCellA = larTime->ncellA();
748 m_nt_nCellC = larTime->ncellC();
749 if(m_nt_nCellA>0 && m_nt_nCellC>0){
750 // Calculate the time diff between ECC and ECA
751 m_nt_ECTimeDiff = larTime->timeC() - larTime->timeA();
752 m_nt_ECTimeAvg = (larTime->timeC() + larTime->timeA()) * 0.5;
753 ATH_MSG_DEBUG ( "LAr: Calculated time difference of " << m_nt_ECTimeDiff << " ns" );
754 }
755 }
756
757 return StatusCode::SUCCESS;
758}
759
764 ATH_MSG_DEBUG ( "in doLarCellInfo " );
765 const EventContext& ctx = Gaudi::Hive::currentContext();
766
768 const LArOnOffIdMapping* cabling=*larCablingHdl;
769 if(!cabling) {
770 ATH_MSG_WARNING("Do not have cabling info, not storing LarCellInfo ");
771 return StatusCode::SUCCESS;
772 }
773
775 const LArBadChannelCont* bcCont=*bcHdl;
776 if(!bcCont) {
777 ATH_MSG_WARNING("Do not have bad chan info, not storing LarCellInfo ");
778 return StatusCode::SUCCESS;
779 }
780
782 ATH_CHECK(caloMgrHandle.isValid());
783 const CaloDetDescrManager* caloMgr = *caloMgrHandle;
784
785 // first fill HVline from NoisyROSummary object
787 if(noisyRO.isValid()) {
788 auto hwidlist = noisyRO->get_noisy_hvlines();
789 for (auto hw : hwidlist) {
790 m_nt_badHVlines.push_back(hw.get_identifier32().get_compact());
791 }
792 m_nt_badHVPartitions = noisyRO->HVlineFlaggedPartitions();
793 } else {
794 ATH_MSG_WARNING("Do not have LArNoisyROSummary object, no HVlines filled !!");
795 }
796
797 // Retrieve LAr calocells container
798 // or LArRawChannel container, whatsever available...
799 const CaloCellContainer* caloTES=nullptr;
800 const LArRawChannelContainer* LArTES=nullptr;
801 const LArRawChannelContainer* LArTES_dig=nullptr;
802 if(evtStore()->contains<CaloCellContainer>("AllCalo")) {
803 ATH_CHECK(evtStore()->retrieve( caloTES, "AllCalo"));
804 } else if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels") || evtStore()->contains<LArRawChannelContainer>("LArRawChannels_fB")) {
805 if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels")) {
806 ATH_CHECK(evtStore()->retrieve( LArTES_dig, "LArRawChannels"));
807 }
808 if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels_fB")) {
809 ATH_CHECK(evtStore()->retrieve( LArTES, "LArRawChannels_fB"));
810 }
811 }
812
813 if (caloTES==nullptr && LArTES==nullptr) {
814 ATH_MSG_WARNING ( "Neither CaloCell nor LArRawChannel Containers found!" );
815 return StatusCode::SUCCESS;
816 }
817
818 m_nb_sat = 0;
819 m_noisycell =0;
820 nlarcell = 0;
821 v_barrelec_noisy.clear(); v_posneg_noisy.clear();
822 v_ft_noisy.clear();v_slot_noisy.clear();v_channel_noisy.clear();
823 v_isbarrel.clear();v_isendcap.clear();v_isfcal.clear();v_ishec.clear();
824 v_layer.clear();v_partition.clear();v_energycell.clear();v_qfactorcell.clear();
825 v_phicell.clear();v_etacell.clear();v_signifcell.clear();v_isbadcell.clear();
826 v_IdHash.clear();v_noisycellHVeta.clear();v_noisycellHVphi.clear();
828
829 float eCalo;
830 float qfactor;
832
834
835 if(caloTES) {
836 for (const CaloCell* cell : *caloTES) {
837 const CaloDetDescrElement* caloDDE = cell->caloDDE();
838 if (caloDDE->is_tile())continue;
839 HWIdentifier onlID;
840 try {onlID = cabling->createSignalChannelID(cell->ID());}
841 catch(LArID_Exception& except) {
842 ATH_MSG_ERROR ( "LArID_Exception " << m_LArEM_IDHelper->show_to_string(cell->ID()) << " " << (std::string) except );
843 ATH_MSG_ERROR ( "LArID_Exception " << m_LArHEC_IDHelper->show_to_string(cell->ID()) );
844 ATH_MSG_ERROR ( "LArID_Exception " << m_LArFCAL_IDHelper->show_to_string(cell->ID()) );
845 continue;
846 }
847 bool connected = cabling->isOnlineConnected(onlID);
848 if(!connected) continue;
849 eCalo = cell->energy();
850 qfactor = cell->quality();
851 gain = cell->gain();
852 //if(qfactor > 0. || cell->ID() == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cell->ID()<<" : "<<eCalo<<" "<<qfactor<<" "<<gain<<" prov.: "<<cell->provenance());
853 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
854 }//loop over cells
855 ATH_MSG_DEBUG("Done cells "<<nlarcell);
856 } else {
857 std::vector<HWIdentifier> chdone;
858 if (LArTES_dig) {
859 LArRawChannelContainer::const_iterator caloItr;
860 for(caloItr=LArTES_dig->begin();caloItr!=LArTES_dig->end();++caloItr){
861 HWIdentifier onlID=caloItr->identify();
862 bool connected = cabling->isOnlineConnected(onlID);
863 if(!connected) continue;
864 eCalo = caloItr->energy();
865 qfactor = caloItr->quality();
866 gain = caloItr->gain();
867 //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain);
868 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
869 chdone.push_back(onlID);
870 }//loop over raw channels
871 }
872 ATH_MSG_DEBUG("Done raw chan. from digi "<<nlarcell);
873 // dirty hack, if we are already complete:
874 if (nlarcell < 182468 && LArTES) { // add those raw channels, which were not from dig.
875 LArRawChannelContainer::const_iterator caloItr;
876 for(caloItr=LArTES->begin();caloItr!=LArTES->end();++caloItr){
877 HWIdentifier onlID=caloItr->identify();
878 if(std::find(chdone.begin(), chdone.end(), onlID) != chdone.end()) continue;
879 bool connected = cabling->isOnlineConnected(onlID);
880 if(!connected) continue;
881 eCalo = caloItr->energy();
882 qfactor = caloItr->quality();
883 gain = caloItr->gain();
884 //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain);
885 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
886 }//loop over raw channels
887 }
888 ATH_MSG_DEBUG("Done raw chan. "<<nlarcell);
889 } // if raw chanels
890
892 if(caloTES) {
893 m_nt_cellsize = caloTES->size();
894 }
895 else if (LArTES) {
896 m_nt_cellsize = LArTES->size();
897 }
898 ATH_MSG_DEBUG ("lar cell size = "<<int(nlarcell));
899 if(caloTES) ATH_MSG_DEBUG ("all cell size = "<<int(caloTES->size()));
900 else {
901 if(LArTES_dig) ATH_MSG_DEBUG ("all LArRawCh. from digi size = "<<int(LArTES_dig->size()));
902 if(LArTES) ATH_MSG_DEBUG ("all LArRawCh. size = "<<int(LArTES->size()));
903 }
904
905 //if (nlarcell > 0)
906 // m_nt_noisycellpercent = 100.0*double(n_noisycell)/double(nlarcell);
907 //else
908 // m_nt_noisycellpercent = 0;
909
910 bool checknoise = false;
911 //ratio of noisy cells per partition
912 for(unsigned int i=0;i<8;i++){
913 float noise = 100.0*(double(n_noisy_cell_part[i])/double(n_cell_part[i]));
914 m_nt_noisycellpart.push_back(noise);
915 if(noise> 1.0){
916 checknoise = true;
917 ATH_MSG_DEBUG ("noise burst in this event ");
918 }
919 }
920
921 const LArDigitContainer* LArDigitCont=nullptr;
922 if (evtStore()->contains<LArDigitContainer>("FREE")) ATH_CHECK(evtStore()->retrieve( LArDigitCont, "FREE"));
923 if(!LArDigitCont) {
924 if (evtStore()->contains<LArDigitContainer>("LArDigitContainer_Thinned")) ATH_CHECK(evtStore()->retrieve( LArDigitCont, "LArDigitContainer_Thinned"));
925 }
926 if (!LArDigitCont) {
927 ATH_MSG_WARNING ( "LArDigitContainer Container not found!" );
928 return StatusCode::SUCCESS;
929 }
930
931 bool store_condition = false;
932 // CosmicCalo stream : Store detailed infos of cells only if Y3Sigma>1% or burst found by LArNoisyRO
934 if(checknoise==true || m_nt_larflag_badFEBs || m_nt_larflag_tightSaturatedDQ){
935 store_condition = true;
936 }
937 }
938 // Not cosmicCalo stream : Store detailed infos of cells only if burst found by LArNoisyRO
941 store_condition = true;
942 }
943 }
944
945 //store the information of the noisy cell only when %noisycells > 1%.
946 if(store_condition){
947 std::vector<short> samples;
948 samples.clear();
949 for(unsigned int k=0;k<v_etacell.size();k++){
950 m_nt_samples.push_back(samples);
951 m_nt_gain.push_back(0);
952 }
953 for (const LArDigit* pLArDigit : *LArDigitCont) {
954 HWIdentifier id2 = pLArDigit->hardwareID();
955 IdentifierHash hashid2 = m_LArOnlineIDHelper->channel_Hash(id2);
956 for(unsigned int j=0;j<v_IdHash.size();j++){
957 if (hashid2 == v_IdHash[j] ){
958 ATH_MSG_DEBUG ( "find a IdentifierHash of the noisy cell in LArDigit container " );
959 samples = pLArDigit->samples();
960 int gain=-1;
961 if (pLArDigit->gain() == CaloGain::LARHIGHGAIN) gain = 0;
962 if (pLArDigit->gain() == CaloGain::LARMEDIUMGAIN) gain = 1;
963 if (pLArDigit->gain() == CaloGain::LARLOWGAIN) gain = 2;
964 m_nt_gain.at(j)= gain;
965 m_nt_samples.at(j) = samples;
966 ATH_MSG_DEBUG ( "I got the samples!" );
967 break;
968 }
969 }
970 }
971 for(unsigned int i=0;i<v_etacell.size();i++){
972 m_nt_energycell.push_back( v_energycell[i]);
973 m_nt_qfactorcell.push_back( v_qfactorcell[i]);
974 m_nt_signifcell.push_back( v_signifcell[i]);
975 m_nt_partition.push_back( v_partition[i]);
976 m_nt_cellIdentifier.push_back(v_cellIdentifier[i].get_identifier32().get_compact());
977 m_nt_onlIdentifier.push_back(v_onlIdentifier[i].get_identifier32().get_compact());
978 if(!m_keepOnlyCellID){
980 m_nt_posneg_noisy.push_back( v_posneg_noisy[i]);
981 m_nt_ft_noisy.push_back( v_ft_noisy[i]);
982 m_nt_slot_noisy.push_back( v_slot_noisy[i]);
983 m_nt_channel_noisy.push_back( v_channel_noisy[i]);
984
985 /*
986 m_nt_isbarrel.push_back( v_isbarrel[i]);
987 m_nt_isendcap.push_back( v_isendcap[i]);
988 m_nt_isfcal.push_back( v_isfcal[i]);
989 m_nt_ishec.push_back( v_ishec[i]);
990 */
991
992 m_nt_layer.push_back( v_layer[i]);
993 m_nt_phicell.push_back( v_phicell[i]);
994 m_nt_etacell.push_back( v_etacell[i]);
995 m_nt_isbadcell.push_back( v_isbadcell[i]);
999 }
1000 }
1001 ATH_MSG_DEBUG ("leaving if checknoise and larnoisyro");
1002
1003 }//if(checknoisy==true ..)
1004
1005 return StatusCode::SUCCESS;
1006
1007}
1008
1010 , float eCalo
1011 , float qfactor
1012 , CaloGain::CaloGain gain
1013 , const LArOnOffIdMapping* cabling
1014 , const LArBadChannelCont* bcCont
1015 , const CaloNoise& totalNoise
1016 , const CaloDetDescrManager* caloMgr)
1017{
1018 const Identifier idd = cabling->cnvToIdentifier(onlID);
1019 nlarcell++;
1020 IdentifierHash channelHash = m_LArOnlineIDHelper->channel_Hash(onlID);
1021 const CaloDetDescrElement *caloDDE = caloMgr->get_element(idd);
1022 int layer = caloDDE->getLayer();
1023 // CaloCell_ID::CaloSample sampling = (*caloItr)->caloDDE()->getSampling();
1024 float phi = caloDDE->phi();
1025 float noise = totalNoise.getNoise (idd, gain);
1026 float significance = eCalo / noise ;
1027 float eta = caloDDE->eta();
1028 bool badcell = ! (bcCont->status(onlID)).good();
1029 unsigned int partition = 0;
1030 bool is_lar_em_barrel = caloDDE->is_lar_em_barrel();
1031 if(is_lar_em_barrel){
1032 if(eta<0){
1033 partition = 0;
1034 }else{
1035 partition = 1;
1036 }
1037 }//barrel
1038 bool is_lar_em_endcap = caloDDE->is_lar_em_endcap();
1039 if(is_lar_em_endcap){
1040 if(eta<0){
1041 partition = 2;
1042 }else{
1043 partition = 3;
1044 }
1045 }//endcap
1046 bool is_lar_fcal = caloDDE->is_lar_fcal();
1047 if(is_lar_fcal){
1048 if(eta<0){
1049 partition = 4;
1050 }else{
1051 partition = 5;
1052 }
1053 }//fcal
1054 bool is_lar_hec = caloDDE->is_lar_hec();
1055 if(is_lar_hec){
1056 if(eta<0){
1057 partition = 6;
1058 }else{
1059 partition = 7;
1060 }
1061 }//hec
1062 for(unsigned int k=0;k<8;k++){
1063 if(partition==k){
1064 n_cell_part[k]++;
1065 }
1066 }
1067 if(qfactor <1000) {m_lowqfactor++;}
1068 if(qfactor>=1000 && qfactor<10000) {m_medqfactor++;}
1069 if(qfactor>=10000 && qfactor<65535){m_hiqfactor++;}
1070 if(qfactor==65535){
1071 ATH_MSG_DEBUG ("Satured cell at eta: "<<eta<<", phi: "<<phi<<", energy: "<<eCalo<<", partition: "<<partition);
1072 m_nb_sat = m_nb_sat +1;
1073 m_nt_partition_sat.push_back(partition);
1074 m_nt_energy_sat.push_back(eCalo);
1075 m_nt_cellIdentifier_sat.push_back((cabling->cnvToIdentifier(onlID)).get_identifier32().get_compact());
1076 if(!m_keepOnlyCellID){
1077 m_nt_barrelec_sat.push_back(m_LArOnlineIDHelper->barrel_ec(onlID));
1078 m_nt_posneg_sat.push_back(m_LArOnlineIDHelper->pos_neg(onlID));
1079 m_nt_ft_sat.push_back(m_LArOnlineIDHelper->feedthrough(onlID));
1080 m_nt_slot_sat.push_back(m_LArOnlineIDHelper->slot(onlID));
1081 m_nt_channel_sat.push_back(m_LArOnlineIDHelper->channel(onlID));
1082 m_nt_phicell_sat.push_back(phi);
1083 m_nt_etacell_sat.push_back(eta);
1084 m_nt_layer_sat.push_back(layer);
1085 m_nt_isbadcell_sat.push_back(badcell);
1086 }
1087 }
1088 // Store all cells in positive and negative 3 sigma tails...
1089 if(significance > m_sigmacut || qfactor > 4000){
1090 v_barrelec_noisy.push_back(m_LArOnlineIDHelper->barrel_ec(onlID));
1091 v_posneg_noisy.push_back(m_LArOnlineIDHelper->pos_neg(onlID));
1092 v_ft_noisy.push_back(m_LArOnlineIDHelper->feedthrough(onlID));
1093 v_slot_noisy.push_back(m_LArOnlineIDHelper->slot(onlID));
1094 v_channel_noisy.push_back(m_LArOnlineIDHelper->channel(onlID));
1095
1096 /*
1097 v_isbarrel.push_back(is_lar_em_barrel);
1098 v_isendcap.push_back(is_lar_em_endcap);
1099 v_isfcal.push_back(is_lar_fcal);
1100 v_ishec.push_back(is_lar_hec);
1101 */
1102
1103 v_layer.push_back(layer);
1104 v_energycell.push_back(eCalo);
1105 v_qfactorcell.push_back(qfactor);
1106 v_phicell.push_back(phi);
1107 v_etacell.push_back(eta);
1108 v_signifcell.push_back(significance);
1109 v_isbadcell.push_back(badcell);
1110 v_partition.push_back(partition);
1111 v_IdHash.push_back(channelHash);
1112 v_cellIdentifier.push_back(cabling->cnvToIdentifier(onlID));
1113 v_onlIdentifier.push_back(onlID);
1114 // ...but count only cells in positive 3 sigma tails!
1115 if (significance > m_sigmacut){
1116 m_noisycell++;
1117 ATH_MSG_DEBUG ("Noisy cell: "<<m_noisycell<<" "<<cabling->cnvToIdentifier(onlID)<<" q: "<<qfactor<<" sign.: "<<significance<<" noise: "<<noise);
1118 for(unsigned int k=0;k<8;k++){
1119 if(partition==k){
1120 n_noisy_cell_part[k]++;
1121 }
1122 }
1123 }
1124 int caloindex = GetPartitionLayerIndex(idd);
1125 v_cellpartlayerindex.push_back(caloindex);
1126 v_noisycellHVphi.push_back(m_LArElectrodeIDHelper->hv_phi(onlID));
1127 v_noisycellHVeta.push_back(m_LArElectrodeIDHelper->hv_eta(onlID));
1128
1129
1130 }
1131 return StatusCode::SUCCESS;
1132}
1133
1135{
1136 // O.Simard -- GetPartitionLayer index [0,32]:
1137 // Returns a single integer code that corresponds to the
1138 // mapping of CaloCells in CaloMonitoring histogram frames.
1139
1140 int caloindex = -1;
1141 int bc = 0;
1142 int sampling = 0;
1143
1144 if(m_LArEM_IDHelper->is_lar_em(id)){ // EMB
1145 bc = m_LArEM_IDHelper->barrel_ec(id);
1146 sampling = m_LArEM_IDHelper->sampling(id);
1147 if(abs(bc)==1){
1148 if(bc<0) caloindex = sampling+4;
1149 else caloindex = sampling;
1150 } else { // EMEC
1151 if(bc<0) caloindex = sampling+12;
1152 else caloindex = sampling+8;
1153 }
1154 } else if(m_LArHEC_IDHelper->is_lar_hec(id)) { // LAr HEC
1155 bc = m_LArHEC_IDHelper->pos_neg(id);
1156 sampling = m_LArHEC_IDHelper->sampling(id);
1157 if(bc<0) caloindex = sampling+20;
1158 else caloindex = sampling+16;
1159 } else if(m_LArFCAL_IDHelper->is_lar_fcal(id)) { // LAr FCAL
1160 bc = m_LArFCAL_IDHelper->pos_neg(id);
1161 sampling = (int)m_LArFCAL_IDHelper->module(id); // module instead of sampling
1162 if(bc<0) caloindex = sampling+26;
1163 else caloindex = sampling+23;
1164 }
1165
1166 return caloindex;
1167}
1168
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
LArBadXCont< LArBadChannel > LArBadChannelCont
int n_cell_part[8]
std::vector< int > v_cellpartlayerindex
std::vector< float > v_signifcell
std::vector< float > v_qfactorcell
std::vector< bool > v_isbadcell
std::vector< bool > v_isendcap
std::vector< short > v_slot_noisy
std::vector< float > v_etacell
int n_noisy_cell_part[8]
std::vector< HWIdentifier > v_onlIdentifier
std::vector< float > v_phicell
std::vector< Identifier > v_cellIdentifier
int nlarcell
LArNoiseBursts Author: Josu Cantero UAM, November, 2010 Modified by Hideki Okawa BNL,...
std::vector< short > v_layer
std::vector< short > v_posneg_noisy
std::vector< bool > v_isbarrel
std::vector< IdentifierHash > v_IdHash
std::vector< short > v_barrelec_noisy
std::vector< float > v_energycell
std::vector< bool > v_isfcal
std::vector< bool > v_ishec
std::vector< short > v_channel_noisy
std::vector< int > v_noisycellHVphi
std::vector< int > v_noisycellHVeta
std::vector< int > v_partition
std::vector< short > v_ft_noisy
static Double_t sc
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
int distanceFromFront(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
@ BunchCrossings
Distance in units of 25 nanoseconds.
BunchCrossingType bcType(const bcid_type bcid) const
Convenience function for the type of the specific bunch crossing.
bool isInTrain(const bcid_type bcid) const
Function deciding if a given bunch crossing is in a filled train.
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Container class for CaloCell.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition CaloCell_ID.h:75
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition CaloCell_ID.h:63
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition CaloCell_ID.h:69
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
virtual int getLayer() const
cell layer
bool is_lar_em_endcap() const
cell belongs to EM end cap
bool is_lar_hec() const
cell belongs to HEC
bool is_lar_em_barrel() const
cell belongs to EM barrel
bool is_lar_fcal() const
cell belongs to FCAL
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class provides the client interface for accessing the detector description information common to...
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:35
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
Holds information about collisions timing from end-cap LAr calorimeters.
int ncellA() const
get number of cells for time A side
double timeA() const
time A side
int ncellC() const
get number of cells for time C side
double timeC() const
time C side
Container class for LArDigit.
Liquid Argon digit base class.
Definition LArDigit.h:25
Helper for the Liquid Argon Calorimeter cell at the electrode level.
Helper for the Liquid Argon Calorimeter High-Voltage identifiers.
Definition LArHVLineID.h:43
Exception class for LAr Identifiers.
std::vector< short > m_nt_cellpartlayerindex
std::vector< float > m_nt_etacell
const LArHEC_ID * m_LArHEC_IDHelper
const LArHVLineID * m_LArHVLineIDHelper
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
bool m_nt_larflag_mediumSaturatedDQ
bool m_nt_larflag_dataCorruptedVeto
std::vector< short > m_nt_ft_sat
std::vector< float > m_nt_signifcell
std::vector< int > m_nt_noisycellHVphi
bool m_nt_larflag_tightSaturatedDQ
std::vector< float > m_nt_phicell
std::vector< unsigned int > m_nt_badHVlines
virtual StatusCode clear()
Clear - clear CBNT members.
std::vector< int > m_nt_partition
bool m_nt_EF_j165_u0uchad_LArNoiseBurstT
bool m_nt_EF_j30_u0uchad_empty_LArNoiseBurst
int GetPartitionLayerIndex(const Identifier &id)
unsigned int m_nt_stablebeams
std::vector< short > m_nt_posneg_noisy
StatusCode doLArNoiseBursts()
virtual StatusCode finalize() override
Finalize - delete any memory allocation from the heap.
virtual StatusCode initialize() override
std::vector< float > m_nt_etacell_sat
bool m_nt_EF_j165_u0uchad_LArNoiseBurst
bool m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurstT
bool m_nt_EF_j35_u0uchad_firstempty_LArNoiseBurst
const LArElectrodeID * m_LArElectrodeIDHelper
bool m_nt_EF_xe45_LArNoiseBurst
virtual StatusCode execute(const EventContext &ctx) override
Execute - on event by event.
std::vector< int > m_nt_layer_sat
std::vector< float > m_nt_energycell
const LArEM_ID * m_LArEM_IDHelper
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
bool m_nt_EF_j130_u0uchad_LArNoiseBurstT
ServiceHandle< ITHistSvc > m_thistSvc
std::vector< float > m_nt_energy_sat
std::vector< short > m_nt_barrelec_noisy
std::vector< short > m_nt_slot_noisy
std::vector< int > m_nt_isbadcell
bool m_nt_EF_xe55_LArNoiseBurst
bool m_nt_larflag_noiseBurstVeto
const LArOnlineID * m_LArOnlineIDHelper
std::vector< int > m_nt_noisycellHVeta
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
bool m_nt_EF_j55_u0uchad_empty_LArNoiseBurst
std::vector< int > m_nt_partition_sat
std::vector< int > m_nt_layer
std::vector< float > m_nt_noisycellpart
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
std::vector< int > m_nt_posneg_sat
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
StatusCode doTrigger()
methods called by execute()
bool m_nt_EF_j80_u0uchad_LArNoiseBurstT
std::vector< int > m_nt_barrelec_sat
std::vector< std::string > m_nt_streamTagType
bool m_nt_EF_j35_u0uchad_empty_LArNoiseBurst
std::vector< int > m_nt_isbadcell_sat
SG::ReadHandleKey< LArNoisyROSummary > m_NoisyROKey
bool m_nt_EF_xe60_LArNoiseBurst
std::vector< float > m_nt_qfactorcell
LArNoiseBursts(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
bool m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurst
std::vector< short > m_nt_slot_sat
std::vector< float > m_nt_phicell_sat
unsigned int m_nt_atlasready
bool m_nt_larflag_dataCorrupted
std::vector< unsigned int > m_nt_cellIdentifier_sat
std::vector< unsigned int > m_nt_cellIdentifier
std::vector< unsigned int > m_nt_onlIdentifier
std::vector< int > m_nt_gain
StatusCode fillCell(HWIdentifier onlID, float eCalo, float qfactor, CaloGain::CaloGain gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const CaloNoise &totalNoise, const CaloDetDescrManager *caloMgr)
unsigned int m_frontbunches
bool m_nt_EF_j100_u0uchad_LArNoiseBurstT
bool m_nt_larflag_mnbTight_psveto
uint8_t m_nt_badHVPartitions
unsigned long m_nt_evtId
std::vector< short > m_nt_ft_noisy
StatusCode doEventProperties()
const LArFCAL_ID * m_LArFCAL_IDHelper
std::vector< std::vector< short > > m_nt_samples
std::vector< short > m_nt_channel_sat
std::vector< short > m_nt_channel_noisy
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
std::vector< int > m_nt_isBunchesInFront
std::vector< std::string > m_nt_streamTagName
Container for LArRawChannel (IDC using LArRawChannelCollection).
virtual bool isValid() override final
Can the handle be successfully dereferenced?
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
@ LAr
The LAr calorimeter.
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
const std::vector< StreamTag > & streamTags() const
Get the streams that the event was put in.
uint32_t runNumber() const
The current event's run number.
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
uint64_t eventNumber() const
The current event's event number.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
EventInfo_v1 EventInfo
Definition of the latest event info version.
#define unlikely(x)
int run(int argc, char *argv[])