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

#include <CaloClusterVertexFractionMaker.h>

Inheritance diagram for CaloClusterVertexFractionMaker:
Collaboration diagram for CaloClusterVertexFractionMaker:

Public Member Functions

 CaloClusterVertexFractionMaker (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~CaloClusterVertexFractionMaker ()
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override
 Execute on an entire collection of clusters. More...
 
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const=0
 Execute on an entire collection of clusters. More...
 
virtual StatusCode execute (xAOD::CaloClusterContainer *collection) final
 Execute on an entire collection of clusters. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
virtual StatusCode execute (xAOD::CaloClusterContainer *collection) final
 Execute on an entire collection of clusters. More...
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Standard Gaudi interface ID method. More...
 

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

Static Private Member Functions

static double calculateDPhi (double phi1, double phi2)
 

Private Attributes

const double m_CALO_INNER_R
 
const double m_CALO_INNER_Z
 
double m_dRMatchMax
 
double m_dR2MatchMax
 
double m_maxClusterEta
 
ToolHandle< Trk::IExtrapolatorm_extrapolator
 
std::string m_vxContainerName
 
std::unique_ptr< Trk::Surfacem_cylinderSurface_atCaloEntrance
 
std::unique_ptr< Trk::Surfacem_discSurface_atCaloEntrance_positiveZ
 
std::unique_ptr< Trk::Surfacem_discSurface_atCaloEntrance_negativeZ
 
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 16 of file CaloClusterVertexFractionMaker.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

◆ CaloClusterVertexFractionMaker()

CaloClusterVertexFractionMaker::CaloClusterVertexFractionMaker ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 27 of file CaloClusterVertexFractionMaker.cxx.

29  m_CALO_INNER_R(1450.), // millimeter
30  m_CALO_INNER_Z(3641.), // millimeter
31  m_dRMatchMax(0.1),
32  m_dR2MatchMax(0.), // will be overwritten in initialize
33  m_maxClusterEta(2.5),
34  m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
35  m_vxContainerName("VxPrimaryCandidate")
36 {
37  declareProperty ( "Extrapolator", m_extrapolator );
38  declareProperty ( "VxContainerName", m_vxContainerName );
39  declareProperty ( "dRMatchMax", m_dRMatchMax );
40  declareProperty ( "maxClusterEta", m_maxClusterEta );
41 }

◆ ~CaloClusterVertexFractionMaker()

CaloClusterVertexFractionMaker::~CaloClusterVertexFractionMaker ( )

Definition at line 43 of file CaloClusterVertexFractionMaker.cxx.

44 {
45  // all delete statements are in finalize (otherwise genconf crashes .. no idea why)
46 }

Member Function Documentation

◆ calculateDPhi()

double CaloClusterVertexFractionMaker::calculateDPhi ( double  phi1,
double  phi2 
)
staticprivate

Definition at line 230 of file CaloClusterVertexFractionMaker.cxx.

231 {
232  double dPhi = std::fabs(phi1 - phi2);
233  if (dPhi > M_PI) dPhi = 2.*M_PI - dPhi;
234 // if (dPhi > 3.1415926535897931) dPhi = 6.2831853071795862 - dPhi;
235  return dPhi;
236 }

◆ 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; }

◆ execute() [1/4]

virtual StatusCode CaloClusterCollectionProcessor::execute

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters. param ctx The event context.

◆ execute() [2/4]

StatusCode CaloClusterVertexFractionMaker::execute ( const EventContext &  ctx,
xAOD::CaloClusterContainer collection 
) const
overridevirtual

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters. param ctx The event context.

usual complicated procedure to get from the vertex to the track(particle)

Implements CaloClusterCollectionProcessor.

Definition at line 73 of file CaloClusterVertexFractionMaker.cxx.

