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
 
const std::vector
< TkStripMeasurementDet * > & 
stripDets () 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
 
edm::Handle< edm::RefGetter
< SiStripCluster > > 
theRefGetterH
 the handle is retrieved from the event to make reference to cluster in it More...
 
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 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_
 
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 10 of file OnDemandMeasurementTracker.h.

Member Typedef Documentation

Definition at line 73 of file OnDemandMeasurementTracker.h.

Definition at line 35 of file OnDemandMeasurementTracker.h.

Definition at line 36 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, 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 }
#define LogDebug(id)
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
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)
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 29 of file OnDemandMeasurementTracker.h.

29 {}

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

References category_, dumpCluster(), dumpRegion(), GeomDet::geographicalId(), MeasurementDet::geomDet(), LogDebug, TkStripMeasurementDet::setEmpty(), theDetODMap, theLazyGetterH, theRefGetterH, and TkStripMeasurementDet::update().

Referenced by idToDet().

262  {
263  // assign is using the handle to the refgetter and the region index range to update the MeasurementDet with their clusters
264 
265  TkStripMeasurementDet * smdet = const_cast<TkStripMeasurementDet *>(csmdet);
266  DetId id = smdet->geomDet().geographicalId();
267 
268  LogDebug(category_)<<"assigning: "<<id.rawId();
269 
270  // what is the iterator. do not look again if already found and provided with
271  DetODContainer::iterator elementInMap;
272  if (alreadyFound){ elementInMap=*alreadyFound;}
273  else{ elementInMap = theDetODMap.find(id);}
274 
275  if ( elementInMap != theDetODMap.end()){
276  //flag it as updated
277  elementInMap->second.updated = true;
278  //retrieve the region range index for this module
279  std::pair<unsigned int,unsigned int> & indexes =elementInMap->second.region_range;
280 
281  //this printout will trigger unpacking. no problem. it is done on the next regular line (find(id.rawId())
282  LogDebug(category_)<<"between index: "<<indexes.first<<" and: "<<indexes.second
283  <<"\nretrieved for module: "<<id.rawId()
284  <<"\n"<<dumpRegion(indexes,*theRefGetterH);
285 
286  //look for iterator range in the regions defined for that module
287  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
288  RefGetter::record_pair range = (*theRefGetterH)[iRegion].find(id.rawId());
289  if (range.first!=range.second){
290  // found something not empty
291  //update the measurementDet
292  smdet->update(range.first, range.second, theLazyGetterH, id);
293  LogDebug(category_)<<"Valid clusters for: "<<id.rawId()
294  <<"\nnumber of regions defined here: "<< indexes.second-indexes.first
295  <<"\n"<<dumpCluster(range.first,range.second);
296  //and you are done
297  return;}
298  }//loop over regions, between indexes
299 
300  //if reached. no cluster are found. set the TkStripMeasurementDet to be empty
301  smdet->setEmpty();
302 
303  }//found in the map
304  else{
305  //throw excpetion
306  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
307  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
308  }
309 }
#define LogDebug(id)
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
virtual const GeomDet & geomDet() const
std::pair< typename record_type::const_iterator, typename record_type::const_iterator > record_pair
Definition: RefGetter.h:26
std::string dumpCluster(const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
some printouts, exclusively under LogDebug
DetODContainer theDetODMap
mapping of detid -&gt; MeasurementDet+flags+region_range
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
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 135 of file OnDemandMeasurementTracker.cc.

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

Referenced by MeasurementTrackerSiStripRefGetterProducer::produce().

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

References begin, end, and i.

Referenced by assign(), and dumpRegion().

224 {
225  // dumpCluster is a printout of all the clusters between the iterator. returns a string
226  std::string tab=" ";
227  std::stringstream ss;
228  std::vector<SiStripCluster> ::const_iterator it = begin;
229  unsigned int i=0;
230  for (;it!=end;++it){
231  ss<<tab<<i++<<") center: "<<it->barycenter()<<",id: "<<it->geographicalId()<<" with: "<<it->amplitudes().size()<<" strips\n"<<tab<<tab<<"{";
232  for (unsigned int is=0;is!=it->amplitudes().size();++is){
233  ss<<it->amplitudes()[is]<<" ";
234  }ss<<"}\n";
235  }
236  return ss.str();
237 }
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 239 of file OnDemandMeasurementTracker.cc.

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

Referenced by assign(), and define().

242 {
243  // dumpRegion is a printout of all the clusters in a region defined on the RefGetter. returns a string
244  std::stringstream ss;
245  ss<<"cluster between: "<<indexes.first<<" and: "<<indexes.second<<"\n";
246  for (unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
247  uint32_t reg = SiStripRegionCabling::region((theGetter)[iRegion].region());
250 
251  ss<<"Clusters for region:["<<iRegion<<"]"
252  <<"\n element index: "<<(theGetter)[iRegion].region()
253  <<"\n region absolute index: "<<reg
254  <<"\n region position index: "<<posI.first<<" "<<posI.second
255  <<"\n region position: "<<pos.first<<" "<<pos.second
256  <<"\n"<< (stayPacked? " hidden to avoid unpacking." : dumpCluster((theGetter)[iRegion].begin(),(theGetter)[iRegion].end()));
257  }
258  return ss.str();
259 }
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 314 of file OnDemandMeasurementTracker.cc.

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

315 {
316  // overloaded from MeasurementTracker
317  // find the detid. if not found throw exception
318  // if already updated: always for pixel or strip already queried. return it
319  DetODContainer::iterator it = theDetODMap.find(id);
320  if ( it != theDetODMap.end()) {
321 
322  //it has already been queried. and so already updated: nothing to be done here (valid for pixels too)
323  if (it->second.updated){LogDebug(category_)<<"found id: "<<id.rawId()<<" as aleardy updated."; return it->second.mdet;}
324 
325  if (StripOnDemand_){
326  //check glued or single
327  std::vector< const GeomDet*> comp = it->second.mdet->geomDet().components();
328  if (!comp.empty()){
329  //glued det
330  LogDebug(category_)<<"updating glued id: "<<id.rawId()<<" ("<<comp.size()<<").";
331  //cast to specific type
332  TkGluedMeasurementDet* theConcreteDet = dynamic_cast<TkGluedMeasurementDet*>(it->second.mdet);
333  //FIXME. do not require the dynamic cast, since we know what we do here
334  // const TkGluedMeasurementDet* theConcreteDet = (const TkGluedMeasurementDet*) it->second.mdet;
335  if (!theConcreteDet){
336  edm::LogError(category_)<<"failed to cast to glued measurement det:"<<it->first.rawId();
337  throw MeasurementDetException("failed to cast. see log file.");}
338 
339  // update the two components
340  //update the mono
341  assign(theConcreteDet->monoDet());
342  //update the stereo
343  assign(theConcreteDet->stereoDet());
344 
345  //flag the glued det as updated (components are flagged in assign)
346  it->second.updated=true;
347  }//glued det
348  else{
349  //single layer
350  LogDebug(category_)<<"updating singel id: "<<id.rawId();
351  //cast to specific type
352  TkStripMeasurementDet* theConcreteDet = dynamic_cast<TkStripMeasurementDet*>(it->second.mdet);
353  //FIXME. do not require the dynamic cast, since we know what we do here
354  // const TkStripMeasurementDet* theConcreteDet = (const TkStripMeasurementDet*)it->second.mdet;
355  if (!theConcreteDet){
356  edm::LogError(category_)<<"failed to cast to strip measurement det:"<<it->first.rawId();
357  throw MeasurementDetException("failed to cast. see log file.");}
358 
359  //update the single layer
360  assign(theConcreteDet,&it);
361  }//single det
362  }
363  //eventually return it
364  return it->second.mdet;
365  }//found in the DetODMap
366  else{
367  //throw excpetion
368  edm::LogError(category_)<<"failed to find the MeasurementDet for: "<<id.rawId();
369  throw MeasurementDetException("failed to find the MeasurementDet for: <see message logger>");
370  }
371  return 0;
372 }
#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 198 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().

199 {
200  // update is supposed to be called by any module that is useing the MeasurementTracker
201  // after checking the the event has not yet been seen
202  // update the pixel using MeasurementTracekr specific function
203  // retreive the RefGetter from the event: the very one that has been pass to define(...) and put into the event
204 
205  if (!PixelOnDemand_) {
206  LogDebug(category_)<<"pixel are not OnDemand. updating them a la MeasurmentTracker.";
208  else{
209  edm::LogError(category_)<<"trying to update siPixel as on-demand. Not Implemented yet.";
210  }
211 
212  if (!StripOnDemand_) {
213  LogDebug(category_)<<"strip are not OnDemand. updating them a la MeasurmentTracker.";
215  else{
216  LogDebug(category_)<<"strip are OnDemand. updating them a la OnDemandMeasurmentTracker.";
217  updateStrips(event);
218  }
219 }
#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 178 of file OnDemandMeasurementTracker.cc.

References category_, edm::EventID::event(), edm::HandleBase::failedToGet(), edm::ParameterSet::getParameter(), edm::EventBase::id(), LogDebug, MeasurementTracker::name_, MeasurementTracker::pset_, edm::EventID::run(), ExpressReco_HICollisions_FallBack::stripClusterProducer, theLazyGetterH, and theRefGetterH.

Referenced by update().

179 {
180  bool oncePerEvent= edm::Service<UpdaterService>()->checkOnce("OnDemandMeasurementTracker::updateStrips::"+name_);
181  bool failedToGet = false;
182  if (!oncePerEvent)
183  failedToGet = theRefGetterH.failedToGet() || theLazyGetterH.failedToGet();
184 
185  if (oncePerEvent || failedToGet)
186  {
187  LogDebug(category_)<<"Updating siStrip on event: "<< (unsigned int) event.id().run() <<" : "<<(unsigned int) event.id().event();
188 
189  //get the ref getter back from the event
190  std::string stripClusterProducer = pset_.getParameter<std::string>("stripClusterProducer");
191  event.getByLabel(stripClusterProducer,theRefGetterH);
192 
193  std::string stripLazyGetter = pset_.getParameter<std::string>("stripLazyGetterProducer");
194  event.getByLabel(stripLazyGetter,theLazyGetterH);
195  }
196 }
#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
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 47 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 54 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 78 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 49 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 52 of file OnDemandMeasurementTracker.h.

Referenced by idToDet(), and update().

DetODContainer OnDemandMeasurementTracker::theDetODMap
mutableprivate

mapping of detid -> MeasurementDet+flags+region_range

Definition at line 75 of file OnDemandMeasurementTracker.h.

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

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

Definition at line 61 of file OnDemandMeasurementTracker.h.

Referenced by assign(), define(), 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 60 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 57 of file OnDemandMeasurementTracker.h.

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