Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 32 additions & 22 deletions PWGEM/PhotonMeson/Core/CutsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,28 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//
// Contact: daiki.sekihata@cern.ch
//
/// \file CutsLibrary.cxx
/// \brief Source of class for EM photon selection.
/// \author daiki.sekihata@cern.ch

#include "PWGEM/PhotonMeson/Core/CutsLibrary.h"

#include "PWGEM/PhotonMeson/Core/DalitzEECut.h"
#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h"
#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h"
#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h"
#include "PWGEM/PhotonMeson/Core/PairCut.h"
#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h"

#include <TString.h>

#include <fairlogger/Logger.h>

#include <cstddef>
#include <regex>
#include <sstream>
#include <string>
#include <vector>
#include <regex>
#include "PWGEM/PhotonMeson/Core/CutsLibrary.h"

//_______________________________________________
int customAtoi(const std::string& str)
Expand Down Expand Up @@ -511,12 +527,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName)
cut->SetM02Range(0.1f, 0.7f);
cut->SetTimeRange(-20.f, 25.f);

cut->SetTrackMatchingEta([](float pT) {
return 0.01f + pow(pT + 4.07f, -2.5f);
});
cut->SetTrackMatchingPhi([](float pT) {
return 0.015f + pow(pT + 3.65f, -2.f);
});
cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
cut->SetMinEoverP(1.75f);
cut->SetUseExoticCut(true);
return cut;
Expand All @@ -527,12 +541,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName)
cut->SetM02Range(0.0f, 1000.f);
cut->SetTimeRange(-500.f, 500.f);

cut->SetTrackMatchingEta([](float /*pT*/) {
return -1.f;
});
cut->SetTrackMatchingPhi([](float /*pT*/) {
return -1.f;
});
cut->SetTrackMatchingEtaParams(-1.f, 0.f, 0.f);
cut->SetTrackMatchingPhiParams(-1.f, 0.f, 0.f);
cut->SetSecTrackMatchingEtaParams(-1.f, 0.f, 0.f);
cut->SetSecTrackMatchingPhiParams(-1.f, 0.f, 0.f);
cut->SetMinEoverP(0.f);
cut->SetUseExoticCut(false);
return cut;
Expand All @@ -543,12 +555,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName)
cut->SetM02Range(0.1f, 0.7f);
cut->SetTimeRange(-20.f, 25.f);

cut->SetTrackMatchingEta([](float pT) {
return 0.01f + pow(pT + 4.07f, -2.5f);
});
cut->SetTrackMatchingPhi([](float pT) {
return 0.015f + pow(pT + 3.65f, -2.f);
});
cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
cut->SetMinEoverP(1.75f);
cut->SetUseExoticCut(true);
return cut;
Expand Down
38 changes: 20 additions & 18 deletions PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,79 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

//
// Class for EMCal cluster selection
//
/// \file EMCPhotonCut.cxx
/// \brief source of class for emcal photon selection.
/// \author M. Hemmer, marvin.hemmer@cern.ch; N. Strangmann, nicolas.strangmann@cern.ch

#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h"

//
#include "PWGJE/DataModel/EMCALClusters.h"

#include "Framework/Logger.h"
#include <Framework/Logger.h>

#include <Rtypes.h>

#include <functional>
#include <string>

ClassImp(EMCPhotonCut);

const char* EMCPhotonCut::mCutNames[static_cast<int>(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"};
const char* EMCPhotonCut::mCutNames[static_cast<int>(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "SecTrackMatching", "Exotic"};

void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString)
{
mDefinition = static_cast<int>(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString));
LOG(info) << "EMCal Photon Cut, set cluster definition to: " << mDefinition << " (" << clusterDefinitionString << ")";
}

void EMCPhotonCut::SetMinE(float min)
{
mMinE = min;
LOG(info) << "EMCal Photon Cut, set minimum cluster energy: " << mMinE;
}

void EMCPhotonCut::SetMinNCell(int min)
{
mMinNCell = min;
LOG(info) << "EMCal Photon Cut, set minimum number of cells per cluster: " << mMinNCell;
}

void EMCPhotonCut::SetM02Range(float min, float max)
{
mMinM02 = min;
mMaxM02 = max;
LOG(info) << "EMCal Photon Cut, set minimum and maximum M02: " << mMinM02 << " <= M02 <= " << mMaxM02;
}

void EMCPhotonCut::SetTimeRange(float min, float max)
{
mMinTime = min;
mMaxTime = max;
LOG(info) << "EMCal Photon Cut, set cluster time range in ns: " << mMinTime << " <= t <= " << mMaxTime;
}
void EMCPhotonCut::SetTrackMatchingEta(std::function<float(float)> funcTM)
{
mTrackMatchingEta = funcTM;
LOG(info) << "EMCal Photon Cut, set max dEta for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingEta(1.4);
}
void EMCPhotonCut::SetTrackMatchingPhi(std::function<float(float)> funcTM)
{
mTrackMatchingPhi = funcTM;
LOG(info) << "EMCal Photon Cut, set max dPhi for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingPhi(1.4);
}

void EMCPhotonCut::SetMinEoverP(float min)
{
mMinEoverP = min;
}

void EMCPhotonCut::SetUseExoticCut(bool flag)
{
mUseExoticCut = flag;
LOG(info) << "EMCal Photon Cut, set usage of exotic cluster cut to: " << mUseExoticCut;
}

void EMCPhotonCut::SetUseTM(bool flag)
{
mUseTM = flag;
LOG(info) << "EM Photon Cluster Cut, using TM cut is set to : " << mUseTM;
}

void EMCPhotonCut::SetUseSecondaryTM(bool flag)
{
mUseSecondaryTM = flag;
LOG(info) << "EM Photon Cluster Cut, using secondary TM cut is set to : " << mUseTM;
}

void EMCPhotonCut::print() const
{
LOG(info) << "EMCal Photon Cut:";
Expand All @@ -100,7 +102,7 @@ void EMCPhotonCut::print() const
case EMCPhotonCuts::kTiming:
LOG(info) << mCutNames[i] << " in [" << mMinTime << ", " << mMaxTime << "]";
break;
// currently unsure how to do this in a nice way
// TODO: find a nice way to print TM cuts
// case EMCPhotonCuts::kTM:
// LOG(info) << mCutNames[i] << " > " << mMinNCrossedRowsOverFindableClustersTPC;
// break;
Expand Down
Loading
Loading