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

#include <TileEopFilterAlg.h>

Inheritance diagram for TileEopFilterAlg:
Collaboration diagram for TileEopFilterAlg:

Public Member Functions

 TileEopFilterAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TileEopFilterAlg ()
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

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

std::string m_inputTracks
 
std::string m_outputTracks
 
std::string m_inputClusters
 
std::string m_outputClusters
 
std::string m_inputCells
 
std::string m_outputCells
 
std::string m_trackClusters
 
std::string m_trackCells
 
std::string m_clusterCells
 
float m_trackMom
 
float m_trackEta
 
float m_trackIso
 
float m_trackPtrel
 
float m_trackClusterR
 
float m_trackCellR
 
bool m_dumpLarCells
 
ToolHandle< ITrackToolsm_trackInCalo
 
DataObjIDColl m_extendedExtraObjects
 
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 23 of file TileEopFilterAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileEopFilterAlg()

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

Definition at line 18 of file TileEopFilterAlg.cxx.

18  :
19  AthAlgorithm( name, pSvcLocator ), m_trackInCalo("TrackExtrapolator"){
20 //=======================================
21 
22  declareProperty("InputTracks", m_inputTracks = "InDetTrackParticles");
23  declareProperty("OutputTracks", m_outputTracks = "SelectedTracks");
24  declareProperty("InputClusters", m_inputClusters = "CaloTopoClusters");
25  declareProperty("OutputClusters", m_outputClusters = "SelectedClusters");
26  declareProperty("InputCells", m_inputCells = "AllCalo");
27  declareProperty("OutputCells", m_outputCells = "SelectedCells");
28  declareProperty("TrackClusters", m_trackClusters = "TrackClusters");
29  declareProperty("TrackCells", m_trackCells = "TrackCells");
30  declareProperty("ClusterCells", m_clusterCells = "ClusterCells");
31  declareProperty("TrackMomCut", m_trackMom = 1000.);
32  declareProperty("TrackEtaCut", m_trackEta = 2.4);
33  declareProperty("TrackIsoCut", m_trackIso = 0.8);
34  declareProperty("TrackPtrelCut", m_trackPtrel = 0.15);
35  declareProperty("TrackClusterR", m_trackClusterR = 0.2);
36  declareProperty("TrackCellR", m_trackCellR = 1.0);
37  declareProperty("DumpLArCells", m_dumpLarCells = false);
38  declareProperty("TrackTools", m_trackInCalo);
39 }

◆ ~TileEopFilterAlg()

TileEopFilterAlg::~TileEopFilterAlg ( )
inline

Definition at line 29 of file TileEopFilterAlg.h.

29 {};

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode TileEopFilterAlg::execute ( )
virtual

Definition at line 52 of file TileEopFilterAlg.cxx.

52  {
53 //=======================================
54 
55  //Get the input tracks
56  const TRACKCONTAINER* inputTracks = 0;
58 
59  //Allocate the output tracks container
60  TRACKCONTAINER * outputTracks = new TRACKCONTAINER;
61  TRACKAUXCONTAINER* outputAuxTracks = new TRACKAUXCONTAINER;
62  outputTracks->setStore( outputAuxTracks );
63 
64 
65  //Select tracks
66  TRACKCONTAINER::const_iterator trackItr = inputTracks->begin();
68  for(; trackItr != trackEnd; ++trackItr ){
69  const TRACK* track = *trackItr;
70  if(!track){ ATH_MSG_INFO("Not a valid track"); continue; }
71  //Cut 1. Momentum
72  if(track->p4().P() >= m_trackMom){
73  //Cut 2. Eta
74  if(fabs(track->eta()) <= m_trackEta){
75  /*
76  //Cut 3. Isolation: Only one track in that cone
77  //Extrapolate the current track and all other tracks and check they don't overlap in the range
78  int tracksInCone=1;
79  TRACKCONTAINER::const_iterator trackItr2 = inputTracks->begin();
80  TRACKCONTAINER::const_iterator trackEnd2 = inputTracks->end();
81  vector< vector<double> > etrack = m_trackInCalo->getXYZEtaPhiPerLayer(track);
82  for(; trackItr2 != trackEnd2; ++trackItr2 ){
83  if(trackItr==trackItr2) continue;
84  const TRACK* track2 = *trackItr2;
85  if(track2->p() < m_trackMom) continue;
86  vector< vector<double> > etrack2 = m_trackInCalo->getXYZEtaPhiPerLayer(track2);
87  for(int i=0;i<11;i++){
88  double dif_eta = etrack2[i][3] - etrack[i][3];
89  double dif_phi = etrack2[i][4] - etrack[i][4];
90  if(dif_phi<0) dif_phi=-dif_phi;
91  if(dif_phi>M_PI){dif_phi=2*M_PI-dif_phi;}
92  double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
93  if(deltaR<m_trackIso) tracksInCone++;
94  }
95  }
96  if(tracksInCone==1){
97  TRACK* tmpTrack = new TRACK();
98  tmpTrack->makePrivateStore( track );
99  outputTracks->push_back(tmpTrack);
100  }
101  */
102 
103  //Cut 3. Isolation: require ptcone{IsoCut}/track_pt < ptrelCut
104  double ptcone=0.;
105  TRACKCONTAINER::const_iterator trackItr2 = inputTracks->begin();
106  TRACKCONTAINER::const_iterator trackEnd2 = inputTracks->end();
107  for(; trackItr2 != trackEnd2; ++trackItr2 ){
108  if(trackItr==trackItr2) continue;
109  const TRACK* track2 = *trackItr2;
110  double dif_eta = track->eta() - track2->eta();
111  double dif_phi = track->phi() - track2->phi();
112  if(dif_phi<0) dif_phi=-dif_phi;
113  if(dif_phi>M_PI){dif_phi=2*M_PI-dif_phi;}
114  double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
115  if(deltaR<m_trackIso) ptcone += track2->pt();
116  }
117  if(ptcone/track->pt() < m_trackPtrel ){
118  TRACK* tmpTrack = new TRACK();
119  tmpTrack->makePrivateStore( track );
120  outputTracks->push_back(tmpTrack);
121  }
122  }
123  }
124  }
125 
126  ATH_MSG_DEBUG("Number of selected tracks: " << outputTracks->size());
127 
128  //Get input clusters
129  const CLUSTERCONTAINER* inputClusters = 0;
130  CHECK( evtStore()->retrieve( inputClusters, m_inputClusters ) );
131 
132  //Allocate output clusters container
135  outputClusters->setStore( outputAuxClusters );
136 
137 
138  //Allocate output association between tracks and clusters
139  ASSOCCONTAINER* trackClusters = new ASSOCCONTAINER_CONSTRUCTOR(outputTracks->size());
140  CHECK( evtStore()->record( trackClusters, m_trackClusters ) );
141 
142  //Select clusters that match a track
143  //For each cluster loop over all selected tracks
144  //extrapolate the track to each calorimeter layer
145  //compute distance of cluster center in given layer to track pointer in same layer
146  //select cluster if distance is smaller than threshold
147  CLUSTERCONTAINER::const_iterator clusterItr = inputClusters->begin();
148  CLUSTERCONTAINER::const_iterator clusterEnd = inputClusters->end();
149  for(;clusterItr != clusterEnd; ++clusterItr){
150  const CLUSTER* cluster = *clusterItr;
151  TRACKCONTAINER::const_iterator trackItr = outputTracks->begin();
152  TRACKCONTAINER::const_iterator trackEnd = outputTracks->end();
153  ASSOCCONTAINER::iterator assocItr = trackClusters->begin();
154  for( ; trackItr != trackEnd; ++trackItr ){
155  const TRACK* track = *trackItr;
156  vector< vector<double> > etrack = m_trackInCalo->getXYZEtaPhiPerLayer(track);
157  double deltaR=999;
158  for(int cell_sid=0;cell_sid<CaloSampling::Unknown;cell_sid++){
159  int lay=-1;
160  if (cell_sid==0 || cell_sid==4 ){lay=0;}
161  else if(cell_sid==1 || cell_sid==5 ){lay=1;}
162  else if(cell_sid==2 || cell_sid==6 ){lay=2;}
163  else if(cell_sid==3 || cell_sid==7 ){lay=3;}
164  else if(cell_sid==12 || cell_sid==18){lay=4;}
165  else if(cell_sid==13 || cell_sid==19){lay=5;}
166  else if(cell_sid==15 || cell_sid==17){lay=5;}
167  else if(cell_sid==14 || cell_sid==20){lay=6;}
168  else if(cell_sid==16) {lay=6;}
169  else if(cell_sid==8 ){lay=7;}
170  else if(cell_sid==9 ){lay=8;}
171  else if(cell_sid==10 ){lay=9;}
172  else if(cell_sid==11 ){lay=10;}
173  if(lay==-1) continue;
174  double dif_eta = cluster->etaSample((CaloSampling::CaloSample)cell_sid) - etrack[lay][3];
175  double dif_phi = cluster->phiSample((CaloSampling::CaloSample)cell_sid) - etrack[lay][4];
176  if(dif_phi<0) dif_phi=-dif_phi;
177  if(dif_phi>M_PI){dif_phi=2*M_PI-dif_phi;}
178  double tmp = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
179  deltaR = (tmp<deltaR ? tmp : deltaR);
180  }
181  if(deltaR<=m_trackClusterR){
182  unsigned int i=0;
183  while(i!=outputClusters->size()){if(outputClusters->at(i)==cluster){break;}i++;}
184  if(i==outputClusters->size()){
185  CLUSTER* tmpCluster = new CLUSTER();
186  tmpCluster->makePrivateStore( cluster );
187  outputClusters->push_back(tmpCluster);
188  }
189  //Fill association
190  assocItr->push_back(i); //FIXME
191  }
192  ++assocItr;
193  }
194  }
195 
196  ATH_MSG_DEBUG("Number of selected clusters: " << outputClusters->size());
197 
198  //Get input cells
199  const CELLCONTAINER* inputCells = 0;
200  CHECK( evtStore()->retrieve( inputCells, m_inputCells ) );
201 
202  //Allocate output cells container
204  CHECK( evtStore()->record( outputCells, m_outputCells ) );
205 
206  //Allocate output association between clusters and cells
207  ASSOCCONTAINER* clusterCells = new ASSOCCONTAINER_CONSTRUCTOR(outputClusters->size());
208  CHECK( evtStore()->record( clusterCells, m_clusterCells ) );
209 
210  //Select cells associated to clusters
211  clusterItr = outputClusters->begin();
212  clusterEnd = outputClusters->end();
213  ASSOCCONTAINER::iterator assocItr = clusterCells->begin();
214  //Loop over clusters
215  for(;clusterItr != clusterEnd; ++clusterItr){
216  const CLUSTER* cluster = *clusterItr;
217  if(cluster->getCellLinks() != 0){
218  CLUSTER::const_cell_iterator cellItr = cluster->cell_begin();
219  CLUSTER::const_cell_iterator cellEnd = cluster->cell_end();
220  for(;cellItr != cellEnd; ++cellItr){
221  const CELL* cell = *cellItr;
222  unsigned int i=0;
223  while(i!=outputCells->size()){if(outputCells->at(i)==cell){break;}i++;}
224  if(i==outputCells->size()){
225  outputCells->push_back(cell);
226  }
227  //Fill association
228  assocItr->push_back(i);//FIXME
229  }
230  }
231  ++assocItr;
232  }
233 
234  //Allocate output association between tracks and cells
235  ASSOCCONTAINER* trackCells = new ASSOCCONTAINER_CONSTRUCTOR(outputTracks->size());
236  CHECK( evtStore()->record( trackCells, m_trackCells ) );
237 
238  //Also select cells associated to tracks
239  //cell matches track in a cone of DeltaR and is not in ouputCells already
240  trackItr = outputTracks->begin();
241  trackEnd = outputTracks->end();
242  assocItr = trackCells->begin();
243  //Loop over tracks
244  for( ; trackItr != trackEnd; ++trackItr ){
245  const TRACK* track = *trackItr;
246  vector< vector<double> > etrack = m_trackInCalo->getXYZEtaPhiPerLayer(track);
247  //loop cells
248  CELLCONTAINER::const_iterator cellItr = inputCells->begin();
249  CELLCONTAINER::const_iterator cellEnd = inputCells->end();
250  for(;cellItr != cellEnd; ++cellItr){
251  const CELL* cell = *cellItr;
252  CaloSampling::CaloSample cell_sid = (CaloSampling::CaloSample)cell->caloDDE()->getSampling();
253  //http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.def
254  int lay=-1;
255  if (cell_sid==0 || cell_sid==4 ){lay=0;}
256  else if(cell_sid==1 || cell_sid==5 ){lay=1;}
257  else if(cell_sid==2 || cell_sid==6 ){lay=2;}
258  else if(cell_sid==3 || cell_sid==7 ){lay=3;}
259  else if(cell_sid==12 || cell_sid==18){lay=4;}
260  else if(cell_sid==13 || cell_sid==19){lay=5;}
261  else if(cell_sid==15 || cell_sid==17){lay=5;}
262  else if(cell_sid==14 || cell_sid==20){lay=6;}
263  else if(cell_sid==16) {lay=6;}
264  else if(cell_sid==8 ){lay=7;}
265  else if(cell_sid==9 ){lay=8;}
266  else if(cell_sid==10 ){lay=9;}
267  else if(cell_sid==11 ){lay=10;}
268  if(lay==-1) continue;
269  double dif_eta = cell->eta() - etrack[lay][3];
270  double dif_phi = cell->phi() - etrack[lay][4];
271  if(dif_phi<0) dif_phi=-dif_phi;
272  if(dif_phi>M_PI){dif_phi=2*M_PI-dif_phi;}
273  double deltaR = sqrt(dif_eta*dif_eta+dif_phi*dif_phi);
274  if(deltaR<=m_trackCellR){
275  unsigned int i=0;
276  while(i!=outputCells->size()){if(outputCells->at(i)==cell){break;}i++;}
277  if(i==outputCells->size()){
278  outputCells->push_back(cell);
279  }
280  assocItr->push_back(i);//FIXME
281  }
282  }
283  ++assocItr;
284  }
285 
286  ATH_MSG_DEBUG("Number of selected cells: " << outputCells->size());
287 
288  CHECK( evtStore()->record(outputClusters, m_outputClusters ) );
289  CHECK( evtStore()->record(outputAuxClusters, m_outputClusters+"Aux.") );
290  CHECK( evtStore()->record(outputTracks, m_outputTracks) );
291  CHECK( evtStore()->record(outputAuxTracks, m_outputTracks+"Aux.") );
292 
293 
294  return StatusCode::SUCCESS;
295 
296 }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & 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.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ initialize()

