CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
OnDemandMeasurementTracker Class Reference

#include <OnDemandMeasurementTracker.h>

Inheritance diagram for OnDemandMeasurementTracker:
MeasurementTrackerImpl MeasurementTracker MeasurementDetSystem

Classes

class  DetODStatus
 a class that holds flags, region_range (in RefGetter) for a given MeasurementDet More...
 

Public Types

typedef edm::LazyGetter
< SiStripCluster
LazyGetter
 
typedef edm::RefGetter
< SiStripCluster
RefGetter
 
- Public Types inherited from MeasurementTrackerImpl
typedef std::unordered_map
< unsigned int, MeasurementDet * > 
DetContainer
 
enum  QualityFlags {
  BadModules =1, BadAPVFibers =2, BadStrips =4, MaskBad128StripBlocks =8,
  BadROCs =2
}
 
- Public Types inherited from MeasurementTracker
enum  QualityFlags {
  BadModules =1, BadAPVFibers =2, BadStrips =4, MaskBad128StripBlocks =8,
  BadROCs =2
}
 

Public Member Functions

void define (const edm::Handle< edm::LazyGetter< SiStripCluster > > &, std::auto_ptr< RefGetter > &) const
 OnDemandMeasurementTracker specific function to be called to define the region in the RefGetter according to MeasurementDet content. More...
 
virtual const MeasurementDetidToDet (const DetId &id) const
 MeasurementDetSystem interface. More...
 
 OnDemandMeasurementTracker (const edm::ParameterSet &conf, const PixelClusterParameterEstimator *pixelCPE, const StripClusterParameterEstimator *stripCPE, const SiStripRecHitMatcher *hitMatcher, const TrackerGeometry *trackerGeom, const GeometricSearchTracker *geometricSearchTracker, const SiStripQuality *stripQuality, int stripQualityFlags, int stripQualityDebugFlags, const SiPixelQuality *pixelQuality, const SiPixelFedCabling *pixelCabling, int pixelQualityFlags, int pixelQualityDebugFlags, const SiStripRegionCabling *stripRegionCabling, bool isRegional=false)
 constructor More...
 
void update (const edm::Event &) const
 MeasurementTracker overloaded function. More...
 
void updateStrips (const edm::Event &event) const
 
virtual ~OnDemandMeasurementTracker ()
 destructor More...
 
- Public Member Functions inherited from MeasurementTrackerImpl
const DetContainerallDets () const
 For debug only. More...
 
TkStripMeasurementDetconcreteDetUpdatable (DetId id) const
 
const MeasurementDetfindDet (const DetId &id) const
 
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackingGeometrygeomTracker () const
 
const std::vector
< TkGluedMeasurementDet > & 
gluedDets () const
 
 MeasurementTrackerImpl (const edm::ParameterSet &conf, const PixelClusterParameterEstimator *pixelCPE, const StripClusterParameterEstimator *stripCPE, const SiStripRecHitMatcher *hitMatcher, const TrackerGeometry *trackerGeom, const GeometricSearchTracker *geometricSearchTracker, const SiStripQuality *stripQuality, int stripQualityFlags, int stripQualityDebugFlags, const SiPixelQuality *pixelQuality, const SiPixelFedCabling *pixelCabling, int pixelQualityFlags, int pixelQualityDebugFlags, bool isRegional=false)
 
const std::vector
< TkPixelMeasurementDet * > & 
pixelDets () const
 
void setClusterToSkip (const edm::InputTag &cluster, const edm::Event &event) const
 
const std::vector
< TkStripMeasurementDet > & 
stripDets () const
 
void unsetClusterToSkip () const
 
void updatePixels (const edm::Event &) const
 
virtual ~MeasurementTrackerImpl ()
 
- Public Member Functions inherited from MeasurementTracker
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackingGeometrygeomTracker () const
 
 MeasurementTracker (TrackerGeometry const *trackerGeom, GeometricSearchTracker const *geometricSearchTracker)
 
virtual ~MeasurementTracker ()
 

Private Types

typedef std::unordered_map
< unsigned int, DetODStatus
DetODContainer
 
typedef std::vector< std::pair
< SiStripRegionCabling::ElementIndex,
std::vector
< DetODContainer::const_iterator > > > 
RegionalMap
 mapping of elementIndex -> iterator to the DetODMap: to know what are the regions that needs to be defined in the ref getter More...
 

