![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
22 #include "CaloGeoHelpers/CaloSampling.h"
25 #include "CaloEvent/CaloCluster.h"
26 #include "CaloEvent/CaloClusterContainer.h"
38 ISvcLocator* pSvcLocator) :
43 m_nEventRandomTrigger(0),
48 m_addBeamTrack(false),
50 m_useEMTBCluster(false),
54 m_xCryo(-9999), m_yTable(-9999), m_zCalo(30000),
92 m_cell_ind_cluster(0),
101 m_beam_intercept_x(0),
102 m_beam_intercept_y(0),
107 m_caloCellContainerName(
"AllCalo"),
108 m_clusterContainerName(
"TBClusters"),
109 m_WTCContainerName(
"TailCatcher"),
110 m_TBTreeName(
"TBH6Tree"),
111 m_rootfile_name(
"tbh6tree.root"),
114 m_txtFileWithXY(
"xcryo_ytable.txt")
147 m_m2_r =
new std::vector<float>;
180 return StatusCode::FAILURE;
192 (
"etaTotal"+
m_suffix+
"/F").c_str());
194 (
"phiTotal"+
m_suffix+
"/F").c_str());
240 (
"cl_ncells"+
m_suffix+
"/I").c_str());
283 return StatusCode::SUCCESS;
296 return StatusCode::SUCCESS;
352 const int lastScintInLayer[] = {11, 23, 29, 35, 41, 47};
360 if (
sc.isFailure() ) {
362 (
"Cannot retrieve TBEventInfo from StoreGate" );
364 return StatusCode::FAILURE;
370 return StatusCode::FAILURE;
375 (
"No filled cell_id vector for random trigger event" );
377 return StatusCode::FAILURE;
404 if (
sc.isFailure()) {
407 (
"cannot allocate CaloCellContainer with key <"
409 <<
"> for random trigger event");
416 if ((
int)
id.get_identifier32().get_compact() == (*m_cell_id)[
icell]) {
419 int ind = (*m_cell_ind_cluster)[
icell];
428 return StatusCode::SUCCESS;
465 return StatusCode::FAILURE;
499 m_tree->GetUserInfo()->Add(rh);
511 return StatusCode::FAILURE;
530 return StatusCode::FAILURE;
535 int nScint = 0;
int nLayer = 0;
538 "/"<<scint->isSignalOverflow()<<
" ");
539 if (scint->isSignalOverflow()) novflow++;
540 signal += scint->getSignal();
541 if (nScint == lastScintInLayer[nLayer]) {
551 for (
int i=0;
i<nLayer;
i++) {
556 for (
int i=0;
i<nLayer;
i++) {
566 sc =
evtStore()->retrieve(clusterContainer,
"EMTBClusters");
567 if (
sc.isFailure()) {
569 (
"cannot allocate CaloClusterContainer with key <"
570 <<
"EMTBClusters" <<
">" );
574 if ( clusterContainer->
size()== 1) {
582 return StatusCode::FAILURE;
589 sc =
evtStore()->retrieve(clusterContainer,
"EMTBClusters");
590 if (
sc.isFailure()) {
592 (
"cannot allocate CaloClusterContainer with key <"
593 <<
"EMTBClusters" <<
">" );
597 if ( clusterContainer->
size()== 1) {
605 return StatusCode::FAILURE;
612 if (
sc.isFailure()) {
614 (
"cannot allocate CaloClusterContainer with key <"
623 if ( clusterContainer->
size() < 1) {
624 ATH_MSG_ERROR (
" wrong CaloClusterContainer container size = " <<
627 return StatusCode::FAILURE;
631 float eAbsTotal = 0.;
632 for (
const CaloCluster* cluster : *clusterContainer) {
633 m_nCells += cluster->getNumberOfCells();
635 m_eCluster->push_back((
float)cluster->energy());
639 eAbsTotal += fabs((
float)cluster->energy());
649 for (; itc!=cluster->cell_end(); itc++) {
652 m_cell_id->push_back(
id.get_identifier32().get_compact());
678 float m1_eta = -9999;
679 float m1_phi = -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) {
779 if (eAbsTotal > 0.) {
780 const float inv_eAbsTotal = 1. / eAbsTotal;
796 std::ifstream xyFile;
800 if (!xyFile.is_open()) {
802 return StatusCode::FAILURE;
805 while ( getline(xyFile,
line,
'\n') ) {
807 std::istringstream buf(
line);
809 buf >>
run >>
x >>
y >>
e;
811 if (
run ==
m_nRun && xyFile.good())
return StatusCode::SUCCESS;
814 return StatusCode::FAILURE;
float deta() const
cell deta
def retrieve(aClass, aKey=None)
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ LONGITUDINAL
Normalized longitudinal moment.
unsigned short m_evType
z-coordinate of the calorimeter surface at which beam coordinates calculated
std::vector< float > * m_center_x
Const iterator class for DataVector/DataList.
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
std::vector< float > * m_m1_eta
TBTree_CaloClusterH6(const std::string &name, ISvcLocator *pSvcLocator)
@ SECOND_R
Second Moment in .
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
@ SECOND_ENG_DENS
Second Moment in E/V.
std::vector< float > * m_delta_alpha
Storable container for CaloCluster.
unsigned int getRunNum() const
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
std::vector< int > * m_cell_ind_cluster
std::vector< float > * m_center_z
int run(int argc, char *argv[])
@ CENTER_Y
Cluster Centroid ( ).
std::vector< float > * m_center_y
bool msgLvl(const MSG::Level lvl) const
@ LATERAL
Normalized lateral moment.
@ DELTA_PHI
Angular shower axis deviation ( ) from IP-to-Center.
const CaloCell_ID * m_calo_id
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
#define ATH_MSG_VERBOSE(x)
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
std::vector< float > * m_eng_frac_max
@ FIRST_ENG_DENS
First Moment in E/V.
std::vector< float > * m_m1_phi
std::vector< float > * m_delta_phi
Definition of CaloDetDescrManager.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
@ FIRST_PHI
First Moment in .
virtual double energy() const
Return energy.
std::vector< float > * m_m2_r
StatusCode getXcryoYtable(float &x, float &y, float &eBeam)
Get Xcryo and Ytable from a text file.
std::vector< int > * m_nCellCluster
virtual StatusCode initialize() override
std::vector< float > * m_delta_theta
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
std::vector< short > * m_wtcNOverflow
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
std::vector< float > * m_m2_lambda
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode execute() override
@ DELTA_THETA
Angular shower axis deviation ( ) from IP-to-Center.
std::vector< float > * m_m1_dens
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
std::vector< float > * m_longitudinal
Principal data class for CaloCell clusters.
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
std::string m_txtFileWithXY
Text file containing xCryo and yTable.
std::string m_WTCContainerName
@ SECOND_LAMBDA
Second Moment in .
std::vector< int > * m_cell_id
std::string m_caloCellContainerName
std::string m_rootfile_name
const double & getValue() const
returns the value of this moment
@ FIRST_ETA
First Moment in .
std::vector< int > * m_cell_gain
std::vector< float > * m_eCluster
virtual ~TBTree_CaloClusterH6()
moment_type getMomentType() const
Function access to moment type.
std::vector< float > * m_cell_quality
int m_nEventRandomTrigger
float volume() const
cell volume
std::vector< float > * m_phiCluster
std::vector< float > * m_lateral
StatusCode initialize(bool used=true)
@ ENG_FRAC_EM
Energy fraction in EM calorimeters.
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Container class for CaloCell.
std::string m_clusterContainerName
const CaloClusterMoment & getMoment() const
Function access to CaloClusterMoment.
virtual StatusCode finalize() override
float dphi() const
cell dphi
std::vector< float > * m_center_lambda
std::vector< float > * m_eng_frac_core
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
std::vector< float > * m_etaCluster
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
def delta_phi(phi1, phi2)
std::vector< float > * m_wtcSignal
@ CENTER_X
Cluster Centroid ( ).
float getBeamMomentum() const
@ CENTER_Z
Cluster Centroid ( ).
float m_beamMom
Run number.
@ DELTA_ALPHA
Angular shower axis deviation from IP-to-Center.
std::vector< float > * m_cell_energy
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< float > * m_cell_time
std::vector< float > * m_eng_frac_em
std::vector< float > * m_m2_dens
@ ENG_FRAC_CORE
Energy fraction of the sum of the hottest cells in each sampling.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
float m_xCryo
Beam momentum.