-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure hypo tool and new Electron class
- Loading branch information
Showing
21 changed files
with
349 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
file(GLOB SOURCES src/*.cxx ) | ||
file(GLOB_RECURSE HEADERS Particle/*.h) | ||
|
||
include_directories(${CMAKE_SOURCE_DIR} ${ROOT_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../core/GaugiKernel) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../core/G4Kernel) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../CaloCell) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../CaloCluster) | ||
|
||
ROOT_GENERATE_DICTIONARY(ParticleDict ${HEADERS} LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/src/LinkDef.h MODULE Particle) | ||
|
||
add_library(Particle OBJECT ${SOURCES} ParticleDict.cxx) | ||
install(FILES ${HEADERS} DESTINATION Particle) | ||
gaugi_install_python_modules( ${CMAKE_CURRENT_SOURCE_DIR}/python Particle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef Electron_h | ||
#define Electron_h | ||
|
||
#include "CaloCluster/CaloCluster.h" | ||
#include "CaloCell/CaloCell.h" | ||
#include "GaugiKernel/EDM.h" | ||
#include "GaugiKernel/macros.h" | ||
#include <cmath> | ||
|
||
namespace xAOD{ | ||
|
||
class Electron: public Gaugi::EDM | ||
{ | ||
public: | ||
|
||
/*! Contructor */ | ||
Electron(); | ||
/*! Contructor */ | ||
/*! Destructor */ | ||
~Electron()=default; | ||
|
||
/*! The eta center of the cluster given by the simulation (RoI) */ | ||
PRIMITIVE_SETTER_AND_GETTER( float, m_eta, setEta, eta ); | ||
/*! The phi center of the cluster given by the simulation (RoI) */ | ||
PRIMITIVE_SETTER_AND_GETTER( float, m_phi, setPhi, phi ); | ||
/*! set/get energy */ | ||
PRIMITIVE_SETTER_AND_GETTER( float, m_e, setE, e ); | ||
/*! set/get transverse energy */ | ||
PRIMITIVE_SETTER_AND_GETTER( float, m_et, setEt, et ); | ||
|
||
void setDecisions (std::vector<bool> decisions ){ for (auto dec : decisions) m_decisions.push_back(dec); } | ||
std::vector<bool> getDecisions() const {return m_decisions;} | ||
|
||
void setCaloCluster( const xAOD::CaloCluster *clus ){ m_caloCluster=clus; }; | ||
const xAOD::CaloCluster* caloCluster() const { return m_caloCluster; }; | ||
|
||
private: | ||
float m_e; | ||
float m_et; | ||
float m_eta; | ||
float m_phi; | ||
|
||
std::vector<bool> m_decisions; | ||
|
||
const xAOD::CaloCluster *m_caloCluster; | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef ElectronContainer_h | ||
#define ElectronContainer_h | ||
|
||
/** simulator includes **/ | ||
#include "Particle/Electron.h" | ||
#include "GaugiKernel/DataVector.h" | ||
|
||
namespace xAOD{ | ||
typedef SG::DataVector<xAOD::Electron> ElectronContainer; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef ElectronConverter_h | ||
#define ElectronConverter_h | ||
|
||
/** simulator includes **/ | ||
#include "Particle/Electron.h" | ||
#include "CaloCluster/CaloClusterConverter.h" | ||
|
||
namespace xAOD{ | ||
|
||
struct Electron_t{ | ||
int cluster_link; | ||
float e; | ||
float et; | ||
float eta; | ||
float phi; | ||
std::vector<bool> decisions; | ||
}; | ||
|
||
class ElectronConverter{ | ||
|
||
public: | ||
ElectronConverter()=default; | ||
~ElectronConverter()=default; | ||
|
||
// convert a class object into a struct | ||
bool convert( const Electron *, Electron_t & , cluster_links_t &) ; | ||
bool convert( const Electron_t &electron_t, Electron *&electron ); | ||
|
||
private: | ||
|
||
}; | ||
|
||
|
||
|
||
} | ||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
__all__ = [] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "Particle/Electron.h" | ||
#include "G4Kernel/CaloPhiRange.h" | ||
|
||
using namespace xAOD; | ||
|
||
|
||
Electron::Electron(): | ||
EDM(), | ||
m_caloCluster(nullptr) | ||
{} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
#include "Particle/ElectronConverter.h" | ||
//#include "G4Kernel/macros.h" | ||
|
||
#include<iostream> | ||
using namespace xAOD; | ||
using namespace std; | ||
|
||
|
||
bool ElectronConverter::convert( const Electron *electron, Electron_t &electron_t, cluster_links_t &cluster_links ) | ||
{ | ||
if(electron){ | ||
|
||
electron_t.cluster_link = cluster_links[electron->caloCluster()]; | ||
electron_t.eta = electron->eta(); | ||
electron_t.phi = electron->phi(); | ||
electron_t.et = electron->et(); | ||
electron_t.e = electron->e(); | ||
for (auto dec : electron->getDecisions() ) electron_t.decisions.push_back(dec); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
|
||
bool ElectronConverter::convert( const Electron_t &electron_t, Electron *&electron) | ||
{ | ||
|
||
electron = new xAOD::Electron(); | ||
electron->setEta(electron_t.eta); | ||
electron->setPhi(electron_t.phi); | ||
electron->setEt(electron_t.et); | ||
electron->setE(electron_t.e); | ||
electron->setDecisions(electron_t.decisions); | ||
|
||
return true; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
|
||
#include "Particle/ElectronConverter.h" | ||
|
||
#ifdef __CINT__ | ||
|
||
|
||
#pragma link off all globals; | ||
#pragma link off all classes; | ||
#pragma link off all functions; | ||
#pragma link C++ nestedclass; | ||
#pragma link C++ struct xAOD::Electron_t+; | ||
#pragma link C++ class std::vector< xAOD::Electron_t >+; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
__all__ = ['CutBasedIsEM'] | ||
|
||
class CutBasedIsEM: | ||
def __init__(self): | ||
|
||
self.etHadCut = {'loose':[0.1218], | ||
'medium':[0.0270375], | ||
'tight':[0.0270375], | ||
'vloose': [0.157]} | ||
|
||
self.rEtaCut={'loose':[0.57], | ||
'medium':[0.814625], | ||
'tight':[0.83125], | ||
'vloose':[0.752]} | ||
|
||
self.eRatioCut = {'loose':[0.47], | ||
'medium':[0.57], | ||
'tight':[0.65], | ||
'vloose':[0.52]} | ||
|
||
def getCuts(self,workingPoint): | ||
return [self.etHadCut[workingPoint], | ||
self.rEtaCut[workingPoint], | ||
self.eRatioCut[workingPoint],] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.