CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FWDTDigiProxyBuilder Class Reference
Inheritance diagram for FWDTDigiProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWDTDigiProxyBuilder (void)
 
virtual bool haveSingleProduct (void) const
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWDTDigiProxyBuilder (void)
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setItem (const FWEventItem *iItem)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Private Member Functions

virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType, const FWViewContext *)
 
 FWDTDigiProxyBuilder (const FWDTDigiProxyBuilder &)
 
const FWDTDigiProxyBuilderoperator= (const FWDTDigiProxyBuilder &)
 

Additional Inherited Members

- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 53 of file FWDTDigiProxyBuilder.cc.

Constructor & Destructor Documentation

FWDTDigiProxyBuilder::FWDTDigiProxyBuilder ( void  )
inline

Definition at line 56 of file FWDTDigiProxyBuilder.cc.

56 {}
virtual FWDTDigiProxyBuilder::~FWDTDigiProxyBuilder ( void  )
inlinevirtual

Definition at line 57 of file FWDTDigiProxyBuilder.cc.

57 {}
FWDTDigiProxyBuilder::FWDTDigiProxyBuilder ( const FWDTDigiProxyBuilder )
private

Member Function Documentation

void FWDTDigiProxyBuilder::buildViewType ( const FWEventItem iItem,
TEveElementList *  product,
FWViewType::EType  type,
const FWViewContext  
)
privatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 73 of file FWDTDigiProxyBuilder.cc.

References FWGeometry::contains(), FWProxyBuilderBase::createCompound(), FWGeometry::find(), fwLog, relativeConstraints::geom, FWEventItem::get(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWViewType::k3D, FWViewType::kISpy, FWViewType::kRhoPhi, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, fwlog::kWarning, FWGeometry::localToGlobal(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), DTSuperLayerId::superLayer(), and DTLayerId::superlayerId().

74 {
75  const DTDigiCollection* digis = 0;
76  iItem->get( digis );
77 
78  if( ! digis )
79  {
80  return;
81  }
82  const FWGeometry *geom = iItem->getGeom();
83 
84  for( DTDigiCollection::DigiRangeIterator det = digis->begin(), detEnd = digis->end(); det != detEnd; ++det )
85  {
86  const DTLayerId& layerId = (*det).first;
87  unsigned int rawid = layerId.rawId();
88  const DTDigiCollection::Range &range = (*det).second;
89 
90  if( ! geom->contains( rawid ))
91  {
92  fwLog( fwlog::kWarning ) << "failed to get geometry of DT with detid: "
93  << rawid << std::endl;
94 
95  TEveCompound* compound = createCompound();
96  setupAddElement( compound, product );
97 
98  continue;
99  }
100 
101  const float* pars = geom->getParameters( rawid );
102  FWGeometry::IdToInfoItr det = geom->find( rawid );
103 
104  int superLayer = layerId.superlayerId().superLayer();
105 
106  float localPos[3] = { 0.0, 0.0, 0.0 };
107 
108  // Loop over the digis of this DetUnit
109  for( DTDigiCollection::const_iterator it = range.first;
110  it != range.second; ++it )
111  {
112  // The x wire position in the layer, starting from its wire number.
113  float firstChannel = pars[3];
114  float nChannels = pars[5];
115  localPos[0] = ((*it).wire() - ( firstChannel - 1 ) - 0.5 ) * pars[0] - nChannels / 2.0 * pars[0];
116 
118  {
119  TEveBox* box = new TEveBox;
120  setupAddElement( box, product );
121  addTube( box, *det, localPos, pars );
122  }
123  else if(( ( type == FWViewType::kRhoPhi || type == FWViewType::kRhoPhiPF ) && superLayer != 2 ) ||
124  ( type == FWViewType::kRhoZ && superLayer == 2 ))
125  {
126  TEvePointSet* pointSet = new TEvePointSet;
127  pointSet->SetMarkerStyle( 24 );
128  setupAddElement( pointSet, product);
129 
130  float globalPos[3];
131  geom->localToGlobal( *det, localPos, globalPos );
132  pointSet->SetNextPoint( globalPos[0], globalPos[1], globalPos[2] );
133 
134  TEveBox* box = new TEveBox;
135  setupAddElement( box, product );
136  addTube( box, *det, localPos, pars );
137  }
138  else
139  {
140  TEveCompound* compound = createCompound();
141  setupAddElement( compound, product );
142 
143  }
144  }
145  }
146 }
type
Definition: HCALResponse.h:22
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:294
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:84
void localToGlobal(unsigned int id, const float *local, float *global) const
Definition: FWGeometry.cc:326
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int superLayer() const
Return the superlayer number.
bool contains(unsigned int id) const
Definition: FWGeometry.h:98
#define fwLog(_level_)
Definition: fwLog.h:51
std::vector< DigiType >::const_iterator const_iterator
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
std::pair< const_iterator, const_iterator > Range
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:96
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:688
virtual bool FWDTDigiProxyBuilder::haveSingleProduct ( void  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 59 of file FWDTDigiProxyBuilder.cc.

59 { return false; }
const FWDTDigiProxyBuilder& FWDTDigiProxyBuilder::operator= ( const FWDTDigiProxyBuilder )
private
FWDTDigiProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )