Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:58

0001 #ifndef DPGAnalysis_SiStripTools_EventWithHistoryFilter_H
0002 #define DPGAnalysis_SiStripTools_EventWithHistoryFilter_H
0003 
0004 #include <string>
0005 #include <vector>
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 #include "FWCore/Utilities/interface/InputTag.h"
0008 #include "CondFormats/SiStripObjects/interface/SiStripLatency.h"
0009 #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
0010 #include "DPGAnalysis/SiStripTools/interface/EventWithHistory.h"
0011 #include "DPGAnalysis/SiStripTools/interface/APVCyclePhaseCollection.h"
0012 
0013 namespace edm {
0014   class ParameterSet;
0015   class Event;
0016   class EventSetup;
0017 }  // namespace edm
0018 class EventWithHistory;
0019 
0020 class EventWithHistoryFilter {
0021 public:
0022   EventWithHistoryFilter();
0023   EventWithHistoryFilter(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC);
0024 
0025   void set(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC);
0026   const bool selected(const EventWithHistory& he, const edm::EventSetup& iSetup) const;
0027   const bool selected(const EventWithHistory& he, const edm::Event& iEvent, const edm::EventSetup& iSetup) const;
0028   const bool selected(const edm::Event& event, const edm::EventSetup& iSetup) const;
0029 
0030 private:
0031   const bool is_selected(const EventWithHistory& he,
0032                          const edm::EventSetup& iSetup,
0033                          const std::vector<int>& apvphases) const;
0034   const int getAPVLatency(const edm::EventSetup& iSetup) const;
0035   const int getAPVMode(const edm::EventSetup& iSetup) const;
0036   const std::vector<int> getAPVPhase(const edm::Event& iEvent) const;
0037   const bool isAPVLatencyNotNeeded() const;
0038   const bool isAPVPhaseNotNeeded() const;
0039   const bool isAPVModeNotNeeded() const;
0040   const bool isCutInactive(const std::vector<int>& range) const;
0041   const bool isInRange(const long long bx, const std::vector<int>& range, const bool extra) const;
0042   void printConfig(const edm::InputTag& historyTag, const edm::InputTag& apvphaseTag) const;
0043 
0044   edm::EDGetTokenT<EventWithHistory> m_historyToken;
0045   std::string m_partition;
0046   edm::EDGetTokenT<APVCyclePhaseCollection> m_APVPhaseToken;
0047   edm::ESGetToken<SiStripLatency, SiStripLatencyRcd> m_apvLatencyToken;
0048   std::vector<int> m_apvmodes;
0049   std::vector<int> m_dbxrange;
0050   std::vector<int> m_dbxrangelat;
0051   std::vector<int> m_bxrange;
0052   std::vector<int> m_bxrangelat;
0053   std::vector<int> m_bxcyclerange;
0054   std::vector<int> m_bxcyclerangelat;
0055   std::vector<int> m_dbxcyclerange;
0056   std::vector<int> m_dbxcyclerangelat;
0057   std::vector<int> m_dbxtrpltrange;
0058   std::vector<int> m_dbxgenericrange;
0059   unsigned int m_dbxgenericfirst;
0060   unsigned int m_dbxgenericlast;
0061   bool m_noAPVPhase;
0062 };
0063 
0064 #endif  // DPGAnalysis_SiStripTools_EventWithHistoryFilter_H