ATLAS Offline Software
Loading...
Searching...
No Matches
LArNoiseBursts.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
10
11#include "GaudiKernel/ThreadLocalContext.h"
13
22
24
25#include "Identifier/Range.h"
28
32
39
42
43// Lar HV
46
48
49#include "TTree.h"
50#include "CLHEP/Vector/LorentzVector.h"
51
53
55
57
58#include <algorithm>
59#include <math.h>
60#include <functional>
61#include <iostream>
62
63using namespace std;
64
66int n_noisy_cell_part[8] = {0,0,0,0,0,0,0,0};
67int n_cell_part[8] = {0,0,0,0,0,0,0,0};
70std::vector<short> v_layer;
73std::vector<float> v_phicell, v_etacell;
74std::vector<bool> v_isbadcell;
75std::vector<IdentifierHash> v_IdHash;
76std::vector<int> v_cellpartlayerindex;
77std::vector<Identifier> v_cellIdentifier;
78std::vector<HWIdentifier> v_onlIdentifier;
79
82
83
84LArNoiseBursts::LArNoiseBursts(const std::string& name,
85 ISvcLocator* pSvcLocator)
86 : AthAlgorithm(name, pSvcLocator),
87 m_tree(nullptr),
88 m_LArOnlineIDHelper(nullptr),
89 m_LArHVLineIDHelper(nullptr),
91 m_LArEM_IDHelper(nullptr),
92 m_LArFCAL_IDHelper(nullptr),
93 m_LArHEC_IDHelper(nullptr),
94 m_CosmicCaloStream(false),
95 m_nb_sat(0),
96 m_lowqfactor(0),
97 m_medqfactor(0),
98 m_hiqfactor(0),
99 m_noisycell(0),
101 m_nt_cellsize(0),
102 m_nt_run(0),
103 m_nt_evtId(0),
104 m_nt_evtTime(0),
106 m_nt_lb(0),
107 m_nt_bcid(0),
108 //m_nt_ntracks(0),
130 m_nt_L1_J75(false),
131 m_nt_L1_J10_EMPTY(false),
133 m_nt_L1_J30_EMPTY(false),
134 m_nt_L1_XE40(false),
135 m_nt_L1_XE50(false),
136 m_nt_L1_XE50_BGRP7(false),
137 m_nt_L1_XE70(false),
154 m_nt_nCellA(0),
155 m_nt_nCellC(0),
158 m_nt_phicell(0),
159 m_nt_etacell(0),
161 //m_nt_noisycellpercent(0),
164 m_nt_ft_noisy(0),
173 m_nt_samples(0),
174 m_nt_gain(0),
177 m_nt_layer(0),
181 m_nt_ft_sat(0),
182 m_nt_slot_sat(0),
190 {
191
192 //event cuts
193 declareProperty("SigmaCut", m_sigmacut = 3.0);
194 declareProperty("NumberOfBunchesInFront",m_frontbunches = 36);
195
196 // Keep cell properties
197 declareProperty("KeepOnlyCellID", m_keepOnlyCellID = false);
198 }
199
201
202 ATH_MSG_DEBUG ( "Initializing LArNoiseBursts" );
203
204 // Trigger Decision Tool
205 ATH_CHECK( m_trigDec.retrieve() );
206
207 ATH_CHECK( m_cablingKey.initialize() );
208 ATH_CHECK( m_BCKey.initialize() );
209 ATH_CHECK( m_totalNoiseKey.initialize() );
210 ATH_CHECK( m_bcDataKey.initialize() );
211 ATH_CHECK( m_NoisyROKey.initialize() );
212
213 // Retrieve online ID helper
214 const LArOnlineID* LArOnlineIDHelper = nullptr;
215 ATH_CHECK( detStore()->retrieve(LArOnlineIDHelper, "LArOnlineID") );
216 m_LArOnlineIDHelper = LArOnlineIDHelper;
217 ATH_MSG_DEBUG( " Found LArOnline Helper");
218
219 // Retrieve HV line ID helper
220 const LArHVLineID* LArHVLineIDHelper = nullptr;
221 ATH_CHECK( detStore()->retrieve(LArHVLineIDHelper, "LArHVLineID") );
222 m_LArHVLineIDHelper = LArHVLineIDHelper;
223 ATH_MSG_DEBUG( " Found LArOnlineIDHelper Helper");
224
225 // Retrieve HV electrode ID helper
226 const LArElectrodeID* LArElectrodeIDHelper = nullptr;
227 ATH_CHECK( detStore()->retrieve(LArElectrodeIDHelper, "LArElectrodeID") );
228 m_LArElectrodeIDHelper = LArElectrodeIDHelper;
229 ATH_MSG_DEBUG( " Found LArElectrodeIDHelper Helper");
230
231 ATH_CHECK(m_caloMgrKey.initialize());
232
233 // Retrieve ID helpers
234 const CaloCell_ID* idHelper = nullptr;
235 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
236 m_LArEM_IDHelper = idHelper->em_idHelper();
237 m_LArHEC_IDHelper = idHelper->hec_idHelper();
238 m_LArFCAL_IDHelper = idHelper->fcal_idHelper();
239
241 ATH_CHECK( m_thistSvc.retrieve() );
242
244 m_tree = new TTree( "CollectionTree", "CollectionTree" );
245 std::string treeName = "/TTREE/CollectionTree" ;
246 ATH_CHECK( m_thistSvc->regTree(treeName, m_tree) );
247
248 // General properties of events
249 m_tree->Branch("Run",&m_nt_run,"Run/I");// Event ID
250 m_tree->Branch("EventId",&m_nt_evtId,"EventId/l");// Event ID
251 m_tree->Branch("EventTime",&m_nt_evtTime,"EventTime/I");// Event time
252 m_tree->Branch("EventTime_ns",&m_nt_evtTime_ns,"EventTime_ns/I");// Event time in nanosecond
253 m_tree->Branch("LumiBlock",&m_nt_lb,"LumiBlock/I"); // LB
254 m_tree->Branch("BCID",&m_nt_bcid,"BCID/I"); // BCID
255 m_tree->Branch("StreamTagName",&m_nt_streamTagName);// stream tag name
256 m_tree->Branch("StreamTagType",&m_nt_streamTagType); // stream tag type
257 m_tree->Branch("IsBCIDFilled", &m_nt_isbcidFilled,"IsBCIDFilled/I"); // check if bunch is filled
258 m_tree->Branch("IsBCIDInTrain",&m_nt_isbcidInTrain,"ISBCIDInTrain/I"); // check if bunch belong to a train
259 m_tree->Branch("BunchesInFront",&m_nt_isBunchesInFront); // check front bunches
260 m_tree->Branch("BunchType",&m_nt_bunchtype,"BunchType/I");// Empty = 0, FirstEmpty=1,&middleEmpty=2, Single=100,Front=200,&middle=201,Tail=202
261 m_tree->Branch("TimeAfterBunch",&m_nt_bunchtime,"TimeAfterBunch/F"); //time "distance" between the colliding bunch and the nearest one.
262 m_tree->Branch("ATLASIsReady",&m_nt_atlasready,"AtlasIsReady/I"); //check if atlas is ready for physics
263 m_tree->Branch("StableBeams",&m_nt_stablebeams,"StableBeams/I");//check stablebeams
264
265 // LAr event bit info
266 m_tree->Branch("larflag_badFEBs",&m_nt_larflag_badFEBs,"larflag_badFEBs/O");
267 m_tree->Branch("larflag_mediumSaturatedDQ",&m_nt_larflag_mediumSaturatedDQ,"larflag_mediumSaturatedDQ/O");
268 m_tree->Branch("larflag_tightSaturatedDQ",&m_nt_larflag_tightSaturatedDQ,"larflag_tightSaturatedDQ/O");
269 m_tree->Branch("larflag_noiseBurstVeto",&m_nt_larflag_noiseBurstVeto,"larflag_noiseBurstVeto/O");
270 m_tree->Branch("larflag_dataCorrupted",&m_nt_larflag_dataCorrupted,"larflag_dataCorrupted/O");
271 m_tree->Branch("larflag_dataCorruptedVeto",&m_nt_larflag_dataCorruptedVeto,"larflag_dataCorruptedVeto/O");
272 m_tree->Branch("larflag_badFEBS_w",&m_nt_larflag_badFEBS_w,"larflag_badFEBS_w/O");
273 m_tree->Branch("larflag_mnbLoose",&m_nt_larflag_mnbLoose,"larflag_mnbLoose/O");
274 m_tree->Branch("larflag_mnbTight",&m_nt_larflag_mnbTight,"larflag_mnbTight/O");
275 m_tree->Branch("larflag_mnbTight_psveto",&m_nt_larflag_mnbTight_psveto,"larflag_mnbTight_psveto/O");
276 m_tree->Branch("larflag_badHVlines",&m_nt_larflag_badHVlines,"larflag_badHVlines/O");
277
278 m_tree->Branch("badHVlinesPartitions",&m_nt_badHVPartitions,"badHVlinesPartitions/b");
279 // Bad HVlines vector
280 m_tree->Branch("badHVlines",&m_nt_badHVlines);
281
282 // trigger flags
283 m_tree->Branch("L1_J75",&m_nt_L1_J75,"L1_J75/O");
284 m_tree->Branch("L1_J10_EMPTY",&m_nt_L1_J10_EMPTY,"L1_J10_EMPTY/O");
285 m_tree->Branch("L1_J30_FIRSTEMPTY",&m_nt_L1_J30_FIRSTEMPTY,"L1_J30_FIRSTEMPTY/O");
286 m_tree->Branch("L1_J30_EMPTY",&m_nt_L1_J30_EMPTY,"L1_J30_EMPTY/O");
287 m_tree->Branch("L1_XE40",&m_nt_L1_XE40,"L1_XE40/O");
288 m_tree->Branch("L1_XE50",&m_nt_L1_XE50,"L1_XE50/O");
289 m_tree->Branch("L1_XE50_BGRP7",&m_nt_L1_XE50_BGRP7,"L1_XE50_BGRP7/O");
290 m_tree->Branch("L1_XE70",&m_nt_L1_XE70,"L1_XE70/O");
291
292 m_tree->Branch("EF_j165_u0uchad_LArNoiseBurst",&m_nt_EF_j165_u0uchad_LArNoiseBurst,"EF_j165_u0uchad_LArNoiseBurst/O");
293 m_tree->Branch("EF_j30_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j30_u0uchad_empty_LArNoiseBurst,"EF_j30_u0uchad_empty_LArNoiseBurst/O");
294 m_tree->Branch("EF_j55_u0uchad_firstempty_LArNoiseBurst",&m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurst,"EF_j55_u0uchad_firstempty_LArNoiseBurst/O");
295 m_tree->Branch("EF_j55_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j55_u0uchad_empty_LArNoiseBurst,"EF_j55_u0uchad_empty_LArNoiseBurst/O");
296 m_tree->Branch("EF_xe45_LArNoiseBurst",&m_nt_EF_xe45_LArNoiseBurst,"EF_xe45_LArNoiseBurst/O");
297 m_tree->Branch("EF_xe55_LArNoiseBurst",&m_nt_EF_xe55_LArNoiseBurst,"EF_xe55_LArNoiseBurst/O");
298 m_tree->Branch("EF_xe60_LArNoiseBurst",&m_nt_EF_xe60_LArNoiseBurst,"EF_xe60_LArNoiseBurst/O");
299 m_tree->Branch("EF_j55_u0uchad_firstempty_LArNoiseBurstT",&m_nt_EF_j55_u0uchad_firstempty_LArNoiseBurstT,"EF_j55_u0uchad_firstempty_LArNoiseBurstT/O");
300 m_tree->Branch("EF_j100_u0uchad_LArNoiseBurstT",&m_nt_EF_j100_u0uchad_LArNoiseBurstT,"EF_j100_u0uchad_LArNoiseBurstT/O");
301 m_tree->Branch("EF_j165_u0uchad_LArNoiseBurstT",&m_nt_EF_j165_u0uchad_LArNoiseBurstT,"EF_j165_u0uchad_LArNoiseBurstT/O");
302 m_tree->Branch("EF_j130_u0uchad_LArNoiseBurstT",&m_nt_EF_j130_u0uchad_LArNoiseBurstT,"EF_j130_u0uchad_LArNoiseBurstT/O");
303 m_tree->Branch("EF_j35_u0uchad_empty_LArNoiseBurst",&m_nt_EF_j35_u0uchad_empty_LArNoiseBurst,"EF_j35_u0uchad_empty_LArNoiseBurst/O");
304 m_tree->Branch("EF_j35_u0uchad_firstempty_LArNoiseBurst",&m_nt_EF_j35_u0uchad_firstempty_LArNoiseBurst,"EF_j35_u0uchad_firstempty_LArNoiseBurst/O");
305 m_tree->Branch("EF_j80_u0uchad_LArNoiseBurstT",&m_nt_EF_j80_u0uchad_LArNoiseBurstT,"EF_j80_u0uchad_LArNoiseBurstT/O");
306
307 //
308 m_tree->Branch("LArCellSize", &m_nt_larcellsize,"LArCellSize/I"); // NEW number of online conected LAr cells
309 m_tree->Branch("CaloCellSize",&m_nt_cellsize,"CaloCellSize/I");// NEW number of total cells.
310 // LAr time difference as computed by LArCollisionTime info
311 m_tree->Branch("LArTime_Diff",&m_nt_ECTimeDiff,"LArTime_Diff/F"); // time diff between 2 endcaps
312 m_tree->Branch("LArTime_Avg",&m_nt_ECTimeAvg,"LArTime_Avg/F"); // time average of 2 endcaps
313 m_tree->Branch("LArTime_nCellA",&m_nt_nCellA,"LArTime_nCellA/I"); // nb of cells used to compute endcap A time
314 m_tree->Branch("LArTime_nCellC",&m_nt_nCellC,"LArTime_nCellC/I"); // nb of cells used to compute endcap C time
315
316 // Event properties related to yield of channels in 3 sigma tails
317 //m_tree->Branch("PerCentNoisyCell",&m_nt_noisycellpercent,"PerCentNoisyCell/F"); // Yield of channels in 3sigma tails in whole LAr
318 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
319
320
321 // Properties of cells with fabs(energy/noise)>3
322 m_tree->Branch("NoisyCellPartitionLayerIndex",&m_nt_cellpartlayerindex);
323 m_tree->Branch("NoisyCellIdentifier",&m_nt_cellIdentifier); // Identifier of the noisy cell
324 m_tree->Branch("NoisyCellOnlineIdentifier",&m_nt_onlIdentifier); // Identifier of the noisy cell
325 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
326 m_tree->Branch("NoisyCellBarrelEc",&m_nt_barrelec_noisy); // BC
327 m_tree->Branch("NoisyCellPosNeg",&m_nt_posneg_noisy); // side
328 m_tree->Branch("NoisyCellFT",&m_nt_ft_noisy); // FT
329 m_tree->Branch("NoisyCellSlot",&m_nt_slot_noisy); // Slot
330 m_tree->Branch("NoisyCellChannel",&m_nt_channel_noisy); // Channel
331 m_tree->Branch("NoisyCellADCvalues", &m_nt_samples); // ADC values
332 m_tree->Branch("NoisyCellGain",&m_nt_gain); // Gain
333 m_tree->Branch("NoisyCellPhi",&m_nt_phicell); // Phi
334 m_tree->Branch("NoisyCellEta",&m_nt_etacell); // Eta
335 m_tree->Branch("NoisyCellLayer", &m_nt_layer); // layer
336 m_tree->Branch("NoisyCellHVphi", &m_nt_noisycellHVphi); // Phi of HV
337 m_tree->Branch("NoisyCellHVeta", &m_nt_noisycellHVeta); // Eta of HV
338 m_tree->Branch("NoisyCellEnergy",&m_nt_energycell); // Energy
339 m_tree->Branch("NoisyCellSignificance",&m_nt_signifcell); // Significance (energy/noise)
340 m_tree->Branch("NoisyCellQFactor",&m_nt_qfactorcell); // Q factor
341 m_tree->Branch("NoisyCellIsBad",&m_nt_isbadcell); // Bad channel status
342 // Event properties related to q factor
343 m_tree->Branch("nbLowQFactor", &m_lowqfactor,"m_lowqfactor/i"); // Nb of cells per event with q factor<1000
344 m_tree->Branch("nbMedQFactor", &m_medqfactor,"m_medqfactor/i"); // Nb of cells per event with 1000<q factor<10000
345 m_tree->Branch("nbHighQFactor", &m_hiqfactor,"m_hiqfactor/i"); // Nb of cells per event with q 10000<factor<65535
346 m_tree->Branch("nbSatQFactor",&m_nb_sat,"nbSat/i"); // Nb of cells per event with saturated q factor (65535)
347 // Properties of cells with q factor saturated
348 m_tree->Branch("SatCellPartition",&m_nt_partition_sat);
349 m_tree->Branch("SatCellBarrelEc",&m_nt_barrelec_sat);
350 m_tree->Branch("SatCellPosNeg",&m_nt_posneg_sat);
351 m_tree->Branch("SatCellFT",&m_nt_ft_sat);
352 m_tree->Branch("SatCellSlot",&m_nt_slot_sat);
353 m_tree->Branch("SatCellChannel",&m_nt_channel_sat);
354 m_tree->Branch("SatCellEnergy",&m_nt_energy_sat);
355 m_tree->Branch("SatCellPhi", &m_nt_phicell_sat);
356 m_tree->Branch("SatCellEta",&m_nt_etacell_sat);
357 m_tree->Branch("SatCellLayer",&m_nt_layer_sat);
358 m_tree->Branch("SatCellIsBad", &m_nt_isbadcell_sat);
359 m_tree->Branch("SatCellOnlineIdentifier",&m_nt_cellIdentifier_sat);
360
361
362 ATH_MSG_DEBUG ( "End of Initializing LArNoiseBursts" );
363
364 return StatusCode::SUCCESS;
365}
366
369
371 ATH_MSG_DEBUG ( "in finalize()" );
372 return StatusCode::SUCCESS;
373}
374
379
380 ATH_MSG_DEBUG ( "start clearing variables " );
381
382 m_nb_sat = 0;
383 m_noisycell = 0;
384 m_lowqfactor = 0;
385 m_medqfactor = 0;
386 m_hiqfactor = 0;
387
388 m_nt_run = 0;
389 m_nt_evtId = 0;
390 m_nt_evtTime = 0;
391 m_nt_evtTime_ns = 0;
392 m_nt_lb = 0;
393 m_nt_bcid = -1;
394
395 m_nt_streamTagName.clear();
396 m_nt_streamTagType.clear();
399 m_nt_isBunchesInFront.clear();
400 m_nt_bunchtype = -1;
401 m_nt_bunchtime = -1.0;
402 m_nt_atlasready = -1;
403 m_nt_stablebeams = -1;
404
405
406 ATH_MSG_DEBUG ( "clearing LAr event flags " );
407
408 // lar bit event info
409 m_nt_larflag_badFEBs = false;
416 m_nt_larflag_mnbLoose = false;
417 m_nt_larflag_mnbTight = false;
420
422 m_nt_badHVlines.clear();
423
424 ATH_MSG_DEBUG ( "clearing Pixel variables " );
425
426 // Trigger flags
427 m_nt_L1_J75 = true; // turned on for tests
428 m_nt_L1_J10_EMPTY = false;
430 m_nt_L1_J30_EMPTY = false;
431 m_nt_L1_XE40 = false;
432 m_nt_L1_XE50 = false;
433 m_nt_L1_XE50_BGRP7 = false;
434 m_nt_L1_XE70 = false;
435
450
451 ATH_MSG_DEBUG ( "clearing noisy cells variables " );
452
453 //Quantities for noisy cells
454 m_nt_energycell.clear();
455 m_nt_qfactorcell.clear();
456 m_nt_phicell.clear();
457 m_nt_etacell.clear();
458 m_nt_signifcell.clear();
459 m_nt_isbadcell.clear();
460 m_nt_partition.clear();
461 m_nt_layer.clear();
462 //m_nt_noisycellpercent = -1;
463 m_nt_barrelec_noisy.clear();
464 m_nt_posneg_noisy.clear();
465 m_nt_ft_noisy.clear();
466 m_nt_slot_noisy.clear();
467 m_nt_channel_noisy.clear();
468 m_nt_larcellsize = -1;
469 m_nt_cellsize = -1;
471 m_nt_cellIdentifier.clear();
472 m_nt_onlIdentifier.clear();
473 m_nt_noisycellpart.clear();
474 m_nt_samples.clear();
475 m_nt_gain.clear();
476
478 m_nt_noisycellHVphi.clear();
479 m_nt_noisycellHVeta.clear();
480
481 ATH_MSG_DEBUG ( "clearing saturated cell variables " );
482
483 //clearing quantities for sat cells
484 m_nt_barrelec_sat.clear();
485 m_nt_posneg_sat.clear();
486 m_nt_ft_sat.clear();
487 m_nt_slot_sat.clear();
488 m_nt_channel_sat.clear();
489 m_nt_partition_sat.clear();
490 m_nt_energy_sat.clear();
491 m_nt_phicell_sat.clear();
492 m_nt_etacell_sat.clear();
493 m_nt_layer_sat.clear();
495 m_nt_isbadcell_sat.clear();
496
497 ATH_MSG_DEBUG ( "clearing LArTimeDiff variables " );
498
499 //DiffTime computed with LAR
500 m_nt_ECTimeDiff = 9999;
501 m_nt_ECTimeAvg = 9999;
502 m_nt_nCellA = -1;
503 m_nt_nCellC = -1;
504
505 return StatusCode::SUCCESS;
506}
507
510
512 ATH_MSG_DEBUG ( "in execute()" );
513
514 StatusCode sc = clear();
515 if(sc.isFailure()) {
516 ATH_MSG_WARNING ( "The method clear() failed" );
517 return StatusCode::SUCCESS;
518 }
519
520 if(!m_trigDec.empty()){
521
522 sc = doTrigger();
523 if(sc.isFailure()) {
524 ATH_MSG_WARNING ( "The method doTrigger() failed" );
525 return StatusCode::SUCCESS;
526 }
527 }
528
530 if(sc.isFailure()) {
531 ATH_MSG_WARNING ( "The method doEventProperties() failed" );
532 return StatusCode::SUCCESS;
533 }
534
536 if (sc.isFailure()) {
537 ATH_MSG_WARNING ( "The method doLArNoiseBursts() failed" );
538 return StatusCode::SUCCESS;
539 }
540
541// sc = doPhysicsObjects();
542// if (sc.isFailure()) {
543// ATH_MSG_WARNING ( "The method doPhysicsObjects() failed" );
544// return StatusCode::SUCCESS;
545// }
546
547 m_tree->Fill();
548
549 return StatusCode::SUCCESS;
550}
551
556 ATH_MSG_DEBUG ("in doTrigger ");
557
558 std::string mychain( "L1_J75" );
559 if( ! m_trigDec->getListOfTriggers(mychain).empty() ){
560 m_nt_L1_J75 = m_trigDec->isPassed( mychain );
561 }
562 mychain = "L1_J10_EMPTY";
563 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
564 m_nt_L1_J10_EMPTY = m_trigDec->isPassed( mychain );
565 }
566 mychain = "L1_J30_FIRSTEMPTY";
567 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
568 m_nt_L1_J30_FIRSTEMPTY = m_trigDec->isPassed( mychain );
569 }
570 mychain = "L1_J30_EMPTY";
571 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
572 m_nt_L1_J30_EMPTY = m_trigDec->isPassed( mychain );
573 }
574 mychain = "L1_XE40";
575 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
576 m_nt_L1_XE40 = m_trigDec->isPassed( mychain );
577 }
578 mychain = "L1_XE50";
579 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
580 m_nt_L1_XE50 = m_trigDec->isPassed( mychain );
581 }
582 mychain = "L1_XE50_BGRP7";
583 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
584 m_nt_L1_XE50_BGRP7 = m_trigDec->isPassed( mychain );
585 }
586 mychain = "L1_XE70";
587 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
588 m_nt_L1_XE70 = m_trigDec->isPassed( mychain );
589 }
590
591 // EF
592 mychain = "EF_j165_u0uchad_LArNoiseBurst";
593 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
594 m_nt_EF_j165_u0uchad_LArNoiseBurst = m_trigDec->isPassed( mychain );
595 }
596 mychain = "EF_j30_u0uchad_empty_LArNoiseBurst";
597 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
599 }
600 mychain = "EF_j55_u0uchad_firstempty_LArNoiseBurst";
601 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
603 }
604 mychain = "EF_j55_u0uchad_empty_LArNoiseBurst";
605 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
607 }
608 mychain = "EF_xe45_LArNoiseBurst";
609 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
610 m_nt_EF_xe45_LArNoiseBurst = m_trigDec->isPassed( mychain );
611 }
612 mychain = "EF_xe55_LArNoiseBurst";
613 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
614 m_nt_EF_xe55_LArNoiseBurst = m_trigDec->isPassed( mychain );
615 }
616 mychain = "EF_xe60_LArNoiseBurst";
617 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
618 m_nt_EF_xe60_LArNoiseBurst = m_trigDec->isPassed( mychain );
619 }
620 mychain = "EF_j55_u0uchad_firstempty_LArNoiseBurstT";
621 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
623 }
624 mychain = "EF_j100_u0uchad_LArNoiseBurstT";
625 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
626 m_nt_EF_j100_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
627 }
628 mychain = "EF_j165_u0uchad_LArNoiseBurstT";
629 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
630 m_nt_EF_j165_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
631 }
632 mychain = "EF_j130_u0uchad_LArNoiseBurstT";
633 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
634 m_nt_EF_j130_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
635 }
636 mychain = "EF_j35_u0uchad_empty_LArNoiseBurst";
637 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
639 }
640 mychain = "EF_j35_u0uchad_firstempty_LArNoiseBurst";
641 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
643 }
644 mychain = "EF_j80_u0uchad_LArNoiseBurstT";
645 if( ! m_trigDec->getListOfTriggers(mychain).empty()){
646 m_nt_EF_j80_u0uchad_LArNoiseBurstT = m_trigDec->isPassed( mychain );
647 }
648
649 return StatusCode::SUCCESS;
650}
651
656 ATH_MSG_DEBUG ("in doEventProperties ");
657
658
660 // Retrieve event info
661 const xAOD::EventInfo* eventInfo = nullptr;
662 ATH_CHECK( evtStore()->retrieve(eventInfo) );
663
664 int run = eventInfo->runNumber();
665 m_nt_run = eventInfo->runNumber();
666 m_nt_evtId = eventInfo->eventNumber();
667 m_nt_evtTime = eventInfo->timeStamp();
668 m_nt_evtTime_ns = eventInfo->timeStampNSOffset();
669 m_nt_lb = eventInfo->lumiBlock();
670 m_nt_bcid = eventInfo->bcid();
671
672 ATH_MSG_DEBUG("Run Number: "<<run<<", event Id "<<m_nt_evtId<<", bcid = "<<m_nt_bcid);
673
675 const BunchCrossingCondData* bunchCrossing=*bccd;
676 if (!bunchCrossing) {
677 ATH_MSG_ERROR("Failed to retrieve Bunch Crossing obj");
678 return StatusCode::FAILURE;
679 }
680
681 m_nt_isbcidFilled = bunchCrossing->isFilled(m_nt_bcid);
682 m_nt_isbcidInTrain = bunchCrossing->isInTrain(m_nt_bcid);
683 m_nt_bunchtype = bunchCrossing->bcType(m_nt_bcid);
684 ATH_MSG_DEBUG("BCID is Filled: "<<m_nt_isbcidFilled);
685 ATH_MSG_DEBUG("BCID is in Train: "<<m_nt_isbcidInTrain);
686 ATH_MSG_DEBUG("bunch type "<<m_nt_bunchtype);
687
688 unsigned int distFromFront = bunchCrossing->distanceFromFront(m_nt_bcid,BunchCrossingCondData::BunchCrossings);
689 if(m_frontbunches < distFromFront) distFromFront=m_frontbunches;
690
691 bool checkfirstbunch = true;
692 for(unsigned int i=1;i<=distFromFront;i++){
693 bool isFilled=bunchCrossing->isFilled(m_nt_bcid-i);
694 ATH_MSG_DEBUG("bunch "<<i<<" is Filled "<<isFilled);
695 m_nt_isBunchesInFront.push_back(isFilled);
696 if(isFilled){
697 if(i!=1){
698 if(checkfirstbunch){
699 float time = 25.0*i;
700 m_nt_bunchtime = time;
701 ATH_MSG_DEBUG("next bunch time: "<<time<<" ns ");
702 checkfirstbunch = false;
703 }
704 }
705 }
706 }
707
708 m_CosmicCaloStream = false;
709 //std::vector<TriggerInfo::StreamTag>::const_iterator streamInfoIt=myTriggerInfo->streamTags().begin();
710 //std::vector<TriggerInfo::StreamTag>::const_iterator streamInfoIt_e=myTriggerInfo->streamTags().end();
711 //for (;streamInfoIt!=streamInfoIt_e;streamInfoIt++) {
712 for (const auto& streamInfo : eventInfo->streamTags()) {
713 const std::string& stream_name = streamInfo.name();
714 const std::string& stream_type = streamInfo.type();
715 m_nt_streamTagName.push_back(stream_name);
716 m_nt_streamTagType.push_back(stream_type);
717 ATH_MSG_DEBUG("event stream tag name "<<streamInfo.name());
718 ATH_MSG_DEBUG("event stream tag type "<<streamInfo.type());
719 if(streamInfo.name()=="CosmicCalo" && streamInfo.type()=="physics"){
720 m_CosmicCaloStream = true;
721 }
722 }
723
724
725 // LArEventInfo
726
730
742
743
745
746 //const AthenaAttributeList* attrList(0);
747 //ATH_CHECK( evtStore()->retrieve(attrList, "/TDAQ/RunCtrl/DataTakingMode") );
748 //if (attrList != 0) {
749 // ATH_MSG_DEBUG ("ReadyForPhysics is: " << (*attrList)["ReadyForPhysics"].data<uint32_t>());
750 // //m_valueCache = ((*attrList)["ReadyForPhysics"].data<uint32_t>() != 0);
751 // m_nt_atlasready = (*attrList)["ReadyForPhysics"].data<uint32_t>();
752 // }
753
754 /*const AthenaAttributeList* fillstate(0);
755 sc = evtStore()->retrieve(fillstate, "/LHC/DCS/FILLSTATE");
756 if (sc.isFailure()) {
757 ATH_MSG_WARNING ("Unable to retrieve fillstate information; falling back to" );
758 return StatusCode::SUCCESS;
759 }
760 if (fillstate != 0) {
761 ATH_MSG_DEBUG ("Stable beams is: " << (*fillstate)["StableBeams"].data<uint32_t>());
762 //m_valueCache = ((*attrList)["ReadyForPhysics"].data<uint32_t>() != 0);
763 m_nt_stablebeams.push_back((*fillstate)["StableBeams"].data<uint32_t>());
764 }*/
765
766
767 // 29/11/10 : Debug messages removed by BT
768 // mLog << MSG::INFO << "Event LAr flags " << std::hex
769 // << eventInfo->errorState(xAOD::EventInfo::LAr) << " "
770 // << std::hex << eventInfo->eventFlags(xAOD::EventInfo::LAr)
771 // << ", bit 0: " << eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,0)
772 // << ", bit 1: " << eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,1)
773 // << ", bit 2: " << eventInfo->isEventFlagBitSet(xAOD::EventInfo::LAr,2)
774 // << endmsg;
775
776 // Retrieve LArCollision Timing information
777 const LArCollisionTime * larTime=nullptr;
778 if (evtStore()->contains<LArCollisionTime>("LArCollisionTime")) {
779 StatusCode sc = evtStore()->retrieve(larTime,"LArCollisionTime");
780 if( sc.isFailure()){
781 ATH_MSG_WARNING ( "Unable to retrieve LArCollisionTime event store" );
782 //return StatusCode::SUCCESS; // Check if failure shd be returned. VB
783 }else {
784 ATH_MSG_DEBUG ( "LArCollisionTime successfully retrieved from event store" );
785 }
786 }
787
788 if (larTime) {
789 m_nt_nCellA = larTime->ncellA();
790 m_nt_nCellC = larTime->ncellC();
791 if(m_nt_nCellA>0 && m_nt_nCellC>0){
792 // Calculate the time diff between ECC and ECA
793 m_nt_ECTimeDiff = larTime->timeC() - larTime->timeA();
794 m_nt_ECTimeAvg = (larTime->timeC() + larTime->timeA()) * 0.5;
795 ATH_MSG_DEBUG ( "LAr: Calculated time difference of " << m_nt_ECTimeDiff << " ns" );
796 }
797 }
798
799 return StatusCode::SUCCESS;
800}
801
806 ATH_MSG_DEBUG ( "in doLarCellInfo " );
807 const EventContext& ctx = Gaudi::Hive::currentContext();
808
810 const LArOnOffIdMapping* cabling=*larCablingHdl;
811 if(!cabling) {
812 ATH_MSG_WARNING("Do not have cabling info, not storing LarCellInfo ");
813 return StatusCode::SUCCESS;
814 }
815
817 const LArBadChannelCont* bcCont=*bcHdl;
818 if(!bcCont) {
819 ATH_MSG_WARNING("Do not have bad chan info, not storing LarCellInfo ");
820 return StatusCode::SUCCESS;
821 }
822
824 ATH_CHECK(caloMgrHandle.isValid());
825 const CaloDetDescrManager* caloMgr = *caloMgrHandle;
826
827 // first fill HVline from NoisyROSummary object
829 if(noisyRO.isValid()) {
830 auto hwidlist = noisyRO->get_noisy_hvlines();
831 for (auto hw : hwidlist) {
832 m_nt_badHVlines.push_back(hw.get_identifier32().get_compact());
833 }
834 m_nt_badHVPartitions = noisyRO->HVlineFlaggedPartitions();
835 } else {
836 ATH_MSG_WARNING("Do not have LArNoisyROSummary object, no HVlines filled !!");
837 }
838
839 // Retrieve LAr calocells container
840 // or LArRawChannel container, whatsever available...
841 const CaloCellContainer* caloTES=nullptr;
842 const LArRawChannelContainer* LArTES=nullptr;
843 const LArRawChannelContainer* LArTES_dig=nullptr;
844 if(evtStore()->contains<CaloCellContainer>("AllCalo")) {
845 ATH_CHECK(evtStore()->retrieve( caloTES, "AllCalo"));
846 } else if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels") || evtStore()->contains<LArRawChannelContainer>("LArRawChannels_fB")) {
847 if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels")) {
848 ATH_CHECK(evtStore()->retrieve( LArTES_dig, "LArRawChannels"));
849 }
850 if (evtStore()->contains<LArRawChannelContainer>("LArRawChannels_fB")) {
851 ATH_CHECK(evtStore()->retrieve( LArTES, "LArRawChannels_fB"));
852 }
853 }
854
855 if (caloTES==nullptr && LArTES==nullptr) {
856 ATH_MSG_WARNING ( "Neither CaloCell nor LArRawChannel Containers found!" );
857 return StatusCode::SUCCESS;
858 }
859
860 m_nb_sat = 0;
861 m_noisycell =0;
862 nlarcell = 0;
863 v_barrelec_noisy.clear(); v_posneg_noisy.clear();
864 v_ft_noisy.clear();v_slot_noisy.clear();v_channel_noisy.clear();
865 v_isbarrel.clear();v_isendcap.clear();v_isfcal.clear();v_ishec.clear();
866 v_layer.clear();v_partition.clear();v_energycell.clear();v_qfactorcell.clear();
867 v_phicell.clear();v_etacell.clear();v_signifcell.clear();v_isbadcell.clear();
868 v_IdHash.clear();v_noisycellHVeta.clear();v_noisycellHVphi.clear();
870
871 float eCalo;
872 float qfactor;
874
876
877 if(caloTES) {
878 for (const CaloCell* cell : *caloTES) {
879 const CaloDetDescrElement* caloDDE = cell->caloDDE();
880 if (caloDDE->is_tile())continue;
881 HWIdentifier onlID;
882 try {onlID = cabling->createSignalChannelID(cell->ID());}
883 catch(LArID_Exception& except) {
884 ATH_MSG_ERROR ( "LArID_Exception " << m_LArEM_IDHelper->show_to_string(cell->ID()) << " " << (std::string) except );
885 ATH_MSG_ERROR ( "LArID_Exception " << m_LArHEC_IDHelper->show_to_string(cell->ID()) );
886 ATH_MSG_ERROR ( "LArID_Exception " << m_LArFCAL_IDHelper->show_to_string(cell->ID()) );
887 continue;
888 }
889 bool connected = cabling->isOnlineConnected(onlID);
890 if(!connected) continue;
891 eCalo = cell->energy();
892 qfactor = cell->quality();
893 gain = cell->gain();
894 //if(qfactor > 0. || cell->ID() == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cell->ID()<<" : "<<eCalo<<" "<<qfactor<<" "<<gain<<" prov.: "<<cell->provenance());
895 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
896 }//loop over cells
897 ATH_MSG_DEBUG("Done cells "<<nlarcell);
898 } else {
899 std::vector<HWIdentifier> chdone;
900 if (LArTES_dig) {
901 LArRawChannelContainer::const_iterator caloItr;
902 for(caloItr=LArTES_dig->begin();caloItr!=LArTES_dig->end();++caloItr){
903 HWIdentifier onlID=caloItr->identify();
904 bool connected = cabling->isOnlineConnected(onlID);
905 if(!connected) continue;
906 eCalo = caloItr->energy();
907 qfactor = caloItr->quality();
908 gain = caloItr->gain();
909 //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain);
910 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
911 chdone.push_back(onlID);
912 }//loop over raw channels
913 }
914 ATH_MSG_DEBUG("Done raw chan. from digi "<<nlarcell);
915 // dirty hack, if we are already complete:
916 if (nlarcell < 182468 && LArTES) { // add those raw channels, which were not from dig.
917 LArRawChannelContainer::const_iterator caloItr;
918 for(caloItr=LArTES->begin();caloItr!=LArTES->end();++caloItr){
919 HWIdentifier onlID=caloItr->identify();
920 if(std::find(chdone.begin(), chdone.end(), onlID) != chdone.end()) continue;
921 bool connected = cabling->isOnlineConnected(onlID);
922 if(!connected) continue;
923 eCalo = caloItr->energy();
924 qfactor = caloItr->quality();
925 gain = caloItr->gain();
926 //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain);
927 ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont, **totalNoise,caloMgr));
928 }//loop over raw channels
929 }
930 ATH_MSG_DEBUG("Done raw chan. "<<nlarcell);
931 } // if raw chanels
932
934 if(caloTES) {
935 m_nt_cellsize = caloTES->size();
936 }
937 else if (LArTES) {
938 m_nt_cellsize = LArTES->size();
939 }
940 ATH_MSG_DEBUG ("lar cell size = "<<int(nlarcell));
941 if(caloTES) ATH_MSG_DEBUG ("all cell size = "<<int(caloTES->size()));
942 else {
943 if(LArTES_dig) ATH_MSG_DEBUG ("all LArRawCh. from digi size = "<<int(LArTES_dig->size()));
944 if(LArTES) ATH_MSG_DEBUG ("all LArRawCh. size = "<<int(LArTES->size()));
945 }
946
947 //if (nlarcell > 0)
948 // m_nt_noisycellpercent = 100.0*double(n_noisycell)/double(nlarcell);
949 //else
950 // m_nt_noisycellpercent = 0;
951
952 bool checknoise = false;
953 //ratio of noisy cells per partition
954 for(unsigned int i=0;i<8;i++){
955 float noise = 100.0*(double(n_noisy_cell_part[i])/double(n_cell_part[i]));
956 m_nt_noisycellpart.push_back(noise);
957 if(noise> 1.0){
958 checknoise = true;
959 ATH_MSG_DEBUG ("noise burst in this event ");
960 }
961 }
962
963 const LArDigitContainer* LArDigitCont=nullptr;
964 if (evtStore()->contains<LArDigitContainer>("FREE")) ATH_CHECK(evtStore()->retrieve( LArDigitCont, "FREE"));
965 if(!LArDigitCont) {
966 if (evtStore()->contains<LArDigitContainer>("LArDigitContainer_Thinned")) ATH_CHECK(evtStore()->retrieve( LArDigitCont, "LArDigitContainer_Thinned"));
967 }
968 if (!LArDigitCont) {
969 ATH_MSG_WARNING ( "LArDigitContainer Container not found!" );
970 return StatusCode::SUCCESS;
971 }
972
973 bool store_condition = false;
974 // CosmicCalo stream : Store detailed infos of cells only if Y3Sigma>1% or burst found by LArNoisyRO
976 if(checknoise==true || m_nt_larflag_badFEBs || m_nt_larflag_tightSaturatedDQ){
977 store_condition = true;
978 }
979 }
980 // Not cosmicCalo stream : Store detailed infos of cells only if burst found by LArNoisyRO
983 store_condition = true;
984 }
985 }
986
987 //store the information of the noisy cell only when %noisycells > 1%.
988 if(store_condition){
989 std::vector<short> samples;
990 samples.clear();
991 for(unsigned int k=0;k<v_etacell.size();k++){
992 m_nt_samples.push_back(samples);
993 m_nt_gain.push_back(0);
994 }
995 for (const LArDigit* pLArDigit : *LArDigitCont) {
996 HWIdentifier id2 = pLArDigit->hardwareID();
997 IdentifierHash hashid2 = m_LArOnlineIDHelper->channel_Hash(id2);
998 for(unsigned int j=0;j<v_IdHash.size();j++){
999 if (hashid2 == v_IdHash[j] ){
1000 ATH_MSG_DEBUG ( "find a IdentifierHash of the noisy cell in LArDigit container " );
1001 samples = pLArDigit->samples();
1002 int gain=-1;
1003 if (pLArDigit->gain() == CaloGain::LARHIGHGAIN) gain = 0;
1004 if (pLArDigit->gain() == CaloGain::LARMEDIUMGAIN) gain = 1;
1005 if (pLArDigit->gain() == CaloGain::LARLOWGAIN) gain = 2;
1006 m_nt_gain.at(j)= gain;
1007 m_nt_samples.at(j) = samples;
1008 ATH_MSG_DEBUG ( "I got the samples!" );
1009 break;
1010 }
1011 }
1012 }
1013 for(unsigned int i=0;i<v_etacell.size();i++){
1014 m_nt_energycell.push_back( v_energycell[i]);
1015 m_nt_qfactorcell.push_back( v_qfactorcell[i]);
1016 m_nt_signifcell.push_back( v_signifcell[i]);
1017 m_nt_partition.push_back( v_partition[i]);
1018 m_nt_cellIdentifier.push_back(v_cellIdentifier[i].get_identifier32().get_compact());
1019 m_nt_onlIdentifier.push_back(v_onlIdentifier[i].get_identifier32().get_compact());
1020 if(!m_keepOnlyCellID){
1022 m_nt_posneg_noisy.push_back( v_posneg_noisy[i]);
1023 m_nt_ft_noisy.push_back( v_ft_noisy[i]);
1024 m_nt_slot_noisy.push_back( v_slot_noisy[i]);
1025 m_nt_channel_noisy.push_back( v_channel_noisy[i]);
1026
1027 /*
1028 m_nt_isbarrel.push_back( v_isbarrel[i]);
1029 m_nt_isendcap.push_back( v_isendcap[i]);
1030 m_nt_isfcal.push_back( v_isfcal[i]);
1031 m_nt_ishec.push_back( v_ishec[i]);
1032 */
1033
1034 m_nt_layer.push_back( v_layer[i]);
1035 m_nt_phicell.push_back( v_phicell[i]);
1036 m_nt_etacell.push_back( v_etacell[i]);
1037 m_nt_isbadcell.push_back( v_isbadcell[i]);
1041 }
1042 }
1043 ATH_MSG_DEBUG ("leaving if checknoise and larnoisyro");
1044
1045 }//if(checknoisy==true ..)
1046
1047 return StatusCode::SUCCESS;
1048
1049}
1050
1052 , float eCalo
1053 , float qfactor
1054 , CaloGain::CaloGain gain
1055 , const LArOnOffIdMapping* cabling
1056 , const LArBadChannelCont* bcCont
1057 , const CaloNoise& totalNoise
1058 , const CaloDetDescrManager* caloMgr)
1059{
1060 const Identifier idd = cabling->cnvToIdentifier(onlID);
1061 nlarcell++;
1062 IdentifierHash channelHash = m_LArOnlineIDHelper->channel_Hash(onlID);
1063 const CaloDetDescrElement *caloDDE = caloMgr->get_element(idd);
1064 int layer = caloDDE->getLayer();
1065 // CaloCell_ID::CaloSample sampling = (*caloItr)->caloDDE()->getSampling();
1066 float phi = caloDDE->phi();
1067 float noise = totalNoise.getNoise (idd, gain);
1068 float significance = eCalo / noise ;
1069 float eta = caloDDE->eta();
1070 bool badcell = ! (bcCont->status(onlID)).good();
1071 unsigned int partition = 0;
1072 bool is_lar_em_barrel = caloDDE->is_lar_em_barrel();
1073 if(is_lar_em_barrel){
1074 if(eta<0){
1075 partition = 0;
1076 }else{
1077 partition = 1;
1078 }
1079 }//barrel
1080 bool is_lar_em_endcap = caloDDE->is_lar_em_endcap();
1081 if(is_lar_em_endcap){
1082 if(eta<0){
1083 partition = 2;
1084 }else{
1085 partition = 3;
1086 }
1087 }//endcap
1088 bool is_lar_fcal = caloDDE->is_lar_fcal();
1089 if(is_lar_fcal){
1090 if(eta<0){
1091 partition = 4;
1092 }else{
1093 partition = 5;
1094 }
1095 }//fcal
1096 bool is_lar_hec = caloDDE->is_lar_hec();
1097 if(is_lar_hec){
1098 if(eta<0){
1099 partition = 6;
1100 }else{
1101 partition = 7;
1102 }
1103 }//hec
1104 for(unsigned int k=0;k<8;k++){
1105 if(partition==k){
1106 n_cell_part[k]++;
1107 }
1108 }
1109 if(qfactor <1000) {m_lowqfactor++;}
1110 if(qfactor>=1000 && qfactor<10000) {m_medqfactor++;}
1111 if(qfactor>=10000 && qfactor<65535){m_hiqfactor++;}
1112 if(qfactor==65535){
1113 ATH_MSG_DEBUG ("Satured cell at eta: "<<eta<<", phi: "<<phi<<", energy: "<<eCalo<<", partition: "<<partition);
1114 m_nb_sat = m_nb_sat +1;
1115 m_nt_partition_sat.push_back(partition);
1116 m_nt_energy_sat.push_back(eCalo);
1117 m_nt_cellIdentifier_sat.push_back((cabling->cnvToIdentifier(onlID)).get_identifier32().get_compact());
1118 if(!m_keepOnlyCellID){
1119 m_nt_barrelec_sat.push_back(m_LArOnlineIDHelper->barrel_ec(onlID));
1120 m_nt_posneg_sat.push_back(m_LArOnlineIDHelper->pos_neg(onlID));
1121 m_nt_ft_sat.push_back(m_LArOnlineIDHelper->feedthrough(onlID));
1122 m_nt_slot_sat.push_back(m_LArOnlineIDHelper->slot(onlID));
1123 m_nt_channel_sat.push_back(m_LArOnlineIDHelper->channel(onlID));
1124 m_nt_phicell_sat.push_back(phi);
1125 m_nt_etacell_sat.push_back(eta);
1126 m_nt_layer_sat.push_back(layer);
1127 m_nt_isbadcell_sat.push_back(badcell);
1128 }
1129 }
1130 // Store all cells in positive and negative 3 sigma tails...
1131 if(significance > m_sigmacut || qfactor > 4000){
1132 v_barrelec_noisy.push_back(m_LArOnlineIDHelper->barrel_ec(onlID));
1133 v_posneg_noisy.push_back(m_LArOnlineIDHelper->pos_neg(onlID));
1134 v_ft_noisy.push_back(m_LArOnlineIDHelper->feedthrough(onlID));
1135 v_slot_noisy.push_back(m_LArOnlineIDHelper->slot(onlID));
1136 v_channel_noisy.push_back(m_LArOnlineIDHelper->channel(onlID));
1137
1138 /*
1139 v_isbarrel.push_back(is_lar_em_barrel);
1140 v_isendcap.push_back(is_lar_em_endcap);
1141 v_isfcal.push_back(is_lar_fcal);
1142 v_ishec.push_back(is_lar_hec);
1143 */
1144
1145 v_layer.push_back(layer);
1146 v_energycell.push_back(eCalo);
1147 v_qfactorcell.push_back(qfactor);
1148 v_phicell.push_back(phi);
1149 v_etacell.push_back(eta);
1150 v_signifcell.push_back(significance);
1151 v_isbadcell.push_back(badcell);
1152 v_partition.push_back(partition);
1153 v_IdHash.push_back(channelHash);
1154 v_cellIdentifier.push_back(cabling->cnvToIdentifier(onlID));
1155 v_onlIdentifier.push_back(onlID);
1156 // ...but count only cells in positive 3 sigma tails!
1157 if (significance > m_sigmacut){
1158 m_noisycell++;
1159 ATH_MSG_DEBUG ("Noisy cell: "<<m_noisycell<<" "<<cabling->cnvToIdentifier(onlID)<<" q: "<<qfactor<<" sign.: "<<significance<<" noise: "<<noise);
1160 for(unsigned int k=0;k<8;k++){
1161 if(partition==k){
1162 n_noisy_cell_part[k]++;
1163 }
1164 }
1165 }
1166 int caloindex = GetPartitionLayerIndex(idd);
1167 v_cellpartlayerindex.push_back(caloindex);
1168 v_noisycellHVphi.push_back(m_LArElectrodeIDHelper->hv_phi(onlID));
1169 v_noisycellHVeta.push_back(m_LArElectrodeIDHelper->hv_eta(onlID));
1170
1171
1172 }
1173 return StatusCode::SUCCESS;
1174}
1175
1177{
1178 // O.Simard -- GetPartitionLayer index [0,32]:
1179 // Returns a single integer code that corresponds to the
1180 // mapping of CaloCells in CaloMonitoring histogram frames.
1181
1182 int caloindex = -1;
1183 int bc = 0;
1184 int sampling = 0;
1185
1186 if(m_LArEM_IDHelper->is_lar_em(id)){ // EMB
1187 bc = m_LArEM_IDHelper->barrel_ec(id);
1188 sampling = m_LArEM_IDHelper->sampling(id);
1189 if(abs(bc)==1){
1190 if(bc<0) caloindex = sampling+4;
1191 else caloindex = sampling;
1192 } else { // EMEC
1193 if(bc<0) caloindex = sampling+12;
1194 else caloindex = sampling+8;
1195 }
1196 } else if(m_LArHEC_IDHelper->is_lar_hec(id)) { // LAr HEC
1197 bc = m_LArHEC_IDHelper->pos_neg(id);
1198 sampling = m_LArHEC_IDHelper->sampling(id);
1199 if(bc<0) caloindex = sampling+20;
1200 else caloindex = sampling+16;
1201 } else if(m_LArFCAL_IDHelper->is_lar_fcal(id)) { // LAr FCAL
1202 bc = m_LArFCAL_IDHelper->pos_neg(id);
1203 sampling = (int)m_LArFCAL_IDHelper->module(id); // module instead of sampling
1204 if(bc<0) caloindex = sampling+26;
1205 else caloindex = sampling+23;
1206 }
1207
1208 return caloindex;
1209}
1210
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Calo Subsystem specific Detector Elements + Dummy element for testing.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
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
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
HWIdentifier id2
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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:34
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
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)
virtual StatusCode execute() override
Execute - on event by event.
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:114
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
Definition run.py:1
STL namespace.
DataModel_detail::iterator< DVL > partition(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of partition for DataVector/List.
EventInfo_v1 EventInfo
Definition of the latest event info version.