CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FWTrackingParticleProxyBuilderFullFramework Class Reference
Inheritance diagram for FWTrackingParticleProxyBuilderFullFramework:
FWSimpleProxyBuilderTemplate< TrackingParticle > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWTrackingParticleProxyBuilderFullFramework (void)
 
 FWTrackingParticleProxyBuilderFullFramework (const FWTrackingParticleProxyBuilderFullFramework &)=delete
 
const
FWTrackingParticleProxyBuilderFullFramework
operator= (const FWTrackingParticleProxyBuilderFullFramework &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWTrackingParticleProxyBuilderFullFramework (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< TrackingParticle >
 FWSimpleProxyBuilderTemplate ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const
FWSimpleProxyBuilderTemplate
operator= (const FWSimpleProxyBuilderTemplate &)=delete
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 FWSimpleProxyBuilder (const FWSimpleProxyBuilder &)=delete
 
const FWSimpleProxyBuilderoperator= (const FWSimpleProxyBuilder &)=delete
 
 ~FWSimpleProxyBuilder () 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 FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- 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
 
void build (const TrackingParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 

Private Attributes

const
SimHitTPAssociationProducer::SimHitTPAssociationList
m_assocList
 
edm::Handle
< TrackingParticleCollection
tpch
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< TrackingParticle >
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
virtual void buildViewType (const TrackingParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const TrackingParticlemodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- Protected Member Functions inherited from FWProxyBuilderBase
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)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 27 of file FWTrackingParticleProxyBuilderFullFramework.cc.

Constructor & Destructor Documentation

FWTrackingParticleProxyBuilderFullFramework::FWTrackingParticleProxyBuilderFullFramework ( void  )
inline

Definition at line 29 of file FWTrackingParticleProxyBuilderFullFramework.cc.

29 : m_assocList(nullptr) {}
const SimHitTPAssociationProducer::SimHitTPAssociationList * m_assocList
FWTrackingParticleProxyBuilderFullFramework::~FWTrackingParticleProxyBuilderFullFramework ( void  )
inlineoverride

Definition at line 30 of file FWTrackingParticleProxyBuilderFullFramework.cc.

30 {}
FWTrackingParticleProxyBuilderFullFramework::FWTrackingParticleProxyBuilderFullFramework ( const FWTrackingParticleProxyBuilderFullFramework )
delete

Member Function Documentation

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

Reimplemented from FWSimpleProxyBuilder.

Definition at line 63 of file FWTrackingParticleProxyBuilderFullFramework.cc.

References FWProxyBuilderBase::build(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, alignCSCRings::e, edmPickEvents::event, cppFunctionSkipper::exception, FWEventItem::getEvent(), FWProxyBuilderBase::item(), m_assocList, FSQHLTOfflineSource_cfi::processName, and tpch.

65  {
66  // setup event handles amd call function from parent class
67 
68  const edm::Event* event = (const edm::Event*)item()->getEvent();
69  if (event) {
70  // get collection handle
71  edm::InputTag coltag(item()->moduleLabel(), item()->productInstanceLabel(), item()->processName());
72  event->getByLabel(coltag, tpch);
73 
74  // AMT todo: check if there is any other way getting the list other than this
75  // ifnot, set proces name as a configurable parameter
77  try {
78  event->getByLabel("xxx", simHitsTPAssoc);
79  m_assocList = &*simHitsTPAssoc;
80  } catch (const std::exception& e) {
81  std::cerr << " FWTrackingParticleProxyBuilderFullFramework::setItem() Can't get hits association list "
82  << e.what() << std::endl;
83  }
84  /*
85  // debug propagator
86  gEve->GetBrowser()->MapWindow();
87  gEve->AddToListTree(context().getTrackPropagator(), true);
88  context().getTrackPropagator()->SetRnrReferences(true);
89  */
90  }
91  FWSimpleProxyBuilder::build(iItem, product, nullptr);
92 }
const FWEventItem * item() const
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
const SimHitTPAssociationProducer::SimHitTPAssociationList * m_assocList
void FWTrackingParticleProxyBuilderFullFramework::build ( const TrackingParticle iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
overrideprivatevirtual

iIndex is the index where iData is found in the container from which it came iItemHolder is the object to which you add your own objects which inherit from TEveElement

Reimplemented from FWSimpleProxyBuilderTemplate< TrackingParticle >.

Definition at line 94 of file FWTrackingParticleProxyBuilderFullFramework.cc.

References a, b, TrackingParticle::charge(), FWProxyBuilderBase::context(), PSimHit::detUnitId(), relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), PSimHit::localPosition(), FWGeometry::localToGlobal(), m_assocList, PSimHit::momentumAtEntry(), phi, phits, TrackingParticle::px(), TrackingParticle::py(), TrackingParticle::pz(), sistrip::SpyUtilities::range(), FWProxyBuilderBase::setupAddElement(), SimHitTPAssociationProducer::simHitTPAssociationListGreater(), submitPVValidationJobs::t, PSimHit::tof(), tpch, HLT_FULL_cff::track, TrackingParticle::vx(), TrackingParticle::vy(), TrackingParticle::vz(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

97  {
98  TEveRecTrack t;
99  t.fBeta = 1.0;
100  t.fP = TEveVector(iData.px(), iData.py(), iData.pz());
101  t.fV = TEveVector(iData.vx(), iData.vy(), iData.vz());
102  t.fSign = iData.charge();
103 
104  TEveTrack* track = new TEveTrack(&t, context().getTrackPropagator());
105  if (t.fSign == 0)
106  track->SetLineStyle(7);
107 
108  track->MakeTrack();
109  setupAddElement(track, &comp);
110  // printf("add track %d \n", tpIdx);
111 
112  if (m_assocList) {
113  TEvePointSet* pointSet = new TEvePointSet;
114  setupAddElement(pointSet, &comp);
115 
116  const FWGeometry* geom = item()->getGeom();
117  float local[3];
118  float localDir[3];
119  float global[3] = {0.0, 0.0, 0.0};
120  float globalDir[3] = {0.0, 0.0, 0.0};
121 
122  TrackingParticleRef tpr(tpch, tpIdx);
123  std::pair<TrackingParticleRef, TrackPSimHitRef> clusterTPpairWithDummyTP(tpr, TrackPSimHitRef());
124  auto range = std::equal_range(m_assocList->begin(),
125  m_assocList->end(),
126  clusterTPpairWithDummyTP,
128  // printf("TrackingParticle[%d] P(%.1f, %.1f, %.1f) matches %d hits\n", tpIdx,iData.px(), iData.py(), iData.pz() ,(int)(range.second-range.first ));
129 
130  std::vector<const PSimHit*> phits;
131  for (auto ri = range.first; ri != range.second; ++ri)
132  phits.push_back(ri->second.get());
133 
134  std::sort(phits.begin(), phits.end(), [](const PSimHit* a, const PSimHit* b) { return a->tof() < b->tof(); });
135  for (auto phi = phits.begin(); phi != phits.end(); ++phi) {
136  const PSimHit* phit = *phi;
137 
138  local[0] = phit->localPosition().x();
139  local[1] = phit->localPosition().y();
140  local[2] = phit->localPosition().z();
141 
142  localDir[0] = phit->momentumAtEntry().x();
143  localDir[1] = phit->momentumAtEntry().y();
144  localDir[2] = phit->momentumAtEntry().z();
145 
146  geom->localToGlobal(phit->detUnitId(), local, global);
147  geom->localToGlobal(phit->detUnitId(), localDir, globalDir, false);
148  pointSet->SetNextPoint(global[0], global[1], global[2]);
149 
150  //printf("localP = (%f, %f, %f) globalP = (%f, %f, %f), loss = %f, tof =%f\n", localDir[0], localDir[1], localDir[2],
151  // globalDir[0], globalDir[1], globalDir[2],
152  // phit->energyLoss(), phit->tof());
153  track->AddPathMark(TEvePathMark(TEvePathMark::kReference,
154  TEveVector(global[0], global[1], global[2]),
155  TEveVector(globalDir[0], globalDir[1], globalDir[2])));
156  }
157  }
158 }
const fireworks::Context & context() const
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:55
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:60
double py() const
y coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
const FWEventItem * item() const
const uint16_t range(const Frame &aFrame)
double pz() const
z coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Local3DPoint localPosition() const
Definition: PSimHit.h:52
double vy() const
y coordinate of parent vertex position
T z() const
Definition: PV3DBase.h:61
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:494
double vx() const
x coordinate of parent vertex position
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
double px() const
x coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
T x() const
Definition: PV3DBase.h:59
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
unsigned int detUnitId() const
Definition: PSimHit.h:97
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ phits
double vz() const
z coordinate of parent vertex position
const SimHitTPAssociationProducer::SimHitTPAssociationList * m_assocList
const std::string & FWTrackingParticleProxyBuilderFullFramework::classPurpose ( )
static
const std::string & FWTrackingParticleProxyBuilderFullFramework::classRegisterTypeName ( )
static
const std::string & FWTrackingParticleProxyBuilderFullFramework::classTypeName ( )
static
const std::string & FWTrackingParticleProxyBuilderFullFramework::classView ( )
static
const FWTrackingParticleProxyBuilderFullFramework& FWTrackingParticleProxyBuilderFullFramework::operator= ( const FWTrackingParticleProxyBuilderFullFramework )
delete
const std::string& FWTrackingParticleProxyBuilderFullFramework::purpose ( ) const
inline
const std::string& FWTrackingParticleProxyBuilderFullFramework::typeName ( ) const
inline
const std::string& FWTrackingParticleProxyBuilderFullFramework::view ( ) const
inline

Member Data Documentation

const SimHitTPAssociationProducer::SimHitTPAssociationList* FWTrackingParticleProxyBuilderFullFramework::m_assocList
private

Definition at line 50 of file FWTrackingParticleProxyBuilderFullFramework.cc.

Referenced by build().

edm::Handle<TrackingParticleCollection> FWTrackingParticleProxyBuilderFullFramework::tpch
private

Definition at line 49 of file FWTrackingParticleProxyBuilderFullFramework.cc.

Referenced by build().