ATLAS Offline Software
Loading...
Searching...
No Matches
GetLCClassification Class Reference

Top algorithm to generate classification histograms for Local Hadron Calibration. More...

#include <GetLCClassification.h>

Inheritance diagram for GetLCClassification:
Collaboration diagram for GetLCClassification:

Public Member Functions

 GetLCClassification (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~GetLCClassification ()
virtual StatusCode initialize ()
virtual StatusCode execute (const EventContext &ctx)
 Execute method.
virtual StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

void mapinsert (const std::vector< Gaudi::Histo1DDef > &dims)
void mapparse ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< Gaudi::Histo1DDef > m_dimensions
 definition of all dimensions used for classification
Gaudi::Property< std::map< std::string, Gaudi::Histo1DDef > > m_dimensionsmap {this, "ClassificationDimensions", {}, "Dimensions to use for classification"}
 property to set all dimensions introduced above
std::vector< int > m_isampmap
 Vector of indices in m_dimensions.
std::vector< TH2F * > m_hclus
 Vector of actual histograms.
Gaudi::Property< std::string > m_outputFileName {this, "OutputFileName", "", "Name of the output file to save histograms in"}
 Name of the output file to save histograms in.
std::unique_ptr< TFile > m_outputFile {nullptr}
 Output file to save histograms in.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollName {this, "ClusterCollectionName", "CaloTopoClusters", "Name of the CaloClusterContainer to use"}
 Name of the CaloClusterContainer to use.
Gaudi::Property< std::string > m_NormalizationType {this, "NormalizationType", "Lin", "Normalization type: Const, Lin, Log or NClus"}
 string to choose different normalization types
int m_NormalizationTypeNumber {0}
Gaudi::Property< std::string > m_ClassificationType {this, "ClassificationType", "None", "Classification type: None, ParticleID_EM or ParticleID_HAD"}
 string to choose different classification types
int m_ClassificationTypeNumber {0}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Top algorithm to generate classification histograms for Local Hadron Calibration.

Version
$Id: GetLCClassification.h,v 1.1.1.1 2008-11-04 08:56:11 menke Exp $
Author
Sven Menke menke.nosp@m.@mpp.nosp@m.mu.mp.nosp@m.g.de
Date
3-October-2008

This class is an Algorithm to generate the 2D histograms from single pion simulations to classify as hadronic or electromagnetic. The output histograms need a combination step to calculate the actual probabilty distributions.

Definition at line 31 of file GetLCClassification.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GetLCClassification()

GetLCClassification::GetLCClassification ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 42 of file GetLCClassification.cxx.

44 : AthAlgorithm(name, pSvcLocator)
45{
46
47 std::vector<Gaudi::Histo1DDef> dims(6);
48 dims[0] = Gaudi::Histo1DDef("side",-1.5,1.5,1);
49 dims[1] = Gaudi::Histo1DDef("|eta|",0.,5.,25);
50 dims[2] = Gaudi::Histo1DDef("phi",-M_PI,M_PI,1);
51 dims[3] = Gaudi::Histo1DDef("log10(E_clus (MeV))",log10(200),log10(1e6),14);
52 dims[4] = Gaudi::Histo1DDef("log10(<rho_cell (MeV/mm^3)>)-log10(E_clus (MeV))",-9.0,-4.0,20);
53 dims[5] = Gaudi::Histo1DDef("log10(lambda_clus (mm))",0.0,4.0,20);
54
55 mapinsert(dims);
56}
#define M_PI
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
void mapinsert(const std::vector< Gaudi::Histo1DDef > &dims)

◆ ~GetLCClassification()

GetLCClassification::~GetLCClassification ( )
virtual

Definition at line 60 of file GetLCClassification.cxx.

61{ }

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode GetLCClassification::execute ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 229 of file GetLCClassification.cxx.

230{
231 SG::ReadHandle<xAOD::CaloClusterContainer> cc (m_clusterCollName, ctx);
232
233 // total calib hit energy of all clusters
234 double eCalibTot(0.);
235 double nClusECalibGt0 = 0.0;
236
237 for (const xAOD::CaloCluster * theCluster : *cc) {
238 double eC=999;
239 if (!theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_TOT,eC)) {
240 ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_TOT" );
241 return StatusCode::FAILURE;
242 }
244 double emFrac = 0;
245 if (!theCluster->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_FRAC_EM,emFrac)) {
246 ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_FRAC_EM" );
247 return StatusCode::FAILURE;
248 }
250 eC = 0;
252 eC = 0;
253 }
254 eCalibTot += eC;
255 if ( eC > 0 ) {
256 nClusECalibGt0++;
257 }
258 }
259
260 if ( eCalibTot > 0 && nClusECalibGt0 > 0) {
261 const double inv_eCalibTot = 1. / eCalibTot;
262 const double inv_nClusECalibGt0 = 1. / nClusECalibGt0;
263 for (const xAOD::CaloCluster * pClus : *cc) {
264 double eng = pClus->e();
265 if ( eng > 0 ) {
267 double emFrac = 0;
268 if (pClus->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_FRAC_EM,emFrac)) {
269 ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_FRAC_EM" );
270 return StatusCode::FAILURE;
271 }
273 continue;
275 continue;
276 }
277
278 double eta = fabs(pClus->eta());
279
280 int iside = 0;
281 int ieta = 0;
282 int iphi = 0;
283 int ilogE = 0;
284 int nside = 1;
285 int neta = 1;
286 int nphi = 1;
287 int nlogE = 1;
288
289 if ( m_isampmap[0] >= 0 ) {
290 const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[0]];
291 nside = hd.bins();
292 iside = (int)(nside*(((pClus->eta()<0?-1.0:1.0) - hd.lowEdge())
293 /(hd.highEdge()-hd.lowEdge())));
294 if ( iside < 0 || iside > nside-1 ) {
295 ATH_MSG_WARNING( " Side index out of bounds " <<
296 iside << " not in [0," << nside-1 << "]" );
297 iside = -1;
298 }
299 }
300
301 if ( m_isampmap[1] >= 0 ) {
302 const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[1]];
303 neta = hd.bins();
304 ieta = (int)(neta*((eta - hd.lowEdge())
305 /(hd.highEdge()-hd.lowEdge())));
306 if ( ieta < 0 || ieta > neta-1 ) {
307 ATH_MSG_WARNING( " Eta index out of bounds " <<
308 ieta << " not in [0," << neta-1 << "]" );
309 ieta = -1;
310 }
311 }
312 if ( m_isampmap[2] >= 0 ) {
313 const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[2]];
314 nphi = hd.bins();
315 iphi = (int)(nphi*((pClus->phi() - hd.lowEdge())
316 /(hd.highEdge()-hd.lowEdge())));
317 if ( iphi < 0 || iphi > nphi-1 ) {
318 ATH_MSG_WARNING( " Phi index out of bounds " <<
319 iphi << " not in [0," << nphi-1 << "]" );
320 iphi = -1;
321 }
322 }
323
324 const Gaudi::Histo1DDef & hd = m_dimensions[m_isampmap[3]];
325 nlogE = hd.bins();
326 ilogE = (int)(nlogE*((log10(eng) - hd.lowEdge())
327 /(hd.highEdge()-hd.lowEdge())));
328 if ( ilogE >= 0 && ilogE < nlogE ) {
329 double dens=0,lamb=0,ecal=0;
330 if (!pClus->retrieveMoment(xAOD::CaloCluster::ENG_CALIB_TOT,ecal)) {
331 ATH_MSG_ERROR( "Failed to retrieve cluster moment ENG_CALIB_TOT" );
332 return StatusCode::FAILURE;
333 }
334 if (!pClus->retrieveMoment(xAOD::CaloCluster::FIRST_ENG_DENS,dens)) {
335 ATH_MSG_ERROR( "Failed to retrieve cluster moment FIRST_ENG_DENS" );
336 return StatusCode::FAILURE;
337 }
338 if (!pClus->retrieveMoment(xAOD::CaloCluster::CENTER_LAMBDA,lamb)) {
339 ATH_MSG_ERROR( "Failed to retrieve cluster moment CENTER_LAMBDA" );
340 return StatusCode::FAILURE;
341 }
342 if ( dens > 0 &&
343 lamb > 0 &&
344 ecal > 0 )
345 {
346 int iH = ilogE*nphi*neta*nside+iphi*neta*nside+ieta*nside+iside;
347 if ( m_hclus[iH]) {
348 double norm = 0.0;
350 norm = ecal*inv_eCalibTot;
351 }
353 // cluster has to have at least 1% of the calib hit E
354 norm = log10(ecal*inv_eCalibTot)+2.0;
355 }
357 norm = inv_nClusECalibGt0;
358 }
359 else {
360 norm = 1.0;
361 }
362 if ( norm > 0 ) {
363 m_hclus[iH]->Fill(log10(dens)-log10(eng),log10(lamb),norm);
364 }
365 }
366 }
367 }
368 }
369 }
370 }
371
372 return StatusCode::SUCCESS;
373}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
std::vector< Gaudi::Histo1DDef > m_dimensions
definition of all dimensions used for classification
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCollName
Name of the CaloClusterContainer to use.
std::vector< int > m_isampmap
Vector of indices in m_dimensions.
std::vector< TH2F * > m_hclus
Vector of actual histograms.
@ FIRST_ENG_DENS
First Moment in E/V.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ PARTICLEID_EM
Definition GetLCDefs.h:25
@ PARTICLEID_HAD
Definition GetLCDefs.h:25
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode GetLCClassification::finalize ( )
virtual