StatusCode TileEopFilterAlg::initialize ( )
virtual

Definition at line 42 of file TileEopFilterAlg.cxx.

42  {
43 //=======================================
44 
45  CHECK(m_trackInCalo.retrieve());
46  //CHECK(m_trackIsoTool.retrieve());
47 
48  return StatusCode::SUCCESS;
49 }

◆ inputHandles()

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

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

std::string TileEopFilterAlg::m_clusterCells
private

Definition at line 44 of file TileEopFilterAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dumpLarCells

bool TileEopFilterAlg::m_dumpLarCells
private

Definition at line 51 of file TileEopFilterAlg.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_inputCells

std::string TileEopFilterAlg::m_inputCells
private

Definition at line 40 of file TileEopFilterAlg.h.

◆ m_inputClusters

std::string TileEopFilterAlg::m_inputClusters
private

Definition at line 38 of file TileEopFilterAlg.h.

◆ m_inputTracks

std::string TileEopFilterAlg::m_inputTracks
private

Definition at line 36 of file TileEopFilterAlg.h.

◆ m_outputCells

std::string TileEopFilterAlg::m_outputCells
private

Definition at line 41 of file TileEopFilterAlg.h.

◆ m_outputClusters

std::string TileEopFilterAlg::m_outputClusters
private

