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:
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 MeasurementTracker
typedef std::map< DetId,
MeasurementDet * > 
DetContainer
 
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 MeasurementTracker
const DetContainerallDets () const
 For debug only. More...
 
const GeometricSearchTrackergeometricSearchTracker () const
 
const TrackingGeometrygeomTracker () const
 
const std::vector
< TkGluedMeasurementDet * > & 
gluedDets () const
 
 MeasurementTracker (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
 
void updateStrips (const edm::Event &) const
 
virtual ~MeasurementTracker ()
 

Private Types

typedef std::map< DetId,
DetODStatus
DetODContainer
 

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...
 
std::map
< SiStripRegionCabling::ElementIndex,
std::vector
< DetODContainer::iterator > > 
region_mapping
 mapping of elementIndex -> iterator to the DetODMap: to know what are the regions that needs to be defined in the ref getter More...
 
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
< edmNew::DetSetVector
< TkStripMeasurementDet::SiStripRegionalClusterRef > > 
theStripClusterRefs
 
const SiStripRegionCablingtheStripRegionCabling
 the cabling region tool to update a RefGetter More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 12 of file OnDemandMeasurementTracker.h.

Member Typedef Documentation

Definition at line 76 of file OnDemandMeasurementTracker.h.

Definition at line 37 of file OnDemandMeasurementTracker.h.

Definition at line 38 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 53 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, MeasurementTracker::theDetMap, theDetODMap, MeasurementTracker::theInactiveStripDetectorLabels, theRawInactiveStripDetIds, theStripRegionCabling, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.

67  :
68  MeasurementTracker(conf,pixelCPE,stripCPE,hitMatcher,trackerGeom,geometricSearchTracker,
69  stripQuality,stripQualityFlags,stripQualityDebugFlags,
70  pixelQuality,pixelCabling,pixelQualityFlags,pixelQualityDebugFlags,
71  isRegional)
72  , category_("OnDemandMeasurementTracker")
73  , StayPacked_(true)
74  , StripOnDemand_(true)
75  , PixelOnDemand_(false)
76  , theStripRegionCabling(stripRegionCabling)
77 {
78  // the constructor does construct the regular MeasurementTracker
79  // then a smart copy of the DetMap is made into DetODMap: this could be avoided with modification to MeasurementDet interface
80  // the elementIndex to be defined in the refgetter is mapped to the detId
81  // flags are set to initialize the DetODMap
82 
83  for (DetContainer::iterator it=theDetMap.begin(); it!= theDetMap.end();++it)
84  {
85  DetODContainer::iterator inserted = theDetODMap.insert(make_pair(it->first,DetODStatus(const_cast<MeasurementDet*>(it->second)))).first;
86 
87 
88  GeomDet::SubDetector subdet = it->second->geomDet().subDetector();
90  //special flag treatement for pixels
91  //one can never be updated and not defined. except if we don't need to care about them: pixels
92  inserted->second.defined=false;
93  inserted->second.updated=true;
94  }//pixel module
95  else if (subdet == GeomDetEnumerators::TIB || subdet == GeomDetEnumerators::TOB ||
96  subdet == GeomDetEnumerators::TID || subdet == GeomDetEnumerators::TEC )
97  {
98  //set flag to false
99  inserted->second.defined=false;
100  inserted->second.updated=false;
101 
102  //what will be the element index in the refgetter
103  GlobalPoint center = it->second->geomDet().position();
104  double eta = center.eta();
105  double phi = center.phi();
106  uint32_t id = it->first.rawId();
110  LogDebug(category_)<<"region selected (from "<<id<<" center) is:\n"
111  <<"position: "<<center
113  <<"\n center position index: "<<theStripRegionCabling->positionIndex(SiStripRegionCabling::Position(eta,phi)).first<<
117  <<"\n eta: "<<eta
118  <<"\n phi: "<<phi
119  <<"\n subedet: "<<SiStripRegionCabling::subdetFromDetId(id)
120  <<" layer: "<<SiStripRegionCabling::layerFromDetId(id);
121 
122  // register those in a map
123  //to be able to know what are the detid in a given elementIndex
124  region_mapping[eIndex].push_back(inserted);
125  }//strip module
126  else{
127  //abort
128  edm::LogError(category_)<<"not a tracker geomdet in constructor: "<<it->first.rawId();
129  throw MeasurementDetException("OnDemandMeasurementTracker dealing with a non tracker GeomDet.");
130  }//abort
131  }//loop over DetMap
132 
133  if (theInactiveStripDetectorLabels.size()!=0)
134  theRawInactiveStripDetIds.reserve(200);
135 }
#define LogDebug(id)
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
const std::vector< edm::InputTag > theInactiveStripDetectorLabels
std::map< SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::iterator > > region_mapping
mapping of elementIndex -&gt; iterator to the DetODMap: to know what are the regions that needs to be de...
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:63
T eta() const
U second(std::pair< T, U > const &p)
std::vector< uint32_t > theRawInactiveStripDetIds
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:79
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
MeasurementTracker(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)
static const uint32_t layerFromDetId(const uint32_t detid)
T eta() const
Definition: PV3DBase.h:70
const uint32_t region(const Position) const
Definition: DDAxes.h:10
virtual OnDemandMeasurementTracker::~OnDemandMeasurementTracker ( )
inlinevirtual

destructor

Definition at line 31 of file OnDemandMeasurementTracker.h.

31 {}

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 274 of file OnDemandMeasurementTracker.cc.

References edmNew::DetSetVector< T >::begin(), category_, dumpCluster(), dumpRegion(), edmNew::DetSetVector< T >::end(), f, GeomDet::geographicalId(), MeasurementDet::geomDet(), LogDebug, MeasurementTracker::selfUpdateSkipClusters_, TkStripMeasurementDet::setActiveThisEvent(), TkStripMeasurementDet::setEmpty(), TkStripMeasurementDet::setRegionalClustersToSkip(), theDetODMap, theLazyGetterH, theRawInactiveStripDetIds, theRefGetterH, theStripClusterRefs, TkStripMeasurementDet::unset(), and TkStripMeasurementDet::update().

Referenced by idToDet().

275  {
276  // assign is using the handle to the refgetter and the region index range to update the MeasurementDet with their clusters
277 
278  TkStripMeasurementDet * smdet = const_cast<TkStripMeasurementDet *>(csmdet);
279  DetId id = smdet->geomDet().geographicalId();
280 
281  LogDebug(category_)<<"assigning: "<<id.rawId();
282 
283  // what is the iterator. do not look again if already found and provided with
284  DetODContainer::iterator elementInMap;
285  if (alreadyFound){ elementInMap=*alreadyFound;}
286  else{ elementInMap = theDetODMap.find(id);}
287 
288  if ( elementInMap != theDetODMap.end()){
289  //flag it as updated
290  elementInMap->second.updated = true;
291 
292  if (!theRawInactiveStripDetIds.empty() && std::binary_search(theRawInactiveStripDetIds.begin(), theRawInactiveStripDetIds.end(), id)) {
293  smdet->setActiveThisEvent(false);
294  return;
295  }
296 
297  //retrieve the region range index for this module
298  std::pair<unsigned int,unsigned int> & indexes =elementInMap->second.region_range;
299 
300  //this printout will trigger unpacking. no problem. it is done on the next regular line (find(id.rawId())
301  LogDebug(category_)<<"between index: "<<indexes.first<<" and: "<<indexes.second
302  <<"\nretrieved for module: "<<id.rawId()
303  <<"\n"<<dumpRegion(indexes,*theRefGetterH);
304 
305  //look for iterator range in the regions defined for that module
306  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
307  RefGetter::record_pair range = (*theRefGetterH)[iRegion].find(id.rawId());
308  if (range.first!=range.second){
309  // found something not empty
310  //update the measurementDet
311  smdet->update(range.first, range.second, theLazyGetterH, id);
312  LogDebug(category_)<<"Valid clusters for: "<<id.rawId()
313  <<"\nnumber of regions defined here: "<< indexes.second-indexes.first
314  <<"\n"<<dumpCluster(range.first,range.second);
316  //assign skip clusters
318  if (f!=theStripClusterRefs->end())
319  smdet->setRegionalClustersToSkip(f->begin(),f->end());
320  else
321  smdet->unset();
322  }
323  //and you are done
324  return;}
325  }//loop over regions, between indexes
326 
327  //if reached. no cluster are found. set the TkStripMeasurementDet to be empty
328  smdet->setEmpty();
329 
330  }//found in the map
331  else{
332  //throw excpetion
333  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
334  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
335  }
336 }
#define LogDebug(id)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin() const
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
void setRegionalClustersToSkip(IT begin, IT end)
virtual const GeomDet & geomDet() const
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
edm::Handle< edmNew::DetSetVector< TkStripMeasurementDet::SiStripRegionalClusterRef > > theStripClusterRefs
std::vector< uint32_t > theRawInactiveStripDetIds
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
double f[11][100]
const_iterator end() const
void setActiveThisEvent(bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
void update(const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiStripCluster > > h, unsigned int id)
std::string category_
log category
Definition: DetId.h:20
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 > > &  theLazyGetterH,
std::auto_ptr< RefGetter > &  theGetter 
) const

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

Definition at line 138 of file OnDemandMeasurementTracker.cc.

References category_, dumpRegion(), LogDebug, python.multivaluedict::map(), region_mapping, StayPacked_, theDetODMap, theLazyGetterH, theStripRegionCabling, and SiStripRegionCabling::updateSiStripRefGetter().

Referenced by MeasurementTrackerSiStripRefGetterProducer::produce().

140 {
141  // define is supposed to be call by an EDProducer module, which wil put the RefGetter in the event
142  // so that reference can be made to it.
143  // the lazy getter is retrieved by the calling module and passed along with the event
144  // the map is cleared, except for pixel
145  // then the known elementIndex are defined to the RefGetter. no unpacking is done at this time
146  // the defined region range is registered in the DetODMap for further use.
147 
148  //clear all defined tags to start from scratch (except for pixel)
149  for (DetODContainer::iterator it=theDetODMap.begin(); it!= theDetODMap.end();++it)
150  {
151  if (it->second.updated && !it->second.defined) continue; //special treatement for pixels
152  it->second.defined= false;
153  it->second.updated = false;
154  }
155 
156  //define all the elementindex in the refgetter
157  for( std::map<SiStripRegionCabling::ElementIndex, std::vector<DetODContainer::iterator> >::iterator eIt= region_mapping.begin();
158  eIt!=region_mapping.end();++eIt){
159  std::pair<unsigned int, unsigned int> region_range;
160 
161  //before update of the refgetter
162  region_range.first = theGetter->size();
163  //update the refegetter with the elementindex
165  //after update of the refgetter
166  region_range.second = theGetter->size();
167 
168  LogDebug(category_)<<"between index: "<<region_range.first<<" "<<region_range.second
169  <<"\n"<<dumpRegion(region_range,*theGetter,StayPacked_);
170 
171  //now assign to each measurement det for that element index
172  for (std::vector<DetODContainer::iterator>::iterator dIt=eIt->second.begin();
173  dIt!=eIt->second.end();++dIt){
174  (*dIt)->second.region_range = region_range;
175  (*dIt)->second.defined=true;
176  LogDebug(category_)<<"detId: "<<(*dIt)->first.rawId()<<" in region range: "<<region_range.first<<" "<<region_range.second;
177  }//loop over MeasurementDet attached to that elementIndex
178  }//loop over know elementindex
179 }
#define LogDebug(id)
edm::Handle< edm::LazyGetter< SiStripCluster > > theLazyGetterH
std::map< SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::iterator > > region_mapping
mapping of elementIndex -&gt; iterator to the DetODMap: to know what are the regions that needs to be de...
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
std::string dumpRegion(std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
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 236 of file OnDemandMeasurementTracker.cc.

References begin, end, and i.

Referenced by assign(), and dumpRegion().

237 {
238  // dumpCluster is a printout of all the clusters between the iterator. returns a string
239  std::string tab=" ";
240  std::stringstream ss;
241  std::vector<SiStripCluster> ::const_iterator it = begin;
242  unsigned int i=0;
243  for (;it!=end;++it){
244  ss<<tab<<i++<<") center: "<<it->barycenter()<<",id: "<<it->geographicalId()<<" with: "<<it->amplitudes().size()<<" strips\n"<<tab<<tab<<"{";
245  for (unsigned int is=0;is!=it->amplitudes().size();++is){
246  ss<<it->amplitudes()[is]<<" ";
247  }ss<<"}\n";
248  }
249  return ss.str();
250 }
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 252 of file OnDemandMeasurementTracker.cc.

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

Referenced by assign(), and define().

255 {
256  // dumpRegion is a printout of all the clusters in a region defined on the RefGetter. returns a string
257  std::stringstream ss;
258  ss<<"cluster between: "<<indexes.first<<" and: "<<indexes.second<<"\n";
259  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
260  uint32_t reg = SiStripRegionCabling::region((theGetter)[iRegion].region());
263 
264  ss<<"Clusters for region:["<<iRegion<<"]"
265  <<"\n element index: "<<(theGetter)[iRegion].region()
266  <<"\n region absolute index: "<<reg
267  <<"\n region position index: "<<posI.first<<" "<<posI.second
268  <<"\n region position: "<<pos.first<<" "<<pos.second
269  <<"\n"<< (stayPacked? " hidden to avoid unpacking." : dumpCluster((theGetter)[iRegion].begin(),(theGetter)[iRegion].end()));
270  }
271  return ss.str();
272 }
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 MeasurementTracker.

