16#include "GaudiKernel/ITHistSvc.h"
17#include "CaloDetDescr/CaloDetDescrElement.h"
48 m_tree =
new TTree(
"m_tree",
"Offset ntuple");
66 return StatusCode::SUCCESS;
97 return StatusCode::SUCCESS;
106 return StatusCode::SUCCESS;
112 return StatusCode::SUCCESS;
122 const EventContext& ctx = Gaudi::Hive::currentContext();
142 return StatusCode::FAILURE;
150 std::vector<int> doneCell;
161 for (
unsigned int i=0;i<((
unsigned int)(
m_ncell));i++) {
173 if (doneCell[i2]>=0) {
175 ATH_MSG_DEBUG(
"Adding cell "<<
id.get_identifier32().get_compact()<<
" to a symmetrized cell "<<
id2.get_identifier32().get_compact());
179 ATH_MSG_DEBUG(
"New symmetrized cell "<<
id2.get_identifier32().get_compact());
184 cell.eta = calodde->
eta();
185 cell.phi = calodde->
phi();
192 cell.identifier =
id2;
210 return StatusCode::FAILURE;
212 int channelNumber = eventInfo->mcChannelNumber();
229 ATH_MSG_WARNING(
" Neither low nor high Pt MinBias sample " << channelNumber <<
" set weight to 1.0 ");
239 for (
auto & inputHits : hitVectorHandles) {
240 if (!inputHits.isValid()) {
246 for (
const LArHit* hit : *inputHits)
249 double energy = hit->energy();
250 double time =hit->time();
253 cellID=
m_scidtool->offlineToSuperCellID(hitCellID);
259 if (index < m_ncell && index>=0 && std::fabs(time)<25.) {
271 return StatusCode::SUCCESS;
276 if (index < m_ncell && index>=0) {
278 if (index2<0)
return;
280 ATH_MSG_INFO(
" LArMinBiasAlg::addCell: for " <<
index <<
", " << index2 <<
" is out-of bounds for list of size " <<
m_CellList.size());
284 double oldAverage =
m_CellList[index2].average;
286 double oldAverage2 =
m_CellList[index2].offset;
288 double frac = oldN/(weight+oldN);
289 double Anew = weight+oldN;
290 double newAverage = frac*oldAverage + weight*energy/Anew;
291 double deltaE = energy-newAverage;
292 double newRMS = frac*(oldRMS + (newAverage-oldAverage)*(newAverage-oldAverage)) + weight*deltaE*deltaE/Anew;
294 double newAverage2 = frac*oldAverage2 + weight*eshift/Anew;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helper class for offline supercell identifiers.
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
Helper base class for offline cell identifiers.
This class groups all DetDescr information related to a CaloCell.
float eta() const
cell eta
float phi() const
cell phi
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class initializes the Calo (LAr and Tile) offline identifiers.
This is a "hash" representation of an Identifier.
Class to store hit energy and time in LAr cell from G4 simulation.
std::vector< CellInfo > m_CellList
double m_average[MAX_SYM_CELLS]
virtual StatusCode finalize() override
virtual StatusCode initialize() override
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
double m_rms[MAX_SYM_CELLS]
SG::ReadHandleKeyArray< LArHitContainer > m_larHitKeys
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
double m_offset[MAX_SYM_CELLS]
int m_region[MAX_SYM_CELLS]
std::vector< int > m_symCellIndex
double m_nevt[MAX_SYM_CELLS]
int m_layer[MAX_SYM_CELLS]
virtual StatusCode execute() override
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
ToolHandle< ICaloSuperCellIDTool > m_scidtool
StringArrayProperty m_inputKeys
SG::ReadCondHandleKey< LArMCSym > m_mcSymKey
std::vector< double > m_eCell
float m_eta[MAX_SYM_CELLS]
virtual StatusCode stop() override
const CaloCell_Base_ID * m_calo_id
LArMinBiasAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
~LArMinBiasAlg()
Default Destructor.
float m_phi[MAX_SYM_CELLS]
ServiceHandle< ITHistSvc > m_thistSvc
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSCMgrKey
void addCell(int index, double e1, double e2, double wt=1.)
int m_ieta[MAX_SYM_CELLS]
int m_identifier[MAX_SYM_CELLS]
virtual bool isValid() override final
Can the handle be successfully dereferenced?