Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
// -*- C++ -*-
//
// Package:     Calo
// Class  :     FWCaloTowerSliceSelector
//
// Implementation:
//     [Notes on implementation]
//
// Original Author:  Alja Mrak-Tadel
//         Created:  Wed Jun  2 17:36:23 CEST 2010
//

// system include files

// user include files
#include "TH2F.h"
#include "TMath.h"
#include "Fireworks/Calo/plugins/FWCaloTowerSliceSelector.h"
#include "Fireworks/Core/interface/FWModelChangeManager.h"
#include "Fireworks/Core/interface/FWEventItem.h"
#include "DataFormats/CaloTowers/interface/CaloTower.h"
#include "DataFormats/CaloTowers/interface/CaloTowerDefs.h"

FWCaloTowerSliceSelector::FWCaloTowerSliceSelector(TH2F* h, const FWEventItem* i) : FWHistSliceSelector(h, i) {}

FWCaloTowerSliceSelector::~FWCaloTowerSliceSelector() {}

void FWCaloTowerSliceSelector::getItemEntryEtaPhi(int itemIdx, float& eta, float& phi) const {
  const CaloTowerCollection* towers = nullptr;
  m_item->get(towers);
  assert(nullptr != towers);
  CaloTowerCollection::const_iterator tower = towers->begin();
  std::advance(tower, itemIdx);

  eta = tower->eta();
  phi = tower->phi();
}