|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Units/SystemOfUnits.h"
21 const std::string&
name,
29 m_CellEnergyInADC(false),
63 log << MSG::INFO <<
"in initialize()" <<
endmsg;
72 <<
"problems performing setup of module and sampling lookup tables"
74 return StatusCode::FAILURE;
80 return StatusCode::FAILURE;
84 " does not correspond to the number of samplings = " <<
86 return StatusCode::FAILURE;
89 log << MSG::INFO <<
"Included calorimeter samplings(coneCuts): ";
90 std::vector<std::string>::const_iterator sampling =
m_samplingNames.begin();
96 log <<
MSG::FATAL <<
" Unknown sampling: \042" << *sampling <<
"\042 "
98 return StatusCode::FAILURE;
100 log << MSG::INFO <<
"\042" << *sampling <<
"\042"
101 <<
"(" << *
cut <<
") ";
112 log <<
MSG::FATAL <<
" Cluster position is fixed but (eta, phi) are not "
113 <<
"supplied in the JO file" <<
endmsg;
114 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
141 if (
sc.isFailure()) {
143 <<
"cannot allocate CaloCellContainer with key <"
147 log <<
MSG::DEBUG <<
"CaloCellContainer container size = " <<
150 std::unique_ptr<xAOD::CaloCluster> Cluster;
151 double cluEta=0,cluPhi=0,cluNorm = 0;
152 double cluEta0=0,cluPhi0=0,cluNorm0 = 0;
153 bool clusterPositionFound =
false;
155 clusterPositionFound =
true;
167 for (; itc!=cellContainer->
endConstCalo(calo); ++itc,++cindex) {
169 double e =
cell->energy();
171 if(noiseRMS <= 0.) noiseRMS = 0.0001;
172 double eSigma =
e/noiseRMS;
175 if (!clusterPositionFound) {
180 <<idSample<<
" "<<
cell->eta()<<
" "<<
cell->phi()<<
" "<<
184 cluPhi0 =
e*
cell->phi();
188 cluEta0 +=
e*
cell->eta();
192 double dist = sqrt(
pow(cluPhi0-
proxim(
cell->phi(),cluPhi0),2)
199 cluEta +=
e*
cell->eta();
206 double dist = sqrt(
pow(cluPhi0-
proxim(
cell->phi(),cluPhi0),2)
216 <<idSample<<
" "<<
e<<
" "<<eSigma<<
" "<<
endmsg;
220 if (clusterPositionFound)
break;
222 if (cluNorm0 == 0.) {
224 log << MSG::INFO <<
"No seed cell found" <<
endmsg;
225 return StatusCode::SUCCESS;
229 log <<
MSG::DEBUG <<
"nIter=0: cluEta0,cluPhi0,cluNorm0= " << cluEta0
230 <<
" " << cluPhi0 <<
" " << cluNorm0 <<
endmsg;
234 log << MSG::ERROR <<
"cluNorm = 0.: should never be" <<
endmsg;
235 return StatusCode::SUCCESS;
239 double dist = sqrt(
pow(cluPhi0-
proxim(cluPhi,cluPhi0),2)
240 +
pow(cluEta0-cluEta,2));
242 clusterPositionFound =
true;
246 clusterPositionFound =
true;
249 log <<
MSG::DEBUG <<
"cluEta0,cluPhi0,cluNorm0= " << cluEta0 <<
" " <<
250 cluPhi0 <<
" " << cluNorm0 <<
endmsg;
251 log <<
MSG::DEBUG <<
"cluEta,cluPhi,cluNorm= " << cluEta <<
" " <<
252 cluPhi <<
" " << cluNorm <<
endmsg;
257 cluEta=0.; cluPhi=0.; cluNorm = 0.;
268 log<<
MSG::DEBUG<<
"In samplings: #samp E eta(etasize) phi(phisize):"
283 return StatusCode::SUCCESS;
285 log << MSG::ERROR <<
"Cluster not found: should never be here!" <<
endmsg;
286 return StatusCode::SUCCESS;
304 return StatusCode::SUCCESS;
372 return StatusCode::SUCCESS;
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
flt_t phi0() const
Returns raw of cluster seed.
virtual double phi() const
The azimuthal angle ( ) of the particle.
int m_maxIter
Maximal number of iterations to find cluster position.
Const iterator class for DataVector/DataList.
float m_cellCut
Threshold cut on cell energy in sigma noise units.
virtual StatusCode initialize() override
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
float m_deltaR
Maximal claster position shift at the current step to stop iterations.
double proxim(double b, double a)
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
float m_seedCut
Threshold cut on seed cell energy in sigma noise units to find the 1st approximation of cluster .
std::vector< float > m_adcToMeV
std::map< std::string, CaloSampling::CaloSample > m_samplingFromNameLookup
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
ClusterSize clusterSize() const
Get cluster size.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
std::vector< CaloSampling::CaloSample > m_samplings
Vectors containing the list of used samplings and corresponding cone cuts; list of used calorimeters.
msgSvc
Provide convenience handles for various services.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual StatusCode finalize() override
std::vector< CaloCell_ID::SUBCALO > m_calos
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode setupLookupTables()
Setup lookup tables.
SUBCALO
enumeration of sub calorimeters
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
std::vector< std::string > m_samplingNames
CaloPhiRange class declaration.
bool m_fixClusterPosition
Flag to fix cluster position ( ) from JO file.
std::vector< float > m_samplingConeCuts
Map of cone cuts for calorimeter samplings.
bool m_CellEnergyInADC
True if cell enrgy is in ADC counts, default = FALSE.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
const CaloCell_ID * m_calo_id
Services.
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Container class for CaloCell.
std::map< CaloSampling::CaloSample, CaloCell_ID::SUBCALO > m_caloLookup
std::string m_caloCellContainerName
Names.
float m_eta0
Cluster ) set in JO file.
flt_t eta0() const
Returns raw of cluster seed.
TBClusterMaker(const std::string &type, const std::string &name, const IInterface *parent)
Data object for each calorimeter readout cell.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusters) const override
Execute on an entire collection of clusters.
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< float > m_coneCuts
virtual double e() const
The total energy of the particle.