Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:27

0001 // -*- C++ -*-
0002 //
0003 // Package:     Calo
0004 // Class  :     FWCaloTowerSliceSelector
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Alja Mrak-Tadel
0010 //         Created:  Wed Jun  2 17:36:23 CEST 2010
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "TH2F.h"
0017 #include "TMath.h"
0018 #include "Fireworks/Calo/plugins/FWCaloTowerSliceSelector.h"
0019 #include "Fireworks/Core/interface/FWModelChangeManager.h"
0020 #include "Fireworks/Core/interface/FWEventItem.h"
0021 #include "DataFormats/CaloTowers/interface/CaloTower.h"
0022 #include "DataFormats/CaloTowers/interface/CaloTowerDefs.h"
0023 
0024 FWCaloTowerSliceSelector::FWCaloTowerSliceSelector(TH2F* h, const FWEventItem* i) : FWHistSliceSelector(h, i) {}
0025 
0026 FWCaloTowerSliceSelector::~FWCaloTowerSliceSelector() {}
0027 
0028 void FWCaloTowerSliceSelector::getItemEntryEtaPhi(int itemIdx, float& eta, float& phi) const {
0029   const CaloTowerCollection* towers = nullptr;
0030   m_item->get(towers);
0031   assert(nullptr != towers);
0032   CaloTowerCollection::const_iterator tower = towers->begin();
0033   std::advance(tower, itemIdx);
0034 
0035   eta = tower->eta();
0036   phi = tower->phi();
0037 }