ATLAS Offline Software
ParticleLinks.h
Go to the documentation of this file.
1 // dear emacs, this is -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef PARTICLEEVENT_PARTICLELINKS_H
8 #define PARTICLEEVENT_PARTICLELINKS_H 1
9 
11 // //
12 // ParticleLinks //
13 // //
14 // Store vector<ElementLink> of selected particles //
15 // //
16 // S. Protopopescu 9 Dec. 2008 //
17 // //
19 
21 //
22 // ParticleLinks is a std::vector of ElementLink<Container>
23 // there should be only one instance in a branch, one can have multiple versions per Container
24 //
25 //
27 //
28 // it inherits vector, so all vector methods are available
29 //
30 // Additional methods:
31 // isGood(i) will return true if ith particle was selected
32 // isGood(ptr) will return true if pointer ptr is in ParticleLinks
33 //
34 //
36 #include <vector>
37 #include<string>
38 #include "AthLinks/ElementLink.h"
39 #include "AthenaKernel/CLASS_DEF.h"
40 
41 template<class Container>
42 class ParticleLinks: public std::vector< ElementLink<Container> >
43 {
44  public:
45 
47  virtual ~ParticleLinks(){;}
48  // find if ith particle was selected
49  bool isGood(unsigned i) const;
50  // find if particle pointer ptr is in ParticleLinks
51  //bool isGood(ElementConstPointer ptr) const;
52  private:
53 };
54 
55 template<class Container>
57 
58 // check by index
59 
60 template<class Container>
61 bool ParticleLinks<Container>::isGood(unsigned i) const{
62  typedef ParticleLinks<Container> Links;
63  typename Links::const_iterator itr=this->begin();
64  for(;itr!=this->end();++itr){
65  if(i==(*itr).index()) return true;
66  }
67  return false;
68 }
69 
70 #endif // !PARTICLEEVENT_PARTICLELINKS_H
71 
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Container
storage of the time histories of all the cells
lumiFormat.i
int i
Definition: lumiFormat.py:92
vector
Definition: MultiHisto.h:13
CLASS_DEF.h
macros to associate a CLID to a type