CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

FWTauProxyBuilderBase Class Reference

#include <Fireworks/Calo/interface/FWTauProxyBuilderBase.h>

Inheritance diagram for FWTauProxyBuilderBase:
FWProxyBuilderBase FWCaloTauProxyBuilder FWPFTauProxyBuilder

List of all members.

Public Member Functions

virtual void cleanLocal ()
 FWTauProxyBuilderBase ()
virtual bool havePerViewProduct (FWViewType::EType) const
virtual bool haveSingleProduct () const
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
virtual ~FWTauProxyBuilderBase ()

Protected Member Functions

void buildBaseTau (const reco::BaseTau &iTau, const reco::Jet &iJet, TEveElement *comp, FWViewType::EType type, const FWViewContext *vc)
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)

Protected Attributes

float m_maxTheta
float m_minTheta
std::vector< double > m_phis

Private Member Functions

void addConstituentTracks (const reco::BaseTau &tau, class TEveElement *product)
void addLeadTrack (const reco::BaseTau &tau, class TEveElement *product)
 FWTauProxyBuilderBase (const FWTauProxyBuilderBase &)
const FWTauProxyBuilderBaseoperator= (const FWTauProxyBuilderBase &)

Private Attributes

std::vector
< fireworks::scaleMarker
m_lines

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 42 of file FWTauProxyBuilderBase.h.


Constructor & Destructor Documentation

FWTauProxyBuilderBase::FWTauProxyBuilderBase ( )

Definition at line 37 of file FWTauProxyBuilderBase.cc.

                                            :
   m_minTheta(0),
   m_maxTheta(0)
{
}
FWTauProxyBuilderBase::~FWTauProxyBuilderBase ( ) [virtual]

Definition at line 43 of file FWTauProxyBuilderBase.cc.

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

Member Function Documentation

void FWTauProxyBuilderBase::addConstituentTracks ( const reco::BaseTau tau,
class TEveElement *  product 
) [private]

Definition at line 122 of file FWTauProxyBuilderBase.cc.

References edm::RefVector< C, T, F >::begin(), FWProxyBuilderBase::context(), edm::RefVector< C, T, F >::end(), i, fireworks::prepareTrack(), FWProxyBuilderBase::setupAddElement(), and reco::BaseTau::signalTracks().

Referenced by buildBaseTau().

{
   for( reco::TrackRefVector::iterator i = tau.signalTracks().begin(), iEnd = tau.signalTracks().end();
        i != iEnd; ++i ) {
      TEveTrack* track( 0 );
      if( i->isAvailable() ) {
         track = fireworks::prepareTrack( **i, context().getTrackPropagator() );
         track->MakeTrack();
         setupAddElement( track, product );
      }
   }    
}
void FWTauProxyBuilderBase::addLeadTrack ( const reco::BaseTau tau,
class TEveElement *  product 
) [private]

Definition at line 137 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderBase::context(), reco::BaseTau::leadTrack(), singlePfTauSkim_cff::leadTrack, fireworks::prepareTrack(), and FWProxyBuilderBase::setupAddElement().

Referenced by buildBaseTau().

{
   const reco::TrackRef leadTrack = tau.leadTrack();
   if( !leadTrack ) return;

   TEveTrack* track = fireworks::prepareTrack( *leadTrack, context().getTrackPropagator() );
   if( track ) 
   {
      track->MakeTrack();
      setupAddElement( track, product );
   }
}
void FWTauProxyBuilderBase::buildBaseTau ( const reco::BaseTau iTau,
const reco::Jet iJet,
TEveElement *  comp,
FWViewType::EType  type,
const FWViewContext vc 
) [protected]

Definition at line 48 of file FWTauProxyBuilderBase.cc.

References addConstituentTracks(), addLeadTrack(), fireworks::addRhoZEnergyProjection(), Reference_intrackfit_cff::barrel, fireworks::Context::caloR1(), fireworks::Context::caloR2(), fireworks::Context::caloTransAngle(), fireworks::Context::caloZ1(), fireworks::Context::caloZ2(), FWDisplayProperties::color(), FWProxyBuilderBase::context(), funct::cos(), FWEventItem::defaultDisplayProperties(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), FWViewContext::getEnergyScale(), fireworks::getPhiRange(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), fireworks::getShape(), FWViewType::isProjected(), FWProxyBuilderBase::item(), FWViewType::kRhoZ, m_lines, m_maxTheta, m_minTheta, m_phis, M_PI, fireworks::makeEveJetCone(), siStripFEDMonitor_P5_cff::Min, reco::LeafCandidate::phi(), phi, Pi, csvReporter::r, FWProxyBuilderBase::setupAddElement(), funct::sin(), findQualityFiles::size, theta(), reco::LeafCandidate::theta(), FWDisplayProperties::transparency(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by FWPFTauProxyBuilder::buildViewType(), and FWCaloTauProxyBuilder::buildViewType().

{
   // track
   addLeadTrack( iTau, comp );
   addConstituentTracks( iTau, comp );
 
   // projected markers
   if (FWViewType::isProjected(type))
   {
      double phi   = iTau.phi();
      double theta = iTau.theta();
      double size  = 1;

      bool  barrel = (theta< context().caloTransAngle() || theta > (TMath::Pi() - context().caloTransAngle()));
      float ecalR  = barrel ? context().caloR1() : context().caloR2();
      float ecalZ  = barrel ? context().caloZ1() : context().caloZ2();
  
      TEveScalableStraightLineSet* marker = new TEveScalableStraightLineSet( "energy" );
     
      if( type == FWViewType::kRhoZ )
      {
         double r(0);
         ( theta <  context().caloTransAngle() || M_PI-theta < context().caloTransAngle()) ?
            r = ecalZ/fabs(cos(theta)) :
            r = ecalR/sin(theta);
   
         fireworks::addRhoZEnergyProjection( this, comp, ecalR, ecalZ, m_minTheta-0.003, m_maxTheta+0.003, phi);

         marker->SetScaleCenter( 0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta) );
         marker->AddLine(0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta),
                         0., (phi>0 ? (r+size)*fabs(sin(theta)) : -(r+size)*fabs(sin(theta))), (r+size)*cos(theta) );

      }
      else
      {
         std::pair<double,double> phiRange = fireworks::getPhiRange( m_phis, phi );
         double min_phi = phiRange.first-M_PI/36/2;
         double max_phi = phiRange.second+M_PI/36/2;
         if( fabs(phiRange.first-phiRange.first)<1e-3 ) {
            min_phi = phi-M_PI/36/2;
            max_phi = phi+M_PI/36/2;
         }
         TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
         TGeoBBox *sc_box = new TGeoTubeSeg(ecalR - 1, ecalR + 1, 1, min_phi * 180 / M_PI, max_phi * 180 / M_PI);
         TEveGeoShape *shape = fireworks::getShape( "spread", sc_box, item()->defaultDisplayProperties().color() );
         shape->SetPickable(kTRUE);
         setupAddElement( shape, comp );

         marker->SetScaleCenter(ecalR*cos(phi), ecalR*sin(phi), 0);      
         marker->AddLine( ecalR*cos( phi ), ecalR*sin( phi ), 0,
                          ( ecalR+size )*cos( phi ), ( ecalR+size )*sin( phi ), 0);
      }
      marker->SetLineWidth(4);  
      FWViewEnergyScale* caloScale = vc->getEnergyScale();    
      marker->SetScale(caloScale->getScaleFactor3D()*(caloScale->getPlotEt() ?  iTau.et() : iTau.energy()));
      setupAddElement( marker, comp );
      m_lines.push_back(fireworks::scaleMarker(marker, iTau.et(), iTau.energy(), vc));

      context().voteMaxEtAndEnergy( iTau.et(), iTau.energy());
   }
   else
   {
      // jet
      TEveJetCone* cone = fireworks::makeEveJetCone(iJet, context());
      const FWDisplayProperties &dp = item()->defaultDisplayProperties();
      cone->SetFillColor(dp.color());
      cone->SetLineColor(dp.color());
      setupAddElement( cone, comp );
      cone->SetMainTransparency(TMath::Min(100, 80 + dp.transparency() / 5)); 
   }
}
void FWTauProxyBuilderBase::cleanLocal ( ) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 180 of file FWTauProxyBuilderBase.cc.

References m_lines.

{
   m_lines.clear();
}
virtual bool FWTauProxyBuilderBase::havePerViewProduct ( FWViewType::EType  ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 49 of file FWTauProxyBuilderBase.h.

{ return true; }
virtual bool FWTauProxyBuilderBase::haveSingleProduct ( void  ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 48 of file FWTauProxyBuilderBase.h.

{ return false; }
void FWTauProxyBuilderBase::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
) [protected, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 151 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderBase::increaseComponentTransparency(), FWModelId::index(), and FWViewType::isProjected().

{
   if (FWViewType::isProjected(viewType))
      increaseComponentTransparency(iId.index(), iCompound, "TEveJetCone", 80);
}
const FWTauProxyBuilderBase& FWTauProxyBuilderBase::operator= ( const FWTauProxyBuilderBase ) [private]
void FWTauProxyBuilderBase::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 159 of file FWTauProxyBuilderBase.cc.

References FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), i, FWViewType::isProjected(), m_lines, and relativeConstraints::value.

{ 
   if (FWViewType::isProjected(viewType))
   {
      typedef std::vector<fireworks::scaleMarker> Lines_t;  
      FWViewEnergyScale* caloScale = vc->getEnergyScale();
      // printf("%p -> %f\n", this,caloScale->getValToHeight() );
      for (Lines_t::iterator i = m_lines.begin(); i!= m_lines.end(); ++ i)
      {
         if (vc == (*i).m_vc)
         { 
            float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;      
            (*i).m_ls->SetScale(caloScale->getScaleFactor3D()*value);
            TEveProjected* proj = *(*i).m_ls->BeginProjecteds();
            proj->UpdateProjection();
         }
      }
   }
}

Member Data Documentation

Definition at line 72 of file FWTauProxyBuilderBase.h.

Referenced by buildBaseTau(), cleanLocal(), and scaleProduct().

std::vector<double> FWTauProxyBuilderBase::m_phis [protected]