CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWPFTauProxyBuilder Class Reference

Inheritance diagram for FWPFTauProxyBuilder:
FWTauProxyBuilderBase FWProxyBuilderBase

List of all members.

Public Member Functions

 FWPFTauProxyBuilder ()
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWPFTauProxyBuilder ()

Private Member Functions

virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType type, const FWViewContext *)
 FWPFTauProxyBuilder (const FWPFTauProxyBuilder &)
const FWPFTauProxyBuilderoperator= (const FWPFTauProxyBuilder &)

Detailed Description

Definition at line 32 of file FWPFTauProxyBuilder.cc.


Constructor & Destructor Documentation

FWPFTauProxyBuilder::FWPFTauProxyBuilder ( ) [inline]

Definition at line 35 of file FWPFTauProxyBuilder.cc.

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

Definition at line 36 of file FWPFTauProxyBuilder.cc.

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

Member Function Documentation

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

Reimplemented from FWProxyBuilderBase.

Definition at line 48 of file FWPFTauProxyBuilder.cc.

References fireworks::addCircle(), FWTauProxyBuilderBase::buildBaseTau(), FWProxyBuilderBase::createCompound(), alignCSCRings::e, exception, fwLog, FWEventItem::get(), reco::Jet::getJetConstituentsQuick(), metsig::jet, fwlog::kInfo, FWViewType::kLego, FWTauProxyBuilderBase::m_maxTheta, FWTauProxyBuilderBase::m_minTheta, FWTauProxyBuilderBase::m_phis, reco::PFTauTagInfo::pfjetRef(), pfTaus_cff::pfTaus, and FWProxyBuilderBase::setupAddElement().

{
   reco::PFTauCollection const * pfTaus = 0;
   iItem->get( pfTaus );
   if( pfTaus == 0 ) return;

   for( reco::PFTauCollection::const_iterator it = pfTaus->begin(), itEnd = pfTaus->end(); it != itEnd; ++it)
   { 
      TEveCompound* comp = createCompound();
      if (viewType == FWViewType::kLego)
      {
         fireworks::addCircle( (*it).eta(), (*it).phi(), 0.5, 20, comp, this );
      }
      else
      {
         // prepare phi-list and theta range
         try {
            const reco::PFTauTagInfo *tauTagInfo = dynamic_cast<const reco::PFTauTagInfo*>( (*it).pfTauTagInfoRef().get() );
            const reco::PFJet *jet = dynamic_cast<const reco::PFJet*>( tauTagInfo->pfjetRef().get() );
            m_minTheta =  100;
            m_maxTheta = -100;
            std::vector<double> phis;
            std::vector <const reco::Candidate*> candidates = jet->getJetConstituentsQuick();
            for( std::vector<const reco::Candidate*>::const_iterator candidate = candidates.begin(), candidateEnd = candidates.end();
                 candidate != candidateEnd; ++candidate )
            {
               double itheta = (*candidate)->theta();
               if( itheta > m_maxTheta ) m_maxTheta = itheta;
               if( itheta < m_minTheta ) m_minTheta = itheta;

               m_phis.push_back( (*candidate)->phi() );
            }
            if( m_minTheta > m_maxTheta ) {     
               m_minTheta = 0;
               m_maxTheta = 0;
            }

            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 FWPFTauProxyBuilder& FWPFTauProxyBuilder::operator= ( const FWPFTauProxyBuilder ) [private]
FWPFTauProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )