49 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 4)
50 #include <x86intrin.h>
56 #include <emmintrin.h>
59 #include <pmmintrin.h>
62 #include <smmintrin.h>
83 template<
typename TKD>
84 void sortTKD( std::vector<TKD*> & det) {
85 std::sort(det.begin(),det.end(),CmpTKD());
87 template<
typename TKD>
88 void sortTKD( std::vector<TKD> & det) {
89 std::sort(det.begin(),det.end(),CmpTKD());
102 int stripQualityFlags,
103 int stripQualityDebugFlags,
106 int pixelQualityFlags,
107 int pixelQualityDebugFlags,
111 name_(conf.getParameter<std::string>(
"ComponentName")),
112 theStDets(hitMatcher,stripCPE,isRegional),
113 thePixelCPE(pixelCPE),
114 theInactivePixelDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >(
"inactivePixelDetectorLabels")),
115 theInactiveStripDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >(
"inactiveStripDetectorLabels"))
170 for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
171 gd != dets.end(); gd++) {
178 for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin();
179 gd != dets.end(); gd++) {
207 edm::LogError(
"MeasurementDet") <<
"Oops, got a MeasurementDetException: " << err.
what() ;
230 if (monoDet == 0 || stereoDet == 0) {
231 edm::LogError(
"MeasurementDet") <<
"MeasurementTracker ERROR: GluedDet components not found as MeasurementDets ";
234 det.
init(monoDet,stereoDet);
265 LogDebug(
"MeasurementTracker")<<
"setClusterToSkip";
267 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";
270 event.getByLabel(cluster,pixelClusterMask);
277 event.getByLabel(cluster,stripClusterMask);
289 LogDebug(
"MeasurementTracker")<<
"unsetClusterToSkip";
291 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";
304 bool switchOffPixelsIfEmpty = (!
pset_.
existsAs<
bool>(
"switchOffPixelsIfEmpty")) ||
307 std::vector<uint32_t> rawInactiveDetIds;
313 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
315 static bool iFailedAlready=
false;
316 if (!iFailedAlready){
317 edm::LogError(
"MissingProduct")<<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
322 if (!rawInactiveDetIds.empty())
std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
325 std::string pixelClusterProducer =
pset_.
getParameter<std::string>(
"pixelClusterProducer");
326 if( pixelClusterProducer.empty() ) {
327 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
329 if (switchOffPixelsIfEmpty) {
330 (**i).setActiveThisEvent(
false);
338 event.getByLabel(pixelClusterProducer, pixelClusters);
341 if (switchOffPixelsIfEmpty && pixelCollection->
empty()) {
342 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
344 (**i).setActiveThisEvent(
false);
356 LogDebug(
"MeasurementTracker")<<
"getting pxl refs to skip";
358 if (pixelClusterMask->refProd().
id()!=pixelClusters.
id()){
359 edm::LogError(
"ProductIdMismatch")<<
"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().
id()<<
"!="<<pixelClusters.
id();
364 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
368 unsigned int id = (**i).geomDet().geographicalId().rawId();
369 if (!rawInactiveDetIds.empty() && std::binary_search(rawInactiveDetIds.begin(), rawInactiveDetIds.end(),
id)) {
370 (**i).setActiveThisEvent(
false);
continue;
375 if ( it != pixelCollection->
end() ){
377 (**i).update( *it, pixelClusters,
id );
387 std::vector<uint32_t> & rawInactiveDetIds)
const {
392 event.getByLabel(*itt, detIds);
393 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
395 if (!rawInactiveDetIds.empty())
std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
406 std::vector<uint32_t> rawInactiveDetIds;
410 std::string stripClusterProducer =
pset_.
getParameter<std::string>(
"stripClusterProducer");
415 if( !stripClusterProducer.compare(
"") )
return;
423 for (
auto id : rawInactiveDetIds) {
424 if (
id==idp)
continue;
434 event.getByLabel(stripClusterProducer, clusterHandle);
441 LogDebug(
"MeasurementTracker")<<
"getting strp refs to skip";
444 if (stripClusterMask->refProd().
id()!=clusterHandle.
id()){
445 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<clusterHandle.
id();
455 for (;it!=endColl; ++it) {
456 StripDetSet detSet = *it;
457 unsigned int id = detSet.
id();
460 if (endDet==i)
throw "we have a problem!!!!";
472 event.getByLabel(stripClusterProducer, refClusterHandle);
474 std::string lazyGetter =
pset_.
getParameter<std::string>(
"stripLazyGetterProducer");
476 event.getByLabel(lazyGetter,lazyClusterHandle);
480 LogDebug(
"MeasurementTracker")<<
"getting reg strp refs to skip";
483 if (stripClusterMask->refProd().
id()!=lazyClusterHandle.id()){
484 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<lazyClusterHandle.id();
492 vector<SiStripCluster>::const_iterator beginIterator;
494 for(;iregion!=refClusterHandle->end();++iregion) {
496 vector<SiStripCluster>::const_iterator icluster = region.
begin();
497 const vector<SiStripCluster>::const_iterator endIterator = region.
end();
498 tmpId = icluster->geographicalId();
499 beginIterator = icluster;
503 for (;icluster!=endIterator;icluster++) {
508 if( icluster->geographicalId() != tmpId){
514 tmpId = icluster->geographicalId();
515 beginIterator = icluster;
516 if( icluster == (endIterator-1)){
519 }
else if( icluster == (endIterator-1)){
529 #ifdef EDM_DEBUG //or similar
532 if(theConcreteDet == 0)
546 if ((quality != 0) && (qualityFlags != 0)) {
547 edm::LogInfo(
"MeasurementTracker") <<
"qualityFlags = " << qualityFlags;
548 unsigned int on = 0, tot = 0, badrocs = 0;
549 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
551 uint32_t
detid = ((**i).geomDet().geographicalId()).rawId();
554 (*i)->setActive(isOn);
555 tot++; on += (
unsigned int) isOn;
556 if (qualityDebugFlags & BadModules) {
557 edm::LogInfo(
"MeasurementTracker")<<
"MeasurementTrackerImpl::initializePixelStatus : detid " << detid <<
" is " << (isOn ?
"on" :
"off");
560 (*i)->setActive(
true);
564 badrocs += badROCs.size();
565 (*i)->setBadRocPositions(badROCs);
567 (*i)->clearBadRocPositions();
572 " Total modules: " << tot <<
", active " << on <<
", inactive " << (tot - on);
574 if (qualityDebugFlags &
BadROCs) {
575 edm::LogInfo(
"MeasurementTracker PixelROCStatus") <<
" Total of bad ROCs: " << badrocs ;
578 for (std::vector<TkPixelMeasurementDet*>::const_iterator
i=
thePixelDets.begin();
580 (*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 init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
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)
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
void initializeStripStatus(const SiStripQuality *quality, int qualityFlags, int qualityDebugFlags, edm::ParameterSet cutPset)
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
const GluedGeomDet & specificGeomDet() 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