58 int stripQualityFlags,
59 int stripQualityDebugFlags,
62 int pixelQualityFlags,
63 int pixelQualityDebugFlags,
67 stripQuality,stripQualityFlags,stripQualityDebugFlags,
68 pixelQuality,pixelCabling,pixelQualityFlags,pixelQualityDebugFlags,
70 , category_(
"OnDemandMeasurementTracker")
72 , StripOnDemand_(
true)
73 , PixelOnDemand_(
false)
74 , theStripRegionCabling(stripRegionCabling)
81 std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::const_iterator> > local_mapping;
84 DetODContainer::iterator inserted =
theDetODMap.insert(make_pair(it->first,
DetODStatus(it->second))).first;
89 inserted->second.index = -1;
96 if (
typeid(*it->second) ==
typeid(TkStripMeasurementDet)) {
97 const TkStripMeasurementDet & sdet =
static_cast<const TkStripMeasurementDet &
>(*it->second);
98 inserted->second.index = sdet.index();
105 GlobalPoint center = it->second->geomDet().position();
106 double eta = center.
eta();
107 double phi = center.
phi();
108 uint32_t
id = it->first;
113 <<
"position: "<<center
126 local_mapping[eIndex].push_back(inserted);
136 for(
auto eIt= local_mapping.begin();
137 eIt!=local_mapping.end();++eIt)
138 region_mapping.push_back(std::make_pair((*eIt).first,(*eIt).second));
155 std::pair<unsigned int, unsigned int> region_range;
158 region_range.first = aGetter.
size();
162 region_range.second = aGetter.size();
164 LogDebug(
category_)<<
"between index: "<<region_range.first<<
" "<<region_range.second
168 for (
auto dIt=eIt->second.begin();
169 dIt!=eIt->second.end();++dIt){
174 LogDebug(
category_)<<
"detId: "<<(*dIt)->first<<
" in region range: "<<region_range.first<<
" "<<region_range.second;
185 std::stringstream ss;
186 std::vector<SiStripCluster> ::const_iterator it =
begin;
189 ss<<tab<<i++<<
") center: "<<it->barycenter()<<
",id: "<<it->geographicalId()<<
" with: "<<it->amplitudes().size()<<
" strips\n"<<tab<<tab<<
"{";
190 for (
unsigned int is=0;is!=it->amplitudes().size();++is){
191 ss<<it->amplitudes()[is]<<
" ";
199 bool stayPacked)
const
202 std::stringstream ss;
203 ss<<
"cluster between: "<<indexes.first<<
" and: "<<indexes.second<<
"\n";
204 for (
unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
209 ss<<
"Clusters for region:["<<iRegion<<
"]"
210 <<
"\n element index: "<<(theGetter)[iRegion].region()
211 <<
"\n region absolute index: "<<reg
212 <<
"\n region position index: "<<posI.first<<
" "<<posI.second
213 <<
"\n region position: "<<pos.first<<
" "<<pos.second
214 <<
"\n"<< (stayPacked?
" hidden to avoid unpacking." :
dumpCluster((theGetter)[iRegion].
begin(),(theGetter)[iRegion].
end()));
234 smdet->setActiveThisEvent(rwdata,
false);
239 const std::pair<unsigned int,unsigned int> & indexes = data.
stripData().
regionRange(smdet->index());
243 <<
"\nretrieved for module: "<<
id.rawId()
247 for (
unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
249 if (range.first!=range.second){
252 smdet->update(rwdata, range.first, range.second);
254 <<
"\nnumber of regions defined here: "<< indexes.second-indexes.first
267 smdet->setEmpty(rwdata);
279 DetODContainer::const_iterator it =
theDetODMap.find(
id);
281 switch (it->second.kind) {
286 const TkStripMeasurementDet* theConcreteDet =
static_cast<const TkStripMeasurementDet*
>(it->second.mdet);
292 const TkGluedMeasurementDet* theConcreteDet =
static_cast<const TkGluedMeasurementDet*
>(it->second.mdet);
293 int imono = theConcreteDet->monoDet()->index(), istereo = theConcreteDet->stereoDet()->index();
300 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
RegionalMap region_mapping
const MeasurementDet * idToDetBare(const DetId &id, const MeasurementTrackerEvent &data) const
MeasurementTrackerImpl interface.
void define(const edm::Handle< edm::LazyGetter< SiStripCluster > > &, RefGetter &, StMeasurementDetSet &) const
OnDemandMeasurementTracker specific function to be called to define the region in the RefGetter accor...
const PositionIndex positionIndex(const uint32_t) const
const SiStripRegionCabling * theStripRegionCabling
the cabling region tool to update a RefGetter
void assign(const TkStripMeasurementDet *csmdet, const MeasurementTrackerEvent &data) const
assigne the cluster iterator to the TkStipMeasurementDet (const_cast in the way)
Geom::Phi< T > phi() const
uint32_t size() const
Return the number of contained 'region_ref's (one per Region).
std::pair< typename record_type::const_iterator, typename record_type::const_iterator > record_pair
std::string dumpCluster(const std::vector< SiStripCluster >::const_iterator &begin, const std::vector< SiStripCluster >::const_iterator &end) const
some printouts, exclusively under LogDebug
const StMeasurementDetSet & stripData() const
void defineStrip(int i, std::pair< unsigned int, unsigned int > range)
const bool stripUpdated(int i) const
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
const std::pair< unsigned int, unsigned int > & regionRange(int i) const
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
static const SubDet subdetFromDetId(const uint32_t detid)
bool StayPacked_
internal flag to avoid unpacking things with LogDebug on
std::pair< double, double > Position
void resetOnDemandStrips()
std::string category_
log category
std::vector< uint32_t > & rawInactiveStripDetIds()
const Position position(const uint32_t) const
static const uint32_t layerFromDetId(const uint32_t detid)
bool find(uint32_t) const
Returns true if region already defined.
const uint32_t region(const Position) const
char data[epos_bytes_allocation]
const edm::RefGetter< SiStripCluster > & refGetter() const
volatile std::atomic< bool > shutdown_flag false
std::pair< uint32_t, uint32_t > PositionIndex
std::string dumpRegion(std::pair< unsigned int, unsigned int > indexes, const RefGetter &theGetter, bool stayUnpacked=false) const
const bool stripDefined(int i) const