CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWDTDigiProxyBuilder Class Reference
Inheritance diagram for FWDTDigiProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWDTDigiProxyBuilder (void)
 
bool haveSingleProduct (void) const override
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWDTDigiProxyBuilder (void) override
 
- 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 &)
 
virtual 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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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...
 

Private Member Functions

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

Additional Inherited Members

- 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 {}
FWDTDigiProxyBuilder::~FWDTDigiProxyBuilder ( void  )
inlineoverride

Definition at line 57 of file FWDTDigiProxyBuilder.cc.

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

Member Function Documentation

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

Reimplemented from FWProxyBuilderBase.

Definition at line 74 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(), ecaldqm::nChannels, DetId::rawId(), FWProxyBuilderBase::setupAddElement(), DTSuperLayerId::superLayer(), and DTLayerId::superlayerId().

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

Definition at line 149 of file FWDTDigiProxyBuilder.cc.

const std::string & FWDTDigiProxyBuilder::classRegisterTypeName ( )
static

Definition at line 149 of file FWDTDigiProxyBuilder.cc.

const std::string & FWDTDigiProxyBuilder::classTypeName ( )
static

Definition at line 149 of file FWDTDigiProxyBuilder.cc.

const std::string & FWDTDigiProxyBuilder::classView ( )
static

Definition at line 149 of file FWDTDigiProxyBuilder.cc.

bool FWDTDigiProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 59 of file FWDTDigiProxyBuilder.cc.

59 { return false; }
const FWDTDigiProxyBuilder& FWDTDigiProxyBuilder::operator= ( const FWDTDigiProxyBuilder )
privatedelete
const std::string& FWDTDigiProxyBuilder::purpose ( ) const
inline

Definition at line 61 of file FWDTDigiProxyBuilder.cc.

63 :
64  // Disable default copy constructor
const std::string& FWDTDigiProxyBuilder::typeName ( ) const
inline

Definition at line 61 of file FWDTDigiProxyBuilder.cc.

63 :
64  // Disable default copy constructor
const std::string& FWDTDigiProxyBuilder::view ( ) const
inline

Definition at line 61 of file FWDTDigiProxyBuilder.cc.

63 :
64  // Disable default copy constructor