ATLAS Offline Software
Loading...
Searching...
No Matches
HICaloCellHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "HICaloCellHelper.h"
7#include "CxxUtils/prefetch.h"
9#include <iomanip>
10#include <sstream>
11#include <cmath>
12#include <set>
13#include <TMath.h>
14
16{
17 float deta=theCell->caloDDE()->deta();
18 float dphi=theCell->caloDDE()->dphi();
19 return std::abs(deta*dphi);
20}
21
22float HICaloCellHelper::getEtDensity(const CaloCell* theCell, float geoWeight)
23{
24 float density=theCell->et();
26 if(area<1e-9) area=0.2*TMath::Pi()/geoWeight;
27 density/=area;
28 return density;
29}
30
31std::string HICaloCellHelper::dumpCell(const CaloCell* theCell)
32{
33 std::stringstream ss;
34 ss << "CELLINFO:"
35 << std::setw(10) << (CaloSampling::CaloSample) theCell->caloDDE()->getSampling()
36 << std::setw(20) << theCell->ID().get_compact()
37 << std::setw(10) << theCell->et()
38 << std::setw(10) << theCell->caloDDE()->eta()
39 << std::setw(10) << theCell->caloDDE()->phi()
40 << std::setw(15) << theCell->caloDDE()->deta()
41 << std::setw(15) << theCell->caloDDE()->dphi()
42 << std::setw(15) << HICaloCellHelper::getAreaEtaPhi(theCell);
43 return ss.str();
44}
double area(double R)
static Double_t ss
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
virtual double et() const override final
get et
Definition CaloCell.h:423
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
CaloCell_ID::CaloSample getSampling() const
cell sampling
value_type get_compact() const
Get the compact id.
std::string dumpCell(const CaloCell *theCell)
float getAreaEtaPhi(const CaloCell *theCell)
float getEtDensity(const CaloCell *theCell, float geoWeight)
Functions to prefetch blocks of memory.