1 #ifndef ALIEMCALITERABLECONTAINER_H 2 #define ALIEMCALITERABLECONTAINER_H 3 #if !(defined(__CINT__) || defined(__MAKECINT__)) 10 #include <type_traits> 15 #if (__GNUC__ >= 3) && !defined(__INTEL_COMPILER) 19 #pragma GCC system_header 22 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 23 #pragma GCC diagnostic push 24 #pragma GCC diagnostic ignored "-Weffc++" 27 class AliEmcalContainer;
39 static star_return_type
star(momentum_object_pair* ptr) {
return *ptr; }
40 static arrow_return_type
arrow(momentum_object_pair* ptr) {
return ptr; }
51 static star_return_type
star(momentum_object_pair* ptr) {
return ptr->second; }
52 static arrow_return_type
arrow(momentum_object_pair* ptr) {
return &(ptr->second); }
94 template <
typename T,
typename STAR=operator_star_
object<T> >
118 class iterator final :
public std::iterator<std::bidirectional_iterator_tag, typename STAR::iterator_type, std::ptrdiff_t> {
125 bool operator!=(
const iterator &ref)
const;
132 typename STAR::star_return_type
operator*() {
return STAR::star(&(this->fCurrentElement)); }
133 typename STAR::arrow_return_type
operator->() {
return STAR::arrow(&(this->fCurrentElement)); }
147 if (fCurrent < 0 || fCurrent >= fkData->
GetContainer()->GetNEntries()) {
148 this->fCurrentElement.first.SetPxPyPzE(0,0,0,0);
149 this->fCurrentElement.second = 0;
152 this->fCurrentElement.second = (*fkData)[fCurrent];
168 T *operator[](
int index)
const;
174 operator int()
const {
return GetEntries(); }
182 int GetEntries()
const;
213 void BuildAcceptIndices();
222 return index < 0 || index >= fAcceptIndices.GetSize() ? -1 : fAcceptIndices[index];
231 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 232 #pragma GCC diagnostic pop 241 template <
typename T,
typename STAR>
256 template <
typename T,
typename STAR>
270 template <
typename T,
typename STAR>
285 template <
typename T,
typename STAR>
300 template <
typename T,
typename STAR>
320 template <
typename T,
typename STAR>
324 if(_index < 0 || _index >= contref.GetNEntries())
return NULL;
325 return static_cast<T*
>(contref[_index]);
333 template <
typename T,
typename STAR>
336 int acceptCounter = 0;
337 for(
int index = 0; index <
fkContainer->GetNEntries(); index++){
338 UInt_t rejectionReason = 0;
359 template <
typename T,
typename STAR>
362 fCurrent(currentpos),
374 template <
typename T,
typename STAR>
390 template <
typename T,
typename STAR>
406 template <
typename T,
typename STAR>
416 template <
typename T,
typename STAR>
431 template <
typename T,
typename STAR>
448 template <
typename T,
typename STAR>
462 template <
typename T,
typename STAR>
STAR::arrow_return_type operator->()
AliEmcalIterableContainerT & operator=(const AliEmcalIterableContainerT< T, STAR > &ref)
momentum_object_pair iterator_type
bidirectional stl iterator over the EMCAL iterable container
Declaration of class AliTLorentzVector.
static star_return_type star(momentum_object_pair *ptr)
const AliTLorentzVector & get_momentum() const
const AliEmcalContainer * GetContainer() const
STAR::star_return_type operator*()
static arrow_return_type arrow(momentum_object_pair *ptr)
UShort_t T(UShort_t m, UShort_t t)
std::pair< AliTLorentzVector, T * > momentum_object_pair
bool operator!=(const iterator &ref) const
void update_current_element()
static arrow_return_type arrow(momentum_object_pair *ptr)
Bool_t fUseAccepted
Switch between accepted and all objects.
static star_return_type star(momentum_object_pair *ptr)
void BuildAcceptIndices()
T * operator[](int index) const
momentum_object_pair fCurrentElement
current element pair (momentum, pointer object)
int fCurrent
current index in the container
const AliEmcalContainer * fkContainer
Container to be iterated over.
std::pair< AliTLorentzVector, T * > momentum_object_pair
iterator & operator=(const iterator &ref)
TArrayI fAcceptIndices
Array of accepted indices.
std::pair< AliTLorentzVector, T * > momentum_object_pair
const AliEmcalIterableContainerT< T, STAR > * fkData
container with data
bool fForward
use forward or backward direction
const momentum_object_pair * arrow_return_type
int GetInternalIndex(int index) const
const momentum_object_pair & star_return_type
AliEmcalIterableContainerT()
~AliEmcalIterableContainerT()
int current_index() const