Definition at line 39 of file TileEopFilterAlg.h.

◆ m_outputTracks

std::string TileEopFilterAlg::m_outputTracks
private

Definition at line 37 of file TileEopFilterAlg.h.

◆ m_trackCellR

float TileEopFilterAlg::m_trackCellR
private

Definition at line 50 of file TileEopFilterAlg.h.

◆ m_trackCells

std::string TileEopFilterAlg::m_trackCells
private

Definition at line 43 of file TileEopFilterAlg.h.

◆ m_trackClusterR

float TileEopFilterAlg::m_trackClusterR
private

Definition at line 49 of file TileEopFilterAlg.h.

◆ m_trackClusters

std::string TileEopFilterAlg::m_trackClusters
private

Definition at line 42 of file TileEopFilterAlg.h.

◆ m_trackEta

float TileEopFilterAlg::m_trackEta
private

Definition at line 46 of file TileEopFilterAlg.h.

◆ m_trackInCalo

ToolHandle<ITrackTools> TileEopFilterAlg::m_trackInCalo
private

Definition at line 53 of file TileEopFilterAlg.h.

◆ m_trackIso

float TileEopFilterAlg::m_trackIso
private

Definition at line 47 of file TileEopFilterAlg.h.

◆ m_trackMom

float TileEopFilterAlg::m_trackMom
private

Definition at line 45 of file TileEopFilterAlg.h.

◆ m_trackPtrel

float TileEopFilterAlg::m_trackPtrel
private

