CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWConversionProxyBuilder Class Reference

Inheritance diagram for FWConversionProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Conversion > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

virtual void cleanLocal ()
 FWConversionProxyBuilder ()
virtual bool haveSingleProduct () const
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWConversionProxyBuilder ()

Private Member Functions

virtual void buildViewType (const reco::Conversion &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *)
 FWConversionProxyBuilder (const FWConversionProxyBuilder &)
const FWConversionProxyBuilderoperator= (const FWConversionProxyBuilder &)
TEveElementList * requestCommon ()

Private Attributes

TEveElementList * m_common

Detailed Description

Definition at line 35 of file FWConversionProxyBuilder.cc.


Constructor & Destructor Documentation

FWConversionProxyBuilder::FWConversionProxyBuilder ( )

Definition at line 58 of file FWConversionProxyBuilder.cc.

References m_common.

                                                  :
   m_common(0)
{
   m_common = new TEveElementList( "common conversion scene" );
   m_common->IncDenyDestroy();
}
FWConversionProxyBuilder::~FWConversionProxyBuilder ( ) [virtual]

Definition at line 65 of file FWConversionProxyBuilder.cc.

References m_common.

{
   m_common->DecDenyDestroy();
}
FWConversionProxyBuilder::FWConversionProxyBuilder ( const FWConversionProxyBuilder ) [private]

Member Function Documentation

void FWConversionProxyBuilder::buildViewType ( const reco::Conversion iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext  
) [private, virtual]

Reimplemented from FWSimpleProxyBuilderTemplate< reco::Conversion >.

Definition at line 118 of file FWConversionProxyBuilder.cc.

References geometryCSVtoXML::line, groupFilesInBlocks::lines, requestCommon(), and FWProxyBuilderBase::setupAddElement().

{
   TEveElementList*   lines = requestCommon();
   TEveElement::List_i linIt = lines->BeginChildren();
   std::advance(linIt, iIndex);
   TEveLine* line = (TEveLine*)((*linIt)->CloneElement());
   TEveVector bvec = line->GetLineStart();
   TEveVector evec = line->GetLineEnd();
   if (bvec.Mag() != evec.Mag())
                setupAddElement(*linIt, &oItemHolder );
}
void FWConversionProxyBuilder::cleanLocal ( ) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 112 of file FWConversionProxyBuilder.cc.

References m_common.

{
   m_common->DestroyElements();
}
virtual bool FWConversionProxyBuilder::haveSingleProduct ( void  ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 41 of file FWConversionProxyBuilder.cc.

{ return false; }
const FWConversionProxyBuilder& FWConversionProxyBuilder::operator= ( const FWConversionProxyBuilder ) [private]
FWConversionProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
TEveElementList * FWConversionProxyBuilder::requestCommon ( ) [private]

Definition at line 71 of file FWConversionProxyBuilder.cc.

References FWPFGeom::caloR1(), fireworks::Context::caloTransEta(), FWPFGeom::caloZ1(), fireworks::Context::caloZ1(), edm::conversion(), funct::cos(), funct::false, i, FWProxyBuilderBase::item(), geometryCSVtoXML::line, m_common, FWSimpleProxyBuilderTemplate< reco::Conversion >::modelData(), reco::Conversion::nTracks(), reco::Conversion::pairMomentum(), phi, CosmicsPD_Skims::radius, FWProxyBuilderBase::setupElement(), funct::sin(), FWEventItem::size(), funct::tan(), z, and reco::Conversion::zOfPrimaryVertexFromTracks().

Referenced by buildViewType().

{
   if( m_common->HasChildren() == false )
   {
      for (int i = 0; i < static_cast<int>(item()->size()); ++i)
      {
         const reco::Conversion& conversion = modelData(i);
         TEveLine* line = new TEveLine(0);
         if (conversion.nTracks() == 2) {
                          if (fabs(conversion.zOfPrimaryVertexFromTracks()) < fireworks::Context::caloZ1())
                                   line->SetNextPoint(0., 0., conversion.zOfPrimaryVertexFromTracks());
                          else
                                   line->SetNextPoint(0., 0., 0.);
                          
                          float phi = conversion.pairMomentum().phi();
                          if (fabs(conversion.pairMomentum().eta()) < fireworks::Context::caloTransEta()) {
                                   float radius = fireworks::Context::caloR1();
                                   float z = radius/tan(conversion.pairMomentum().theta());
                                   line->SetNextPoint(radius*cos(phi), radius*sin(phi), z);
                          }
                          else {
                                   float z = fireworks::Context::caloZ1();
                                   float radius = z*tan(conversion.pairMomentum().theta());
                                   z *= (conversion.pairMomentum().eta()/fabs(conversion.pairMomentum().eta()));
                                   line->SetNextPoint(radius*cos(phi), radius*sin(phi), z);
                          }
                 }
         else {
                          line->SetNextPoint(0., 0., 0.);
                          line->SetNextPoint(0., 0., 0.);
                 }

         setupElement( line );
         m_common->AddElement( line );
      }
   }

   return m_common;
}

Member Data Documentation

TEveElementList* FWConversionProxyBuilder::m_common [private]