ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DerivationFramework::VertexPlus1TrackCascade Class Reference

#include <VertexPlus1TrackCascade.h>

Inheritance diagram for DerivationFramework::VertexPlus1TrackCascade:
Collaboration diagram for DerivationFramework::VertexPlus1TrackCascade:

Public Member Functions

 VertexPlus1TrackCascade (const std::string &t, const std::string &n, const IInterface *p)
 
 ~VertexPlus1TrackCascade ()
 
StatusCode initialize () override
 
StatusCode finalize () override
 
StatusCode performSearch (std::vector< Trk::VxCascadeInfo * > *cascadeinfoContainer) const
 
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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 
static double getInvariantMass (const std::vector< const xAOD::TrackParticle * > &Tracks, const std::vector< double > &massHypotheses)
 
static bool isContainedIn (const xAOD::TrackParticle *theTrack, const xAOD::MuonContainer *theColl)
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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...
 

Private Attributes

SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainerKey
 
SG::ReadHandleKey< xAOD::TrackParticleContainerm_TrackPContainerKey
 
SG::ReadHandleKey< xAOD::MuonContainerm_MuonsUsedInJpsiKey
 
std::vector< double > m_massHypothesis
 
std::vector< int > m_massConstraintTracksVtx1
 
std::vector< int > m_massConstraintTracksVtx2
 
double m_Vtx1MassConstraint
 
double m_Vtx2MassConstraint
 
double m_trkThresholdPt
 
double m_trkMaxEta
 
double m_roughMassLower
 
double m_roughMassUpper
 
ToolHandle< Trk::TrkVKalVrtFitterm_iVertexFitter
 
ToolHandle< Trk::ITrackSelectorToolm_trkSelector
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 33 of file VertexPlus1TrackCascade.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ VertexPlus1TrackCascade()

DerivationFramework::VertexPlus1TrackCascade::VertexPlus1TrackCascade ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 48 of file VertexPlus1TrackCascade.cxx.

48  : AthAlgTool(t,n,p),
54  m_trkThresholdPt(0.0),
55  m_trkMaxEta(102.5),
56 // m_BThresholdPt(0.0),
57 // m_BMassUpper(0.0),
58 // m_BMassLower(0.0),
59  m_roughMassLower(0.0),
60  m_roughMassUpper(0.0),
61  m_iVertexFitter("Trk::TrkVKalVrtFitter"),
62  m_trkSelector("InDet::TrackSelectorTool")
63  {
64  declareProperty("InitialVertices", m_vertexContainerKey);
65  declareProperty("TrackParticleCollection", m_TrackPContainerKey);
66  declareProperty("MuonCollection", m_MuonsUsedInJpsiKey);
67  declareProperty("MassHypthesis", m_massHypothesis);
68  declareProperty("MassContraintTracksVtx1", m_massConstraintTracksVtx1);
69  declareProperty("MassContraintTracksVtx2", m_massConstraintTracksVtx2);
70 
71  declareProperty("Vtx1MassConstraint", m_Vtx1MassConstraint);
72  declareProperty("Vtx2MassConstraint", m_Vtx2MassConstraint);
73 
74  declareProperty("trkThresholdPtCut", m_trkThresholdPt);
75  declareProperty("trkMassEtaCut", m_trkMaxEta);
76 // declareProperty("BThresholdPtCut", m_BThresholdPt);
77 // declareProperty("BMassUpperCut", m_BMassUpper);
78 // declareProperty("BMassLowerCut", m_BMassLower);
79 
80  declareProperty("RoughMassUpperCut", m_roughMassLower);
81  declareProperty("RoughMassLowerCut", m_roughMassUpper);
82 
83  }

◆ ~VertexPlus1TrackCascade()

DerivationFramework::VertexPlus1TrackCascade::~VertexPlus1TrackCascade ( )

Definition at line 85 of file VertexPlus1TrackCascade.cxx.