75 {
76  const VxContainer* primcontainer(nullptr);
77  if ( evtStore()->contains<VxContainer> ( m_vxContainerName ) )
78  {
79  if ( evtStore()->retrieve ( primcontainer, m_vxContainerName ).isFailure() )
80  {
81  ATH_MSG_WARNING( "Could not retrieve collection " << m_vxContainerName << " in StoreGate, but contains<> says it is there." );
82  return StatusCode::FAILURE;
83  }
84  } else {
85  ATH_MSG_WARNING( "No collection " << m_vxContainerName << " in StoreGate." );
86  return StatusCode::FAILURE;
87  }
88 
89  // loop over vertices, extrapolate tracks to calo, remember num tracks per vertex (for cluster vertex fraction calculation later)
90  std::vector<unsigned int> numTracksPerVertex(primcontainer->size()-1, 0);
91  std::vector<float> trkParticlePt_atOrigin;
92  std::vector<float> trkParticleEta_atCaloEntrance;
93  std::vector<float> trkParticlePhi_atCaloEntrance;
94 
95  for (unsigned int v = 0 ; v < primcontainer->size()-1; ++v)
96  {
97  const std::vector<Trk::VxTrackAtVertex*>* vxTrackAtVertex = primcontainer->at(v)->vxTrackAtVertex();
98  for (std::vector<Trk::VxTrackAtVertex*>::const_iterator vxTrkItr = vxTrackAtVertex->begin(); vxTrkItr != vxTrackAtVertex->end(); ++vxTrkItr)
99  {
101  Trk::ITrackLink* trklink = (*vxTrkItr)->trackOrParticleLink();
102  Trk::LinkToTrackParticleBase* linkToTrackParticle = dynamic_cast<Trk::LinkToTrackParticleBase*>(trklink);
103  if (linkToTrackParticle != nullptr && linkToTrackParticle->isValid()) {
104  const Rec::TrackParticle* theTrackParticle = dynamic_cast<const Rec::TrackParticle*>(linkToTrackParticle->cachedElement());
105  if (theTrackParticle != nullptr)
106  {
107  const Trk::TrackParameters* trackParameters_atCaloEntrance(nullptr);
108  numTracksPerVertex.at(v)++;
109  trkParticlePt_atOrigin.push_back (theTrackParticle->pt()/1.e3);
110 
111  const Trk::TrackParameters* lastTrackParametersInID(nullptr);
112  const std::vector< const Trk::TrackParameters * >& trackParametersVector = theTrackParticle->trackParameters();
113  if (trackParametersVector.size() > 1) lastTrackParametersInID = trackParametersVector.at(trackParametersVector.size()-2);
114  else lastTrackParametersInID = trackParametersVector.at(0); // the perigee
115 
116  // very simplified way for now to decide to extrapolate a track to barrel or endcap
117  if (theTrackParticle->eta() >
118  1.35) // track most likely in endcap A, extrapolate track to a
119  // disc at ID exist in positive z direction
120  {
121  trackParameters_atCaloEntrance =
122  dynamic_cast<const Trk::AtaDisc*>(m_extrapolator->extrapolate(
123  ctx,
124  *lastTrackParametersInID,
127  true,
128  Trk::pion).release());
129  } else if (theTrackParticle->eta() <
130  -1.35) // track most likely in endcap C, extrapolate track
131  // to a disc at ID exist in negative z direction
132  {
133  trackParameters_atCaloEntrance =
134  dynamic_cast<const Trk::AtaDisc*>(m_extrapolator->extrapolate(
135  ctx,
136  *lastTrackParametersInID,
139  true,
140  Trk::pion).release());
141  } else // track is in barrel, extrapolate to cylinder at ID exit
142  {
143  trackParameters_atCaloEntrance =
144  dynamic_cast<const Trk::AtaCylinder*>(
145  m_extrapolator->extrapolate(ctx,
146  *lastTrackParametersInID,
149  true,
150  Trk::pion).release());
151  }
152  if (trackParameters_atCaloEntrance != nullptr) {
153  trkParticleEta_atCaloEntrance.push_back(trackParameters_atCaloEntrance->position().eta());
154  trkParticlePhi_atCaloEntrance.push_back(trackParameters_atCaloEntrance->position().phi());
155  ATH_MSG_DEBUG( "At calo entrance R(1150mm) " << *trackParameters_atCaloEntrance );
156  ATH_MSG_DEBUG( "TrkParticle eta/phi/pt[GeV] at calo " << trackParameters_atCaloEntrance->position().eta() << "\t"
157  << trackParameters_atCaloEntrance->position().phi() << "\t"
158  << trackParameters_atCaloEntrance->position().perp()/1.e3 );
159  delete trackParameters_atCaloEntrance;
160  } else {
161  trkParticleEta_atCaloEntrance.push_back(999.);
162  trkParticlePhi_atCaloEntrance.push_back(999.);
163  }
164  }
165  }
166  }
167  }
168 
169  double fabs_Dphi(9999.);
170  double fabs_Deta(9999.);
171  double dR2(9999.);
172  std::vector<float> sumPtOfMatchedTracksPerVertex(numTracksPerVertex.size(), 0.);
173 
174  for (xAOD::CaloClusterContainer::iterator clItr = caloClusterContainer->begin(); clItr != caloClusterContainer->end(); ++clItr)
175  {
176  xAOD::CaloCluster* theCluster = (*clItr);
177 // double cl_theta = 2.*atan(exp(-theCluster->eta()));
178 // double cl_et = theCluster->e()/1.e3*sin(cl_theta);
179  if (std::fabs(theCluster->eta()) < 2.5)
180  {
181  // Calculation of Cluster Vertex Fraction
182  std::vector<unsigned int>::iterator numTrksPerVertexItr = numTracksPerVertex.begin();
183  std::vector<unsigned int>::iterator numTrksPerVertexItrE = numTracksPerVertex.end();
184  unsigned int vertexCounter(0);
185  unsigned int totalTrackCounter(0);
186  for ( ; numTrksPerVertexItr != numTrksPerVertexItrE ; ++numTrksPerVertexItr, vertexCounter++)
187  {
188  sumPtOfMatchedTracksPerVertex.at(vertexCounter) = 0.;
189  for (unsigned int track = 0; track < (*numTrksPerVertexItr); ++track, totalTrackCounter++)
190  {
191  if (trkParticleEta_atCaloEntrance.at(totalTrackCounter) < 900.) // no need to check phi as well (not extrapolated eta is set to 999.)
192  {
193  fabs_Dphi = calculateDPhi(trkParticlePhi_atCaloEntrance.at(totalTrackCounter), theCluster->phi());
194  fabs_Deta = fabs(trkParticleEta_atCaloEntrance.at(totalTrackCounter) - theCluster->eta());
195  dR2 = fabs_Deta * fabs_Deta + fabs_Dphi * fabs_Dphi;
196  if (dR2 < m_dR2MatchMax) {
197  sumPtOfMatchedTracksPerVertex.at(vertexCounter) += trkParticlePt_atOrigin.at(totalTrackCounter);
198  }
199  }
200  }
201  }
202  double totalSumPtOfMatchedTracksWhichWereAlsoUsedInAVertex(0.);
203  for (unsigned int mTpV = 0; mTpV < sumPtOfMatchedTracksPerVertex.size(); ++mTpV) {
204  totalSumPtOfMatchedTracksWhichWereAlsoUsedInAVertex += sumPtOfMatchedTracksPerVertex.at(mTpV);
205  //std::cout << "CaloClusterVertexFractionMakerAOD: " << mTpV << "\t" << sumPtOfMatchedTracksPerVertex.at(mTpV) << std::endl;
206  }
207 
208  double cvf(-1.);
209  double ncvf(-1.);
210  if (totalSumPtOfMatchedTracksWhichWereAlsoUsedInAVertex > 0.)
211  {
212  double sumPtInPrimary = sumPtOfMatchedTracksPerVertex.at(0);
213  cvf = sumPtOfMatchedTracksPerVertex.at(0)/totalSumPtOfMatchedTracksWhichWereAlsoUsedInAVertex;
214  std::sort(sumPtOfMatchedTracksPerVertex.begin(), sumPtOfMatchedTracksPerVertex.end());
215  double highestSumPt = sumPtOfMatchedTracksPerVertex.at(sumPtOfMatchedTracksPerVertex.size()-1);
216  if (highestSumPt > 0) ncvf = sumPtInPrimary/highestSumPt;
217  }
218  //std::cout << "CaloClusterVertexFractionMakerAOD: cvf " << cvf << "\tncvf " << ncvf << std::endl;
219  theCluster->insertMoment(xAOD::CaloCluster::VERTEX_FRACTION, cvf); // false at the end writes the moment into the moment store of the cluster directly (the moment is then written to AOD as well)
220  theCluster->insertMoment(xAOD::CaloCluster::NVERTEX_FRACTION, ncvf); // false at the end writes the moment into the moment store of the cluster directly (the moment is then written to AOD as well)
221  } else {
222  theCluster->insertMoment(xAOD::CaloCluster::VERTEX_FRACTION, -1.); // false at the end writes the moment into the moment store of the cluster directly (the moment is then written to AOD as well)
223  theCluster->insertMoment(xAOD::CaloCluster::NVERTEX_FRACTION, -1.); // false at the end writes the moment into the moment store of the cluster directly (the moment is then written to AOD as well)
224  }
225  }
226 
227  return StatusCode::SUCCESS;
228 }

