-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
67 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,74 @@ | ||
#include "CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h" | ||
// -*- C++ -*- | ||
// | ||
// Package: CalibTracker/SiStripDCS/plugins | ||
// Class: FilterTrackerOn | ||
// | ||
/**\class FilterTrackerOn FilterTrackerOn.cc | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
Description: EDFilter returning true when the number of modules with HV on in the Tracker is | ||
above a given threshold. | ||
*/ | ||
// | ||
// Original Author: Marco DE MATTIA | ||
// Created: 2010/03/10 10:51:00 | ||
// | ||
// | ||
|
||
// system include files | ||
#include <memory> | ||
#include <iostream> | ||
#include <algorithm> | ||
|
||
// user include files | ||
#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" | ||
#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/Framework/interface/stream/EDFilter.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
class FilterTrackerOn : public edm::stream::EDFilter<> { | ||
public: | ||
explicit FilterTrackerOn(const edm::ParameterSet&); | ||
static void fillDescriptions(edm::ConfigurationDescriptions&); | ||
~FilterTrackerOn() override; | ||
|
||
private: | ||
bool filter(edm::Event&, const edm::EventSetup&) override; | ||
|
||
int minModulesWithHVoff_; | ||
edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> detVOffToken_; | ||
}; | ||
|
||
FilterTrackerOn::FilterTrackerOn(const edm::ParameterSet& iConfig) | ||
: minModulesWithHVoff_(iConfig.getParameter<int>("MinModulesWithHVoff")), detVOffToken_(esConsumes()) {} | ||
|
||
FilterTrackerOn::~FilterTrackerOn() {} | ||
FilterTrackerOn::~FilterTrackerOn() = default; | ||
|
||
void FilterTrackerOn::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc; | ||
desc.setComment("Filters out events in which at least a fraction of Tracker is DCS ON"); | ||
desc.addUntracked<int>("MinModulesWithHVoff", 0); | ||
descriptions.addWithDefaultLabel(desc); | ||
} | ||
|
||
bool FilterTrackerOn::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
using namespace edm; | ||
|
||
const auto& detVOff = iSetup.getData(detVOffToken_); | ||
|
||
// std::cout << "detVOff.getHVoffCounts() = " << detVOff.getHVoffCounts() << " < " << minModulesWithHVoff_; | ||
LogDebug("FilterTrackerOn") << "detVOff.getHVoffCounts() = " << detVOff.getHVoffCounts() << " < " | ||
<< minModulesWithHVoff_; | ||
if (detVOff.getHVoffCounts() > minModulesWithHVoff_) { | ||
// std::cout << " skipping event" << std::endl; | ||
LogDebug("FilterTrackerOn") << " skipping event"; | ||
return false; | ||
} | ||
// cout << " keeping event" << endl; | ||
LogDebug("FilterTrackerOn") << " keeping event"; | ||
return true; | ||
} | ||
|
||
// ------------ method called once each job just before starting event loop ------------ | ||
void FilterTrackerOn::beginJob() {} | ||
|
||
// ------------ method called once each job just after ending the event loop ------------ | ||
void FilterTrackerOn::endJob() {} | ||
// EDFilter on the max number of modules with HV off | ||
DEFINE_FWK_MODULE(FilterTrackerOn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CalibTracker/SiStripDCS/plugins | ||
// Class: SyncDCSO2O | ||
// | ||
/**\class FilterTrackerOn FilterTrackerOn.cc | ||
|
||
Description: EDFilter returning true when the number of modules with HV on in the Tracker is | ||
above a given threshold. | ||
*/ | ||
// | ||
// Original Author: Marco DE MATTIA | ||
// Created: 2010/03/10 10:51:00 | ||
// | ||
// | ||
|
||
// system include files | ||
#include <memory> | ||
|
||
// user include files | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/EDFilter.h" | ||
|
||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h" | ||
#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" | ||
|
||
class FilterTrackerOn : public edm::EDFilter { | ||
public: | ||
explicit FilterTrackerOn(const edm::ParameterSet&); | ||
~FilterTrackerOn() override; | ||
|
||
private: | ||
void beginJob() override; | ||
bool filter(edm::Event&, const edm::EventSetup&) override; | ||
void endJob() override; | ||
|
||
int minModulesWithHVoff_; | ||
edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> detVOffToken_; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters