|
ATLAS Offline Software
|
#include <TruthHitAnalysis.h>
|
| TruthHitAnalysis (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~TruthHitAnalysis () |
|
virtual StatusCode | initialize () |
|
virtual StatusCode | execute () |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. 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 | 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 |
|
Definition at line 24 of file TruthHitAnalysis.h.
◆ StoreGateSvc_t
◆ TruthHitAnalysis()
TruthHitAnalysis::TruthHitAnalysis |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~TruthHitAnalysis()
TruthHitAnalysis::~TruthHitAnalysis |
( |
| ) |
|
|
inline |
◆ 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()
StatusCode TruthHitAnalysis::execute |
( |
| ) |
|
|
virtual |
Definition at line 224 of file TruthHitAnalysis.cxx.
243 if (
evtStore()->
retrieve(mcCollection,
"TruthEvent") == StatusCode::SUCCESS) {
245 if (currentGenEventIter != mcCollection->
end()) {
249 const auto &
barcodes = (*currentGenEventIter)->attribute<HepMC::GenEventBarcodes> (
"barcodes");
250 std::map<int,int> id_to_barcode_map;
252 for (
const auto& vtx: (*currentGenEventIter)->vertices()) {
253 int bcode = id_to_barcode_map[vtx->id()];
255 for (HepMC::GenEvent::vertex_const_iterator vtxit=(*currentGenEventIter)->vertices_begin(); vtxit!=(*currentGenEventIter)->vertices_end(); ++vtxit) {
259 double x = vtx->position().x();
260 double y = vtx->position().y();
261 double z = vtx->position().z();
262 double r = std::sqrt(
x*
x+
y*
y);
293 for (
auto currentGenParticle: *(*currentGenEventIter)) {
294 const HepMC::FourVector
mom = currentGenParticle->momentum();
296 int currentGenParticlebarcode = id_to_barcode_map[currentGenParticle->id()];
314 m_barcode->push_back(currentGenParticlebarcode);
315 m_status->push_back(currentGenParticle->status());
317 int pdg = currentGenParticle->pdg_id();
352 return StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ initialize()
StatusCode TruthHitAnalysis::initialize |
( |
| ) |
|
|
virtual |
histograms declaration
now add branches and leaves to the tree
Definition at line 76 of file TruthHitAnalysis.cxx.
83 m_h_n_vert =
new TH1D(
"h_n_vert",
"n_vert", 100,200, 1500);
87 m_h_n_part =
new TH1D(
"h_n_part",
"n_part", 100,1000, 10000);
95 m_h_n_part_prim =
new TH1D(
"h_n_part_prim",
"n_part prim", 100,200, 1500);
99 m_h_n_vert_sec =
new TH1D(
"h_n_vert_sec",
"n_vert sec", 100,0, 1000);
103 m_h_n_part_sec =
new TH1D(
"h_n_part_sec",
"n_part sec", 100,0, 5000);
107 m_h_vtx_x =
new TH1D(
"h_vtx_x",
"vtx_x", 100,-1300, 1300);
111 m_h_vtx_y =
new TH1D(
"h_vtx_y",
"vtx_y", 100,-1200, 1200);
115 m_h_vtx_z =
new TH1D(
"h_vtx_z",
"vtx_z", 100,-5000, 5000);
119 m_h_vtx_r =
new TH1D(
"h_vtx_r",
"vtx_r", 100,0, 1160);
123 m_h_vtx_prim_xy =
new TH2D(
"h_vtx_prim_xy",
"vtx_prim_xy", 100,-100, 100, 100,-100, 100);
127 m_h_vtx_prim_zr =
new TH2D(
"h_vtx_prim_zr",
"vtx_prim_zr", 100,-1500, 1500, 100,0, 150);
131 m_h_vtx_sec_xy =
new TH2D(
"h_vtx_sec_xy",
"vtx_sec_xy", 100,-1200, 1200, 100,-1200, 1200);
135 m_h_vtx_sec_zr =
new TH2D(
"h_vtx_sec_zr",
"vtx_sec_zr", 100,-6000, 6000, 100,0, 1160);
143 m_h_truth_px =
new TH1D(
"h_turht_px",
"truth_px", 100,0, 4000);
147 m_h_truth_py =
new TH1D(
"h_turht_py",
"truth_py", 100,0, 4000);
151 m_h_truth_pz =
new TH1D(
"h_truth_pz",
"truth_pz", 100,0, 4000);
155 m_h_truth_pt =
new TH1D(
"h_truth_pt",
"truth_pt", 100,0, 4000);
159 m_h_truth_eta =
new TH1D(
"h_truth_eta",
"truth_eta", 50,-10, 10);
163 m_h_truth_phi =
new TH1D(
"h_truth_phi",
"truth_phi", 25,-3.1416, 3.1416);
167 m_h_barcode =
new TH1D(
"h_truth_barcode",
"truth_barcode", 100,0, 300000);
175 m_h_part_pdgid =
new TH1D(
"h_part_pdgid",
"part pdgid", 100,-5000, 5000);
183 m_h_part_eta =
new TH1D(
"h_part_eta",
"part eta", 100,-10, 10);
187 m_h_part_phi =
new TH1D(
"h_part_phi",
"part phi", 100,-3.2, 3.2);
191 m_h_part_p =
new TH1D(
"h_part_p",
"part p", 100,0, 5000);
196 m_tree =
new TTree(
"Truth",
"Truth");
220 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.
◆ 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()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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_barcode
std::vector<float>* TruthHitAnalysis::m_barcode |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_h_barcode
TH1* TruthHitAnalysis::m_h_barcode |
|
private |
◆ m_h_n_generations
TH1* TruthHitAnalysis::m_h_n_generations |
|
private |
◆ m_h_n_part
TH1* TruthHitAnalysis::m_h_n_part |
|
private |
◆ m_h_n_part_prim
TH1* TruthHitAnalysis::m_h_n_part_prim |
|
private |
◆ m_h_n_part_sec
TH1* TruthHitAnalysis::m_h_n_part_sec |
|
private |
◆ m_h_n_vert
TH1* TruthHitAnalysis::m_h_n_vert |
|
private |
◆ m_h_n_vert_prim
TH1* TruthHitAnalysis::m_h_n_vert_prim |
|
private |
◆ m_h_n_vert_sec
TH1* TruthHitAnalysis::m_h_n_vert_sec |
|
private |
◆ m_h_part_eta
TH1* TruthHitAnalysis::m_h_part_eta |
|
private |
◆ m_h_part_p
TH1* TruthHitAnalysis::m_h_part_p |
|
private |
◆ m_h_part_pdgid
TH1* TruthHitAnalysis::m_h_part_pdgid |
|
private |
◆ m_h_part_pdgid_sec
TH1* TruthHitAnalysis::m_h_part_pdgid_sec |
|
private |
◆ m_h_part_phi
TH1* TruthHitAnalysis::m_h_part_phi |
|
private |
◆ m_h_part_status
TH1* TruthHitAnalysis::m_h_part_status |
|
private |
◆ m_h_truth_eta
TH1* TruthHitAnalysis::m_h_truth_eta |
|
private |
◆ m_h_truth_phi
TH1* TruthHitAnalysis::m_h_truth_phi |
|
private |
◆ m_h_truth_pt
TH1* TruthHitAnalysis::m_h_truth_pt |
|
private |
◆ m_h_truth_px
TH1* TruthHitAnalysis::m_h_truth_px |
|
private |
◆ m_h_truth_py
TH1* TruthHitAnalysis::m_h_truth_py |
|
private |
◆ m_h_truth_pz
TH1* TruthHitAnalysis::m_h_truth_pz |
|
private |
◆ m_h_vtx_prim_xy
TH2* TruthHitAnalysis::m_h_vtx_prim_xy |
|
private |
◆ m_h_vtx_prim_zr
TH2* TruthHitAnalysis::m_h_vtx_prim_zr |
|
private |
◆ m_h_vtx_r
TH1* TruthHitAnalysis::m_h_vtx_r |
|
private |
◆ m_h_vtx_sec_xy
TH2* TruthHitAnalysis::m_h_vtx_sec_xy |
|
private |
◆ m_h_vtx_sec_zr
TH2* TruthHitAnalysis::m_h_vtx_sec_zr |
|
private |
◆ m_h_vtx_x
TH1* TruthHitAnalysis::m_h_vtx_x |
|
private |
◆ m_h_vtx_y
TH1* TruthHitAnalysis::m_h_vtx_y |
|
private |
◆ m_h_vtx_z
TH1* TruthHitAnalysis::m_h_vtx_z |
|
private |
◆ m_ntupleFileName
std::string TruthHitAnalysis::m_ntupleFileName |
|
private |
◆ m_path
std::string TruthHitAnalysis::m_path |
|
private |
◆ m_pdgid
std::vector<float>* TruthHitAnalysis::m_pdgid |
|
private |
◆ m_status
std::vector<float>* TruthHitAnalysis::m_status |
|
private |
◆ m_thistSvc
◆ m_tree
TTree* TruthHitAnalysis::m_tree |
|
private |
◆ m_truth_eta
std::vector<float>* TruthHitAnalysis::m_truth_eta |
|
private |
◆ m_truth_phi
std::vector<float>* TruthHitAnalysis::m_truth_phi |
|
private |
◆ m_truth_pt
std::vector<float>* TruthHitAnalysis::m_truth_pt |
|
private |
◆ m_truth_px
std::vector<float>* TruthHitAnalysis::m_truth_px |
|
private |
◆ m_truth_py
std::vector<float>* TruthHitAnalysis::m_truth_py |
|
private |
◆ m_truth_pz
std::vector<float>* TruthHitAnalysis::m_truth_pz |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_vtx_barcode
std::vector<float>* TruthHitAnalysis::m_vtx_barcode |
|
private |
◆ m_vtx_r
std::vector<float>* TruthHitAnalysis::m_vtx_r |
|
private |
◆ m_vtx_x
std::vector<float>* TruthHitAnalysis::m_vtx_x |
|
private |
◆ m_vtx_y
std::vector<float>* TruthHitAnalysis::m_vtx_y |
|
private |
◆ m_vtx_z
std::vector<float>* TruthHitAnalysis::m_vtx_z |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::vector< float > * m_pdgid
Const iterator class for DataVector/DataList.
std::string m_ntupleFileName
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< float > * m_truth_py
std::vector< float > * m_barcode
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
TH1 * m_h_n_vert
Some variables.
std::vector< float > * m_truth_phi
std::vector< float > * m_vtx_r
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize() override
Override sysInitialize.
std::vector< float > * m_vtx_barcode
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
def barcodes(beg, end, sz)
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< float > * m_status
std::vector< float > * m_truth_px
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
std::vector< float > * m_vtx_y
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ServiceHandle< ITHistSvc > m_thistSvc
AthAlgorithm()
Default constructor:
std::vector< float > * m_vtx_z
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
std::vector< float > * m_truth_pt
std::vector< float > * m_truth_eta
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< float > * m_vtx_x
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::vector< float > * m_truth_pz