61 int stripQualityFlags,
62 int stripQualityDebugFlags,
65 int pixelQualityFlags,
66 int pixelQualityDebugFlags,
70 stripQuality,stripQualityFlags,stripQualityDebugFlags,
71 pixelQuality,pixelCabling,pixelQualityFlags,pixelQualityDebugFlags,
73 , category_(
"OnDemandMeasurementTracker")
75 , StripOnDemand_(
true)
76 , PixelOnDemand_(
false)
77 , theStripRegionCabling(stripRegionCabling)
84 std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::const_iterator> > local_mapping;
88 DetODContainer::iterator inserted =
theDetODMap.insert(make_pair(it->first,
DetODStatus(const_cast<MeasurementDet*>(it->second)))).first;
95 inserted->second.defined=
false;
96 inserted->second.updated=
true;
102 inserted->second.defined=
false;
103 inserted->second.updated=
false;
106 GlobalPoint center = it->second->geomDet().position();
107 double eta = center.
eta();
108 double phi = center.
phi();
109 uint32_t
id = it->first;
114 <<
"position: "<<center
127 local_mapping[eIndex].push_back(inserted);
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));
147 std::auto_ptr< RefGetter > & aGetter )
const
159 if (it->second.updated && !it->second.defined)
continue;
160 it->second.defined=
false;
161 it->second.updated =
false;
171 std::pair<unsigned int, unsigned int> region_range;
174 region_range.first = aGetter->size();
178 region_range.second = aGetter->size();
180 LogDebug(
category_)<<
"between index: "<<region_range.first<<
" "<<region_range.second
184 for (
auto dIt=eIt->second.begin();
185 dIt!=eIt->second.end();++dIt){
189 LogDebug(
category_)<<
"detId: "<<(*dIt)->first<<
" in region range: "<<region_range.first<<
" "<<region_range.second;
197 bool failedToGet =
false;
201 if (oncePerEvent || failedToGet)
206 std::string stripClusterProducer =
pset_.
getParameter<std::string>(
"stripClusterProducer");
209 std::string stripLazyGetter =
pset_.
getParameter<std::string>(
"stripLazyGetterProducer");
238 LogDebug(
category_)<<
"pixel are not OnDemand. updating them a la MeasurmentTracker.";
245 LogDebug(
category_)<<
"strip are not OnDemand. updating them a la MeasurmentTracker.";
248 LogDebug(
category_)<<
"strip are OnDemand. updating them a la OnDemandMeasurmentTracker.";
259 std::stringstream ss;
260 std::vector<SiStripCluster> ::const_iterator it =
begin;
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]<<
" ";
273 bool stayPacked)
const
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){
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()));
294 DetODContainer::iterator * alreadyFound)
const {
303 DetODContainer::iterator elementInMap;
304 if (alreadyFound){ elementInMap=*alreadyFound;}
309 elementInMap->second.updated =
true;
317 std::pair<unsigned int,unsigned int> & indexes =elementInMap->second.region_range;
321 <<
"\nretrieved for module: "<<
id.rawId()
325 for (
unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
327 if (range.first!=range.second){
330 smdet->
update(range.first, range.second);
332 <<
"\nnumber of regions defined here: "<< indexes.second-indexes.first
363 DetODContainer::iterator it =
theDetODMap.find(
id);
367 if (it->second.updated){
369 return it->second.mdet;
374 if (it->second.glued){
387 it->second.updated=
true;
396 assign(theConcreteDet,&it);
400 return it->second.mdet;
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
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
T getParameter(std::string const &) const
EventNumber_t event() const
void update(const detset &detSet)
RegionalMap region_mapping
edm::Handle< edm::LazyGetter< SiStripCluster > > theLazyGetterH
bool PixelOnDemand_
internal flag to do pixel on demand (not configurable) false by default
edm::Handle< edm::RefGetter< SiStripCluster > > theRefGetterH
the handle is retrieved from the event to make reference to cluster in it
const PositionIndex positionIndex(const uint32_t) const
void update(const edm::Event &) const
MeasurementTracker overloaded function.
const SiStripRegionCabling * theStripRegionCabling
the cabling region tool to update a RefGetter
Geom::Phi< T > phi() const
void updateStrips(const edm::Event &) const
std::vector< bool > & clusterToSkip() const
std::pair< typename record_type::const_iterator, typename record_type::const_iterator > record_pair
const TkStripMeasurementDet * monoDet() const
const std::vector< edm::InputTag > theInactiveStripDetectorLabels
std::string dumpCluster(const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
some printouts, exclusively under LogDebug
U second(std::pair< T, U > const &p)
std::vector< uint32_t > theRawInactiveStripDetIds
edm::Handle< edm::ContainerMask< edm::LazyGetter< SiStripCluster > > > theStripClusterMask
bool selfUpdateSkipClusters_
void updateSiStripRefGetter(edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const ElementIndex) const
DetODContainer theDetODMap
mapping of detid -> MeasurementDet+flags+region_range
void updatePixels(const edm::Event &) const
static const SubDet subdetFromDetId(const uint32_t detid)
bool StayPacked_
internal flag to avoid unpacking things with LogDebug on
std::pair< double, double > Position
const edm::ParameterSet & pset_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
void setActiveThisEvent(bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
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)
a class that holds flags, region_range (in RefGetter) for a given MeasurementDet
void setLazyGetter(edm::Handle< LazyGetter > const &lg)
const uint32_t region(const Position) const
unsigned int rawId() const
void updateStrips(const edm::Event &event) const
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
std::pair< unsigned int, unsigned int > region_range
std::pair< uint32_t, uint32_t > PositionIndex
std::string dumpRegion(std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
virtual const MeasurementDet * idToDet(const DetId &id) const
MeasurementDetSystem interface.
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 accor...
StMeasurementDetSet theStDets