85 { }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode DerivationFramework::VertexPlus1TrackCascade::finalize ( )
override

Definition at line 42 of file VertexPlus1TrackCascade.cxx.

42  {
43 
44  return StatusCode::SUCCESS;
45 
46  }

◆ getInvariantMass()

double DerivationFramework::VertexPlus1TrackCascade::getInvariantMass ( const std::vector< const xAOD::TrackParticle * > &  Tracks,
const std::vector< double > &  massHypotheses 
)
static

Definition at line 87 of file VertexPlus1TrackCascade.cxx.

87  {
88 
89  TLorentzVector total;
90  total.SetVectM(Tracks[0]->p4().Vect(), massHypotheses[0]);
91  TLorentzVector temp;
92  for(size_t i=1; i < Tracks.size(); i++){
93  temp.SetVectM(Tracks[i]->p4().Vect(), massHypotheses[i]);
94  total += temp;
95  }
96  return total.M();
97  }

◆ initialize()

StatusCode DerivationFramework::VertexPlus1TrackCascade::initialize ( )
override

Definition at line 18 of file VertexPlus1TrackCascade.cxx.

18  {
19 
20  // retrieving vertex Fitter
21  if ( m_iVertexFitter.retrieve().isFailure() ) {
22  ATH_MSG_FATAL("Failed to retrieve tool " << m_iVertexFitter);
23  return StatusCode::FAILURE;
24  } else {
25  ATH_MSG_DEBUG("Retrieved tool " << m_iVertexFitter);
26  }
27 
28  // Get the track selector tool from ToolSvc
29  if ( m_trkSelector.retrieve().isFailure() ) {
30  ATH_MSG_FATAL("Failed to retrieve tool " << m_trkSelector);
31  return StatusCode::FAILURE;
32  } else {
33  ATH_MSG_DEBUG("Retrieved tool " << m_trkSelector);
34  }
35  if(!m_vertexContainerKey.key().empty()) ATH_CHECK(m_vertexContainerKey.initialize());
37  if(!m_MuonsUsedInJpsiKey.key().empty()) ATH_CHECK(m_MuonsUsedInJpsiKey.initialize());
38 
39  return StatusCode::SUCCESS;
40  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

static const InterfaceID& DerivationFramework::VertexPlus1TrackCascade::interfaceID ( )
inlinestatic

Definition at line 60 of file VertexPlus1TrackCascade.h.

60 { return IID_VertexPlus1TrackCascade;}

◆ isContainedIn()

bool DerivationFramework::VertexPlus1TrackCascade::isContainedIn ( const xAOD::TrackParticle theTrack,
const xAOD::MuonContainer theColl 
)
static

Definition at line 99 of file VertexPlus1TrackCascade.cxx.

99  {
100  bool isContained(false);
101  for (auto muItr=theColl->cbegin(); muItr!=theColl->cend(); ++muItr) {
102  auto& link = ( *muItr )->inDetTrackParticleLink();
103  if ( link.isValid() && ( *link == theTrack ) ) {isContained=true; break;}
104  }
105  return isContained;
106  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ performSearch()

StatusCode DerivationFramework::VertexPlus1TrackCascade::performSearch ( std::vector< Trk::VxCascadeInfo * > *  cascadeinfoContainer) const

Definition at line 108 of file VertexPlus1TrackCascade.cxx.

109  {
110  ATH_MSG_DEBUG( "VertexPlus1TrackCascade::performSearch" );
111  assert(cascadeinfoContainer!=nullptr);
113  if(!vertexContainer.isValid()){
114  ATH_MSG_ERROR("No VertexContainer with key " << m_vertexContainerKey.key() << " found in StoreGate. BCandidates will be EMPTY!");
115  return StatusCode::FAILURE;
116  }
117 
118  // Get tracks
120  if(!TrackPContainer.isValid()){
121  ATH_MSG_ERROR("No track particle collection with name " << m_TrackPContainerKey.key() << " found in StoreGate!");
122  return StatusCode::FAILURE;
123  }
124 
125 
126  // Get the muon collection used to build the J/psis
127  const xAOD::MuonContainer* importedMuonCollection = nullptr;
128  if (!m_MuonsUsedInJpsiKey.key().empty()) {
130  if(handle.isValid()) importedMuonCollection = handle.cptr();
131  else {
132  ATH_MSG_FATAL("problem retrieving MuonContainer " << m_MuonsUsedInJpsiKey.key());
133  return StatusCode::FAILURE;
134  }
135  ATH_MSG_DEBUG("Muon container size "<< importedMuonCollection->size());
136  }
137 
138  // Select the inner detector tracks
139  TrackBag theIDTracksAfterSelection;
140  for (auto tp : *TrackPContainer){
141  if ( tp->pt()<m_trkThresholdPt ) continue;
142  if ( fabs(tp->eta())>m_trkMaxEta ) continue;
143  if (importedMuonCollection!=NULL) {
144  if (isContainedIn(tp, importedMuonCollection)) continue;
145  }
146  if ( m_trkSelector->decision(*tp, NULL) ) theIDTracksAfterSelection.push_back(tp);
147  }
148 
149  const std::vector<double> &fullMassHypoth = (m_massHypothesis);
150  const std::vector<double> initialVertexMassHypo(fullMassHypoth.begin(), fullMassHypoth.end()-1);
151 
152  TrackBag originalVertexTracks(initialVertexMassHypo.size());
153  TrackBag secondVertexTracks(fullMassHypoth.size());
154 
155  const std::vector< Trk::VertexID > emptyVtxList;
156  TrackBag ConstraintTracksVtx1(m_massConstraintTracksVtx1.size());
157  TrackBag ConstraintTracksVtx2(m_massConstraintTracksVtx2.size());
158 
159  assert(fullMassHypoth.size() == secondVertexTracks.size());
160 
161  for(auto vertex : *vertexContainer){ //Iterate over previous vertices
162 
163  size_t OriginaltrackNum = vertex->nTrackParticles();
164  if(initialVertexMassHypo.size() != OriginaltrackNum){
165  ATH_MSG_FATAL("Mass hypothesis not correctly set");
166  return StatusCode::FAILURE;
167  }
168  for(size_t i = 0;i<OriginaltrackNum;i++)
169  originalVertexTracks[i] = secondVertexTracks[i] = (vertex->trackParticle(i));
170 
171  for(auto newtrack : theIDTracksAfterSelection){
172  //Skip any track already used in vertex
173  if(std::find(originalVertexTracks.begin(), originalVertexTracks.end(), newtrack) != originalVertexTracks.end()) continue;
174 
175  secondVertexTracks.back() = newtrack;
176 
177  double roughmass = getInvariantMass(secondVertexTracks, fullMassHypoth);
178 
179  if(m_roughMassUpper > 0.0 && (roughmass < m_roughMassLower || roughmass > m_roughMassUpper)) continue;
180 
181  std::unique_ptr<Trk::IVKalState> state = m_iVertexFitter->makeState();
182  m_iVertexFitter->setRobustness( 0, *state );
183 
184  auto vID1 = m_iVertexFitter->startVertex( originalVertexTracks, initialVertexMassHypo, *state );
185  auto vID2 = m_iVertexFitter->nextVertex( secondVertexTracks, fullMassHypoth, *state );
186 
187  if(!m_massConstraintTracksVtx1.empty()){
188  for(size_t i =0; i<m_massConstraintTracksVtx1.size(); i++) ConstraintTracksVtx1[i] = originalVertexTracks.at(m_massConstraintTracksVtx1[i]);
189  if( !m_iVertexFitter->addMassConstraint( vID1, ConstraintTracksVtx1, emptyVtxList, *state, m_Vtx1MassConstraint ).isSuccess() ) {
190  ATH_MSG_WARNING( "cascade fit: addMassConstraint failed" );
191  }
192  }
193 
194  if(!m_massConstraintTracksVtx2.empty()){
195  for(size_t i =0; i<m_massConstraintTracksVtx2.size(); i++) ConstraintTracksVtx2[i] = secondVertexTracks.at(m_massConstraintTracksVtx2[i]);
196  if( !m_iVertexFitter->addMassConstraint( vID2, ConstraintTracksVtx2, emptyVtxList,*state, m_Vtx2MassConstraint ).isSuccess() ) {
197  ATH_MSG_WARNING( "cascade fit: addMassConstraint failed" );
198  }
199  }
200 
201  auto result = m_iVertexFitter->fitCascade(*state);
202  if(result ==nullptr ){ ATH_MSG_WARNING("Cascade Fit failed"); continue; }
203  assert(result->vertices().size()==2);
204  cascadeinfoContainer->push_back(result);
205 
206  }
207 
208  }
209  ATH_MSG_DEBUG("cascadeinfoContainer size " << cascadeinfoContainer->size());
210  return StatusCode::SUCCESS;
211  }

◆ 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< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_iVertexFitter

ToolHandle< Trk::TrkVKalVrtFitter > DerivationFramework::VertexPlus1TrackCascade::m_iVertexFitter
private

Definition at line 56 of file VertexPlus1TrackCascade.h.

◆ m_massConstraintTracksVtx1

std::vector<int> DerivationFramework::VertexPlus1TrackCascade::m_massConstraintTracksVtx1
private

Definition at line 43 of file VertexPlus1TrackCascade.h.

◆ m_massConstraintTracksVtx2

std::vector<int> DerivationFramework::VertexPlus1TrackCascade::m_massConstraintTracksVtx2
private

Definition at line 44 of file VertexPlus1TrackCascade.h.

◆ m_massHypothesis

std::vector<double> DerivationFramework::VertexPlus1TrackCascade::m_massHypothesis
private

Definition at line 41 of file VertexPlus1TrackCascade.h.

◆ m_MuonsUsedInJpsiKey

SG::ReadHandleKey<xAOD::MuonContainer> DerivationFramework::VertexPlus1TrackCascade::m_MuonsUsedInJpsiKey
private

Definition at line 39 of file VertexPlus1TrackCascade.h.

◆ m_roughMassLower

double DerivationFramework::VertexPlus1TrackCascade::m_roughMassLower
private

Definition at line 54 of file VertexPlus1TrackCascade.h.

◆ m_roughMassUpper

double DerivationFramework::VertexPlus1TrackCascade::m_roughMassUpper
private

Definition at line 55 of file VertexPlus1TrackCascade.h.

◆ m_TrackPContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> DerivationFramework::VertexPlus1TrackCascade::m_TrackPContainerKey
private

Definition at line 38 of file VertexPlus1TrackCascade.h.

◆ m_trkMaxEta

double DerivationFramework::VertexPlus1TrackCascade::m_trkMaxEta
private

Definition at line 49 of file VertexPlus1TrackCascade.h.

◆ m_trkSelector

ToolHandle< Trk::ITrackSelectorTool > DerivationFramework::VertexPlus1TrackCascade::m_trkSelector
private

Definition at line 57 of file VertexPlus1TrackCascade.h.

◆ m_trkThresholdPt

double DerivationFramework::VertexPlus1TrackCascade::m_trkThresholdPt
private

Definition at line 48 of file VertexPlus1TrackCascade.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> DerivationFramework::VertexPlus1TrackCascade::m_vertexContainerKey
private

Definition at line 37 of file VertexPlus1TrackCascade.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_Vtx1MassConstraint

double DerivationFramework::VertexPlus1TrackCascade::m_Vtx1MassConstraint
private

Definition at line 45 of file VertexPlus1TrackCascade.h.

◆ m_Vtx2MassConstraint

double DerivationFramework::VertexPlus1TrackCascade::m_Vtx2MassConstraint
private

Definition at line 46 of file VertexPlus1TrackCascade.h.


The documentation for this class was generated from the following files:
DerivationFramework::VertexPlus1TrackCascade::m_massConstraintTracksVtx2
std::vector< int > m_massConstraintTracksVtx2
Definition: VertexPlus1TrackCascade.h:44
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DerivationFramework::VertexPlus1TrackCascade::m_roughMassLower
double m_roughMassLower
Definition: VertexPlus1TrackCascade.h:54
DerivationFramework::VertexPlus1TrackCascade::m_trkThresholdPt
double m_trkThresholdPt
Definition: VertexPlus1TrackCascade.h:48
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ParticleTest.tp
tp
Definition: ParticleTest.py:25
DerivationFramework::VertexPlus1TrackCascade::m_Vtx2MassConstraint
double m_Vtx2MassConstraint
Definition: VertexPlus1TrackCascade.h:46
DataVector::cend
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
DerivationFramework::VertexPlus1TrackCascade::getInvariantMass
static double getInvariantMass(const std::vector< const xAOD::TrackParticle * > &Tracks, const std::vector< double > &massHypotheses)
Definition: VertexPlus1TrackCascade.cxx:87
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::VertexPlus1TrackCascade::m_roughMassUpper
double m_roughMassUpper
Definition: VertexPlus1TrackCascade.h:55
DerivationFramework::VertexPlus1TrackCascade::m_TrackPContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackPContainerKey
Definition: VertexPlus1TrackCascade.h:38
DerivationFramework::VertexPlus1TrackCascade::m_trkSelector
ToolHandle< Trk::ITrackSelectorTool > m_trkSelector
Definition: VertexPlus1TrackCascade.h:57
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FlavorTagDiscriminants::internal::Tracks
std::vector< const xAOD::TrackParticle * > Tracks
Definition: DataPrepUtilities.h:65
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DerivationFramework::VertexPlus1TrackCascade::m_vertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Definition: VertexPlus1TrackCascade.h:37
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DerivationFramework::TrackBag
std::vector< const xAOD::TrackParticle * > TrackBag
Definition: BPhysAddMuonBasedInvMass.h:32
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DerivationFramework::VertexPlus1TrackCascade::m_Vtx1MassConstraint
double m_Vtx1MassConstraint
Definition: VertexPlus1TrackCascade.h:45
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
a
TList * a
Definition: liststreamerinfos.cxx:10
h
DerivationFramework::VertexPlus1TrackCascade::isContainedIn
static bool isContainedIn(const xAOD::TrackParticle *theTrack, const xAOD::MuonContainer *theColl)
Definition: VertexPlus1TrackCascade.cxx:99
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
DataVector::cbegin
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
DerivationFramework::VertexPlus1TrackCascade::m_iVertexFitter
ToolHandle< Trk::TrkVKalVrtFitter > m_iVertexFitter
Definition: VertexPlus1TrackCascade.h:56
DerivationFramework::VertexPlus1TrackCascade::m_trkMaxEta
double m_trkMaxEta
Definition: VertexPlus1TrackCascade.h:49
DerivationFramework::VertexPlus1TrackCascade::m_MuonsUsedInJpsiKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonsUsedInJpsiKey
Definition: VertexPlus1TrackCascade.h:39
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DerivationFramework::VertexPlus1TrackCascade::m_massConstraintTracksVtx1
std::vector< int > m_massConstraintTracksVtx1
Definition: VertexPlus1TrackCascade.h:43
fitman.k
k
Definition: fitman.py:528
DerivationFramework::VertexPlus1TrackCascade::m_massHypothesis
std::vector< double > m_massHypothesis
Definition: VertexPlus1TrackCascade.h:41