#include <MeasurementTrackerImpl.h>
Public Types | |
typedef std::unordered_map < unsigned int, MeasurementDet * > | DetContainer |
enum | QualityFlags { BadModules = 1, BadAPVFibers = 2, BadStrips = 4, MaskBad128StripBlocks = 8, BadROCs = 2 } |
Public Member Functions | |
const DetContainer & | allDets () const |
For debug only. | |
TkStripMeasurementDet * | concreteDetUpdatable (DetId id) const |
const MeasurementDet * | findDet (const DetId &id) const |
const GeometricSearchTracker * | geometricSearchTracker () const |
const TrackingGeometry * | geomTracker () const |
const std::vector < TkGluedMeasurementDet > & | gluedDets () const |
virtual const MeasurementDet * | idToDet (const DetId &id) const |
MeasurementDetSystem interface (can be overloaded!) | |
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 std::vector < TkPixelMeasurementDet * > & | pixelDets () const |
void | setClusterToSkip (const edm::InputTag &cluster, const edm::Event &event) const |
const std::vector < TkStripMeasurementDet > & | stripDets () const |
void | unsetClusterToSkip () const |
virtual void | update (const edm::Event &) const |
void | updatePixels (const edm::Event &) const |
void | updateStrips (const edm::Event &) const |
virtual | ~MeasurementTrackerImpl () |
Protected Member Functions | |
void | addGluedDet (const GluedGeomDet *gd) |
void | addPixelDet (const GeomDet *gd, const PixelClusterParameterEstimator *cpe) |
void | addPixelDets (const TrackingGeometry::DetContainer &dets) |
void | addStripDet (const GeomDet *gd) |
void | addStripDets (const TrackingGeometry::DetContainer &dets) |
void | getInactiveStrips (const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const |
void | initGluedDet (TkGluedMeasurementDet &det) |
void | initialize () |
void | initializePixelStatus (const SiPixelQuality *stripQuality, const SiPixelFedCabling *pixelCabling, int qualityFlags, int qualityDebugFlags) |
void | initializeStripStatus (const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags) |
Protected Attributes | |
const std::string | name_ |
const edm::ParameterSet & | pset_ |
bool | selfUpdateSkipClusters_ |
DetContainer | theDetMap |
std::vector < TkGluedMeasurementDet > | theGluedDets |
const std::vector< edm::InputTag > | theInactivePixelDetectorLabels |
const std::vector< edm::InputTag > | theInactiveStripDetectorLabels |
const SiPixelFedCabling * | thePixelCabling |
const PixelClusterParameterEstimator * | thePixelCPE |
std::vector < TkPixelMeasurementDet * > | thePixelDets |
std::vector< bool > | thePixelsToSkip |
StMeasurementDetSet | theStDets |
std::vector < TkStripMeasurementDet > | theStripDets |
Definition at line 44 of file MeasurementTrackerImpl.h.
typedef std::unordered_map<unsigned int,MeasurementDet*> MeasurementTrackerImpl::DetContainer |
Definition at line 97 of file MeasurementTrackerImpl.h.
Reimplemented from MeasurementTracker.
Definition at line 46 of file MeasurementTrackerImpl.h.
{ BadModules=1, // for everybody /* Strips: */ BadAPVFibers=2, BadStrips=4, MaskBad128StripBlocks=8, /* Pixels: */ BadROCs=2 };
MeasurementTrackerImpl::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 |
||
) |
Definition at line 74 of file MeasurementTrackerImpl.cc.
References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), initialize(), initializePixelStatus(), initializeStripStatus(), LogDebug, selfUpdateSkipClusters_, and createPayload::skip.
: MeasurementTracker(trackerGeom,geometricSearchTracker), pset_(conf), name_(conf.getParameter<std::string>("ComponentName")), theStDets(hitMatcher,stripCPE,isRegional), thePixelCPE(pixelCPE), theInactivePixelDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >("inactivePixelDetectorLabels")), theInactiveStripDetectorLabels(conf.getParameter<std::vector<edm::InputTag> >("inactiveStripDetectorLabels")) { this->initialize(); this->initializeStripStatus(stripQuality, stripQualityFlags, stripQualityDebugFlags); this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags); //the measurement tracking is set to skip clusters, the other option is set from outside selfUpdateSkipClusters_=conf.exists("skipClusters"); if (selfUpdateSkipClusters_) { edm::InputTag skip=conf.getParameter<edm::InputTag>("skipClusters"); if (skip==edm::InputTag("")) selfUpdateSkipClusters_=false; } LogDebug("MeasurementTracker")<<"skipping clusters: "<<selfUpdateSkipClusters_; }
MeasurementTrackerImpl::~MeasurementTrackerImpl | ( | ) | [virtual] |
Definition at line 111 of file MeasurementTrackerImpl.cc.
References thePixelDets.
{ for(vector<TkPixelMeasurementDet*>::const_iterator it=thePixelDets.begin(); it!=thePixelDets.end(); ++it){ delete *it; } }
void MeasurementTrackerImpl::addGluedDet | ( | const GluedGeomDet * | gd | ) | [protected] |
Definition at line 199 of file MeasurementTrackerImpl.cc.
References StMeasurementDetSet::matcher(), StMeasurementDetSet::stripCPE(), theGluedDets, and theStDets.
Referenced by addStripDets().
{ theGluedDets.push_back(TkGluedMeasurementDet( gd, theStDets.matcher(), theStDets.stripCPE())); }
void MeasurementTrackerImpl::addPixelDet | ( | const GeomDet * | gd, |
const PixelClusterParameterEstimator * | cpe | ||
) | [protected] |
Definition at line 190 of file MeasurementTrackerImpl.cc.
References GeomDet::geographicalId(), TkPixelMeasurementDet::setClusterToSkip(), theDetMap, thePixelDets, and thePixelsToSkip.
Referenced by addPixelDets().
{ TkPixelMeasurementDet* det = new TkPixelMeasurementDet( gd, cpe); thePixelDets.push_back(det); det->setClusterToSkip(&thePixelsToSkip); theDetMap[gd->geographicalId()] = det; }
void MeasurementTrackerImpl::addPixelDets | ( | const TrackingGeometry::DetContainer & | dets | ) | [protected] |
Definition at line 147 of file MeasurementTrackerImpl.cc.
References addPixelDet(), and thePixelCPE.
Referenced by initialize().
{ for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin(); gd != dets.end(); gd++) { addPixelDet(*gd, thePixelCPE); } }
void MeasurementTrackerImpl::addStripDet | ( | const GeomDet * | gd | ) | [protected] |
Definition at line 180 of file MeasurementTrackerImpl.cc.
References theStDets, theStripDets, and cms::Exception::what().
Referenced by addStripDets().
{ try { theStripDets.push_back(TkStripMeasurementDet( gd, theStDets)); } catch(MeasurementDetException& err){ edm::LogError("MeasurementDet") << "Oops, got a MeasurementDetException: " << err.what() ; } }
void MeasurementTrackerImpl::addStripDets | ( | const TrackingGeometry::DetContainer & | dets | ) | [protected] |
Definition at line 155 of file MeasurementTrackerImpl.cc.
References addGluedDet(), and addStripDet().
Referenced by initialize().
{ for (TrackerGeometry::DetContainer::const_iterator gd=dets.begin(); gd != dets.end(); gd++) { const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd); // StripSubdetector stripId( (**gd).geographicalId()); // bool isDetUnit( gdu != 0); // cout << "StripSubdetector glued? " << stripId.glued() // << " is DetUnit? " << isDetUnit << endl; if (gdu != 0) { addStripDet(*gd); } else { const GluedGeomDet* gluedDet = dynamic_cast<const GluedGeomDet*>(*gd); if (gluedDet == 0) { throw MeasurementDetException("MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet"); } addGluedDet(gluedDet); } } }
const DetContainer& MeasurementTrackerImpl::allDets | ( | ) | const [inline] |
For debug only.
Definition at line 100 of file MeasurementTrackerImpl.h.
References theDetMap.
{return theDetMap;}
TkStripMeasurementDet * MeasurementTrackerImpl::concreteDetUpdatable | ( | DetId | id | ) | const |
Definition at line 507 of file MeasurementTrackerImpl.cc.
References findDet(), and idToDet().
Referenced by updateStrips().
{ #ifdef EDM_DEBUG //or similar const TkStripMeasurementDet* theConcreteDet = dynamic_cast<const TkStripMeasurementDet*>(findDet(id)); if(theConcreteDet == 0) throw MeasurementDetException("failed casting to TkStripMeasurementDet*"); #endif // will trigger ondemand unpacking return const_cast<TkStripMeasurementDet*>(static_cast<const TkStripMeasurementDet*>(idToDet(id))); }
const MeasurementDet* MeasurementTrackerImpl::findDet | ( | const DetId & | id | ) | const [inline] |
Definition at line 82 of file MeasurementTrackerImpl.h.
References theDetMap.
Referenced by concreteDetUpdatable(), idToDet(), and initGluedDet().
const GeometricSearchTracker* MeasurementTrackerImpl::geometricSearchTracker | ( | ) | const [inline] |
Reimplemented from MeasurementTracker.
Definition at line 73 of file MeasurementTrackerImpl.h.
References MeasurementTracker::theGeometricSearchTracker.
{return theGeometricSearchTracker;}
const TrackingGeometry* MeasurementTrackerImpl::geomTracker | ( | ) | const [inline] |
Reimplemented from MeasurementTracker.
Definition at line 71 of file MeasurementTrackerImpl.h.
References MeasurementTracker::theTrackerGeom.
{ return theTrackerGeom;}
void MeasurementTrackerImpl::getInactiveStrips | ( | const edm::Event & | event, |
std::vector< uint32_t > & | rawInactiveDetIds | ||
) | const [protected] |
Definition at line 365 of file MeasurementTrackerImpl.cc.
References python::multivaluedict::sort(), and theInactiveStripDetectorLabels.
Referenced by OnDemandMeasurementTracker::updateStrips(), and updateStrips().
{ if (!theInactiveStripDetectorLabels.empty()) { edm::Handle<DetIdCollection> detIds; for (std::vector<edm::InputTag>::const_iterator itt = theInactiveStripDetectorLabels.begin(), edt = theInactiveStripDetectorLabels.end(); itt != edt; ++itt) { event.getByLabel(*itt, detIds); rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end()); } if (!rawInactiveDetIds.empty()) std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end()); } }
const std::vector<TkGluedMeasurementDet>& MeasurementTrackerImpl::gluedDets | ( | ) | const [inline] |
Definition at line 103 of file MeasurementTrackerImpl.h.
References theGluedDets.
{return theGluedDets;}
virtual const MeasurementDet* MeasurementTrackerImpl::idToDet | ( | const DetId & | id | ) | const [inline, virtual] |
MeasurementDetSystem interface (can be overloaded!)
Implements MeasurementTracker.
Reimplemented in OnDemandMeasurementTracker.
Definition at line 77 of file MeasurementTrackerImpl.h.
References findDet().
Referenced by concreteDetUpdatable().
{ return findDet(id); }
void MeasurementTrackerImpl::initGluedDet | ( | TkGluedMeasurementDet & | det | ) | [protected] |
Definition at line 204 of file MeasurementTrackerImpl.cc.
References findDet(), GeomDet::geographicalId(), GluedGeomDet::monoDet(), GluedGeomDet::stereoDet(), and theDetMap.
Referenced by initialize().
{ const GluedGeomDet& gd = det.specificGeomDet(); const MeasurementDet* monoDet = findDet( gd.monoDet()->geographicalId()); const MeasurementDet* stereoDet = findDet( gd.stereoDet()->geographicalId()); if (monoDet == 0 || stereoDet == 0) { edm::LogError("MeasurementDet") << "MeasurementTracker ERROR: GluedDet components not found as MeasurementDets "; throw MeasurementDetException("MeasurementTracker ERROR: GluedDet components not found as MeasurementDets"); } det.init(monoDet,stereoDet); theDetMap[gd.geographicalId()] = &det; }
void MeasurementTrackerImpl::initialize | ( | ) | [protected] |
Definition at line 120 of file MeasurementTrackerImpl.cc.
References addPixelDets(), addStripDets(), TrackerGeometry::detsPXB(), TrackerGeometry::detsPXF(), TrackerGeometry::detsTEC(), TrackerGeometry::detsTIB(), TrackerGeometry::detsTID(), TrackerGeometry::detsTOB(), i, StMeasurementDetSet::id(), StMeasurementDetSet::init(), initGluedDet(), theDetMap, theGluedDets, thePixelDets, theStDets, theStripDets, and MeasurementTracker::theTrackerGeom.
Referenced by MeasurementTrackerImpl().
{ addPixelDets( theTrackerGeom->detsPXB()); addPixelDets( theTrackerGeom->detsPXF()); addStripDets( theTrackerGeom->detsTIB()); addStripDets( theTrackerGeom->detsTID()); addStripDets( theTrackerGeom->detsTOB()); addStripDets( theTrackerGeom->detsTEC()); // fist all stripdets sortTKD(theStripDets); theStDets.init(theStripDets); for (unsigned int i=0; i!=theStripDets.size(); ++i) theDetMap[theStDets.id(i)] = &theStripDets[i]; // now the glued dets sortTKD(theGluedDets); for (unsigned int i=0; i!=theGluedDets.size(); ++i) initGluedDet(theGluedDets[i]); sortTKD(thePixelDets); }
void MeasurementTrackerImpl::initializePixelStatus | ( | const SiPixelQuality * | stripQuality, |
const SiPixelFedCabling * | pixelCabling, | ||
int | qualityFlags, | ||
int | qualityDebugFlags | ||
) | [protected] |
Definition at line 524 of file MeasurementTrackerImpl.cc.
References BadModules, BadROCs, cond::rpcobgas::detid, SiPixelQuality::getBadRocPositions(), SiPixelQuality::getBadRocs(), i, SiPixelQuality::IsModuleUsable(), thePixelDets, and MeasurementTracker::theTrackerGeom.
Referenced by MeasurementTrackerImpl().
{ if ((quality != 0) && (qualityFlags != 0)) { edm::LogInfo("MeasurementTracker") << "qualityFlags = " << qualityFlags; unsigned int on = 0, tot = 0, badrocs = 0; for (std::vector<TkPixelMeasurementDet*>::const_iterator i=thePixelDets.begin(); i!=thePixelDets.end(); i++) { uint32_t detid = ((**i).geomDet().geographicalId()).rawId(); if (qualityFlags & BadModules) { bool isOn = quality->IsModuleUsable(detid); (*i)->setActive(isOn); tot++; on += (unsigned int) isOn; if (qualityDebugFlags & BadModules) { edm::LogInfo("MeasurementTracker")<< "MeasurementTrackerImpl::initializePixelStatus : detid " << detid << " is " << (isOn ? "on" : "off"); } } else { (*i)->setActive(true); } if ((qualityFlags & BadROCs) && (quality->getBadRocs(detid) != 0)) { std::vector<LocalPoint> badROCs = quality->getBadRocPositions(detid, *theTrackerGeom, pixelCabling); badrocs += badROCs.size(); (*i)->setBadRocPositions(badROCs); } else { (*i)->clearBadRocPositions(); } } if (qualityDebugFlags & BadModules) { edm::LogInfo("MeasurementTracker PixelModuleStatus") << " Total modules: " << tot << ", active " << on <<", inactive " << (tot - on); } if (qualityDebugFlags & BadROCs) { edm::LogInfo("MeasurementTracker PixelROCStatus") << " Total of bad ROCs: " << badrocs ; } } else { for (std::vector<TkPixelMeasurementDet*>::const_iterator i=thePixelDets.begin(); i!=thePixelDets.end(); i++) { (*i)->setActive(true); // module ON } } }
void MeasurementTrackerImpl::initializeStripStatus | ( | const SiStripQuality * | stripQuality, |
int | qualityFlags, | ||
int | qualityDebugFlags | ||
) | [protected] |
Definition at line 519 of file MeasurementTrackerImpl.cc.
References edm::ParameterSet::getParameter(), StMeasurementDetSet::initializeStripStatus(), pset_, and theStDets.
Referenced by MeasurementTrackerImpl().
{ edm::ParameterSet cutPset = pset_.getParameter<edm::ParameterSet>("badStripCuts"); theStDets.initializeStripStatus(quality, qualityFlags, qualityDebugFlags, cutPset); }
const std::vector<TkPixelMeasurementDet*>& MeasurementTrackerImpl::pixelDets | ( | ) | const [inline] |
Definition at line 102 of file MeasurementTrackerImpl.h.
References thePixelDets.
{return thePixelDets;}
void MeasurementTrackerImpl::setClusterToSkip | ( | const edm::InputTag & | cluster, |
const edm::Event & | event | ||
) | const [virtual] |
Implements MeasurementTracker.
Definition at line 238 of file MeasurementTrackerImpl.cc.
References LogDebug, selfUpdateSkipClusters_, thePixelsToSkip, theStDets, and StMeasurementDetSet::theStripsToSkip.
{ //method called by user of the measurement tracker to tell what needs to be skiped from the event. //there it is incompatible with a configuration in which the measurement tracker already knows what to skip // i.e selfUpdateSkipClusters_=True LogDebug("MeasurementTracker")<<"setClusterToSkip"; if (selfUpdateSkipClusters_) 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"; edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > > pixelClusterMask; event.getByLabel(cluster,pixelClusterMask); thePixelsToSkip.resize(pixelClusterMask->size()); pixelClusterMask->copyMaskTo(thePixelsToSkip); edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > stripClusterMask; event.getByLabel(cluster,stripClusterMask); theStDets.theStripsToSkip.resize(stripClusterMask->size()); stripClusterMask->copyMaskTo(theStDets.theStripsToSkip); }
const std::vector<TkStripMeasurementDet>& MeasurementTrackerImpl::stripDets | ( | ) | const [inline] |
Definition at line 101 of file MeasurementTrackerImpl.h.
References theStripDets.
{return theStripDets;}
void MeasurementTrackerImpl::unsetClusterToSkip | ( | ) | const [virtual] |
Implements MeasurementTracker.
Definition at line 263 of file MeasurementTrackerImpl.cc.
References LogDebug, selfUpdateSkipClusters_, thePixelsToSkip, theStDets, and StMeasurementDetSet::theStripsToSkip.
{ //method called by user of the measurement tracker to tell what needs to be skiped from the event. //there it is incompatible with a configuration in which the measurement tracker already knows what to skip // i.e selfUpdateSkipClusters_=True LogDebug("MeasurementTracker")<<"unsetClusterToSkip"; if (selfUpdateSkipClusters_) 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"; thePixelsToSkip.clear(); theStDets.theStripsToSkip.clear(); }
void MeasurementTrackerImpl::update | ( | const edm::Event & | event | ) | const [virtual] |
Implements MeasurementTracker.
Reimplemented in OnDemandMeasurementTracker.
Definition at line 218 of file MeasurementTrackerImpl.cc.
References updatePixels(), and updateStrips().
{ updatePixels(event); updateStrips(event); /* for (std::vector<TkStripMeasurementDet>::const_iterator i=theStripDets.begin(); i!=theStripDets.end(); i++) { if( (*i).isEmpty()){ std::cout << "stripDet id, #hits: " << (*i).geomDet().geographicalId().rawId() << " , " << 0 << std::endl; }else{ std::cout << "stripDet id, #hits: " << (*i).geomDet().geographicalId().rawId() << " , " << (*i).size() << " " << (*i).detSet().size() std::endl; } } */ }
void MeasurementTrackerImpl::updatePixels | ( | const edm::Event & | event | ) | const [virtual] |
Implements MeasurementTracker.
Definition at line 276 of file MeasurementTrackerImpl.cc.
References edmNew::DetSetVector< T >::dataSize(), edmNew::DetSetVector< T >::empty(), edmNew::DetSetVector< T >::end(), edm::ParameterSet::existsAs(), edm::HandleBase::failedToGet(), lumiContext::fill, edmNew::DetSetVector< T >::find(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), i, edm::HandleBase::id(), LogDebug, name_, clustersummaryproducer_cfg::pixelClusters, edm::Handle< T >::product(), pset_, selfUpdateSkipClusters_, python::multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, theInactivePixelDetectorLabels, thePixelDets, and thePixelsToSkip.
Referenced by update(), and OnDemandMeasurementTracker::update().
{ // avoid to update twice from the same event if (!edm::Service<UpdaterService>()->checkOnce("MeasurementTrackerImpl::updatePixels::"+name_)) return; typedef edmNew::DetSet<SiPixelCluster> PixelDetSet; bool switchOffPixelsIfEmpty = (!pset_.existsAs<bool>("switchOffPixelsIfEmpty")) || (pset_.getParameter<bool>("switchOffPixelsIfEmpty")); std::vector<uint32_t> rawInactiveDetIds; if (!theInactivePixelDetectorLabels.empty()) { edm::Handle<DetIdCollection> detIds; for (std::vector<edm::InputTag>::const_iterator itt = theInactivePixelDetectorLabels.begin(), edt = theInactivePixelDetectorLabels.end(); itt != edt; ++itt) { if (event.getByLabel(*itt, detIds)){ rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end()); }else{ static bool iFailedAlready=false; if (!iFailedAlready){ edm::LogError("MissingProduct")<<"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change."; iFailedAlready=true; } } } if (!rawInactiveDetIds.empty()) std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end()); } // Pixel Clusters std::string pixelClusterProducer = pset_.getParameter<std::string>("pixelClusterProducer"); if( pixelClusterProducer.empty() ) { //clusters have not been produced for (std::vector<TkPixelMeasurementDet*>::const_iterator i=thePixelDets.begin(); i!=thePixelDets.end(); i++) { if (switchOffPixelsIfEmpty) { (**i).setActiveThisEvent(false); }else{ (**i).setEmpty(); } } }else{ edm::Handle<edmNew::DetSetVector<SiPixelCluster> > pixelClusters; event.getByLabel(pixelClusterProducer, pixelClusters); const edmNew::DetSetVector<SiPixelCluster>* pixelCollection = pixelClusters.product(); if (switchOffPixelsIfEmpty && pixelCollection->empty()) { for (std::vector<TkPixelMeasurementDet*>::const_iterator i=thePixelDets.begin(); i!=thePixelDets.end(); i++) { (**i).setActiveThisEvent(false); } } else { //std::cout <<"updatePixels "<<pixelCollection->dataSize()<<std::endl; thePixelsToSkip.resize(pixelCollection->dataSize()); std::fill(thePixelsToSkip.begin(),thePixelsToSkip.end(),false); if(selfUpdateSkipClusters_) { edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > > pixelClusterMask; //and get the collection of pixel ref to skip event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"),pixelClusterMask); LogDebug("MeasurementTracker")<<"getting pxl refs to skip"; if (pixelClusterMask.failedToGet())edm::LogError("MeasurementTracker")<<"not getting the pixel clusters to skip"; if (pixelClusterMask->refProd().id()!=pixelClusters.id()){ edm::LogError("ProductIdMismatch")<<"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().id()<<"!="<<pixelClusters.id(); } pixelClusterMask->copyMaskTo(thePixelsToSkip); } for (std::vector<TkPixelMeasurementDet*>::const_iterator i=thePixelDets.begin(); i!=thePixelDets.end(); i++) { // foreach det get cluster range unsigned int id = (**i).geomDet().geographicalId().rawId(); if (!rawInactiveDetIds.empty() && std::binary_search(rawInactiveDetIds.begin(), rawInactiveDetIds.end(), id)) { (**i).setActiveThisEvent(false); continue; } //FIXME //fill the set with what needs to be skipped edmNew::DetSetVector<SiPixelCluster>::const_iterator it = pixelCollection->find( id ); if ( it != pixelCollection->end() ){ // push cluster range in det (**i).update( *it, pixelClusters, id ); } else{ (**i).setEmpty(); } } } } }
void MeasurementTrackerImpl::updateStrips | ( | const edm::Event & | event | ) | const [virtual] |
Implements MeasurementTracker.
Reimplemented in OnDemandMeasurementTracker.
Definition at line 378 of file MeasurementTrackerImpl.cc.
References edm::RegionIndex< T >::begin(), concreteDetUpdatable(), edm::RegionIndex< T >::end(), edm::HandleBase::failedToGet(), StMeasurementDetSet::find(), getInactiveStrips(), edm::ParameterSet::getParameter(), StMeasurementDetSet::handle_, i, edm::HandleBase::id(), edmNew::DetSetVector< T >::id(), StMeasurementDetSet::id(), StMeasurementDetSet::id_, getHLTprescales::index, StMeasurementDetSet::isActive(), StMeasurementDetSet::isRegional(), LogDebug, name_, edm::Handle< T >::product(), pset_, StMeasurementDetSet::regionalHandle_, selfUpdateSkipClusters_, StMeasurementDetSet::setActiveThisEvent(), StMeasurementDetSet::setEmpty(), AlCaHLTBitMon_QueryRunRegistry::string, theStDets, StMeasurementDetSet::theStripsToSkip, and StMeasurementDetSet::update().
Referenced by update().
{ // avoid to update twice from the same event if (!edm::Service<UpdaterService>()->checkOnce("MeasurementTrackerImpl::updateStrips::"+name_)) return; typedef edmNew::DetSet<SiStripCluster> StripDetSet; std::vector<uint32_t> rawInactiveDetIds; getInactiveStrips(event,rawInactiveDetIds); // Strip Clusters std::string stripClusterProducer = pset_.getParameter<std::string>("stripClusterProducer"); //first clear all of them theStDets.setEmpty(); if( !stripClusterProducer.compare("") ) return; //clusters have not been produced const int endDet = theStDets.id_.size(); // mark as inactive if in rawInactiveDetIds int i=0; unsigned int idp=0; for ( auto id : rawInactiveDetIds) { if (id==idp) continue; // skip multiple id idp=id; i=theStDets.find(id,i); assert(i!=endDet && id == theStDets.id(i)); theStDets.setActiveThisEvent(i,false); } //========= actually load cluster ============= if(!theStDets.isRegional()){ edm::Handle<edmNew::DetSetVector<SiStripCluster> > clusterHandle; event.getByLabel(stripClusterProducer, clusterHandle); const edmNew::DetSetVector<SiStripCluster>* clusterCollection = clusterHandle.product(); if (selfUpdateSkipClusters_){ edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > stripClusterMask; //and get the collection of pixel ref to skip LogDebug("MeasurementTracker")<<"getting strp refs to skip"; event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"),stripClusterMask); if (stripClusterMask.failedToGet()) edm::LogError("MeasurementTracker")<<"not getting the strip clusters to skip"; if (stripClusterMask->refProd().id()!=clusterHandle.id()){ edm::LogError("ProductIdMismatch")<<"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().id()<<"!="<<clusterHandle.id(); } stripClusterMask->copyMaskTo(theStDets.theStripsToSkip); } theStDets.handle_ = clusterHandle; int i=0; edmNew::DetSetVector<SiStripCluster>::const_iterator it = (*clusterCollection).begin(); edmNew::DetSetVector<SiStripCluster>::const_iterator endColl = (*clusterCollection).end(); // cluster and det and in order (both) and unique so let's use set intersection for (;it!=endColl; ++it) { StripDetSet detSet = *it; unsigned int id = detSet.id(); while ( id != theStDets.id(i)) { // eventually change to lower_bound ++i; if (endDet==i) throw "we have a problem!!!!"; } // push cluster range in det if ( theStDets.isActive(i) ) theStDets.update(i,detSet); } }else{ // regional //then set the not-empty ones only edm::Handle<edm::RefGetter<SiStripCluster> > refClusterHandle; event.getByLabel(stripClusterProducer, refClusterHandle); std::string lazyGetter = pset_.getParameter<std::string>("stripLazyGetterProducer"); edm::Handle<edm::LazyGetter<SiStripCluster> > lazyClusterHandle; event.getByLabel(lazyGetter,lazyClusterHandle); if(selfUpdateSkipClusters_){ edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > stripClusterMask; LogDebug("MeasurementTracker")<<"getting reg strp refs to skip"; event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"),stripClusterMask); if (stripClusterMask.failedToGet())edm::LogError("MeasurementTracker")<<"not getting the strip clusters to skip"; if (stripClusterMask->refProd().id()!=lazyClusterHandle.id()){ edm::LogError("ProductIdMismatch")<<"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().id()<<"!="<<lazyClusterHandle.id(); } stripClusterMask->copyMaskTo(theStDets.theStripsToSkip); } theStDets.regionalHandle_ = lazyClusterHandle; uint32_t tmpId=0; vector<SiStripCluster>::const_iterator beginIterator; edm::RefGetter<SiStripCluster>::const_iterator iregion = refClusterHandle->begin(); for(;iregion!=refClusterHandle->end();++iregion) { const edm::RegionIndex<SiStripCluster>& region = *iregion; vector<SiStripCluster>::const_iterator icluster = region.begin(); const vector<SiStripCluster>::const_iterator endIterator = region.end(); tmpId = icluster->geographicalId(); beginIterator = icluster; //std::cout << "== tmpId ad inizio loop dentro region: " << tmpId << std::endl; for (;icluster!=endIterator;icluster++) { //std::cout << "===== cluster id,pos " // << icluster->geographicalId() << " , " << icluster->barycenter() // << std::endl; //std::cout << "=====making ref in recHits() " << std::endl; if( icluster->geographicalId() != tmpId){ //std::cout << "geo!=tmpId" << std::endl; //cannot we avoid to update the det with detId of itself?? (sure we can!, done!) theStDets.update(concreteDetUpdatable(tmpId)->index(),beginIterator,icluster); tmpId = icluster->geographicalId(); beginIterator = icluster; if( icluster == (endIterator-1)){ theStDets.update(concreteDetUpdatable(tmpId)->index(),icluster,endIterator); } }else if( icluster == (endIterator-1)){ theStDets.update(concreteDetUpdatable(tmpId)->index(),beginIterator,endIterator); } }//end loop cluster in one ragion } }//end of block for updating with regional clusters }
const std::string MeasurementTrackerImpl::name_ [protected] |
Definition at line 110 of file MeasurementTrackerImpl.h.
Referenced by updatePixels(), OnDemandMeasurementTracker::updateStrips(), and updateStrips().
const edm::ParameterSet& MeasurementTrackerImpl::pset_ [protected] |
Definition at line 109 of file MeasurementTrackerImpl.h.
Referenced by initializeStripStatus(), updatePixels(), OnDemandMeasurementTracker::updateStrips(), and updateStrips().
bool MeasurementTrackerImpl::selfUpdateSkipClusters_ [protected] |
Definition at line 130 of file MeasurementTrackerImpl.h.
Referenced by MeasurementTrackerImpl(), setClusterToSkip(), unsetClusterToSkip(), updatePixels(), OnDemandMeasurementTracker::updateStrips(), and updateStrips().
DetContainer MeasurementTrackerImpl::theDetMap [mutable, protected] |
Definition at line 114 of file MeasurementTrackerImpl.h.
Referenced by addPixelDet(), allDets(), findDet(), initGluedDet(), initialize(), and OnDemandMeasurementTracker::OnDemandMeasurementTracker().
std::vector<TkGluedMeasurementDet> MeasurementTrackerImpl::theGluedDets [mutable, protected] |
Definition at line 120 of file MeasurementTrackerImpl.h.
Referenced by addGluedDet(), gluedDets(), and initialize().
const std::vector<edm::InputTag> MeasurementTrackerImpl::theInactivePixelDetectorLabels [protected] |
Definition at line 127 of file MeasurementTrackerImpl.h.
Referenced by updatePixels().
const std::vector<edm::InputTag> MeasurementTrackerImpl::theInactiveStripDetectorLabels [protected] |
Definition at line 128 of file MeasurementTrackerImpl.h.
Referenced by getInactiveStrips(), and OnDemandMeasurementTracker::OnDemandMeasurementTracker().
const SiPixelFedCabling* MeasurementTrackerImpl::thePixelCabling [protected] |
Definition at line 125 of file MeasurementTrackerImpl.h.
const PixelClusterParameterEstimator* MeasurementTrackerImpl::thePixelCPE [protected] |
Definition at line 124 of file MeasurementTrackerImpl.h.
Referenced by addPixelDets().
std::vector<TkPixelMeasurementDet*> MeasurementTrackerImpl::thePixelDets [mutable, protected] |
Definition at line 117 of file MeasurementTrackerImpl.h.
Referenced by addPixelDet(), initialize(), initializePixelStatus(), pixelDets(), updatePixels(), and ~MeasurementTrackerImpl().
std::vector<bool> MeasurementTrackerImpl::thePixelsToSkip [mutable, protected] |
Definition at line 122 of file MeasurementTrackerImpl.h.
Referenced by addPixelDet(), setClusterToSkip(), unsetClusterToSkip(), and updatePixels().
StMeasurementDetSet MeasurementTrackerImpl::theStDets [mutable, protected] |
Definition at line 112 of file MeasurementTrackerImpl.h.
Referenced by addGluedDet(), addStripDet(), OnDemandMeasurementTracker::define(), initialize(), initializeStripStatus(), setClusterToSkip(), unsetClusterToSkip(), OnDemandMeasurementTracker::updateStrips(), and updateStrips().
std::vector<TkStripMeasurementDet> MeasurementTrackerImpl::theStripDets [mutable, protected] |
Definition at line 119 of file MeasurementTrackerImpl.h.
Referenced by addStripDet(), initialize(), and stripDets().