Definition at line 215 of file GetLCClassification.cxx.

216{
217 ATH_MSG_INFO( "Writing out histograms" );
218 m_outputFile->cd();
219 for(unsigned int i=0;i<m_hclus.size();i++) {
220 m_hclus[i]->Write();
221 }
222 m_outputFile->Close();
223
224 return StatusCode::SUCCESS;
225}
#define ATH_MSG_INFO(x,...)
std::unique_ptr< TFile > m_outputFile
Output file to save histograms in.

◆ initialize()

StatusCode GetLCClassification::initialize ( )
virtual

Definition at line 65 of file GetLCClassification.cxx.

66{
67 m_outputFile = std::make_unique<TFile>(m_outputFileName.value().c_str(),"RECREATE");
68 m_outputFile->cd();
69 m_hclus.resize(0);
70 mapparse();
71
72 if ( m_NormalizationType == "Lin" ) {
73 ATH_MSG_INFO( "Using weighting proportional to E_calib" );
75 }
76 else if ( m_NormalizationType == "Log" ) {
77 ATH_MSG_INFO( "Using weighting proportional to log(E_calib)" );
79 }
80 else if ( m_NormalizationType == "NClus" ) {
81 ATH_MSG_INFO( "Using weighting proportional to 1/N_Clus_E_calib>0" );
83 }
84 else {
85 ATH_MSG_INFO( "Using constant weighting" );
87 }
88
89 if ( m_ClassificationType == "None" ) {
90 ATH_MSG_INFO( "Expecting single particle input" );
92 }
93 else if ( m_ClassificationType == "ParticleID_EM" ) {
94 ATH_MSG_INFO( "Expecting ParticleID simulation as input -- use EM type clusters only" );
96 }
97 else if ( m_ClassificationType == "ParticleID_HAD" ) {
98 ATH_MSG_INFO( "Expecting ParticleID simulation as input -- use HAD type clusters only" );
100 }
101 else {
102 ATH_MSG_WARNING( " unknown classification type " << m_ClassificationType.value() << " given! Using None instead" );
104 }
105
106 int iside(-1);
107 int ieta(-1);
108 int iphi(-1);
109 int ilogE(-1);
110 int ilogrho(-1);
111 int iloglambda(-1);
112
113 m_isampmap.resize(4,-1);
114 for(unsigned int idim=0;idim<m_dimensions.size();idim++) {
115 if ( m_dimensions[idim].title() == "side" ) {
116 iside = idim;
117 m_isampmap[0] = iside;
118 }
119 else if ( m_dimensions[idim].title() == "|eta|" ) {
120 ieta = idim;
121 m_isampmap[1] = ieta;
122 }
123 else if ( m_dimensions[idim].title() == "phi" ) {
124 iphi = idim;
125 m_isampmap[2] = iphi;
126 }
127 else if ( m_dimensions[idim].title() == "log10(E_clus (MeV))" ) {
128 ilogE = idim;
129 m_isampmap[3] = ilogE;
130 }
131 else if ( m_dimensions[idim].title() == "log10(<rho_cell (MeV/mm^3)>)-log10(E_clus (MeV))" )
132 ilogrho = idim;
133 else if ( m_dimensions[idim].title() == "log10(lambda_clus (mm))" )
134 iloglambda = idim;
135 }
136 if ( ilogE < 0 || ilogrho < 0 || iloglambda < 0 ) {
137 ATH_MSG_FATAL( " Mandatory dimension log10E, log10rho or log10lambda missing ..." );
138 return StatusCode::FAILURE;
139 }
140 int nside = 1;
141 if (iside>=0) nside = m_dimensions[iside].bins();
142 //
143 int neta = 1;
144 if (ieta>=0) neta = m_dimensions[ieta].bins();
145 //
146 int nphi = 1;
147 if (iphi>=0) nphi = m_dimensions[iphi].bins();
148 int nlogE = m_dimensions[ilogE].bins();
149 m_hclus.resize(nside*neta*nphi*nlogE,nullptr);
150 for ( int jside=0;jside<nside;jside++) {
151 for ( int jeta=0;jeta<neta;jeta++) {
152 for ( int jphi=0;jphi<nphi;jphi++) {
153 for(int jlogE=0;jlogE<nlogE;jlogE++) {
154 TString hname("hclus");
155 hname += "_iside_";
156 hname += jside;
157 hname += "_[";
158 hname += (iside>=0?m_dimensions[iside].lowEdge():-1);
159 hname += ",";
160 hname += (iside>=0?m_dimensions[iside].highEdge():-1);
161 hname += ",";
162 hname += nside;
163 hname += "]";
164 hname += "_ieta_";
165 hname += jeta;
166 hname += "_[";
167 hname += (ieta>=0?m_dimensions[ieta].lowEdge():-1);
168 hname += ",";
169 hname += (ieta>=0?m_dimensions[ieta].highEdge():-1);
170 hname += ",";
171 hname += neta;
172 hname += "]";
173 hname += "_iphi_";
174 hname += jphi;
175 hname += "_[";
176 hname += (iphi>=0?m_dimensions[iphi].lowEdge():-1);
177 hname += ",";
178 hname += (iphi>=0?m_dimensions[iphi].highEdge():-1);
179 hname += ",";
180 hname += nphi;
181 hname += "]";
182 hname += "_ilogE_";
183 hname += jlogE;
184 hname += "_[";
185 hname += m_dimensions[ilogE].lowEdge();
186 hname += ",";
187 hname += m_dimensions[ilogE].highEdge();
188 hname += ",";
189 hname += nlogE;
190 hname += "]";
191 int iH = jlogE*nphi*neta*nside+jphi*neta*nside+jeta*nside+jside;
192 m_hclus[iH] = new TH2F(hname,hname,
193 m_dimensions[ilogrho].bins(),
194 m_dimensions[ilogrho].lowEdge(),
195 m_dimensions[ilogrho].highEdge(),
196 m_dimensions[iloglambda].bins(),
197 m_dimensions[iloglambda].lowEdge(),
198 m_dimensions[iloglambda].highEdge());
199 m_hclus[iH]->Sumw2();
200 m_hclus[iH]->SetXTitle("log10(<#rho_{cell}> (MeV/mm^{3})) - log10(E_{clus} (MeV))");
201 m_hclus[iH]->SetYTitle("log10(#lambda_{clus} (mm))");
202 m_hclus[iH]->SetZTitle("Number of Clusters");
203 }
204 }
205 }
206 }
207
208 ATH_CHECK( m_clusterCollName.initialize() );
209
210 return StatusCode::SUCCESS;
211}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x,...)
static const std::vector< std::string > bins
Gaudi::Property< std::string > m_NormalizationType
string to choose different normalization types
Gaudi::Property< std::string > m_ClassificationType
string to choose different classification types
Gaudi::Property< std::string > m_outputFileName
Name of the output file to save histograms in.
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ mapinsert()

void GetLCClassification::mapinsert ( const std::vector< Gaudi::Histo1DDef > & dims)
private

Definition at line 375 of file GetLCClassification.cxx.

375 {
376 for (unsigned int i=0;i<dims.size();i++) {
377 m_dimensionsmap.value()[dims[i].title()] = dims[i];
378 }
379}
Gaudi::Property< std::map< std::string, Gaudi::Histo1DDef > > m_dimensionsmap
property to set all dimensions introduced above

◆ mapparse()

void GetLCClassification::mapparse ( )
private

Definition at line 381 of file GetLCClassification.cxx.

381 {
382
383 for (std::pair<const std::string, Gaudi::Histo1DDef>& p : m_dimensionsmap.value()) {
384 m_dimensions.push_back(p.second);
385 ATH_MSG_DEBUG( " New Dimension: "
386 << p.second.title() << ", [" << p.second.lowEdge()
387 << ", " << p.second.highEdge()
388 << ", " << p.second.bins()
389 << "]" );
390 }
391}
#define ATH_MSG_DEBUG(x,...)

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_ClassificationType

Gaudi::Property<std::string> GetLCClassification::m_ClassificationType {this, "ClassificationType", "None", "Classification type: None, ParticleID_EM or ParticleID_HAD"}
private

string to choose different classification types

