28 ~ClusterChargeMasker(){}
38 float minGoodStripCharge_;
52 mergeOld_(iConfig.exists(
"oldClusterRemovalInfo")),
55 produces<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster> > >();
56 produces<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >();
60 stripClusters_ = consumes<edmNew::DetSetVector<SiStripCluster> >(iConfig.getParameter<
edm::InputTag>(
"stripClusters"));
63 oldPxlMaskToken_ = consumes<PixelMaskContainer>(iConfig.getParameter<
edm::InputTag>(
"oldClusterRemovalInfo"));
64 oldStrMaskToken_ = consumes<StripMaskContainer>(iConfig.getParameter<
edm::InputTag>(
"oldClusterRemovalInfo"));
76 iEvent.
getByToken(pixelClusters_, pixelClusters);
78 iEvent.
getByToken(stripClusters_, stripClusters);
81 std::vector<bool> collectedStrips;
82 std::vector<bool> collectedPixels;
87 iEvent.
getByToken(oldPxlMaskToken_ ,oldPxlMask);
88 iEvent.
getByToken(oldStrMaskToken_ ,oldStrMask);
89 LogDebug(
"ClusterChargeMasker")<<
"to merge in, "<<oldStrMask->size()<<
" strp and "<<oldPxlMask->size()<<
" pxl";
90 oldStrMask->copyMaskTo(collectedStrips);
91 oldPxlMask->copyMaskTo(collectedPixels);
92 assert(stripClusters->dataSize()>=collectedStrips.size());
93 collectedStrips.resize(stripClusters->dataSize(),
false);
95 collectedStrips.resize(stripClusters->dataSize(),
false);
96 collectedPixels.resize(pixelClusters->dataSize(),
false);
99 auto const &
clusters = stripClusters->data();
100 for (
auto const & item : stripClusters->ids()) {
102 if (!item.isValid())
continue;
104 auto detid = item.id;
106 for (
auto i = item.offset;
i<item.offset+
int(item.size); ++
i) {
108 if(clusCharge < minGoodStripCharge_) collectedStrips[
i] =
true;
113 std::auto_ptr<StripMaskContainer> removedStripClusterMask(
115 LogDebug(
"ClusterChargeMasker")<<
"total strip to skip: "<<
std::count(collectedStrips.begin(),collectedStrips.end(),
true);
118 iEvent.
put( removedStripClusterMask );
120 std::auto_ptr<PixelMaskContainer> removedPixelClusterMask(
122 LogDebug(
"ClusterChargeMasker")<<
"total pxl to skip: "<<
std::count(collectedPixels.begin(),collectedPixels.end(),
true);
123 iEvent.
put( removedPixelClusterMask );
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void produce(Event &, EventSetup const &)=0
#define DEFINE_FWK_MODULE(type)
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.