CMS 3D CMS Logo

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

Public Member Functions

 FWSiPixelClusterProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWSiPixelClusterProxyBuilder (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
 
virtual bool haveSingleProduct () 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 build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
 FWSiPixelClusterProxyBuilder (const FWSiPixelClusterProxyBuilder &)=delete
 
const FWSiPixelClusterProxyBuilderoperator= (const FWSiPixelClusterProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, 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 24 of file FWSiPixelClusterProxyBuilder.cc.

Constructor & Destructor Documentation

FWSiPixelClusterProxyBuilder::FWSiPixelClusterProxyBuilder ( void  )
inline

Definition at line 27 of file FWSiPixelClusterProxyBuilder.cc.

27 {}
FWSiPixelClusterProxyBuilder::~FWSiPixelClusterProxyBuilder ( void  )
inlineoverride

Definition at line 28 of file FWSiPixelClusterProxyBuilder.cc.

28 {}
FWSiPixelClusterProxyBuilder::FWSiPixelClusterProxyBuilder ( const FWSiPixelClusterProxyBuilder )
privatedelete

Member Function Documentation

void FWSiPixelClusterProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 43 of file FWSiPixelClusterProxyBuilder.cc.

References ecalMGPA::adc(), edmNew::DetSet< T >::begin(), edmNew::DetSetVector< T >::begin(), fastPrimaryVertexProducer_cfi::clusters, FWGeometry::contains(), FWProxyBuilderBase::createCompound(), edmNew::DetSet< T >::end(), edmNew::DetSetVector< T >::end(), fwLog, relativeConstraints::geom, FWEventItem::get(), FWEventItem::getGeom(), FWGeometry::getParameters(), fwlog::kWarning, FWGeometry::localToGlobal(), eostools::ls(), AlCaHLTBitMon_ParallelJobs::p, fireworks::pixelLocalX(), fireworks::pixelLocalY(), and FWProxyBuilderBase::setupAddElement().

44 {
45  const SiPixelClusterCollectionNew* pixels = nullptr;
46 
47  iItem->get( pixels );
48 
49  if( ! pixels )
50  {
51  fwLog( fwlog::kWarning ) << "failed get SiPixelDigis" << std::endl;
52  return;
53  }
54 
55  for( SiPixelClusterCollectionNew::const_iterator set = pixels->begin(), setEnd = pixels->end();
56  set != setEnd; ++set )
57  {
58  unsigned int id = set->detId();
59 
60  const FWGeometry *geom = iItem->getGeom();
61  const float* pars = geom->getParameters( id );
62 
64 
65  for( edmNew::DetSet<SiPixelCluster>::const_iterator itc = clusters.begin(), edc = clusters.end();
66  itc != edc; ++itc )
67  {
68  TEveElement* itemHolder = createCompound();
69  product->AddElement(itemHolder);
70 
71  TEvePointSet* pointSet = new TEvePointSet;
72 
73  if( ! geom->contains( id ))
74  {
76  << "failed get geometry of SiPixelCluster with detid: "
77  << id << std::endl;
78  continue;
79  }
80 
81  float localPoint[3] =
82  {
83  fireworks::pixelLocalX(( *itc ).minPixelRow(), pars ),
84  fireworks::pixelLocalY(( *itc ).minPixelCol(), pars ),
85  0.0
86  };
87 
88  float globalPoint[3];
89  geom->localToGlobal( id, localPoint, globalPoint );
90 
91  pointSet->SetNextPoint( globalPoint[0], globalPoint[1], globalPoint[2] );
92 
93  setupAddElement( pointSet, itemHolder );
94 
95  TEveStraightLineSet* ls = new TEveStraightLineSet();
96  for(int j=0;j< (*itc).size(); j++ )
97  {
98 
99  // float adc= (*itc).pixel(j).adc*0.03/5000.;
100  float adc= 0.025;
101  float offsetx[4] = {-0.4,-0.4,+0.4,+0.4};
102  float offsety[4] = {-0.4,+0.4,+0.4,-0.4};
103  // float vert[24];
104 
105  std::vector<TEveVector> boxCorners;
106  for(int of=0;of<8;of++) {
107  float lp[3]= {
109  (*itc).pixel(j).x+offsetx[of%4], pars) ,
111  (*itc).pixel(j).y+offsety[of%4], pars ),
112  (of<4)?(0.0f):(adc)
113  };
114 
115  TEveVector p;
116  geom->localToGlobal( id,lp, p.Arr() );
117 
118  boxCorners.push_back(p);
119 
120  }
121 
122  // bottom
123  ls->AddLine(boxCorners[0], boxCorners[1]);
124  ls->AddLine(boxCorners[1], boxCorners[2]);
125  ls->AddLine(boxCorners[2], boxCorners[3]);
126  ls->AddLine(boxCorners[3], boxCorners[0]);
127  // top
128  ls->AddLine(boxCorners[4], boxCorners[5]);
129  ls->AddLine(boxCorners[5], boxCorners[6]);
130  ls->AddLine(boxCorners[6], boxCorners[7]);
131  ls->AddLine(boxCorners[7], boxCorners[4]);
132  // sides
133  ls->AddLine(boxCorners[0], boxCorners[4]);
134  ls->AddLine(boxCorners[1], boxCorners[5]);
135  ls->AddLine(boxCorners[2], boxCorners[6]);
136  ls->AddLine(boxCorners[3], boxCorners[7]);
137 
138 
139  }
140 
141  setupAddElement( ls, itemHolder );
142 
143  }
144  }
145 }
int adc(sample_type sample)
get the ADC sample (12 bits)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:446
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:85
data_type const * const_iterator
Definition: DetSetNew.h:30
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:478
bool contains(unsigned int id) const
Definition: FWGeometry.h:117
float pixelLocalX(const double mpx, const float *)
Definition: TrackUtils.cc:160
float pixelLocalY(const double mpy, const float *)
Definition: TrackUtils.cc:216
def ls(path, rec=False)
Definition: eostools.py:349
#define fwLog(_level_)
Definition: fwLog.h:50
iterator end()
Definition: DetSetNew.h:70
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const_iterator begin(bool update=false) const
iterator begin()
Definition: DetSetNew.h:67
const std::string & FWSiPixelClusterProxyBuilder::classPurpose ( )
static

Definition at line 147 of file FWSiPixelClusterProxyBuilder.cc.

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

Definition at line 147 of file FWSiPixelClusterProxyBuilder.cc.

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

Definition at line 147 of file FWSiPixelClusterProxyBuilder.cc.

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

Definition at line 147 of file FWSiPixelClusterProxyBuilder.cc.

const FWSiPixelClusterProxyBuilder& FWSiPixelClusterProxyBuilder::operator= ( const FWSiPixelClusterProxyBuilder )
privatedelete
const std::string& FWSiPixelClusterProxyBuilder::purpose ( ) const
inline

Definition at line 30 of file FWSiPixelClusterProxyBuilder.cc.

32 :
33  // Disable default copy constructor
const std::string& FWSiPixelClusterProxyBuilder::typeName ( ) const
inline

Definition at line 30 of file FWSiPixelClusterProxyBuilder.cc.

32 :
33  // Disable default copy constructor
const std::string& FWSiPixelClusterProxyBuilder::view ( ) const
inline

Definition at line 30 of file FWSiPixelClusterProxyBuilder.cc.

32 :
33  // Disable default copy constructor