◆ execute() [3/4]

virtual StatusCode CaloClusterCollectionProcessor::execute
inlinefinal

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters. (deprecated)

Definition at line 49 of file CaloClusterCollectionProcessor.h.

50  {
51  return execute (Gaudi::Hive::currentContext(), collection);
52  }

◆ execute() [4/4]

virtual StatusCode CaloClusterCollectionProcessor::execute ( xAOD::CaloClusterContainer collection)
inlinefinalvirtualinherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters. (deprecated)

Definition at line 49 of file CaloClusterCollectionProcessor.h.

50  {
51  return execute (Gaudi::Hive::currentContext(), collection);
52  }

◆ 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

◆ initialize()

StatusCode CaloClusterVertexFractionMaker::initialize ( )
overridevirtual

Definition at line 48 of file CaloClusterVertexFractionMaker.cxx.

49 {
50  ATH_MSG_INFO( "Initializing " << name() );
51  ATH_MSG_INFO( "Only considering clusters with |eta| < " << m_maxClusterEta << "\tdRMatchMax Cluster-Track = " << m_dRMatchMax );
52 
54 
55  /* Get the extrapolator */
56  ATH_CHECK( m_extrapolator.retrieve() );
57  ATH_MSG_INFO( "Retrieved tool " << m_extrapolator );
58 
59  // a surface at the entrance to the calorimeter
60 // HepGeom::TranslateZ3D* translateAlongPositiveZ = new HepGeom::TranslateZ3D(m_CALO_INNER_Z);
61 // HepGeom::TranslateZ3D* translateAlongNegativeZ = new HepGeom::TranslateZ3D(-m_CALO_INNER_Z);
62  Amg::Transform3D translateAlongPositiveZ = Amg::Transform3D(Amg::Vector3D(0.,0.,m_CALO_INNER_Z));
63  Amg::Transform3D translateAlongNegativeZ = Amg::Transform3D(Amg::Vector3D(0.,0.,m_CALO_INNER_Z));
64 
65  m_cylinderSurface_atCaloEntrance = std::make_unique<Trk::CylinderSurface>(m_CALO_INNER_R, 8000.);
66  m_discSurface_atCaloEntrance_positiveZ = std::make_unique<Trk::DiscSurface>(translateAlongPositiveZ, 0., 10000.);
67  m_discSurface_atCaloEntrance_negativeZ = std::make_unique<Trk::DiscSurface>(translateAlongNegativeZ, 0., 10000.);
68 
69  return StatusCode::SUCCESS;
70 }

◆ 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& CaloClusterCollectionProcessor::interfaceID ( )
inlinestaticinherited

Standard Gaudi interface ID method.

Definition at line 58 of file CaloClusterCollectionProcessor.h.

58 {return IID_CaloClusterCollectionProcessor;}

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

◆ 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_CALO_INNER_R

const double CaloClusterVertexFractionMaker::m_CALO_INNER_R
private

Definition at line 30 of file CaloClusterVertexFractionMaker.h.

◆ m_CALO_INNER_Z

const double CaloClusterVertexFractionMaker::m_CALO_INNER_Z
private

Definition at line 31 of file CaloClusterVertexFractionMaker.h.

◆ m_cylinderSurface_atCaloEntrance

std::unique_ptr<Trk::Surface> CaloClusterVertexFractionMaker::m_cylinderSurface_atCaloEntrance
private

Definition at line 43 of file CaloClusterVertexFractionMaker.h.

◆ 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_discSurface_atCaloEntrance_negativeZ

std::unique_ptr<Trk::Surface> CaloClusterVertexFractionMaker::m_discSurface_atCaloEntrance_negativeZ
private

Definition at line 45 of file CaloClusterVertexFractionMaker.h.

◆ m_discSurface_atCaloEntrance_positiveZ

std::unique_ptr<Trk::Surface> CaloClusterVertexFractionMaker::m_discSurface_atCaloEntrance_positiveZ
private

Definition at line 44 of file CaloClusterVertexFractionMaker.h.

◆ m_dR2MatchMax

