From e27e17c277d6dd4aed65b148e295aff9a12fffbe Mon Sep 17 00:00:00 2001 From: Alexander Gude Date: Tue, 13 May 2014 13:42:40 -0500 Subject: [PATCH] Move CutLevel to its own interface file --- ZFinder/Event/interface/CutLevel.h | 37 +++++++++++++++++++ ZFinder/Event/interface/ZDefinition.h | 3 +- ZFinder/Event/interface/ZDefinitionPlotter.h | 2 +- .../Event/interface/ZDefinitionWorkspace.h | 2 +- ZFinder/Event/interface/ZFinderEvent.h | 26 +------------ ZFinder/Event/src/ZDefinitionPlotter.cc | 3 ++ ZFinder/Event/src/ZDefinitionWorkspace.cc | 1 + 7 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 ZFinder/Event/interface/CutLevel.h diff --git a/ZFinder/Event/interface/CutLevel.h b/ZFinder/Event/interface/CutLevel.h new file mode 100644 index 0000000..c72887e --- /dev/null +++ b/ZFinder/Event/interface/CutLevel.h @@ -0,0 +1,37 @@ +#ifndef ZFINDER_CUTLEVEL_H_ +#define ZFINDER_CUTLEVEL_H_ + +// Standard Library +#include // std::string +#include // std::pair +#include // std::vector + +namespace zf { + + // Cut level struct + struct CutLevel{ + // Constructor sets all values to false + CutLevel() { + pass = false; + t0p1_pass = false; + t0p1_eff = 1.; + t1p0_pass = false; + t1p0_eff = 1.; + event_weight = 1.; + } + bool pass; + bool t0p1_pass; + bool t1p0_pass; + double t0p1_eff; + double t1p0_eff; + double event_weight; + }; + + + // Used to match cut levels to names + typedef std::pair cutlevel_pair; + // Used to pass around cut levels + typedef std::vector cutlevel_vector; + +} // namespace zf +#endif // ZFINDER_CUTLEVEL_H_ diff --git a/ZFinder/Event/interface/ZDefinition.h b/ZFinder/Event/interface/ZDefinition.h index ae11941..d668368 100644 --- a/ZFinder/Event/interface/ZDefinition.h +++ b/ZFinder/Event/interface/ZDefinition.h @@ -7,7 +7,8 @@ #include // std::pair // ZFinder -#include "ZFinder/Event/interface/ZFinderEvent.h" // ZFinderEvent, cutlevel_vector +#include "ZFinder/Event/interface/CutLevel.h" // CutLevel, cutlevel_vector +#include "ZFinder/Event/interface/ZFinderEvent.h" // ZFinderEvent #include "ZFinder/Event/interface/ZFinderElectron.h" // ZFinderElectron diff --git a/ZFinder/Event/interface/ZDefinitionPlotter.h b/ZFinder/Event/interface/ZDefinitionPlotter.h index 5ed050d..bd03318 100644 --- a/ZFinder/Event/interface/ZDefinitionPlotter.h +++ b/ZFinder/Event/interface/ZDefinitionPlotter.h @@ -10,7 +10,7 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" // ZFinder Code -#include "ZFinderEvent.h" // ZFinderEvent, cutlevel_vector +#include "ZFinderEvent.h" // ZFinderEvent #include "ZFinderPlotter.h" // ZFinderPlotter #include "ZDefinition.h" // ZDefinition diff --git a/ZFinder/Event/interface/ZDefinitionWorkspace.h b/ZFinder/Event/interface/ZDefinitionWorkspace.h index 708448f..8d60437 100644 --- a/ZFinder/Event/interface/ZDefinitionWorkspace.h +++ b/ZFinder/Event/interface/ZDefinitionWorkspace.h @@ -18,7 +18,7 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" // ZFinder Code -#include "ZFinderEvent.h" // ZFinderEvent, CutLevel, ZData +#include "ZFinderEvent.h" // ZFinderEvent, ZData #include "ZDefinition.h" // ZDefinition diff --git a/ZFinder/Event/interface/ZFinderEvent.h b/ZFinder/Event/interface/ZFinderEvent.h index 9a5e271..8fa3eca 100644 --- a/ZFinder/Event/interface/ZFinderEvent.h +++ b/ZFinder/Event/interface/ZFinderEvent.h @@ -20,38 +20,14 @@ // ZFinder #include "ZFinder/Event/interface/ZFinderElectron.h" // ZFinderElectron, ZFinderElectron +#include "ZFinder/Event/interface/CutLevel.h" // CutLevel, cutlevel_pair, cutlevel_vector namespace zf { - // Cut level struct - struct CutLevel{ - // Constructor sets all values to false - CutLevel() { - pass = false; - t0p1_pass = false; - t0p1_eff = 1.; - t1p0_pass = false; - t1p0_eff = 1.; - event_weight = 1.; - } - bool pass; - bool t0p1_pass; - bool t1p0_pass; - double t0p1_eff; - double t1p0_eff; - double event_weight; - }; - - - // Used to match cut levels to names - typedef std::pair cutlevel_pair; - // Used to pass around cut levels - typedef std::vector cutlevel_vector; // Used to pass around trigger objects for matching typedef std::pair trig_dr_pair; typedef std::vector trig_dr_vec; - class ZFinderEvent{ public: // Constructor. Although iEvent, iSetup, and iConfig violate our naming diff --git a/ZFinder/Event/src/ZDefinitionPlotter.cc b/ZFinder/Event/src/ZDefinitionPlotter.cc index 3444cbb..9d10b90 100644 --- a/ZFinder/Event/src/ZDefinitionPlotter.cc +++ b/ZFinder/Event/src/ZDefinitionPlotter.cc @@ -4,6 +4,9 @@ #include // std::make_pair #include // std::ostringstream +// ZFinder Code +#include "ZFinder/Event/interface/CutLevel.h" // cutlevel_vector + namespace zf { // Constructor diff --git a/ZFinder/Event/src/ZDefinitionWorkspace.cc b/ZFinder/Event/src/ZDefinitionWorkspace.cc index eb2b098..3a0f49f 100644 --- a/ZFinder/Event/src/ZDefinitionWorkspace.cc +++ b/ZFinder/Event/src/ZDefinitionWorkspace.cc @@ -5,6 +5,7 @@ #include // std::ostringstream // ZFinder Code +#include "ZFinder/Event/interface/CutLevel.h" // CutLevel, cutlevel_vector #include "ZFinder/Event/interface/ZFinderElectron.h" // ZFinderElectron