Available options are "None": the input MC is expected to be just a single pion MC with one sort of particles; "ParticleID_EM" Gena's ParticleID classification (EM type objects) for the use of QCD MC; "ParticleID_HAD" Gena's ParticleID classification (HAD type objects) for the use of QCD MC;

Definition at line 136 of file GetLCClassification.h.

136{this, "ClassificationType", "None", "Classification type: None, ParticleID_EM or ParticleID_HAD"};

◆ m_ClassificationTypeNumber

int GetLCClassification::m_ClassificationTypeNumber {0}
private

Definition at line 138 of file GetLCClassification.h.

138{0};

◆ m_clusterCollName

SG::ReadHandleKey<xAOD::CaloClusterContainer> GetLCClassification::m_clusterCollName {this, "ClusterCollectionName", "CaloTopoClusters", "Name of the CaloClusterContainer to use"}
private

Name of the CaloClusterContainer to use.

Definition at line 111 of file GetLCClassification.h.

111{this, "ClusterCollectionName", "CaloTopoClusters", "Name of the CaloClusterContainer to use"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_dimensions

std::vector<Gaudi::Histo1DDef> GetLCClassification::m_dimensions
private

definition of all dimensions used for classification

The currently defined dimensions are:

side: negative values for eta < 0 and positive for eta > 0; 1 bin from -1.5 to 1.5 for no side dependency

|eta|: the absolute value of eta; normally in ATLAS the bounds are within [0,5], smaller ones are useful for test beam setups.

phi: the phi range; 1 bin from -pi to pi for no phi dependency

log10(E_clus): the log10 of the cluster energy; typical range should be within the generated energy range of single pions with about 50% room to the maximum created energy - i.e. use log10(1 TeV) as max value if you generated up tp 2 TeV pions

log10(<rho_cell>) - log10(E_clus): the log10 of the cell energy density moment normalized to the cluster energy; typical ranges are from -9 to -4

log10(lambda_clus): the log10 of the cluster depth in the calorimeter; typical ranges are from 0 to 4

Definition at line 73 of file GetLCClassification.h.

◆ m_dimensionsmap

Gaudi::Property<std::map<std::string,Gaudi::Histo1DDef> > GetLCClassification::m_dimensionsmap {this, "ClassificationDimensions", {}, "Dimensions to use for classification"}
private

property to set all dimensions introduced above

Gaudi has only a map<string,Histo1DDef> to use as property. So the syntax for all dimensions introduced above is {'Title': ('Title',Low,High,Bins), ... }.

Definition at line 81 of file GetLCClassification.h.

81{this, "ClassificationDimensions", {}, "Dimensions to use for classification"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_hclus

std::vector<TH2F *> GetLCClassification::m_hclus
private

Vector of actual histograms.

Internal list of histograms to fill and save.

Definition at line 93 of file GetLCClassification.h.

◆ m_isampmap

std::vector<int> GetLCClassification::m_isampmap
private

Vector of indices in m_dimensions.

Internal list of indices in m_dimensions object.

Definition at line 87 of file GetLCClassification.h.

◆ m_NormalizationType

Gaudi::Property<std::string> GetLCClassification::m_NormalizationType {this, "NormalizationType", "Lin", "Normalization type: Const, Lin, Log or NClus"}
private

string to choose different normalization types

Available options are "Const": every cluster counts with weight 1; "Lin": Each cluster is weighted with E_calib_clus/E_calib_tot; "Log": Each cluster is weighted with log10(E_calib_clus/E_calib_tot)+2; "NClus": Each cluster is weighted with 1/TotalNumberOfClustersWithE_calib>0.

Definition at line 123 of file GetLCClassification.h.

123{this, "NormalizationType", "Lin", "Normalization type: Const, Lin, Log or NClus"};

◆ m_NormalizationTypeNumber

int GetLCClassification::m_NormalizationTypeNumber {0}
private

Definition at line 125 of file GetLCClassification.h.

125{0};

◆ m_outputFile

std::unique_ptr<TFile> GetLCClassification::m_outputFile {nullptr}
private

Output file to save histograms in.

Internal variable pointing to the output file.

Definition at line 106 of file GetLCClassification.h.

106{nullptr};

◆ m_outputFileName

Gaudi::Property<std::string> GetLCClassification::m_outputFileName {this, "OutputFileName", "", "Name of the output file to save histograms in"}
private

Name of the output file to save histograms in.

Use this property to set the name of the output file containing the classification histograms.

Definition at line 100 of file GetLCClassification.h.

100{this, "OutputFileName", "", "Name of the output file to save histograms in"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: