Reimplemented from FWProxyBuilderBase.
Definition at line 50 of file FWCaloTauProxyBuilder.cc.
References fireworks::addCircle(), FWTauProxyBuilderBase::buildBaseTau(), reco::CaloTauTagInfo::calojetRef(), FWProxyBuilderBase::createCompound(), FWEventItem::get(), reco::CaloJet::getCaloConstituents(), metsig::jet, FWViewType::kLego, FWTauProxyBuilderBase::m_maxTheta, FWTauProxyBuilderBase::m_minTheta, FWTauProxyBuilderBase::m_phis, max(), min, FWProxyBuilderBase::setupAddElement(), and fireworks::thetaBins().
{
reco::CaloTauCollection const * caloTaus = 0;
iItem->get( caloTaus );
if( caloTaus == 0 ) return;
Int_t idx = 0;
for( reco::CaloTauCollection::const_iterator it = caloTaus->begin(), itEnd = caloTaus->end(); it != itEnd; ++it, ++idx)
{
TEveCompound* comp = createCompound();
if (viewType == FWViewType::kLego)
{
fireworks::addCircle( (*it).eta(), (*it).phi(), 0.5, 20, comp, this );
}
else
{
const reco::CaloTauTagInfo *tauTagInfo = dynamic_cast<const reco::CaloTauTagInfo*>(((*it).caloTauTagInfoRef().get()));
const reco::CaloJet *jet = dynamic_cast<const reco::CaloJet*>((tauTagInfo->calojetRef().get()));
int min = 100;
int max = -100;
std::vector<double> phis;
std::vector<CaloTowerPtr> towers = jet->getCaloConstituents();
for( std::vector<CaloTowerPtr>::const_iterator tower = towers.begin(), towerEnd = towers.end();
tower != towerEnd; ++tower )
{
unsigned int ieta = 41 + (*tower)->id().ieta();
if( ieta > 40 ) --ieta;
assert( ieta <= 82 );
if( int(ieta) > max ) max = ieta;
if( int(ieta) < min ) min = ieta;
m_phis.push_back( (*tower)->phi() );
}
if( min > max ) {
min = 0; max = 0;
}
const std::vector<std::pair<double, double> > thetaBins = fireworks::thetaBins();
m_minTheta = thetaBins[min].first;
m_maxTheta = thetaBins[max].second;
buildBaseTau(*it, *jet, comp, viewType, vc);
m_phis.clear();
}
setupAddElement( comp, product );
}
}