Definition at line 341 of file OnDemandMeasurementTracker.cc.

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

342 {
343  // overloaded from MeasurementTracker
344  // find the detid. if not found throw exception
345  // if already updated: always for pixel or strip already queried. return it
346  DetODContainer::iterator it = theDetODMap.find(id);
347  if ( it != theDetODMap.end()) {
348 
349  //it has already been queried. and so already updated: nothing to be done here (valid for pixels too)
350  if (it->second.updated){LogDebug(category_)<<"found id: "<<id.rawId()<<" as aleardy updated."; return it->second.mdet;}
351 
352  if (StripOnDemand_){
353  //check glued or single
354  std::vector< const GeomDet*> comp = it->second.mdet->geomDet().components();
355  if (!comp.empty()){
356  //glued det
357  LogDebug(category_)<<"updating glued id: "<<id.rawId()<<" ("<<comp.size()<<").";
358  //cast to specific type
359  TkGluedMeasurementDet* theConcreteDet = static_cast<TkGluedMeasurementDet*>(it->second.mdet);
360 
361  // update the two components
362  //update the mono
363  assign(theConcreteDet->monoDet());
364  //update the stereo
365  assign(theConcreteDet->stereoDet());
366 
367  //flag the glued det as updated (components are flagged in assign)
368  it->second.updated=true;
369  }//glued det
370  else{
371  //single layer
372  LogDebug(category_)<<"updating singel id: "<<id.rawId();
373  //cast to specific type
374  TkStripMeasurementDet* theConcreteDet = static_cast<TkStripMeasurementDet*>(it->second.mdet);
375 
376  //update the single layer
377  assign(theConcreteDet,&it);
378  }//single det
379  }
380  //eventually return it
381  return it->second.mdet;
382  }//found in the DetODMap
383  else{
384  //throw excpetion
385  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
386  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
387  }
388  return 0;
389 }
#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 MeasurementTracker.