Definition at line 48 of file TileEopFilterAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.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::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
ConstDataVector::at
ElementProxy at(size_type n)
Access an element, as an lvalue.
xAOD::CaloCluster_v1::cell_begin
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Definition: CaloCluster_v1.h:812
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::TrackParticleAuxContainer_v5
Temporary container used until we have I/O for AuxStoreInternal.
Definition: TrackParticleAuxContainer_v5.h:35
CLUSTER
xAOD::CaloCluster CLUSTER
Definition: D3PDMaker/TileD3PDMaker/src/ITrackTools.h:89
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
TileEopFilterAlg::m_dumpLarCells
bool m_dumpLarCells
Definition: TileEopFilterAlg.h:51
TileEopFilterAlg::m_trackCells
std::string m_trackCells
Definition: TileEopFilterAlg.h:43
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
TileEopFilterAlg::m_inputTracks
std::string m_inputTracks
Definition: TileEopFilterAlg.h:36
TRACKCONTAINER
xAOD::TrackParticleContainer TRACKCONTAINER
Definition: D3PDMaker/TileD3PDMaker/src/ITrackTools.h:87
M_PI
#define M_PI
Definition: ActiveFraction.h:11
ASSOCCONTAINER_CONSTRUCTOR
#define ASSOCCONTAINER_CONSTRUCTOR(size)
Definition: TileAssocFillerTool.h:23
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TileEopFilterAlg::m_trackIso
float m_trackIso
Definition: TileEopFilterAlg.h:47
TileEopFilterAlg::m_trackClusters
std::string m_trackClusters
Definition: TileEopFilterAlg.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:532
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TileEopFilterAlg::m_trackInCalo
ToolHandle< ITrackTools > m_trackInCalo
Definition: TileEopFilterAlg.h:53
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
TileEopFilterAlg::m_clusterCells
std::string m_clusterCells
Definition: TileEopFilterAlg.h:44
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
python.TrigInDetConfig.inputTracks
inputTracks
Definition: TrigInDetConfig.py:168
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileEopFilterAlg::m_inputClusters
std::string m_inputClusters
Definition: TileEopFilterAlg.h:38
TileEopFilterAlg::m_trackCellR
float m_trackCellR
Definition: TileEopFilterAlg.h:50
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
xAOD::Iso::ptcone
@ ptcone
Track isolation.
Definition: IsolationFlavour.h:22
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:547
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
DataVector< xAOD::TrackParticle_v1 >
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
Definition: CaloCluster_v1.cxx:905
TRACKAUXCONTAINER
xAOD::TrackParticleAuxContainer TRACKAUXCONTAINER
Definition: D3PDMaker/TileD3PDMaker/src/ITrackTools.h:88
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
TileEopFilterAlg::m_outputCells
std::string m_outputCells
Definition: TileEopFilterAlg.h:41
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
xAOD::CaloClusterAuxContainer_v2
Auxiliary container for calorimeter cluster containers.
Definition: CaloClusterAuxContainer_v2.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAOD::CaloClusterAuxContainer
CaloClusterAuxContainer_v2 CaloClusterAuxContainer
Define the latest version of the calorimeter cluster auxiliary container.
Definition: CaloClusterAuxContainer.h:16
TileEopFilterAlg::m_trackClusterR
float m_trackClusterR
Definition: TileEopFilterAlg.h:49
ConstDataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::AuxElement::makePrivateStore
void makePrivateStore()
Create a new (empty) private store for this object.
Definition: AuxElement.cxx:172
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TileEopFilterAlg::m_inputCells
std::string m_inputCells
Definition: TileEopFilterAlg.h:40
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileEopFilterAlg::m_outputTracks
std::string m_outputTracks
Definition: TileEopFilterAlg.h:37
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
TileEopFilterAlg::m_trackEta
float m_trackEta
Definition: TileEopFilterAlg.h:46
xAOD::CaloCluster_v1::cell_end
const_cell_iterator cell_end() const
Definition: CaloCluster_v1.h:813
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
TRACK
xAOD::TrackParticle TRACK
Definition: D3PDMaker/TileD3PDMaker/src/ITrackTools.h:86
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TileEopFilterAlg::m_trackPtrel
float m_trackPtrel
Definition: TileEopFilterAlg.h:48
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
TileEopFilterAlg::m_trackMom
float m_trackMom
Definition: TileEopFilterAlg.h:45
TileEopFilterAlg::m_outputClusters
std::string m_outputClusters
Definition: TileEopFilterAlg.h:39
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
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
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
fitman.k
k
Definition: fitman.py:528
ASSOCCONTAINER
std::vector< std::vector< int > > ASSOCCONTAINER
Definition: TileAssocFillerTool.h:22
ServiceHandle< ICondSvc >