351{
352 const int lastScintInLayer[] = {11, 23, 29, 35, 41, 47};
356
357
358 const TBEventInfo* theEventInfo = nullptr;
360 if (
sc.isFailure() ) {
362 ( "Cannot retrieve TBEventInfo from StoreGate" );
364 return StatusCode::FAILURE;
365 }
370 return StatusCode::FAILURE;
371 }
375 ( "No filled cell_id vector for random trigger event" );
377 return StatusCode::FAILURE;
378 }
401
402 const CaloCellContainer* cellContainer = nullptr;
404 if (
sc.isFailure()) {
407 ( "cannot allocate CaloCellContainer with key <"
409 << "> for random trigger event");
411 }
412
413 for (const CaloCell* cell : *cellContainer) {
414 const Identifier
id =
cell->ID();
416 if ((
int)
id.get_identifier32().get_compact() == (*
m_cell_id)[icell]) {
419 int ind = (*m_cell_ind_cluster)[
icell];
420 (*m_eCluster)[ind] += (
float)
cell->energy();
421 break;
422 }
423 }
424 }
425
428 return StatusCode::SUCCESS;
429 }
430
431
434
436
439
444 }
448
449
450 TBH6RunHeader* rh =
new TBH6RunHeader(
m_nRun);
455
456
457 const CaloCellContainer* cellContainer = nullptr;
461
465 return StatusCode::FAILURE;
466 }
467
468
470 for (const CaloCell* cell : *cellContainer) {
471 const CaloDetDescrElement* caloDDE =
cell->caloDDE();
472 const Identifier
id =
cell->ID();
473 rh->
SetCellID(icell,
id.get_identifier32().get_compact());
493 elecNoise->getNoise(
id,
cell->gain()));
495 }
497
498
499 m_tree->GetUserInfo()->Add(rh);
500 }
501
503
504
506 TBTrack *
track =
nullptr;
511 return StatusCode::FAILURE;
512 }
522 }
523
525 TBTailCatcher * wtc = nullptr;
530 return StatusCode::FAILURE;
531 }
533 short novflow = 0;
535 int nScint = 0; int nLayer = 0;
536 for (const TBScintillator* scint : *wtc) {
538 "/"<<scint->isSignalOverflow()<<" ");
539 if (scint->isSignalOverflow()) novflow++;
540 signal += scint->getSignal();
541 if (nScint == lastScintInLayer[nLayer]) {
545 nLayer++;
546 }
547 nScint++;
548 }
549 if (
msgLvl(MSG::VERBOSE)) {
550 msg()<<MSG::VERBOSE<<
"nOverflow: ";
551 for (
int i=0;
i<nLayer;
i++) {
552 msg()<<MSG::VERBOSE<<(*m_wtcNOverflow)[
i]<<
" ";
553 }
555 msg()<<MSG::VERBOSE<<
"Signals: ";
556 for (
int i=0;
i<nLayer;
i++) {
557 msg()<<MSG::VERBOSE<<(*m_wtcSignal)[
i]<<
" ";
558 }
560 }
561 }
562
563
566 sc =
evtStore()->retrieve(clusterContainer,
"EMTBClusters");
567 if (
sc.isFailure()) {
569 ( "cannot allocate CaloClusterContainer with key <"
570 << "EMTBClusters" << ">" );
573 }
574 if ( clusterContainer->
size()== 1) {
578 float ecut = 6000;
580 if (e < ecut) {
582 return StatusCode::FAILURE;
583 }
584 }
585 }
586
589 sc =
evtStore()->retrieve(clusterContainer,
"EMTBClusters");
590 if (
sc.isFailure()) {
592 ( "cannot allocate CaloClusterContainer with key <"
593 << "EMTBClusters" << ">" );
596 }
597 if ( clusterContainer->
size()== 1) {
601 float ecut = 9000;
602
603 if (e < ecut) {
605 return StatusCode::FAILURE;
606 }
607 }
608 }
609
612 if (
sc.isFailure()) {
614 ( "cannot allocate CaloClusterContainer with key <"
616 << ">");
619 }
623 if ( clusterContainer->
size() < 1) {
624 ATH_MSG_ERROR (
" wrong CaloClusterContainer container size = " <<
627 return StatusCode::FAILURE;
628 }
629
630 int clu_ind = 0;
631 float eAbsTotal = 0.;
632 for (
const CaloCluster* cluster : *clusterContainer) {
639 eAbsTotal += fabs((
float)cluster->
energy());
642
643
644
645
646
647
649 for (; itc!=cluster->
cell_end(); itc++) {
650 const CaloCell*
cell = (*itc);
651 const Identifier
id =
cell->ID();
652 m_cell_id->push_back(
id.get_identifier32().get_compact());
658 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::EME2)
660 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::EME3)
662 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::HEC0)
664 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::HEC1)
666 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::HEC2)
668 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::FCAL0)
670 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::FCAL1)
672 if (
m_calo_id->calo_sample(
id) == (
int)CaloSampling::FCAL2)
674 }
675
676
678 float m1_eta = -9999;
679 float m1_phi = -9999;
680 float m2_r = -9999;
681 float m2_lambda = -9999;
683 float delta_theta = -9999;
684 float delta_alpha = -9999;
685 float center_x = -9999;
686 float center_y = -9999;
687 float center_z = -9999;
688 float center_lambda = -9999;
689 float lateral = -9999;
690 float longitudinal = -9999;
691 float eng_frac_em = -9999;
692 float eng_frac_max = -9999;
693 float eng_frac_core = -9999;
694 float m1_dens = -9999;
695 float m2_dens = -9999;
697 for (; it_mom != cluster->
endMoment(
false); ++it_mom) {
701 break;
704 break;
707 break;
710 break;
713 break;
716 break;
719 break;
722 break;
725 break;
728 break;
731 break;
734 break;
737 break;
740 break;
743 break;
746 break;
749 break;
752 break;
753 default:
754 break;
755 }
756 }
775 }
776 clu_ind++;
777 }
778
779 if (eAbsTotal > 0.) {
780 const float inv_eAbsTotal = 1. / eAbsTotal;
783 }
784
785
788
790}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
@ CENTER_Y
Cluster Centroid ( ).
@ DELTA_ALPHA
Angular shower axis deviation from IP-to-Center.
@ SECOND_LAMBDA
Second Moment in .
@ CENTER_Z
Cluster Centroid ( ).
@ FIRST_PHI
First Moment in .
@ DELTA_PHI
Angular shower axis deviation ( ) from IP-to-Center.
@ ENG_FRAC_EM
Energy fraction in EM calorimeters.
@ SECOND_ENG_DENS
Second Moment in E/V.
@ CENTER_X
Cluster Centroid ( ).
@ FIRST_ENG_DENS
First Moment in E/V.
@ LATERAL
Normalized lateral moment.
@ SECOND_R
Second Moment in .
@ DELTA_THETA
Angular shower axis deviation ( ) from IP-to-Center.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ FIRST_ETA
First Moment in .
@ ENG_FRAC_CORE
Energy fraction of the sum of the hottest cells in each sampling.
@ LONGITUDINAL
Normalized longitudinal moment.
const double & getValue() const
returns the value of this moment
moment_type getMomentType() const
Function access to moment type.
const CaloClusterMoment & getMoment() const
Function access to CaloClusterMoment.
MomentStoreIter moment_iterator
Moment iterator type for CaloCluster clients.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
virtual double eta() const
Retrieve eta independent of signal state.
moment_iterator beginMoment(bool useLink=true) const
First iterator on moment store.
moment_iterator endMoment(bool useLink=true) const
Last iterator on moment store.
virtual double phi() const
Retrieve phi independent of signal state.
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
unsigned int getNumberOfCells() const
Return the number of cells in the store.
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
virtual double energy() const
Return energy.
float dphi() const
cell dphi
float deta() const
cell deta
float volume() const
cell volume
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
float getBeamMomentum() const
unsigned int getRunNum() const
StatusCode getXcryoYtable(float &x, float &y, float &eBeam)
Get Xcryo and Ytable from a text file.
const CaloCell_ID * m_calo_id
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
::StatusCode StatusCode
StatusCode definition for legacy code.
retrieve(aClass, aKey=None)