15#include "GaudiKernel/ITHistSvc.h"
16#include "CaloDetDescr/CaloDetDescrElement.h"
36 m_tree =
new TTree(
"m_tree",
"Offset ntuple");
54 return StatusCode::SUCCESS;
85 return StatusCode::SUCCESS;
94 return StatusCode::SUCCESS;
123 return StatusCode::FAILURE;
131 std::vector<int> doneCell;
142 for (
unsigned int i=0;i<((
unsigned int)(
m_ncell));i++) {
148 Identifier id2 = cabling->cnvToIdentifier(hwid2);
149 int i2 = (int) (
m_calo_id->calo_cell_hash(id2));
154 if (doneCell[i2]>=0) {
165 cell.eta = calodde->
eta();
166 cell.phi = calodde->
phi();
173 cell.identifier = id2;
191 return StatusCode::FAILURE;
193 int channelNumber = eventInfo->mcChannelNumber();
210 ATH_MSG_WARNING(
" Neither low nor high Pt MinBias sample " << channelNumber <<
" set weight to 1.0 ");
220 for (
auto & inputHits : hitVectorHandles) {
221 if (!inputHits.isValid()) {
227 for (
const LArHit* hit : *inputHits)
230 double energy = hit->energy();
231 double time =hit->time();
234 cellID=
m_scidtool->offlineToSuperCellID(hitCellID);
240 if (index < m_ncell && index>=0 && std::fabs(time)<25.) {
252 return StatusCode::SUCCESS;
257 if (index < m_ncell && index>=0) {
259 if (index2<0)
return;
261 ATH_MSG_INFO(
" LArMinBiasAlg::addCell: for " <<
index <<
", " << index2 <<
" is out-of bounds for list of size " <<
m_CellList.size());
265 double oldAverage =
m_CellList[index2].average;
267 double oldAverage2 =
m_CellList[index2].offset;
269 double frac = oldN/(weight+oldN);
270 double Anew = weight+oldN;
271 double newAverage = frac*oldAverage + weight*energy/Anew;
272 double deltaE = energy-newAverage;
273 double newRMS = frac*(oldRMS + (newAverage-oldAverage)*(newAverage-oldAverage)) + weight*deltaE*deltaE/Anew;
275 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.
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.
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
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 initialize() override
Gaudi::Property< int > m_datasetID_lowPt
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]
Gaudi::Property< double > m_weight_lowPt
Gaudi::Property< int > m_datasetID_highPt
int m_layer[MAX_SYM_CELLS]
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
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
const CaloCell_Base_ID * m_calo_id
LArMinBiasAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Gaudi::Property< double > m_weight_highPt
~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?