Definition at line 211 of file OnDemandMeasurementTracker.cc.

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

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

212 {
213  // update is supposed to be called by any module that is useing the MeasurementTracker
214  // after checking the the event has not yet been seen
215  // update the pixel using MeasurementTracekr specific function
216  // retreive the RefGetter from the event: the very one that has been pass to define(...) and put into the event
217 
218  if (!PixelOnDemand_) {
219  LogDebug(category_)<<"pixel are not OnDemand. updating them a la MeasurmentTracker.";
221  else{
222  edm::LogError(category_)<<"trying to update siPixel as on-demand. Not Implemented yet.";
223  }
224 
225  if (!StripOnDemand_) {
226  LogDebug(category_)<<"strip are not OnDemand. updating them a la MeasurmentTracker.";
228  else{
229  LogDebug(category_)<<"strip are OnDemand. updating them a la OnDemandMeasurmentTracker.";
230  updateStrips(event);
231  }
232 }
#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

Definition at line 181 of file OnDemandMeasurementTracker.cc.

References category_, edm::EventID::event(), edm::HandleBase::failedToGet(), MeasurementTracker::getInactiveStrips(), edm::ParameterSet::getParameter(), edm::EventBase::id(), LogDebug, MeasurementTracker::name_, MeasurementTracker::pset_, edm::EventID::run(), MeasurementTracker::selfUpdateSkipClusters_, theLazyGetterH, theRawInactiveStripDetIds, theRefGetterH, theSkipClusterRefs, and theStripClusterRefs.

Referenced by update().

182 {
183  bool oncePerEvent= edm::Service<UpdaterService>()->checkOnce("OnDemandMeasurementTracker::updateStrips::"+name_);
184  bool failedToGet = false;
185  if (!oncePerEvent)
186  failedToGet = theRefGetterH.failedToGet() || theLazyGetterH.failedToGet();
187 
188  if (oncePerEvent || failedToGet)
189  {
190  LogDebug(category_)<<"Updating siStrip on event: "<< (unsigned int) event.id().run() <<" : "<<(unsigned int) event.id().event();
191 
192  //get the ref getter back from the event
193  std::string stripClusterProducer = pset_.getParameter<std::string>("stripClusterProducer");
194  event.getByLabel(stripClusterProducer,theRefGetterH);
195 
196  std::string stripLazyGetter = pset_.getParameter<std::string>("stripLazyGetterProducer");
197  event.getByLabel(stripLazyGetter,theLazyGetterH);
198 
199  //get the skip clusters
201  theSkipClusterRefs=true;
202  event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"),theStripClusterRefs);
203  }
204 
205  //get the detid that are inactive
208  }
209 }
#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
edm::Handle< edmNew::DetSetVector< TkStripMeasurementDet::SiStripRegionalClusterRef > > theStripClusterRefs
std::vector< uint32_t > theRawInactiveStripDetIds
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
bool failedToGet() const
Definition: HandleBase.h:80
std::string category_
log category
const edm::ParameterSet & pset_
edm::EventID id() const
Definition: EventBase.h:56
const std::string name_

Member Data Documentation

std::string OnDemandMeasurementTracker::category_
private

log category

Definition at line 49 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().

std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::iterator> > OnDemandMeasurementTracker::region_mapping
mutableprivate

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 81 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 51 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 78 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 assign(), define(), and updateStrips().

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

Definition at line 93 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< edmNew::DetSetVector<TkStripMeasurementDet::SiStripRegionalClusterRef> > OnDemandMeasurementTracker::theStripClusterRefs
mutableprivate

Definition at line 65 of file OnDemandMeasurementTracker.h.

Referenced by assign(), and 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().