double CaloClusterVertexFractionMaker::m_dR2MatchMax
private

Definition at line 34 of file CaloClusterVertexFractionMaker.h.

◆ m_dRMatchMax

double CaloClusterVertexFractionMaker::m_dRMatchMax
private

Definition at line 33 of file CaloClusterVertexFractionMaker.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_extrapolator

ToolHandle< Trk::IExtrapolator > CaloClusterVertexFractionMaker::m_extrapolator
private

Definition at line 38 of file CaloClusterVertexFractionMaker.h.

◆ m_maxClusterEta

double CaloClusterVertexFractionMaker::m_maxClusterEta
private

Definition at line 35 of file CaloClusterVertexFractionMaker.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vxContainerName

std::string CaloClusterVertexFractionMaker::m_vxContainerName
private

Definition at line 41 of file CaloClusterVertexFractionMaker.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
CaloClusterVertexFractionMaker::calculateDPhi
static double calculateDPhi(double phi1, double phi2)
Definition: CaloClusterVertexFractionMaker.cxx:230
xAOD::CaloCluster_v1::VERTEX_FRACTION
@ VERTEX_FRACTION
Vertex fraction of this cluster wrt.
Definition: CaloCluster_v1.h:184
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloClusterVertexFractionMaker::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override
Execute on an entire collection of clusters.
Definition: CaloClusterVertexFractionMaker.cxx:73
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
CaloClusterCollectionProcessor::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
xAOD::CaloCluster_v1::insertMoment
void insertMoment(MomentType type, double value)
Definition: CaloCluster_v1.cxx:754
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
I4Momentum::pt
virtual double pt() const =0
transverse momentum
CaloClusterVertexFractionMaker::m_dR2MatchMax
double m_dR2MatchMax
Definition: CaloClusterVertexFractionMaker.h:34
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
CaloClusterVertexFractionMaker::m_dRMatchMax
double m_dRMatchMax
Definition: CaloClusterVertexFractionMaker.h:33
CaloClusterVertexFractionMaker::m_maxClusterEta
double m_maxClusterEta
Definition: CaloClusterVertexFractionMaker.h:35
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloClusterVertexFractionMaker::m_CALO_INNER_Z
const double m_CALO_INNER_Z
Definition: CaloClusterVertexFractionMaker.h:31
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
CaloClusterVertexFractionMaker::m_discSurface_atCaloEntrance_positiveZ
std::unique_ptr< Trk::Surface > m_discSurface_atCaloEntrance_positiveZ
Definition: CaloClusterVertexFractionMaker.h:44
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CaloClusterVertexFractionMaker::m_cylinderSurface_atCaloEntrance
std::unique_ptr< Trk::Surface > m_cylinderSurface_atCaloEntrance
Definition: CaloClusterVertexFractionMaker.h:43
test_pyathena.parent
parent
Definition: test_pyathena.py:15
I4Momentum::eta
virtual double eta() const =0
pseudo rapidity
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
Trk::ParametersBase
Definition: ParametersBase.h:55
VxContainer
Definition: VxContainer.h:28
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
Trk::LinkToTrackParticleBase
Definition: LinkToTrackParticleBase.h:17
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloClusterVertexFractionMaker::m_discSurface_atCaloEntrance_negativeZ
std::unique_ptr< Trk::Surface > m_discSurface_atCaloEntrance_negativeZ
Definition: CaloClusterVertexFractionMaker.h:45
Trk::TrackParticleBase::trackParameters
const std::vector< const TrackParameters * > & trackParameters() const
Returns the track parameters.
Definition: TrackParticleBase.h:243
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
python.PyAthena.v
v
Definition: PyAthena.py:154
CaloClusterVertexFractionMaker::m_CALO_INNER_R
const double m_CALO_INNER_R
Definition: CaloClusterVertexFractionMaker.h:30
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CaloClusterVertexFractionMaker::m_vxContainerName
std::string m_vxContainerName
Definition: CaloClusterVertexFractionMaker.h:41
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::CaloCluster_v1::NVERTEX_FRACTION
@ NVERTEX_FRACTION
slightly updated vertex fraction more pile up independent (similar to nJVF)
Definition: CaloCluster_v1.h:185
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CaloClusterVertexFractionMaker::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: CaloClusterVertexFractionMaker.h:38
fitman.k
k
Definition: fitman.py:528