|
ATLAS Offline Software
|
#include <JpsiExample.h>
|
| JpsiExample (const std::string &name, ISvcLocator *pSvcLocator) |
|
StatusCode | initialize () override |
|
StatusCode | execute () override |
|
StatusCode | finalize () override |
|
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 |
|
|
void | initializeBranches (void) |
|
void | clearBranches (void) |
|
TVector3 | trackMomentum (const xAOD::Vertex *vxCandidate, uint trkIndex) const |
|
TLorentzVector | track4Momentum (const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const |
|
TVector3 | origTrackMomentum (const xAOD::Vertex *vxCandidate, int trkIndex) const |
|
TLorentzVector | origTrack4Momentum (const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const |
|
double | invariantMassError (const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const |
|
double | massErrorVKalVrt (const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const |
|
double | trackCharge (const xAOD::Vertex *vxCandidate, int i) const |
|
Amg::MatrixX * | convertVKalCovMatrix (int NTrk, const std::vector< float > &Matrix) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 22 of file JpsiExample.h.
◆ StoreGateSvc_t
◆ JpsiExample()
JpsiExample::JpsiExample |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ clearBranches()
void JpsiExample::clearBranches |
( |
void |
| ) |
|
|
private |
◆ convertVKalCovMatrix()
Amg::MatrixX * JpsiExample::convertVKalCovMatrix |
( |
int |
NTrk, |
|
|
const std::vector< float > & |
Matrix |
|
) |
| const |
|
private |
Definition at line 496 of file JpsiExample.cxx.
501 for(
int i=1;
i<=(3+3*NTrk);
i++){
502 for(
int j=1; j<=
i; j++){
506 (*mtx).fillSymmetric(
i-1,j-1,
Matrix[ij]);
◆ 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 JpsiExample::execute |
( |
| ) |
|
|
override |
Definition at line 127 of file JpsiExample.cxx.
135 jpsiContainer = handle.cptr();
137 if (!jpsiContainer) {
139 return StatusCode::RECOVERABLE;
143 ATH_MSG_DEBUG(
"number of jpsi candidates " << jpsiContainer->size());
154 for (
const xAOD::Vertex* jpsiCandidate : *jpsiContainer) {
169 m_vx->push_back(jpsiCandidate->x());
170 m_vy->push_back(jpsiCandidate->y());
171 m_vz->push_back(jpsiCandidate->z());
186 double orig_mass = (origTrk1+origTrk2).M();
187 double mass = (refTrk1+refTrk2).M();
192 m_jpsiChi2->push_back(jpsiCandidate->chiSquared());
203 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();
◆ finalize()
StatusCode JpsiExample::finalize |
( |
| ) |
|
|
override |
Definition at line 208 of file JpsiExample.cxx.
212 std::cout <<
"===================" << std::endl;
213 std::cout <<
"SUMMARY OF ANALYSIS" << std::endl;
214 std::cout <<
"===================" << std::endl;
215 std::cout <<
" " << std::endl;
216 std::cout <<
"Total number of events analysed: " <<
m_eventCntr << std::endl;
217 std::cout <<
"Total number of jpsi candidates: " <<
m_jpsiCntr << std::endl;
224 return StatusCode::SUCCESS;
◆ initialize()
StatusCode JpsiExample::initialize |
( |
| ) |
|
|
override |
◆ initializeBranches()
void JpsiExample::initializeBranches |
( |
void |
| ) |
|
|
private |
Definition at line 271 of file JpsiExample.cxx.
289 m_vx =
new std::vector<double>;
290 m_vy =
new std::vector<double>;
291 m_vz =
new std::vector<double>;
◆ 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.
◆ invariantMassError()
double JpsiExample::invariantMassError |
( |
const xAOD::Vertex * |
vxCandidate, |
|
|
const std::vector< double > & |
masses |
|
) |
| const |
|
private |
Definition at line 389 of file JpsiExample.cxx.
392 if (
masses.size() != NTrk) {
393 ATH_MSG_WARNING(
"The provided number of masses does not match the number of tracks in the vertex");
398 uint ndimExp = (3*NTrk+3)*(3*NTrk+3+1)/2;
399 if (ndim == ndimExp) {
402 ATH_MSG_WARNING(
"Unknown covariance matrix dimension: " << ndim <<
", expected: " << ndimExp);
◆ massErrorVKalVrt()
double JpsiExample::massErrorVKalVrt |
( |
const xAOD::Vertex * |
vxCandidate, |
|
|
const std::vector< double > & |
masses |
|
) |
| const |
|
private |
Definition at line 411 of file JpsiExample.cxx.
418 std::vector<CLHEP::HepLorentzVector> particleMom(NTrk);
419 std::vector<CLHEP::HepMatrix> particleDeriv(NTrk);
420 CLHEP::HepLorentzVector totalMom;
421 CLHEP::HepMatrix tmpDeriv(3,3);
424 for(
unsigned int it=0;
it<NTrk;
it++){
433 double e = (esq>0.) ? sqrt(esq) : 0.;
435 particleMom[
it] =
tmp;
439 tmpDeriv(1,1) = -
tmp.py();
440 tmpDeriv(2,1) =
tmp.px();
444 tmpDeriv(3,2) = -
sin(
theta)/fabs(invP);
445 tmpDeriv(1,3) = -
tmp.px()/invP;
446 tmpDeriv(2,3) = -
tmp.py()/invP;
447 tmpDeriv(3,3) = -
tmp.pz()/invP;
448 particleDeriv[
it] = tmpDeriv;
451 double dMdPx=0., dMdPy=0., dMdPz=0., dMdPhi=0., dMdTheta=0., dMdInvP=0.;
452 std::vector<double> Deriv(3*NTrk+3, 0.);
453 for(
unsigned int it=0;
it<NTrk;
it++){
454 dMdPx = ( totalMom.e() * particleMom[
it].px()/particleMom[
it].e() - totalMom.px() ) / totalMom.m();
455 dMdPy = ( totalMom.e() * particleMom[
it].py()/particleMom[
it].e() - totalMom.py() ) / totalMom.m();
456 dMdPz = ( totalMom.e() * particleMom[
it].pz()/particleMom[
it].e() - totalMom.pz() ) / totalMom.m();
458 dMdPhi = dMdPx*particleDeriv[
it](1,1) + dMdPy*particleDeriv[
it](2,1) + dMdPz*particleDeriv[
it](3,1);
459 dMdTheta = dMdPx*particleDeriv[
it](1,2) + dMdPy*particleDeriv[
it](2,2) + dMdPz*particleDeriv[
it](3,2);
460 dMdInvP = dMdPx*particleDeriv[
it](1,3) + dMdPy*particleDeriv[
it](2,3) + dMdPz*particleDeriv[
it](3,3);
462 Deriv[3*
it + 3 + 0] = dMdPhi; Deriv[3*
it + 3 + 1] = dMdTheta; Deriv[3*
it + 3 + 2] = dMdInvP;
466 for(
unsigned int i=0;
i<3*NTrk+3;
i++){
467 for(
unsigned int j=0; j<3*NTrk+3; j++){
468 err += Deriv[
i]*( (*fullCov)(
i,j))*Deriv[j];
475 return (
err>0.) ? sqrt(
err) : 0.;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ origTrack4Momentum()
TLorentzVector JpsiExample::origTrack4Momentum |
( |
const xAOD::Vertex * |
vxCandidate, |
|
|
int |
trkIndex, |
|
|
double |
mass |
|
) |
| const |
|
private |
◆ origTrackMomentum()
TVector3 JpsiExample::origTrackMomentum |
( |
const xAOD::Vertex * |
vxCandidate, |
|
|
int |
trkIndex |
|
) |
| const |
|
private |
Definition at line 361 of file JpsiExample.cxx.
365 if(origTrack==NULL) {
369 mom.SetPtEtaPhi(origTrack->
pt(), origTrack->
eta(), origTrack->
phi());
◆ 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.
◆ track4Momentum()
TLorentzVector JpsiExample::track4Momentum |
( |
const xAOD::Vertex * |
vxCandidate, |
|
|
int |
trkIndex, |
|
|
double |
mass |
|
) |
| const |
|
private |
◆ trackCharge()
◆ trackMomentum()
Definition at line 313 of file JpsiExample.cxx.
315 float px = 0.,
py = 0.,
pz = 0.;
330 const std::vector<float>& refTrackPx =
hx(*vxCandidate);
331 const std::vector<float>& refTrackPy =
hy(*vxCandidate);
332 const std::vector<float>& refTrackPz =
hz(*vxCandidate);
334 if(trkIndex < refTrackPx.size() && refTrackPx.size() == refTrackPy.size() && refTrackPz.size()) {
335 px = refTrackPx[trkIndex];
336 py = refTrackPy[trkIndex];
337 pz = refTrackPz[trkIndex];
◆ updateVHKA()
◆ m_auxTree
TTree* JpsiExample::m_auxTree |
|
private |
◆ m_detStore
◆ m_eventCntr
int JpsiExample::m_eventCntr |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_JpsiCandidatesKey
◆ m_jpsiChi2
std::vector<double>* JpsiExample::m_jpsiChi2 |
|
private |
◆ m_jpsiCntr
int JpsiExample::m_jpsiCntr |
|
private |
◆ m_jpsiMass
std::vector<double>* JpsiExample::m_jpsiMass |
|
private |
◆ m_jpsiMassError
std::vector<double>* JpsiExample::m_jpsiMassError |
|
private |
◆ m_jpsiMassPullMC
std::vector<double>* JpsiExample::m_jpsiMassPullMC |
|
private |
◆ m_jpsiMassPullRec
std::vector<double>* JpsiExample::m_jpsiMassPullRec |
|
private |
◆ m_jpsiMassRec
std::vector<double>* JpsiExample::m_jpsiMassRec |
|
private |
◆ m_muonMass
double JpsiExample::m_muonMass |
|
private |
◆ m_outputFile
TFile* JpsiExample::m_outputFile |
|
private |
◆ m_refPX
◆ m_refPY
◆ m_refPZ
◆ m_trkOrigCharge1
std::vector<double>* JpsiExample::m_trkOrigCharge1 |
|
private |
◆ m_trkOrigCharge2
std::vector<double>* JpsiExample::m_trkOrigCharge2 |
|
private |
◆ m_trkOrigPx1
std::vector<double>* JpsiExample::m_trkOrigPx1 |
|
private |
◆ m_trkOrigPx2
std::vector<double>* JpsiExample::m_trkOrigPx2 |
|
private |
◆ m_trkOrigPy1
std::vector<double>* JpsiExample::m_trkOrigPy1 |
|
private |
◆ m_trkOrigPy2
std::vector<double>* JpsiExample::m_trkOrigPy2 |
|
private |
◆ m_trkOrigPz1
std::vector<double>* JpsiExample::m_trkOrigPz1 |
|
private |
◆ m_trkOrigPz2
std::vector<double>* JpsiExample::m_trkOrigPz2 |
|
private |
◆ m_trkRefitPx1
std::vector<double>* JpsiExample::m_trkRefitPx1 |
|
private |
◆ m_trkRefitPx2
std::vector<double>* JpsiExample::m_trkRefitPx2 |
|
private |
◆ m_trkRefitPy1
std::vector<double>* JpsiExample::m_trkRefitPy1 |
|
private |
◆ m_trkRefitPy2
std::vector<double>* JpsiExample::m_trkRefitPy2 |
|
private |
◆ m_trkRefitPz1
std::vector<double>* JpsiExample::m_trkRefitPz1 |
|
private |
◆ m_trkRefitPz2
std::vector<double>* JpsiExample::m_trkRefitPz2 |
|
private |
◆ m_userFName
std::string JpsiExample::m_userFName |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_vx
std::vector<double>* JpsiExample::m_vx |
|
private |
◆ m_vy
std::vector<double>* JpsiExample::m_vy |
|
private |
◆ m_vz
std::vector<double>* JpsiExample::m_vz |
|
private |
The documentation for this class was generated from the following files:
std::vector< double > * m_trkOrigPz2
virtual double pt() const override final
The transverse momentum ( ) of the particle.
std::vector< double > * m_trkRefitPy2
std::vector< double > * m_trkOrigPy2
std::vector< double > * m_vz
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
double trackCharge(const xAOD::Vertex *vxCandidate, int i) const
std::vector< double > * m_vy
Scalar phi() const
phi method
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPX
TLorentzVector origTrack4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
std::vector< double > * m_trkRefitPz2
std::vector< double > * m_jpsiMassError
float charge() const
Returns the charge.
std::vector< double > * m_trkOrigPy1
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Scalar theta() const
theta method
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPY
std::vector< double > * m_trkOrigCharge1
std::vector< double > * m_trkRefitPy1
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::vector< double > * m_trkOrigPx2
std::vector< double > * m_jpsiMassRec
virtual void setOwner(IDataHandleHolder *o)=0
double invariantMassError(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
TVector3 origTrackMomentum(const xAOD::Vertex *vxCandidate, int trkIndex) const
virtual StatusCode sysInitialize() override
Override sysInitialize.
Handle class for reading a decoration on an object.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
std::vector< double > * m_trkRefitPx1
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::MatrixX * convertVKalCovMatrix(int NTrk, const std::vector< float > &Matrix) const
void initializeBranches(void)
std::vector< double > * m_trkRefitPz1
TLorentzVector track4Momentum(const xAOD::Vertex *vxCandidate, int trkIndex, double mass) const
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::vector< double > * m_jpsiMass
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< double > * m_trkOrigPz1
std::vector< double > * m_jpsiChi2
std::vector< double > * m_trkOrigCharge2
std::vector< double > * m_jpsiMassPullMC
double massErrorVKalVrt(const xAOD::Vertex *vxCandidate, const std::vector< double > &masses) const
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
DataObjIDColl m_extendedExtraObjects
std::vector< double > * m_vx
Class describing a Vertex.
std::vector< double > * m_trkOrigPx1
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadHandleKey< xAOD::VertexContainer > m_JpsiCandidatesKey
Name of J/psi container.
AthAlgorithm()
Default constructor:
Class describing a TrackParticle.
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< double > * m_jpsiMassPullRec
SG::ReadDecorHandleKey< xAOD::VertexContainer > m_refPZ
TVector3 trackMomentum(const xAOD::Vertex *vxCandidate, uint trkIndex) const
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
std::vector< double > * m_trkRefitPx2