60 int stripQualityFlags,
61 int stripQualityDebugFlags,
64 int pixelQualityFlags,
65 int pixelQualityDebugFlags,
68 MeasurementTracker(conf,pixelCPE,stripCPE,hitMatcher,trackerGeom,geometricSearchTracker,
69 stripQuality,stripQualityFlags,stripQualityDebugFlags,
70 pixelQuality,pixelCabling,pixelQualityFlags,pixelQualityDebugFlags,
72 , category_(
"OnDemandMeasurementTracker")
74 , StripOnDemand_(
true)
75 , PixelOnDemand_(
false)
76 , theStripRegionCabling(stripRegionCabling)
85 DetODContainer::iterator inserted =
theDetODMap.insert(make_pair(it->first,
DetODStatus(const_cast<MeasurementDet*>(it->second)))).first;
92 inserted->second.defined=
false;
93 inserted->second.updated=
true;
99 inserted->second.defined=
false;
100 inserted->second.updated=
false;
103 GlobalPoint center = it->second->geomDet().position();
104 double eta = center.
eta();
105 double phi = center.
phi();
106 uint32_t
id = it->first.rawId();
111 <<
"position: "<<center
136 std::auto_ptr< RefGetter > & theGetter )
const
148 if (it->second.updated && !it->second.defined)
continue;
149 it->second.defined=
false;
150 it->second.updated =
false;
156 std::pair<unsigned int, unsigned int> region_range;
159 region_range.first = theGetter->size();
163 region_range.second = theGetter->size();
165 LogDebug(
category_)<<
"between index: "<<region_range.first<<
" "<<region_range.second
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;
181 bool failedToGet =
false;
185 if (oncePerEvent || failedToGet)
193 std::string stripLazyGetter =
pset_.
getParameter<std::string>(
"stripLazyGetterProducer");
206 LogDebug(
category_)<<
"pixel are not OnDemand. updating them a la MeasurmentTracker.";
213 LogDebug(
category_)<<
"strip are not OnDemand. updating them a la MeasurmentTracker.";
216 LogDebug(
category_)<<
"strip are OnDemand. updating them a la OnDemandMeasurmentTracker.";
227 std::stringstream ss;
228 std::vector<SiStripCluster> ::const_iterator it =
begin;
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]<<
" ";
241 bool stayPacked)
const
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){
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()));
262 DetODContainer::iterator * alreadyFound)
const {
271 DetODContainer::iterator elementInMap;
272 if (alreadyFound){ elementInMap=*alreadyFound;}
277 elementInMap->second.updated =
true;
279 std::pair<unsigned int,unsigned int> & indexes =elementInMap->second.region_range;
283 <<
"\nretrieved for module: "<<
id.rawId()
287 for (
unsigned int iRegion = indexes.first; iRegion != indexes.second; ++iRegion){
289 if (range.first!=range.second){
294 <<
"\nnumber of regions defined here: "<< indexes.second-indexes.first
319 DetODContainer::iterator it =
theDetODMap.find(
id);
323 if (it->second.updated){
LogDebug(
category_)<<
"found id: "<<
id.rawId()<<
" as aleardy updated.";
return it->second.mdet;}
327 std::vector< const GeomDet*> comp = it->second.mdet->geomDet().components();
335 if (!theConcreteDet){
346 it->second.updated=
true;
355 if (!theConcreteDet){
360 assign(theConcreteDet,&it);
364 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
edm::Handle< edm::LazyGetter< SiStripCluster > > theLazyGetterH
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 de...
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
void updateStrips(const edm::Event &) const
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
virtual const GeomDet & geomDet() const
Geom::Phi< T > phi() const
std::pair< typename record_type::const_iterator, typename record_type::const_iterator > record_pair
const TkStripMeasurementDet * monoDet() const
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)
void updatePixels(const edm::Event &) 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
DetId geographicalId() const
The label of this GeomDet.
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
bool StripOnDemand_
internal flag to do strip on demand (not configurable) true by default
tuple stripClusterProducer
void update(const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiStripCluster > > h, unsigned int id)
std::string category_
log category
const Position position(const uint32_t) const
const edm::ParameterSet & pset_
static const uint32_t layerFromDetId(const uint32_t detid)
a class that holds flags, region_range (in RefGetter) for a given MeasurementDet
const uint32_t region(const Position) 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< 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...