62 template<
typename TKD>
63 void sortTKD( std::vector<TKD*> & det) {
64 std::sort(det.begin(),det.end(),CmpTKD());
66 template<
typename TKD>
67 void sortTKD( std::vector<TKD> & det) {
68 std::sort(det.begin(),det.end(),CmpTKD());
81 int stripQualityFlags,
82 int stripQualityDebugFlags,
85 int pixelQualityFlags,
86 int pixelQualityDebugFlags,
90 name_(conf.getParameter<std::
string>(
"ComponentName")),
91 theStDets(hitMatcher,stripCPE,isRegional),
92 thePixelCPE(pixelCPE),
93 theInactivePixelDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >(
"inactivePixelDetectorLabels")),
94 theInactiveStripDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >(
"inactiveStripDetectorLabels"))
149 for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
150 gd != dets.end(); gd++) {
157 for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
158 gd != dets.end(); gd++) {
186 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " << err.
what() ;
209 if (monoDet == 0 || stereoDet == 0) {
210 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
213 det.init(monoDet,stereoDet);
244 LogDebug(
"MeasurementTracker")<<
"setClusterToSkip";
246 edm::LogError(
"MeasurementTracker")<<
"this mode of operation is not supported, either the measurement tracker is set to skip clusters, or is being told to skip clusters. not both";
249 event.getByLabel(cluster,pixelClusterMask);
256 event.getByLabel(cluster,stripClusterMask);
268 LogDebug(
"MeasurementTracker")<<
"unsetClusterToSkip";
270 edm::LogError(
"MeasurementTracker")<<
"this mode of operation is not supported, either the measurement tracker is set to skip clusters, or is being told to skip clusters. not both";
283 bool switchOffPixelsIfEmpty = (!
pset_.
existsAs<
bool>(
"switchOffPixelsIfEmpty")) ||
286 std::vector<uint32_t> rawInactiveDetIds;
292 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
294 static bool iFailedAlready=
false;
295 if (!iFailedAlready){
296 edm::LogError(
"MissingProduct")<<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
301 if (!rawInactiveDetIds.empty())
std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
305 if( pixelClusterProducer.empty() ) {
306 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
308 if (switchOffPixelsIfEmpty) {
309 (**i).setActiveThisEvent(
false);
317 event.getByLabel(pixelClusterProducer, pixelClusters);
320 if (switchOffPixelsIfEmpty && pixelCollection->
empty()) {
321 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
323 (**i).setActiveThisEvent(
false);
335 LogDebug(
"MeasurementTracker")<<
"getting pxl refs to skip";
337 if (pixelClusterMask->refProd().
id()!=pixelClusters.
id()){
338 edm::LogError(
"ProductIdMismatch")<<
"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().
id()<<
"!="<<pixelClusters.
id();
343 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
347 unsigned int id = (**i).geomDet().geographicalId().rawId();
348 if (!rawInactiveDetIds.empty() && std::binary_search(rawInactiveDetIds.begin(), rawInactiveDetIds.end(), id)) {
349 (**i).setActiveThisEvent(
false);
continue;
354 if ( it != pixelCollection->
end() ){
356 (**i).update( *it, pixelClusters,
id );
366 std::vector<uint32_t> & rawInactiveDetIds)
const {
371 event.getByLabel(*itt, detIds);
372 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
374 if (!rawInactiveDetIds.empty())
std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
385 std::vector<uint32_t> rawInactiveDetIds;
394 if( !stripClusterProducer.compare(
"") )
return;
402 for (
auto id : rawInactiveDetIds) {
403 if (
id==idp)
continue;
413 event.getByLabel(stripClusterProducer, clusterHandle);
420 LogDebug(
"MeasurementTracker")<<
"getting strp refs to skip";
423 if (stripClusterMask->refProd().
id()!=clusterHandle.
id()){
424 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<clusterHandle.
id();
434 for (;it!=endColl; ++it) {
435 StripDetSet detSet = *it;
436 unsigned int id = detSet.
id();
439 if (endDet==i)
throw "we have a problem!!!!";
451 event.getByLabel(stripClusterProducer, refClusterHandle);
455 event.getByLabel(lazyGetter,lazyClusterHandle);
459 LogDebug(
"MeasurementTracker")<<
"getting reg strp refs to skip";
462 if (stripClusterMask->refProd().
id()!=lazyClusterHandle.id()){
463 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<lazyClusterHandle.id();
471 vector<SiStripCluster>::const_iterator beginIterator;
473 for(;iregion!=refClusterHandle->end();++iregion) {
475 vector<SiStripCluster>::const_iterator icluster = region.
begin();
476 const vector<SiStripCluster>::const_iterator endIterator = region.
end();
477 tmpId = icluster->geographicalId();
478 beginIterator = icluster;
482 for (;icluster!=endIterator;icluster++) {
487 if( icluster->geographicalId() != tmpId){
493 tmpId = icluster->geographicalId();
494 beginIterator = icluster;
495 if( icluster == (endIterator-1)){
498 }
else if( icluster == (endIterator-1)){
508 #ifdef EDM_DEBUG //or similar
509 const TkStripMeasurementDet* theConcreteDet =
510 dynamic_cast<const TkStripMeasurementDet*
>(
findDet(
id));
511 if(theConcreteDet == 0)
515 return const_cast<TkStripMeasurementDet*
>(
static_cast<const TkStripMeasurementDet*
>(
idToDet(
id)));
525 if ((quality != 0) && (qualityFlags != 0)) {
526 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
527 unsigned int on = 0, tot = 0, badrocs = 0;
528 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
530 uint32_t
detid = ((**i).geomDet().geographicalId()).rawId();
533 (*i)->setActive(isOn);
534 tot++; on += (
unsigned int) isOn;
535 if (qualityDebugFlags & BadModules) {
536 edm::LogInfo(
"MeasurementTracker")<<
"MeasurementTrackerImpl::initializePixelStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
539 (*i)->setActive(
true);
543 badrocs += badROCs.size();
544 (*i)->setBadRocPositions(badROCs);
546 (*i)->clearBadRocPositions();
551 " Total modules: " << tot <<
", active " << on <<
", inactive " << (tot - on);
553 if (qualityDebugFlags &
BadROCs) {
554 edm::LogInfo(
"MeasurementTracker PixelROCStatus") <<
" Total of bad ROCs: " << badrocs ;
557 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
559 (*i)->setActive(
true);
virtual char const * what() const
void unsetClusterToSkip() const
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
size_type dataSize() const
void addStripDet(const GeomDet *gd)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::vector< TkStripMeasurementDet > theStripDets
const GeomDetUnit * monoDet() const
const MeasurementDet * findDet(const DetId &id) const
const SiStripRecHitMatcher * matcher() const
void initializeStripStatus(const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags)
void initializeStripStatus(const SiStripQuality *quality, int qualityFlags, int qualityDebugFlags, const edm::ParameterSet &cutPset)
const TrackerGeometry * theTrackerGeom
void setClusterToSkip(const std::vector< bool > *skip)
const_iterator end() const
Get off the end iterator.
void initGluedDet(TkGluedMeasurementDet &det)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< unsigned int > id_
void updateStrips(const edm::Event &) const
void update(int i, const StripDetset &detSet)
const std::vector< edm::InputTag > theInactiveStripDetectorLabels
std::vector< GeomDet * > DetContainer
const_iterator find(id_type i) const
id_type id(size_t cell) const
void addPixelDets(const TrackingGeometry::DetContainer &dets)
const StripClusterParameterEstimator * stripCPE() const
void addStripDets(const TrackingGeometry::DetContainer &dets)
unsigned int id(int i) const
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
virtual void update(const edm::Event &) const
MeasurementTrackerImpl(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 PixelClusterParameterEstimator * thePixelCPE
const DetContainer & detsTEC() const
edm::Handle< edm::LazyGetter< SiStripCluster > > regionalHandle_
bool selfUpdateSkipClusters_
void initializePixelStatus(const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags)
void setActiveThisEvent(int i, bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
const std::vector< LocalPoint > getBadRocPositions(const uint32_t &detid, const TrackerGeometry &theTracker, const SiPixelFedCabling *map) const
TkStripMeasurementDet * concreteDetUpdatable(DetId id) const
void updatePixels(const edm::Event &) const
const DetContainer & detsPXB() const
const std::vector< edm::InputTag > theInactivePixelDetectorLabels
void setClusterToSkip(const edm::InputTag &cluster, const edm::Event &event) const
DetId geographicalId() const
The label of this GeomDet.
const edm::ParameterSet & pset_
const_iterator end() const
bool IsModuleUsable(const uint32_t &detid) const
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
virtual ~MeasurementTrackerImpl()
const_iterator begin() const
Get begin iterator.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
const DetContainer & detsTIB() const
int find(unsigned int jd, int i=0)
boost::indirect_iterator< typename collection_type::const_iterator > const_iterator
void addGluedDet(const GluedGeomDet *gd)
virtual const MeasurementDet * idToDet(const DetId &id) const
MeasurementDetSystem interface (can be overloaded!)
std::vector< TkGluedMeasurementDet > theGluedDets
T const * product() const
short getBadRocs(const uint32_t &detid) const
bool isActive(int i) const
void addPixelDet(const GeomDet *gd, const PixelClusterParameterEstimator *cpe)
edm::Handle< edmNew::DetSetVector< SiStripCluster > > handle_
const DetContainer & detsPXF() const
const DetContainer & detsTOB() const
std::vector< bool > thePixelsToSkip
std::vector< TkPixelMeasurementDet * > thePixelDets
std::vector< bool > theStripsToSkip
void init(std::vector< TkStripMeasurementDet > &stripDets)
const GeomDetUnit * stereoDet() const
const DetContainer & detsTID() const
StMeasurementDetSet theStDets