CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWCaloTauProxyBuilder Class Reference

Inheritance diagram for FWCaloTauProxyBuilder:
FWTauProxyBuilderBase FWProxyBuilderBase

List of all members.

Public Member Functions

 FWCaloTauProxyBuilder ()
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWCaloTauProxyBuilder ()

Private Member Functions

virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *vc)
 FWCaloTauProxyBuilder (const FWCaloTauProxyBuilder &)
const FWCaloTauProxyBuilderoperator= (const FWCaloTauProxyBuilder &)

Detailed Description

Definition at line 34 of file FWCaloTauProxyBuilder.cc.


Constructor & Destructor Documentation

FWCaloTauProxyBuilder::FWCaloTauProxyBuilder ( ) [inline]

Definition at line 37 of file FWCaloTauProxyBuilder.cc.

{}
virtual FWCaloTauProxyBuilder::~FWCaloTauProxyBuilder ( ) [inline, virtual]

Definition at line 38 of file FWCaloTauProxyBuilder.cc.

{}
FWCaloTauProxyBuilder::FWCaloTauProxyBuilder ( const FWCaloTauProxyBuilder ) [private]

Member Function Documentation

void FWCaloTauProxyBuilder::buildViewType ( const FWEventItem iItem,
TEveElementList *  product,
FWViewType::EType  viewType,
const FWViewContext vc 
) [private, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 51 of file FWCaloTauProxyBuilder.cc.

References fireworks::addCircle(), FWTauProxyBuilderBase::buildBaseTau(), reco::CaloTauTagInfo::calojetRef(), FWProxyBuilderBase::createCompound(), alignCSCRings::e, exception, fwLog, FWEventItem::get(), reco::CaloJet::getCaloConstituents(), UserOptions_cff::idx, metsig::jet, fwlog::kInfo, 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
      {
         try {
            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();
         }  
         catch (std::exception&  e)
         { 
            fwLog(fwlog::kInfo) << "FWPFTauProxyBuilder missing PFTauTagInfo. Skip drawing of jets.\n";
            buildBaseTau(*it, 0, comp, viewType, vc);
         }
      }
      setupAddElement( comp, product );
   }
}
const FWCaloTauProxyBuilder& FWCaloTauProxyBuilder::operator= ( const FWCaloTauProxyBuilder ) [private]
FWCaloTauProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )