Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:42

0001 #ifndef HcalLaserEventFilter2012_h
0002 #define HcalLaserEventFilter2012_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    HcalLaserEventFilter2012
0007 // Class:      HcalLaserEventFilter2012
0008 //
0009 /**\class HcalLaserEventFilter2012 HcalLaserEventFilter2012.cc UserCode/HcalLaserEventFilter2012/src/HcalLaserEventFilter2012.cc
0010 
0011  Description: [Remove known HCAL laser events in 2012 data]
0012 
0013  Implementation:
0014      [Notes on implementation]
0015 */
0016 //
0017 // Original Author:  Jeff Temple, University of Maryland (jtemple@fnal.gov)
0018 //         Created:  Fri Oct 19 13:15:44 EDT 2012
0019 //
0020 //
0021 
0022 // system include files
0023 #include <iostream>
0024 #include <sstream>
0025 #include <fstream>
0026 
0027 // user include files
0028 #include "FWCore/Framework/interface/Frameworkfwd.h"
0029 #include "FWCore/Framework/interface/one/EDFilter.h"
0030 #include "FWCore/Framework/interface/Event.h"
0031 
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 
0034 //
0035 // class declaration
0036 //
0037 class HcalLaserEventFiltProducer2012;
0038 
0039 class HcalLaserEventFilter2012 : public edm::one::EDFilter<> {
0040 public:
0041   explicit HcalLaserEventFilter2012(const edm::ParameterSet&);
0042   ~HcalLaserEventFilter2012() override;
0043 
0044   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0045 
0046   friend HcalLaserEventFiltProducer2012;
0047 
0048 private:
0049   bool filter(edm::Event&, const edm::EventSetup&) override;
0050   void endJob() override;
0051 
0052   void readEventListFile(const std::string& eventFileName);
0053   void addEventString(const std::string& eventString);
0054 
0055   // ----------member data ---------------------------
0056   typedef std::vector<std::string> strVec;
0057   typedef std::vector<std::string>::iterator strVecI;
0058 
0059   // vector of strings representing bad events, with each string in "run:LS:event" format
0060   std::vector<std::string> EventList_;
0061   // if set to true, then the run:LS:event for any event failing the cut will be printed out
0062   bool verbose_;
0063   // prefix will be printed before any event if verbose mode is true, in order to make searching for events easier
0064   std::string prefix_;
0065 
0066   // Set run range of events in the BAD LASER LIST.
0067   // The purpose of these values is to shorten the length of the EventList_ vector when running on only a subset of data
0068   int minrun_;
0069   int maxrun_;  // if specified (i.e., values > -1), then only events in the given range will be filtered
0070   int minRunInFile, maxRunInFile;
0071 
0072   bool WriteBadToFile_;
0073   bool forceFilterTrue_;
0074   std::ofstream outfile_;
0075 };
0076 #endif