1 #ifndef StMeasurementDetSet_H 2 #define StMeasurementDetSet_H 25 #include <unordered_map> 31 #define COUT std::cout 33 #define COUT LogDebug("") 49 maxBad(pset.getParameter<uint32_t>(
"maxBad")),
73 unsigned int id(
int i)
const {
return id_[
i]; }
76 int find(
unsigned int jd,
int i=0)
const {
77 return std::lower_bound(
id_.begin()+
i,
id_.end(),jd)-
id_.begin();
132 std::vector<unsigned int>
id_;
154 conditionSet_(&cond),
156 activeThisEvent_(cond.
nDet(),
true),
157 detSet_(cond.
nDet()),
158 detIndex_(cond.
nDet(),-1),
160 theRawInactiveStripDetIds_(),
174 void update(
int i,
const StripDetset & detSet ) {
180 assert(j>=0); assert(empty_[i]); assert(ready_[i]);
186 int size()
const {
return conditions().nDet(); }
188 unsigned int id(
int i)
const {
return conditions().id(i); }
189 int find(
unsigned int jd,
int i=0)
const {
190 return conditions().find(jd,
i);
194 bool isActive(
int i)
const {
return activeThisEvent_[
i] && conditions().isActiveThisPeriod(i); }
196 void setEmpty(
int i) {empty_[
i] =
true; activeThisEvent_[
i] =
true; }
201 std::fill(empty_.begin(),empty_.end(),
true);
202 std::fill(ready_.begin(),ready_.end(),
true);
203 std::fill(detIndex_.begin(),detIndex_.end(),-1);
204 std::fill(activeThisEvent_.begin(), activeThisEvent_.end(),
true);
226 stripDefined_[
i] =
true;
227 stripUpdated_[
i] =
false;
228 stripRegions_[
i] = range;
234 if(detIndex_[i]>=0) {
235 detSet_[
i].set(*handle_,handle_->item(detIndex_[i]));
239 detSet_[
i] = StripDetset();
284 void zeroStat()
const { stat = Stat(); }
285 void incTot(
int n)
const { stat.totDet=
n;}
286 void incReady()
const { stat.detReady++;}
287 void incSet()
const { stat.detSet++;}
288 void incAct()
const { stat.detAct++;}
289 void printStat()
const {
290 COUT <<
"VI detsets " << stat.totDet <<
','<< stat.detReady <<
','<< stat.detSet <<
','<< stat.detAct << std::endl;
312 unsigned int id(
int i)
const {
return id_[
i]; }
313 int find(
unsigned int jd,
int i=0)
const {
314 return std::lower_bound(
id_.begin()+
i,
id_.end(),jd)-
id_.begin();
332 std::vector<unsigned int>
id_;
345 conditionSet_(&cond),
346 detSet_(cond.
nDet()),
348 activeThisEvent_(cond.
nDet(),
true) {}
352 int size()
const {
return conditions().nDet(); }
354 unsigned int id(
int i)
const {
return conditions().id(i); }
355 int find(
unsigned int jd,
int i=0)
const {
356 return conditions().find(jd,
i);
359 void update(
int i,
const PixelDetSet & detSet ) {
365 bool isActive(
int i)
const {
return activeThisEvent_[
i] && conditions().isActiveThisPeriod(i); }
369 activeThisEvent_[
i] =
true;
370 auto found = badFEDChannelPositionsSet_.find(i);
371 if(
found != badFEDChannelPositionsSet_.end()) {
372 badFEDChannelPositionsSet_.erase(
found);
377 std::fill(empty_.begin(),empty_.end(),
true);
378 std::fill(activeThisEvent_.begin(), activeThisEvent_.end(),
true);
379 badFEDChannelPositionsSet_.clear();
382 std::fill(activeThisEvent_.begin(), activeThisEvent_.end(),active);
386 auto found = badFEDChannelPositionsSet_.find(i);
387 if(
found == badFEDChannelPositionsSet_.end())
389 return &(
found->second);
392 auto found = badFEDChannelPositionsSet_.find(i);
393 if(
found == badFEDChannelPositionsSet_.end()) {
394 badFEDChannelPositionsSet_.emplace(i, positions);
397 found->second.insert(
found->second.end(), positions.begin(), positions.end());
406 const PixelDetSet &
detSet(
int i)
const {
return detSet_[
i];}
431 unsigned int id(
int i)
const {
return id_[
i]; }
432 int find(
unsigned int jd,
int i=0)
const {
433 return std::lower_bound(
id_.begin()+
i,
id_.end(),jd)-
id_.begin();
451 std::vector<unsigned int>
id_;
462 conditionSet_(&cond),
463 detSet_(cond.
nDet()),
465 activeThisEvent_(cond.
nDet(),
true) {}
469 int size()
const {
return conditions().nDet(); }
471 unsigned int id(
int i)
const {
return conditions().id(i); }
472 int find(
unsigned int jd,
int i=0)
const {
473 return conditions().find(jd,
i);
476 void update(
int i,
const Phase2DetSet & detSet ) {
482 bool isActive(
int i)
const {
return activeThisEvent_[
i] && conditions().isActiveThisPeriod(i); }
484 void setEmpty(
int i) {empty_[
i] =
true; activeThisEvent_[
i] =
true; }
487 std::fill(empty_.begin(),empty_.end(),
true);
488 std::fill(activeThisEvent_.begin(), activeThisEvent_.end(),
true);
491 std::fill(activeThisEvent_.begin(), activeThisEvent_.end(),active);
496 const Phase2DetSet &
detSet(
int i)
const {
return detSet_[
i];}
511 #endif // StMeasurementDetSet_H bool isMasked(int i, const SiStripCluster &cluster) const
edmNew::DetSet< Phase2TrackerCluster1D > Phase2DetSet
int find(unsigned int jd, int i=0) const
edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle()
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 ...
std::vector< std::vector< BadStripBlock > > badStripBlocks_
PxMeasurementConditionSet(const PixelClusterParameterEstimator *cpe)
unsigned int id(int i) const
std::vector< bool > activeThisPeriod_
const PixelClusterParameterEstimator * theCPE
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
int totalStrips(int i) const
const StripDetset & detSet(int i) const
bool isActive(int i) const
edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > handle_
bool bad128Strip(int index, int strip) const
edm::Ref< edmNew::DetSetVector< SiPixelCluster >, SiPixelCluster > SiPixelClusterRef
StMeasurementDetSet(const StMeasurementConditionSet &cond)
void update(int i, int j)
std::vector< bool > ready_
const Phase2DetSet & detSet(int i) const
const PxMeasurementConditionSet * conditionSet_
void update(int i, const StripDetset &detSet)
const StMeasurementConditionSet & conditions() const
bool maskBad128StripBlocks_
StripDetset::const_iterator new_const_iterator
uint16_t firstStrip() const
data_type const * const_iterator
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
bool isActiveThisPeriod(int i) const
std::vector< std::pair< LocalPoint, LocalPoint > > BadFEDChannelPositions
unsigned int id(int i) const
const BadFEDChannelPositions * getBadFEDChannelPositions(int i) const
edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1D > Phase2TrackerCluster1DRef
void defineStrip(int i, std::pair< unsigned int, unsigned int > range)
std::vector< bool > empty_
const bool stripUpdated(int i) const
uint16_t maxConsecutiveBad
unsigned int id(int i) const
unsigned int id(int i) const
edmNew::DetSet< SiStripCluster > StripDetset
int find(unsigned int jd, int i=0) const
std::vector< unsigned char > subId_
const BadStripCuts & badStripCuts(int i) const
const ClusterParameterEstimator< Phase2TrackerCluster1D > * cpe() const
unsigned int id(int i) const
const SiStripRecHitMatcher * matcher() const
const StMeasurementConditionSet * conditionSet_
int find(unsigned int jd, int i=0) const
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 edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
bool isActive(int i) const
std::vector< BadStripBlock > & getBadStripBlocks(int i)
edm::Handle< edmNew::DetSetVector< SiPixelCluster > > handle_
bool hasAny128StripBad(int i) const
bool isActiveThisPeriod(int i) const
const edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle() const
std::vector< Phase2DetSet > detSet_
PxMeasurementDetSet(const PxMeasurementConditionSet &cond)
const StripClusterParameterEstimator * stripCPE() const
std::vector< uint32_t > theRawInactiveStripDetIds_
std::vector< unsigned int > id_
StMeasurementConditionSet(const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe)
void update(int i, const PixelDetSet &detSet)
void addBadFEDChannelPositions(int i, BadFEDChannelPositions &positions)
std::vector< int > totalStrips_
void resetOnDemandStrips()
bool maskBad128StripBlocks() const
std::vector< bool > hasAny128StripBad_
const StripClusterParameterEstimator * theCPE
void setActiveThisEvent(int i, bool active)
std::vector< bool > empty_
std::vector< uint32_t > & rawInactiveStripDetIds()
void setMaskBad128StripBlocks(bool maskThem)
std::vector< bool > activeThisPeriod_
std::vector< unsigned int > id_
std::vector< unsigned int > id_
std::vector< bool > activeThisPeriod_
const Phase2OTMeasurementConditionSet & conditions() const
BadStripBlock(const SiStripBadStrip::data &data)
bool isActive(int i) const
edm::Handle< edmNew::DetSetVector< SiStripCluster > > handle_
std::vector< bool > bad128Strip_
int find(unsigned int jd, int i=0) const
std::vector< bool > activeThisEvent_
void setActiveThisEvent(bool active)
Pixel cluster – collection of neighboring pixels above threshold.
BadStripCuts(const edm::ParameterSet &pset)
char data[epos_bytes_allocation]
std::vector< bool > empty_
std::vector< StripDetset > detSet_
std::vector< bool > activeThisEvent_
int find(unsigned int jd, int i=0) const
const PixelClusterParameterEstimator * pixelCPE() const
std::vector< BadStripBlock > const & badStripBlocks(int i) const
std::vector< bool > activeThisEvent_
int find(unsigned int jd, int i=0) const
const ClusterParameterEstimator< Phase2TrackerCluster1D > * theCPE
void setActiveThisEvent(bool active)
BadStripCuts badStripCuts_[4]
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
void set128StripStatus(int i, bool good, int idx=-1)
const PixelDetSet & detSet(int i) const
Phase2OTMeasurementDetSet(const Phase2OTMeasurementConditionSet &cond)
std::vector< std::pair< unsigned int, unsigned int > > stripRegions_
std::vector< int > detIndex_
unsigned int id(int i) const
void update(int i, const Phase2DetSet &detSet)
std::vector< PixelDetSet > detSet_
const SiStripRecHitMatcher * theMatcher
edmNew::DetSet< SiPixelCluster > PixelDetSet
const std::vector< uint32_t > & rawInactiveStripDetIds() const
unsigned char subId(int i) const
const std::vector< uint8_t > & amplitudes() const
std::vector< bool > stripUpdated_
bool bad128Strip(int offset) const
note: index is 6*detector index + offset!
const bool stripDefined(int i) const
const Phase2OTMeasurementConditionSet * conditionSet_
std::unordered_map< int, BadFEDChannelPositions > badFEDChannelPositionsSet_
bool isActiveThisPeriod(int i) const
Phase2OTMeasurementConditionSet(const ClusterParameterEstimator< Phase2TrackerCluster1D > *cpe)
const PxMeasurementConditionSet & conditions() const
edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle()