Skip to content

Commit

Permalink
Move CutLevel to its own interface file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gude committed May 13, 2014
1 parent 06da0d0 commit e27e17c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 28 deletions.
37 changes: 37 additions & 0 deletions ZFinder/Event/interface/CutLevel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef ZFINDER_CUTLEVEL_H_
#define ZFINDER_CUTLEVEL_H_

// Standard Library
#include <string> // std::string
#include <utility> // std::pair
#include <vector> // 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<std::string, CutLevel> cutlevel_pair;
// Used to pass around cut levels
typedef std::vector<cutlevel_pair> cutlevel_vector;

} // namespace zf
#endif // ZFINDER_CUTLEVEL_H_
3 changes: 2 additions & 1 deletion ZFinder/Event/interface/ZDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include <utility> // 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


Expand Down
2 changes: 1 addition & 1 deletion ZFinder/Event/interface/ZDefinitionPlotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ZFinder/Event/interface/ZDefinitionWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
26 changes: 1 addition & 25 deletions ZFinder/Event/interface/ZFinderEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, CutLevel> cutlevel_pair;
// Used to pass around cut levels
typedef std::vector<cutlevel_pair> cutlevel_vector;
// Used to pass around trigger objects for matching
typedef std::pair<const trigger::TriggerObject*, double> trig_dr_pair;
typedef std::vector<trig_dr_pair> trig_dr_vec;


class ZFinderEvent{
public:
// Constructor. Although iEvent, iSetup, and iConfig violate our naming
Expand Down
3 changes: 3 additions & 0 deletions ZFinder/Event/src/ZDefinitionPlotter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <utility> // std::make_pair
#include <sstream> // std::ostringstream

// ZFinder Code
#include "ZFinder/Event/interface/CutLevel.h" // cutlevel_vector


namespace zf {
// Constructor
Expand Down
1 change: 1 addition & 0 deletions ZFinder/Event/src/ZDefinitionWorkspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <sstream> // std::ostringstream

// ZFinder Code
#include "ZFinder/Event/interface/CutLevel.h" // CutLevel, cutlevel_vector
#include "ZFinder/Event/interface/ZFinderElectron.h" // ZFinderElectron


Expand Down

0 comments on commit e27e17c

Please sign in to comment.