1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#ifndef HcalLaserEventFilter2012_h
#define HcalLaserEventFilter2012_h
// -*- C++ -*-
//
// Package: HcalLaserEventFilter2012
// Class: HcalLaserEventFilter2012
//
/**\class HcalLaserEventFilter2012 HcalLaserEventFilter2012.cc UserCode/HcalLaserEventFilter2012/src/HcalLaserEventFilter2012.cc
Description: [Remove known HCAL laser events in 2012 data]
Implementation:
[Notes on implementation]
*/
//
// Original Author: Jeff Temple, University of Maryland (jtemple@fnal.gov)
// Created: Fri Oct 19 13:15:44 EDT 2012
//
//
// system include files
#include <iostream>
#include <sstream>
#include <fstream>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDFilter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
//
// class declaration
//
class HcalLaserEventFiltProducer2012;
class HcalLaserEventFilter2012 : public edm::one::EDFilter<> {
public:
explicit HcalLaserEventFilter2012(const edm::ParameterSet&);
~HcalLaserEventFilter2012() override;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
friend HcalLaserEventFiltProducer2012;
private:
bool filter(edm::Event&, const edm::EventSetup&) override;
void endJob() override;
void readEventListFile(const std::string& eventFileName);
void addEventString(const std::string& eventString);
// ----------member data ---------------------------
typedef std::vector<std::string> strVec;
typedef std::vector<std::string>::iterator strVecI;
// vector of strings representing bad events, with each string in "run:LS:event" format
std::vector<std::string> EventList_;
// if set to true, then the run:LS:event for any event failing the cut will be printed out
bool verbose_;
// prefix will be printed before any event if verbose mode is true, in order to make searching for events easier
std::string prefix_;
// Set run range of events in the BAD LASER LIST.
// The purpose of these values is to shorten the length of the EventList_ vector when running on only a subset of data
int minrun_;
int maxrun_; // if specified (i.e., values > -1), then only events in the given range will be filtered
int minRunInFile, maxRunInFile;
bool WriteBadToFile_;
bool forceFilterTrue_;
std::ofstream outfile_;
};
#endif
|