68 virtual void endJob()
override;
121 , FilterAlgo_ (iConfig.getUntrackedParameter<std::
string> (
"FilterAlgo",
"TuningMode"))
122 , taggingMode_ (iConfig.getParameter<bool>(
"taggingMode"))
123 , skimGap_ (iConfig.getUntrackedParameter<bool> (
"skimGap",
false))
124 , skimDead_ (iConfig.getUntrackedParameter<bool> (
"skimDead",
false))
125 , cutBoundEnergyGapEE (iConfig.getUntrackedParameter<double> (
"cutBoundEnergyGapEE"))
126 , cutBoundEnergyGapEB (iConfig.getUntrackedParameter<double> (
"cutBoundEnergyGapEB"))
127 , cutBoundEnergyDeadCellsEB (iConfig.getUntrackedParameter<double> (
"cutBoundEnergyDeadCellsEB"))
128 , cutBoundEnergyDeadCellsEE (iConfig.getUntrackedParameter<double> (
"cutBoundEnergyDeadCellsEE"))
130 , limitFilterToEB_ (iConfig.getUntrackedParameter<bool> (
"limitFilterToEB",
false))
131 , limitFilterToEE_ (iConfig.getUntrackedParameter<bool> (
"limitFilterToEE",
false))
132 , limitDeadCellToChannelStatusEB_ (iConfig.getParameter<std::vector<int> > (
"limitDeadCellToChannelStatusEB"))
133 , limitDeadCellToChannelStatusEE_ (iConfig.getParameter<std::vector<int> > (
"limitDeadCellToChannelStatusEE"))
135 , enableGap_ (iConfig.getUntrackedParameter<bool> (
"enableGap",
false))
136 , debug_ (iConfig.getParameter<bool>(
"debug"))
159 if(
debug_ )
std::cout <<
"Constructor EcalAnomalousEvent" << std::endl;
163 produces<AnomalousECALVariables> (
"anomalousECALVariables");
205 std::vector<DetId> sameFlagDetIds;
216 bool detIdAlreadyChecked =
false;
220 int status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
223 bool passChannelLimitation =
false;
226 std::vector<int> deadNeighbourStati;
232 for (std::vector<int>::iterator sit = deadNeighbourStati.begin(); sit != deadNeighbourStati.end(); ++sit) {
234 if (channelAllowed == *sit || (channelAllowed < 0 &&
abs(channelAllowed) <= *sit)) {
235 passChannelLimitation =
true;
241 for (std::vector<DetId>::iterator it = sameFlagDetIds.begin(); it != sameFlagDetIds.end(); it++) {
242 if (currDetId == *it)
243 detIdAlreadyChecked =
true;
257 for (std::vector<DetId>::iterator it = gapinfo.
detIds.begin(); it != gapinfo.
detIds.end(); it++) {
258 sameFlagDetIds.push_back(*it);
268 << gapinfo.
detIds.size() << std::endl;
274 && deadNeighbourStati.size() > 0))) {
283 for (std::vector<DetId>::iterator it = boundinfo.
detIds.begin(); it != boundinfo.
detIds.end(); it++) {
284 sameFlagDetIds.push_back(*it);
294 << boundinfo.
boundaryET <<
" deadCells: " << boundinfo.
detIds.size() << std::endl;
302 sameFlagDetIds.clear();
311 bool detIdAlreadyChecked =
false;
315 int status = (chit != ecalStatus->end()) ? chit->getStatusCode() & 0x1F : -1;
318 bool passChannelLimitation =
false;
321 std::vector<int> deadNeighbourStati;
327 for (std::vector<int>::iterator sit = deadNeighbourStati.begin(); sit != deadNeighbourStati.end(); ++sit) {
329 if (channelAllowed == *sit || (channelAllowed < 0 &&
abs(channelAllowed) <= *sit)) {
330 passChannelLimitation =
true;
336 for (std::vector<DetId>::iterator it = sameFlagDetIds.begin(); it != sameFlagDetIds.end(); it++) {
337 if (currDetId == *it)
338 detIdAlreadyChecked =
true;
347 *
hit, ecalStatus) &&
abs(eta) < 1.6) {
356 for (std::vector<DetId>::iterator it = gapinfo.
detIds.begin(); it != gapinfo.
detIds.end(); it++) {
357 sameFlagDetIds.push_back(*it);
367 << gapinfo.
detIds.size() << std::endl;
373 && deadNeighbourStati.size() > 0))) {
382 for (std::vector<DetId>::iterator it = boundinfo.
detIds.begin(); it != boundinfo.
detIds.end(); it++) {
383 sameFlagDetIds.push_back(*it);
393 << boundinfo.
boundaryET <<
" deadCells: " << boundinfo.
detIds.size() << std::endl;
406 sameFlagDetIds.clear();
417 iEvent.
put(pAnomalousECALVariables,
"anomalousECALVariables");
419 iEvent.
put( std::auto_ptr<bool>(
new bool(pass)) );
EcalBoundaryInfoCalculator< EBDetId > ebBoundaryCalc
double maxBoundaryEnergy_
auto_ptr< ClusterSequence > cs
const double cutBoundEnergyDeadCellsEB
std::vector< BoundaryInformation > v_enNeighboursGap_EB
const double cutBoundEnergyDeadCellsEE
std::vector< BoundaryInformation > v_enNeighboursGap_EE
BoundaryInformation gapRecHits(const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry)
bool checkRecHitHasDeadNeighbour(const EcalRecHit &hit, const edm::ESHandle< EcalChannelStatus > ecalStatus, std::vector< int > &stati)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< EcalRecHitCollection > EERecHitsToken_
BoundaryInformation boundaryRecHits(const edm::Handle< EcalRecHitCollection > &, const EcalRecHit *, const edm::ESHandle< CaloTopology > theCaloTopology, const edm::ESHandle< EcalChannelStatus > ecalStatus, const edm::ESHandle< CaloGeometry > geometry)
#define DEFINE_FWK_MODULE(type)
std::vector< EcalRecHit >::const_iterator const_iterator
virtual void beginJob() override
const double cutBoundEnergyGapEE
virtual bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< BoundaryInformation > v_boundaryInfoDeadCells_EE
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
EcalBoundaryInfoCalculator< EEDetId > eeBoundaryCalc
const bool limitFilterToEB_
const double cutBoundEnergyGapEB
EcalDeadCellBoundaryEnergyFilter(const edm::ParameterSet &)
const std::vector< int > limitDeadCellToChannelStatusEE_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~EcalDeadCellBoundaryEnergyFilter()
Abs< T >::type abs(const T &t)
std::vector< BoundaryInformation > v_boundaryInfoDeadCells_EB
const std::string FilterAlgo_
std::vector< Item >::const_iterator const_iterator
float * enNeighboursGap_EE
bool checkRecHitHasInvalidNeighbour(const EcalRecHit &hit, const edm::ESHandle< EcalChannelStatus > ecalStatus)
ESHandle< TrackerGeometry > geometry
float * enNeighboursGap_EB
const std::vector< int > limitDeadCellToChannelStatusEB_
edm::EDGetTokenT< EcalRecHitCollection > EBRecHitsToken_
volatile std::atomic< bool > shutdown_flag false
virtual void endJob() override
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const bool limitFilterToEE_