CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiPixelTopoCache Class Reference

#include <SiPixelStatusProducer.h>

Public Member Functions

std::shared_ptr< SiPixelTopoFindergetSiPixelTopoFinder (edm::EventSetup const &iSetup) const
 
 SiPixelTopoCache (edm::ParameterSet const &iPSet)
 

Private Attributes

edm::ReusableObjectHolder< SiPixelTopoFinderm_holder
 
std::shared_ptr< SiPixelTopoFinderm_mostRecentSiPixelTopoFinder_
 
edm::SerialTaskQueue m_queue
 
edm::ESWatcher< SiPixelFedCablingMapRcdsiPixelFedCablingMapWatcher_
 
edm::ESWatcher< TrackerDigiGeometryRecordtrackerDIGIGeoWatcher_
 
edm::ESWatcher< TrackerTopologyRcdtrackerTopoWatcher_
 

Detailed Description


class: SiPixelStatusProducer.h package: CalibTracker/SiPixelQuality reference : https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkStreamModuleInterface


Definition at line 53 of file SiPixelStatusProducer.h.

Constructor & Destructor Documentation

◆ SiPixelTopoCache()

SiPixelTopoCache::SiPixelTopoCache ( edm::ParameterSet const &  iPSet)
inline

Definition at line 55 of file SiPixelStatusProducer.h.

55 {};

Member Function Documentation

◆ getSiPixelTopoFinder()

std::shared_ptr<SiPixelTopoFinder> SiPixelTopoCache::getSiPixelTopoFinder ( edm::EventSetup const &  iSetup) const
inline

Definition at line 57 of file SiPixelStatusProducer.h.

57  {
58  std::shared_ptr<SiPixelTopoFinder> returnValue;
59 
60  m_queue.pushAndWait([&]() {
61  if (!this->siPixelFedCablingMapWatcher_.check(iSetup) && !this->trackerDIGIGeoWatcher_.check(iSetup) &&
62  !this->trackerTopoWatcher_.check(iSetup)) {
63  /*the condition hasn't changed so we can just use our old value*/
64  returnValue = m_mostRecentSiPixelTopoFinder_;
65  } else {
67  iSetup.get<TrackerDigiGeometryRecord>().get(tkGeoHandle);
68  const TrackerGeometry* trackerGeometry = tkGeoHandle.product();
69 
70  edm::ESHandle<TrackerTopology> tkTopoHandle;
71  iSetup.get<TrackerTopologyRcd>().get(tkTopoHandle);
72  const TrackerTopology* trackerTopology = tkTopoHandle.product();
73 
75  iSetup.get<SiPixelFedCablingMapRcd>().get(cMapHandle);
76  const SiPixelFedCablingMap* cablingMap = cMapHandle.product();
77 
78  /*the condition has changed so we need to update*/
79  //const TrackerGeometry* trackerGeometry = &iSetup.getData(trackerGeometryToken);
80  //const TrackerTopology* trackerTopology = &iSetup.getData(trackerTopologyToken);
81  //const SiPixelFedCablingMap* cablingMap = &iSetup.getData(siPixelFedCablingMapToken);
82 
83  returnValue = m_holder.makeOrGet([]() { return new SiPixelTopoFinder(); });
84  returnValue->init(trackerGeometry, trackerTopology, cablingMap);
85 
86  m_mostRecentSiPixelTopoFinder_ = returnValue;
87  }
88  }); //m_queue
89 
90  return returnValue;
91  }

References edm::ESWatcher< T >::check(), edm::EventSetup::get(), get, m_holder, m_mostRecentSiPixelTopoFinder_, m_queue, edm::ReusableObjectHolder< T, Deleter >::makeOrGet(), edm::ESHandle< T >::product(), edm::SerialTaskQueue::pushAndWait(), siPixelFedCablingMapWatcher_, trackerDIGIGeoWatcher_, and trackerTopoWatcher_.

Member Data Documentation

◆ m_holder

edm::ReusableObjectHolder<SiPixelTopoFinder> SiPixelTopoCache::m_holder
mutableprivate

Definition at line 94 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

◆ m_mostRecentSiPixelTopoFinder_

std::shared_ptr<SiPixelTopoFinder> SiPixelTopoCache::m_mostRecentSiPixelTopoFinder_
mutableprivate

Definition at line 106 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

◆ m_queue

edm::SerialTaskQueue SiPixelTopoCache::m_queue
mutableprivate

Definition at line 95 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

◆ siPixelFedCablingMapWatcher_

edm::ESWatcher<SiPixelFedCablingMapRcd> SiPixelTopoCache::siPixelFedCablingMapWatcher_
mutableprivate

Definition at line 99 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

◆ trackerDIGIGeoWatcher_

edm::ESWatcher<TrackerDigiGeometryRecord> SiPixelTopoCache::trackerDIGIGeoWatcher_
mutableprivate

Definition at line 101 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

◆ trackerTopoWatcher_

edm::ESWatcher<TrackerTopologyRcd> SiPixelTopoCache::trackerTopoWatcher_
mutableprivate

Definition at line 103 of file SiPixelStatusProducer.h.

Referenced by getSiPixelTopoFinder().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiPixelTopoCache::trackerTopoWatcher_
edm::ESWatcher< TrackerTopologyRcd > trackerTopoWatcher_
Definition: SiPixelStatusProducer.h:103
SiPixelTopoCache::m_holder
edm::ReusableObjectHolder< SiPixelTopoFinder > m_holder
Definition: SiPixelStatusProducer.h:94
TrackerTopology
Definition: TrackerTopology.h:16
SiPixelTopoCache::siPixelFedCablingMapWatcher_
edm::ESWatcher< SiPixelFedCablingMapRcd > siPixelFedCablingMapWatcher_
Definition: SiPixelStatusProducer.h:99
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
SiPixelTopoCache::m_mostRecentSiPixelTopoFinder_
std::shared_ptr< SiPixelTopoFinder > m_mostRecentSiPixelTopoFinder_
Definition: SiPixelStatusProducer.h:106
SiPixelTopoFinder
Definition: SiPixelTopoFinder.h:16
edm::SerialTaskQueue::pushAndWait
void pushAndWait(const T &iAction)
synchronously pushes functor iAction into queue
Definition: SerialTaskQueue.h:194
get
#define get
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
SiPixelTopoCache::trackerDIGIGeoWatcher_
edm::ESWatcher< TrackerDigiGeometryRecord > trackerDIGIGeoWatcher_
Definition: SiPixelStatusProducer.h:101
SiPixelTopoCache::m_queue
edm::SerialTaskQueue m_queue
Definition: SiPixelStatusProducer.h:95
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SiPixelFedCablingMapRcd
Definition: SiPixelFedCablingMapRcd.h:5
TrackerGeometry
Definition: TrackerGeometry.h:14