|
ATLAS Offline Software
|
simple cone cluster maker for TB data analysis.
More...
#include <TBClusterMaker.h>
|
| TBClusterMaker (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloClusterContainer *theClusters) const override |
| Execute on an entire collection of clusters. More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const=0 |
| Execute on an entire collection of clusters. More...
|
|
virtual StatusCode | execute (xAOD::CaloClusterContainer *collection) final |
| Execute on an entire collection of clusters. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
virtual StatusCode | execute (xAOD::CaloClusterContainer *collection) final |
| Execute on an entire collection of clusters. More...
|
|
simple cone cluster maker for TB data analysis.
- Version
- $Id: TBClusterMaker.h,v 1.2 2009-04-17 09:51:30 pavol Exp $
- Author
- Andrey Minaenko minae.nosp@m.nko@.nosp@m.ihep..nosp@m.ru
- Date
- 01-September-2005 Make clusters using simple cone algorithm with the sampling dependent cone size Like all other cluster maker tools this class derives from CaloClusterMakerTool.
Definition at line 31 of file TBClusterMaker.h.
◆ StoreGateSvc_t
◆ TBClusterMaker()
TBClusterMaker::TBClusterMaker |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute() [1/4]
virtual StatusCode CaloClusterCollectionProcessor::execute |
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. param ctx The event context. |
◆ execute() [2/4]
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. param ctx The event context. |
Implements CaloClusterCollectionProcessor.
Definition at line 125 of file TBClusterMaker.cxx.
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();
170 double noiseRMS = elecNoise->getNoise(
cell->ID(),
cell->gain());
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):"
282 clusCont->push_back(std::move(Cluster));
283 return StatusCode::SUCCESS;
285 log << MSG::ERROR <<
"Cluster not found: should never be here!" <<
endmsg;
286 return StatusCode::SUCCESS;
◆ execute() [3/4]
virtual StatusCode CaloClusterCollectionProcessor::execute |
|
inlinefinal |
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. (deprecated) |
Definition at line 49 of file CaloClusterCollectionProcessor.h.
51 return execute (Gaudi::Hive::currentContext(), collection);
◆ execute() [4/4]
|
inlinefinalvirtualinherited |
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. (deprecated) |
Definition at line 49 of file CaloClusterCollectionProcessor.h.
51 return execute (Gaudi::Hive::currentContext(), collection);
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode TBClusterMaker::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode TBClusterMaker::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 60 of file TBClusterMaker.cxx.
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;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& CaloClusterCollectionProcessor::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setupLookupTables()
StatusCode TBClusterMaker::setupLookupTables |
( |
| ) |
|
|
private |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_adcToMeV
std::vector<float> TBClusterMaker::m_adcToMeV |
|
private |
◆ m_calo_id
◆ m_caloCellContainerName
std::string TBClusterMaker::m_caloCellContainerName |
|
private |
◆ m_caloLookup
◆ m_calos
◆ m_cellCut
float TBClusterMaker::m_cellCut |
|
private |
Threshold cut on cell energy in sigma noise units.
Definition at line 59 of file TBClusterMaker.h.
◆ m_CellEnergyInADC
bool TBClusterMaker::m_CellEnergyInADC |
|
private |
True if cell enrgy is in ADC counts, default = FALSE.
Definition at line 85 of file TBClusterMaker.h.
◆ m_clusterContainerName
std::string TBClusterMaker::m_clusterContainerName |
|
private |
◆ m_coneCuts
std::vector<float> TBClusterMaker::m_coneCuts |
|
private |
◆ m_deltaR
float TBClusterMaker::m_deltaR |
|
private |
Maximal claster position shift at the current step to stop iterations.
Definition at line 69 of file TBClusterMaker.h.
◆ m_detStore
◆ m_elecNoiseKey
◆ m_eta0
float TBClusterMaker::m_eta0 |
|
private |
◆ m_evtStore
◆ m_fixClusterPosition
bool TBClusterMaker::m_fixClusterPosition |
|
private |
Flag to fix cluster position ( \( \eta,\phi \)) from JO file.
Definition at line 77 of file TBClusterMaker.h.
◆ m_maxIter
int TBClusterMaker::m_maxIter |
|
private |
Maximal number of iterations to find cluster position.
Definition at line 73 of file TBClusterMaker.h.
◆ m_phi0
float TBClusterMaker::m_phi0 |
|
private |
◆ m_samplingConeCuts
std::vector<float> TBClusterMaker::m_samplingConeCuts |
|
private |
Map of cone cuts for calorimeter samplings.
Definition at line 55 of file TBClusterMaker.h.
◆ m_samplingFromNameLookup
◆ m_samplingNames
std::vector<std::string> TBClusterMaker::m_samplingNames |
|
private |
◆ m_samplings
Vectors containing the list of used samplings and corresponding cone cuts; list of used calorimeters.
Definition at line 49 of file TBClusterMaker.h.
◆ m_seedCut
float TBClusterMaker::m_seedCut |
|
private |
Threshold cut on seed cell energy in sigma noise units to find the 1st approximation of cluster \( \eta, \phi \).
Definition at line 64 of file TBClusterMaker.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
float m_deltaR
Maximal claster position shift at the current step to stop iterations.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
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
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
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.
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
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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.
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.
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
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< float > m_coneCuts
virtual double e() const
The total energy of the particle.