Private Member Functions

void assign (const TkStripMeasurementDet *csmdet, DetODContainer::iterator *alreadyFound=0) const
 assigne the cluster iterator to the TkStipMeasurementDet (const_cast in the way) More...
 
std::string dumpCluster (const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
 some printouts, exclusively under LogDebug More...
 
std::string dumpRegion (std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
 

Private Attributes

std::string category_
 log category More...
 
bool PixelOnDemand_
 internal flag to do pixel on demand (not configurable) false by default More...
 
RegionalMap region_mapping
 
bool StayPacked_
 internal flag to avoid unpacking things with LogDebug on More...
 
bool StripOnDemand_
 internal flag to do strip on demand (not configurable) true by default More...
 
DetODContainer theDetODMap
 mapping of detid -> MeasurementDet+flags+region_range More...
 
edm::Handle< edm::LazyGetter
< SiStripCluster > > 
theLazyGetterH
 
std::vector< uint32_t > theRawInactiveStripDetIds
 
edm::Handle< edm::RefGetter
< SiStripCluster > > 
theRefGetterH
 the handle is retrieved from the event to make reference to cluster in it More...
 
bool theSkipClusterRefs
 
edm::Handle
< edm::ContainerMask
< edm::LazyGetter
< SiStripCluster > > > 
theStripClusterMask
 
const SiStripRegionCablingtheStripRegionCabling
 the cabling region tool to update a RefGetter More...
 

Additional Inherited Members

- Protected Member Functions inherited from MeasurementTrackerImpl
void addGluedDet (const GluedGeomDet *gd)
 
void addPixelDet (const GeomDet *gd, const PixelClusterParameterEstimator *cpe)
 
void addPixelDets (const TrackingGeometry::DetContainer &dets)
 
void addStripDet (const GeomDet *gd)
 
void addStripDets (const TrackingGeometry::DetContainer &dets)
 
void getInactiveStrips (const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
 
void initGluedDet (TkGluedMeasurementDet &det)
 
void initialize ()
 
void initializePixelStatus (const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
 
void initializeStripStatus (const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
 
- Protected Attributes inherited from MeasurementTrackerImpl
const std::string name_
 
const edm::ParameterSetpset_
 
bool selfUpdateSkipClusters_
 
DetContainer theDetMap
 
std::vector
< TkGluedMeasurementDet
theGluedDets
 
const std::vector< edm::InputTagtheInactivePixelDetectorLabels
 
const std::vector< edm::InputTagtheInactiveStripDetectorLabels
 
const SiPixelFedCablingthePixelCabling
 
const
PixelClusterParameterEstimator
thePixelCPE
 
std::vector
< TkPixelMeasurementDet * > 
thePixelDets
 
std::vector< bool > thePixelsToSkip
 
StMeasurementDetSet theStDets
 
std::vector
< TkStripMeasurementDet
theStripDets
 
- Protected Attributes inherited from MeasurementTracker
const GeometricSearchTrackertheGeometricSearchTracker
 
const TrackerGeometrytheTrackerGeom
 

Detailed Description

Definition at line 13 of file OnDemandMeasurementTracker.h.

Member Typedef Documentation

typedef std::unordered_map<unsigned int, DetODStatus> OnDemandMeasurementTracker::DetODContainer
private

Definition at line 79 of file OnDemandMeasurementTracker.h.

Definition at line 38 of file OnDemandMeasurementTracker.h.

Definition at line 39 of file OnDemandMeasurementTracker.h.

typedef std::vector<std::pair<SiStripRegionCabling::ElementIndex, std::vector<DetODContainer::const_iterator> > > OnDemandMeasurementTracker::RegionalMap
private

mapping of elementIndex -> iterator to the DetODMap: to know what are the regions that needs to be defined in the ref getter

Definition at line 84 of file OnDemandMeasurementTracker.h.

Constructor & Destructor Documentation

OnDemandMeasurementTracker::OnDemandMeasurementTracker ( const edm::ParameterSet conf,
const PixelClusterParameterEstimator pixelCPE,
const StripClusterParameterEstimator stripCPE,
const SiStripRecHitMatcher hitMatcher,
const TrackerGeometry trackerGeom,
const GeometricSearchTracker geometricSearchTracker,
const SiStripQuality stripQuality,
int  stripQualityFlags,
int  stripQualityDebugFlags,
const SiPixelQuality pixelQuality,
const SiPixelFedCabling pixelCabling,
int  pixelQualityFlags,
int  pixelQualityDebugFlags,
const SiStripRegionCabling stripRegionCabling,
bool  isRegional = false 
)

constructor

Definition at line 54 of file OnDemandMeasurementTracker.cc.

References category_, SiStripRegionCabling::elementIndex(), PV3DBase< T, PVType, FrameType >::eta(), eta(), first, SiStripRegionCabling::layerFromDetId(), LogDebug, phi, PV3DBase< T, PVType, FrameType >::phi(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, SiStripRegionCabling::position(), SiStripRegionCabling::positionIndex(), SiStripRegionCabling::region(), region_mapping, edm::second(), SiStripRegionCabling::subdetFromDetId(), GeomDetEnumerators::TEC, MeasurementTrackerImpl::theDetMap, theDetODMap, MeasurementTrackerImpl::theInactiveStripDetectorLabels, theRawInactiveStripDetIds, theStripRegionCabling, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.

68  :
69  MeasurementTrackerImpl(conf,pixelCPE,stripCPE,hitMatcher,trackerGeom,geometricSearchTracker,
70  stripQuality,stripQualityFlags,stripQualityDebugFlags,
71  pixelQuality,pixelCabling,pixelQualityFlags,pixelQualityDebugFlags,
72  isRegional)
73  , category_("OnDemandMeasurementTracker")
74  , StayPacked_(true)
75  , StripOnDemand_(true)
76  , PixelOnDemand_(false)
77  , theStripRegionCabling(stripRegionCabling)
78 {
79  // the constructor does construct the regular MeasurementTracker
80  // then a smart copy of the DetMap is made into DetODMap: this could be avoided with modification to MeasurementDet interface
81  // the elementIndex to be defined in the refgetter is mapped to the detId
82  // flags are set to initialize the DetODMap
83 
84  std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::const_iterator> > local_mapping;
85 
86  for (DetContainer::iterator it=theDetMap.begin(); it!= theDetMap.end();++it)
87  {
88  DetODContainer::iterator inserted = theDetODMap.insert(make_pair(it->first,DetODStatus(const_cast<MeasurementDet*>(it->second)))).first;
89 
90 
91  GeomDet::SubDetector subdet = it->second->geomDet().subDetector();
93  //special flag treatement for pixels
94  //one can never be updated and not defined. except if we don't need to care about them: pixels
95  inserted->second.defined=false;
96  inserted->second.updated=true;
97  }//pixel module
98  else if (subdet == GeomDetEnumerators::TIB || subdet == GeomDetEnumerators::TOB ||
99  subdet == GeomDetEnumerators::TID || subdet == GeomDetEnumerators::TEC )
100  {
101  //set flag to false
102  inserted->second.defined=false;
103  inserted->second.updated=false;
104 
105  //what will be the element index in the refgetter
106  GlobalPoint center = it->second->geomDet().position();
107  double eta = center.eta();
108  double phi = center.phi();
109  uint32_t id = it->first;
113  LogDebug(category_)<<"region selected (from "<<id<<" center) is:\n"
114  <<"position: "<<center
116  <<"\n center position index: "<<theStripRegionCabling->positionIndex(SiStripRegionCabling::Position(eta,phi)).first<<
120  <<"\n eta: "<<eta
121  <<"\n phi: "<<phi
122  <<"\n subedet: "<<SiStripRegionCabling::subdetFromDetId(id)
123  <<" layer: "<<SiStripRegionCabling::layerFromDetId(id);
124 
125  // register those in a map
126  //to be able to know what are the detid in a given elementIndex
127  local_mapping[eIndex].push_back(inserted);
128  }//strip module
129  else{
130  //abort
131  edm::LogError(category_)<<"not a tracker geomdet in constructor: "<<it->first;
132  throw MeasurementDetException("OnDemandMeasurementTracker dealing with a non tracker GeomDet.");
133  }//abort
134  }//loop over DetMap
135  if (theInactiveStripDetectorLabels.size()!=0)
136  theRawInactiveStripDetIds.reserve(200);
137 
138  //move into a vector
139  region_mapping.reserve(local_mapping.size());
140  for( auto eIt= local_mapping.begin();
141  eIt!=local_mapping.end();++eIt)
142  region_mapping.push_back(std::make_pair((*eIt).first,(*eIt).second));
143 }
#define LogDebug(id)
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
bool PixelOnDemand_
internal flag to do pixel on demand (not configurable) false by default
const PositionIndex positionIndex(const uint32_t) const
const SiStripRegionCabling * theStripRegionCabling
the cabling region tool to update a RefGetter
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
const std::vector< edm::InputTag > theInactiveStripDetectorLabels
T eta() const
U second(std::pair< T, U > const &p)
std::vector< uint32_t > theRawInactiveStripDetIds
MeasurementTrackerImpl(const edm::ParameterSet &conf, const PixelClusterParameterEstimator *pixelCPE, const StripClusterParameterEstimator *stripCPE, const SiStripRecHitMatcher *hitMatcher, const TrackerGeometry *trackerGeom, const GeometricSearchTracker *geometricSearchTracker, const SiStripQuality *stripQuality, int stripQualityFlags, int stripQualityDebugFlags, const SiPixelQuality *pixelQuality, const SiPixelFedCabling *pixelCabling, int pixelQualityFlags, int pixelQualityDebugFlags, bool isRegional=false)
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
static const SubDet subdetFromDetId(const uint32_t detid)
bool StayPacked_
internal flag to avoid unpacking things with LogDebug on
std::pair< double, double > Position
bool first
Definition: L1TdeRCT.cc:94
bool StripOnDemand_
internal flag to do strip on demand (not configurable) true by default
std::string category_
log category
const Position position(const uint32_t) const
static const uint32_t layerFromDetId(const uint32_t detid)
T eta() const
Definition: PV3DBase.h:75
const uint32_t region(const Position) const
Definition: DDAxes.h:10
virtual OnDemandMeasurementTracker::~OnDemandMeasurementTracker ( )
inlinevirtual

destructor

Definition at line 32 of file OnDemandMeasurementTracker.h.

32 {}

Member Function Documentation

void OnDemandMeasurementTracker::assign ( const TkStripMeasurementDet csmdet,
DetODContainer::iterator *  alreadyFound = 0 
) const
private

assigne the cluster iterator to the TkStipMeasurementDet (const_cast in the way)

Definition at line 293 of file OnDemandMeasurementTracker.cc.

References category_, dumpCluster(), dumpRegion(), errorMatrix2Lands_multiChannel::id, LogDebug, TkStripMeasurementDet::rawId(), TkStripMeasurementDet::setActiveThisEvent(), TkStripMeasurementDet::setEmpty(), theDetODMap, theRawInactiveStripDetIds, theRefGetterH, and TkStripMeasurementDet::update().

Referenced by idToDet().

294  {
295  // assign is using the handle to the refgetter and the region index range to update the MeasurementDet with their clusters
296 
297  TkStripMeasurementDet * smdet = const_cast<TkStripMeasurementDet *>(csmdet);
298  DetId id = smdet->rawId();
299 
300  LogDebug(category_)<<"assigning: "<<id.rawId();
301 
302  // what is the iterator. do not look again if already found and provided with
303  DetODContainer::iterator elementInMap;
304  if (alreadyFound){ elementInMap=*alreadyFound;}
305  else{ elementInMap = theDetODMap.find(id);}
306 
307  if ( elementInMap != theDetODMap.end()){
308  //flag it as updated
309  elementInMap->second.updated = true;
310 
311  if (!theRawInactiveStripDetIds.empty() && std::binary_search(theRawInactiveStripDetIds.begin(), theRawInactiveStripDetIds.end(), id)) {
312  smdet->setActiveThisEvent(false);
313  return;
314  }
315 
316  //retrieve the region range index for this module
317  std::pair<unsigned int,unsigned int> & indexes =elementInMap->second.region_range;
318 
319  //this printout will trigger unpacking. no problem. it is done on the next regular line (find(id.rawId())
320  LogDebug(category_)<<"between index: "<<indexes.first<<" and: "<<indexes.second
321  <<"\nretrieved for module: "<<id.rawId()
322  <<"\n"<<dumpRegion(indexes,*theRefGetterH);
323 
324  //look for iterator range in the regions defined for that module
325  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
326  RefGetter::record_pair range = (*theRefGetterH)[iRegion].find(id.rawId());
327  if (range.first!=range.second){
328  // found something not empty
329  //update the measurementDet
330  smdet->update(range.first, range.second);
331  LogDebug(category_)<<"Valid clusters for: "<<id.rawId()
332  <<"\nnumber of regions defined here: "<< indexes.second-indexes.first
333  <<"\n"<<dumpCluster(range.first,range.second);
334  /* since theStripsToSkip is a "static" pointer of the MT, no need to set it at all time.
335  if (selfUpdateSkipClusters_){
336  //assign skip clusters
337  smdet->setClusterToSkip(&theStripsToSkip);
338  }
339  */
340  //and you are done
341  return;}
342  }//loop over regions, between indexes
343 
344  //if reached. no cluster are found. set the TkStripMeasurementDet to be empty
345  smdet->setEmpty();
346 
347  }//found in the map
348  else{
349  //throw excpetion
350  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
351  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
352  }
353 }
#define LogDebug(id)
void update(const detset &detSet)
edm::Handle< edm::RefGetter< SiStripCluster > > theRefGetterH
the handle is retrieved from the event to make reference to cluster in it
std::pair< typename record_type::const_iterator, typename record_type::const_iterator > record_pair
Definition: RefGetter.h:27
std::string dumpCluster(const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
some printouts, exclusively under LogDebug
std::vector< uint32_t > theRawInactiveStripDetIds
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
void setActiveThisEvent(bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
std::string category_
log category
Definition: DetId.h:20
unsigned int rawId() const
std::string dumpRegion(std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
void OnDemandMeasurementTracker::define ( const edm::Handle< edm::LazyGetter< SiStripCluster > > &  aLazyGetterH,
std::auto_ptr< RefGetter > &  aGetter 
) const

OnDemandMeasurementTracker specific function to be called to define the region in the RefGetter according to MeasurementDet content.

Definition at line 146 of file OnDemandMeasurementTracker.cc.

References category_, OnDemandMeasurementTracker::DetODStatus::defined, dumpRegion(), HTMLExport::elem(), LogDebug, region_mapping, OnDemandMeasurementTracker::DetODStatus::region_range, StMeasurementDetSet::setLazyGetter(), StayPacked_, theDetODMap, MeasurementTrackerImpl::theStDets, theStripRegionCabling, and SiStripRegionCabling::updateSiStripRefGetter().

Referenced by MeasurementTrackerSiStripRefGetterProducer::produce().

148 {
149  // define is supposed to be call by an EDProducer module, which wil put the RefGetter in the event
150  // so that reference can be made to it.
151  // the lazy getter is retrieved by the calling module and passed along with the event
152  // the map is cleared, except for pixel
153  // then the known elementIndex are defined to the RefGetter. no unpacking is done at this time
154  // the defined region range is registered in the DetODMap for further use.
155 
156  //clear all defined tags to start from scratch (except for pixel)
157  for (DetODContainer::iterator it=theDetODMap.begin(); it!= theDetODMap.end();++it)
158  {
159  if (it->second.updated && !it->second.defined) continue; //special treatement for pixels
160  it->second.defined= false;
161  it->second.updated = false;
162  }
163 
164  // nedeed??
165  theStDets.setLazyGetter(aLazyGetterH);
166 
167 
168  //define all the elementindex in the refgetter
169  for(auto eIt= region_mapping.begin();
170  eIt!=region_mapping.end();++eIt){
171  std::pair<unsigned int, unsigned int> region_range;
172 
173  //before update of the refgetter
174  region_range.first = aGetter->size();
175  //update the refegetter with the elementindex
176  theStripRegionCabling->updateSiStripRefGetter<SiStripCluster> (*aGetter, aLazyGetterH, eIt->first);
177  //after update of the refgetter
178  region_range.second = aGetter->size();
179 
180  LogDebug(category_)<<"between index: "<<region_range.first<<" "<<region_range.second
181  <<"\n"<<dumpRegion(region_range,*aGetter,StayPacked_);
182 
183  //now assign to each measurement det for that element index
184  for (auto dIt=eIt->second.begin();
185  dIt!=eIt->second.end();++dIt){
186  DetODStatus & elem = const_cast<DetODStatus &>((*dIt)->second);
187  elem.region_range = region_range;
188  elem.defined=true;
189  LogDebug(category_)<<"detId: "<<(*dIt)->first<<" in region range: "<<region_range.first<<" "<<region_range.second;
190  }//loop over MeasurementDet attached to that elementIndex
191  }//loop over know elementindex
192 }
#define LogDebug(id)
const SiStripRegionCabling * theStripRegionCabling
the cabling region tool to update a RefGetter
void updateSiStripRefGetter(edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const ElementIndex) const
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
bool StayPacked_
internal flag to avoid unpacking things with LogDebug on
std::string category_
log category
void setLazyGetter(edm::Handle< LazyGetter > const &lg)
std::string dumpRegion(std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
StMeasurementDetSet theStDets
std::string OnDemandMeasurementTracker::dumpCluster ( const std::vector< SiStripCluster >::const_iterator &  begin,
const std::vector< SiStripCluster >::const_iterator &  end 
) const
private

some printouts, exclusively under LogDebug

Definition at line 255 of file OnDemandMeasurementTracker.cc.

References begin, end, and i.

Referenced by assign(), and dumpRegion().

256 {
257  // dumpCluster is a printout of all the clusters between the iterator. returns a string
258  std::string tab=" ";
259  std::stringstream ss;
260  std::vector<SiStripCluster> ::const_iterator it = begin;
261  unsigned int i=0;
262  for (;it!=end;++it){
263  ss<<tab<<i++<<") center: "<<it->barycenter()<<",id: "<<it->geographicalId()<<" with: "<<it->amplitudes().size()<<" strips\n"<<tab<<tab<<"{";
264  for (unsigned int is=0;is!=it->amplitudes().size();++is){
265  ss<<it->amplitudes()[is]<<" ";
266  }ss<<"}\n";
267  }
268  return ss.str();
269 }
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
std::string OnDemandMeasurementTracker::dumpRegion ( std::pair< unsigned int, unsigned int >  indexes,
const RefGetter theGetter,
bool  stayUnpacked = false 
) const
private

Definition at line 271 of file OnDemandMeasurementTracker.cc.

References begin, dumpCluster(), end, pos, SiStripRegionCabling::position(), SiStripRegionCabling::positionIndex(), SiStripRegionCabling::region(), and theStripRegionCabling.

Referenced by assign(), and define().

274 {
275  // dumpRegion is a printout of all the clusters in a region defined on the RefGetter. returns a string
276  std::stringstream ss;
277  ss<<"cluster between: "<<indexes.first<<" and: "<<indexes.second<<"\n";
278  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
279  uint32_t reg = SiStripRegionCabling::region((theGetter)[iRegion].region());
282 
283  ss<<"Clusters for region:["<<iRegion<<"]"
284  <<"\n element index: "<<(theGetter)[iRegion].region()
285  <<"\n region absolute index: "<<reg
286  <<"\n region position index: "<<posI.first<<" "<<posI.second
287  <<"\n region position: "<<pos.first<<" "<<pos.second
288  <<"\n"<< (stayPacked? " hidden to avoid unpacking." : dumpCluster((theGetter)[iRegion].begin(),(theGetter)[iRegion].end()));
289  }
290  return ss.str();
291 }
const PositionIndex positionIndex(const uint32_t) const
const SiStripRegionCabling * theStripRegionCabling
the cabling region tool to update a RefGetter
std::string dumpCluster(const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
some printouts, exclusively under LogDebug
std::pair< double, double > Position
#define end
Definition: vmac.h:38
const Position position(const uint32_t) const
const uint32_t region(const Position) const
#define begin
Definition: vmac.h:31
std::pair< uint32_t, uint32_t > PositionIndex
const MeasurementDet * OnDemandMeasurementTracker::idToDet ( const DetId id) const
virtual

MeasurementDetSystem interface.

Reimplemented from MeasurementTrackerImpl.

Definition at line 358 of file OnDemandMeasurementTracker.cc.

References assign(), category_, LogDebug, TkGluedMeasurementDet::monoDet(), TkGluedMeasurementDet::stereoDet(), StripOnDemand_, and theDetODMap.

359 {
360  // overloaded from MeasurementTracker
361  // find the detid. if not found throw exception
362  // if already updated: always for pixel or strip already queried. return it
363  DetODContainer::iterator it = theDetODMap.find(id);
364  if ( it != theDetODMap.end()) {
365 
366  //it has already been queried. and so already updated: nothing to be done here (valid for pixels too)
367  if (it->second.updated){
368  LogDebug(category_)<<"found id: "<<id.rawId()<<" as aleardy updated.";
369  return it->second.mdet;
370  }
371 
372  if (StripOnDemand_){
373  //check glued or single
374  if (it->second.glued){
375  //glued det
376  LogDebug(category_)<<"updating glued id: "<<id.rawId();
377  //cast to specific type
378  TkGluedMeasurementDet* theConcreteDet = static_cast<TkGluedMeasurementDet*>(it->second.mdet);
379 
380  // update the two components
381  //update the mono
382  assign(theConcreteDet->monoDet());
383  //update the stereo
384  assign(theConcreteDet->stereoDet());
385 
386  //flag the glued det as updated (components are flagged in assign)
387  it->second.updated=true;
388  }//glued det
389  else{
390  //single layer
391  LogDebug(category_)<<"updating singel id: "<<id.rawId();
392  //cast to specific type
393  TkStripMeasurementDet* theConcreteDet = static_cast<TkStripMeasurementDet*>(it->second.mdet);
394 
395  //update the single layer
396  assign(theConcreteDet,&it);
397  }//single det
398  }
399  //eventually return it
400  return it->second.mdet;
401  }//found in the DetODMap
402  else{
403  //throw excpetion
404  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
405  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
406  }
407  return 0;
408 }
#define LogDebug(id)
const TkStripMeasurementDet * monoDet() const
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
bool StripOnDemand_
internal flag to do strip on demand (not configurable) true by default
std::string category_
log category
void assign(const TkStripMeasurementDet *csmdet, DetODContainer::iterator *alreadyFound=0) const
assigne the cluster iterator to the TkStipMeasurementDet (const_cast in the way)
const TkStripMeasurementDet * stereoDet() const
void OnDemandMeasurementTracker::update ( const edm::Event event) const
virtual

MeasurementTracker overloaded function.

Reimplemented from MeasurementTrackerImpl.

Definition at line 230 of file OnDemandMeasurementTracker.cc.

References category_, LogDebug, PixelOnDemand_, StripOnDemand_, MeasurementTrackerImpl::updatePixels(), updateStrips(), and MeasurementTrackerImpl::updateStrips().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

231 {
232  // update is supposed to be called by any module that is useing the MeasurementTracker
233  // after checking the the event has not yet been seen
234  // update the pixel using MeasurementTracekr specific function
235  // retreive the RefGetter from the event: the very one that has been pass to define(...) and put into the event
236 
237  if (!PixelOnDemand_) {
238  LogDebug(category_)<<"pixel are not OnDemand. updating them a la MeasurmentTracker.";
240  else{
241  edm::LogError(category_)<<"trying to update siPixel as on-demand. Not Implemented yet.";
242  }
243 
244  if (!StripOnDemand_) {
245  LogDebug(category_)<<"strip are not OnDemand. updating them a la MeasurmentTracker.";
247  else{
248  LogDebug(category_)<<"strip are OnDemand. updating them a la OnDemandMeasurmentTracker.";
249  updateStrips(event);
250  }
251 }
#define LogDebug(id)
bool PixelOnDemand_
internal flag to do pixel on demand (not configurable) false by default
void updateStrips(const edm::Event &) const
void updatePixels(const edm::Event &) const
bool StripOnDemand_
internal flag to do strip on demand (not configurable) true by default
std::string category_
log category
void updateStrips(const edm::Event &event) const
void OnDemandMeasurementTracker::updateStrips ( const edm::Event event) const
virtual

Reimplemented from MeasurementTrackerImpl.

Definition at line 194 of file OnDemandMeasurementTracker.cc.

References category_, StMeasurementDetSet::clusterToSkip(), edm::EventID::event(), MeasurementTrackerImpl::getInactiveStrips(), edm::ParameterSet::getParameter(), edm::EventBase::id(), LogDebug, MeasurementTrackerImpl::name_, MeasurementTrackerImpl::pset_, edm::EventID::run(), MeasurementTrackerImpl::selfUpdateSkipClusters_, StMeasurementDetSet::setLazyGetter(), theLazyGetterH, theRawInactiveStripDetIds, theRefGetterH, theSkipClusterRefs, MeasurementTrackerImpl::theStDets, and theStripClusterMask.

Referenced by update().

195 {
196  bool oncePerEvent= edm::Service<UpdaterService>()->checkOnce("OnDemandMeasurementTracker::updateStrips::"+name_);
197  bool failedToGet = false;
198  if (!oncePerEvent)
199  failedToGet = theRefGetterH.failedToGet() || theLazyGetterH.failedToGet();
200 
201  if (oncePerEvent || failedToGet)
202  {
203  LogDebug(category_)<<"Updating siStrip on event: "<< (unsigned int) event.id().run() <<" : "<<(unsigned int) event.id().event();
204 
205  //get the ref getter back from the event
206  std::string stripClusterProducer = pset_.getParameter<std::string>("stripClusterProducer");
207  event.getByLabel(stripClusterProducer,theRefGetterH);
208 
209  std::string stripLazyGetter = pset_.getParameter<std::string>("stripLazyGetterProducer");
210  event.getByLabel(stripLazyGetter,theLazyGetterH);
211 
213 
214 
215  //get the skip clusters
217  theSkipClusterRefs=true;
218  event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"),theStripClusterMask);
220  } else {
221  theStDets.clusterToSkip().clear();
222  }
223 
224  //get the detid that are inactive
227  }
228 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
edm::Handle< edm::LazyGetter< SiStripCluster > > theLazyGetterH
edm::Handle< edm::RefGetter< SiStripCluster > > theRefGetterH
the handle is retrieved from the event to make reference to cluster in it
std::vector< bool > & clusterToSkip() const
std::vector< uint32_t > theRawInactiveStripDetIds
edm::Handle< edm::ContainerMask< edm::LazyGetter< SiStripCluster > > > theStripClusterMask
const edm::ParameterSet & pset_
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
std::string category_
log category
void setLazyGetter(edm::Handle< LazyGetter > const &lg)
edm::EventID id() const
Definition: EventBase.h:56
StMeasurementDetSet theStDets

Member Data Documentation

std::string OnDemandMeasurementTracker::category_
private

log category

Definition at line 50 of file OnDemandMeasurementTracker.h.

Referenced by assign(), define(), idToDet(), OnDemandMeasurementTracker(), update(), and updateStrips().

bool OnDemandMeasurementTracker::PixelOnDemand_
private

internal flag to do pixel on demand (not configurable) false by default

Definition at line 56 of file OnDemandMeasurementTracker.h.

Referenced by update().

RegionalMap OnDemandMeasurementTracker::region_mapping
private

Definition at line 85 of file OnDemandMeasurementTracker.h.

Referenced by define(), and OnDemandMeasurementTracker().

bool OnDemandMeasurementTracker::StayPacked_
private

internal flag to avoid unpacking things with LogDebug on

Definition at line 52 of file OnDemandMeasurementTracker.h.

Referenced by define().

bool OnDemandMeasurementTracker::StripOnDemand_
private

internal flag to do strip on demand (not configurable) true by default

Definition at line 54 of file OnDemandMeasurementTracker.h.

Referenced by idToDet(), and update().

DetODContainer OnDemandMeasurementTracker::theDetODMap
mutableprivate

mapping of detid -> MeasurementDet+flags+region_range

Definition at line 81 of file OnDemandMeasurementTracker.h.

Referenced by assign(), define(), idToDet(), and OnDemandMeasurementTracker().

edm::Handle< edm::LazyGetter<SiStripCluster> > OnDemandMeasurementTracker::theLazyGetterH
mutableprivate

Definition at line 63 of file OnDemandMeasurementTracker.h.

Referenced by updateStrips().

std::vector<uint32_t> OnDemandMeasurementTracker::theRawInactiveStripDetIds
mutableprivate

Definition at line 97 of file OnDemandMeasurementTracker.h.

Referenced by assign(), OnDemandMeasurementTracker(), and updateStrips().

edm::Handle< edm::RefGetter<SiStripCluster> > OnDemandMeasurementTracker::theRefGetterH
mutableprivate

the handle is retrieved from the event to make reference to cluster in it

Definition at line 62 of file OnDemandMeasurementTracker.h.

Referenced by assign(), and updateStrips().

bool OnDemandMeasurementTracker::theSkipClusterRefs
mutableprivate

Definition at line 64 of file OnDemandMeasurementTracker.h.

Referenced by updateStrips().

edm::Handle< edm::ContainerMask<edm::LazyGetter<SiStripCluster> > > OnDemandMeasurementTracker::theStripClusterMask
mutableprivate

Definition at line 65 of file OnDemandMeasurementTracker.h.

Referenced by updateStrips().

const SiStripRegionCabling* OnDemandMeasurementTracker::theStripRegionCabling
private

the cabling region tool to update a RefGetter

Definition at line 59 of file OnDemandMeasurementTracker.h.

Referenced by define(), dumpRegion(), and OnDemandMeasurementTracker().