Skip to content

Commit b8c9784

Browse files
committed
[PWGEM,PhotonMeson] Clean up clang-tidy errors, Add secondary track matching for EMCal
- Remove unused mesonTables header file - Fix `abs()` function calls using integer version istead of float - Fix missing includes - Fix uninitialized field in `HNMUtilities.h` in `GammaGammaPair` - Add secondary track matching to skimmerGammaCalo, usuable with spacial process function - Add version 001 of `SkimEMCClusters_001` to enable storage of matched secondary tracks - Add converter for `SkimEMCClusters_000` -> `SkimEMCClusters_001` - Add secondary track matching cut into the EMCPhotonCut library - Remove std::function from EMCPhotonCut for easier, more readable and faster code - Adapted changes of EMCPhotonCut library in all tasks where it is used - Add FV0A as possible QVector in EMCal Pi0 Flow task
1 parent 4f11e57 commit b8c9784

22 files changed

+583
-374
lines changed

PWGEM/PhotonMeson/Core/CutsLibrary.cxx

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,28 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// Contact: daiki.sekihata@cern.ch
13-
//
12+
/// \file CutsLibrary.cxx
13+
/// \brief Source of class for EM photon selection.
14+
/// \author daiki.sekihata@cern.ch
15+
16+
#include "PWGEM/PhotonMeson/Core/CutsLibrary.h"
17+
18+
#include "PWGEM/PhotonMeson/Core/DalitzEECut.h"
19+
#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h"
20+
#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h"
21+
#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h"
22+
#include "PWGEM/PhotonMeson/Core/PairCut.h"
23+
#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h"
24+
25+
#include <TString.h>
26+
27+
#include <fairlogger/Logger.h>
28+
29+
#include <cstddef>
30+
#include <regex>
31+
#include <sstream>
1432
#include <string>
1533
#include <vector>
16-
#include <regex>
17-
#include "PWGEM/PhotonMeson/Core/CutsLibrary.h"
1834

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

514-
cut->SetTrackMatchingEta([](float pT) {
515-
return 0.01f + pow(pT + 4.07f, -2.5f);
516-
});
517-
cut->SetTrackMatchingPhi([](float pT) {
518-
return 0.015f + pow(pT + 3.65f, -2.f);
519-
});
530+
cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
531+
cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
532+
cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
533+
cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
520534
cut->SetMinEoverP(1.75f);
521535
cut->SetUseExoticCut(true);
522536
return cut;
@@ -527,12 +541,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName)
527541
cut->SetM02Range(0.0f, 1000.f);
528542
cut->SetTimeRange(-500.f, 500.f);
529543

530-
cut->SetTrackMatchingEta([](float /*pT*/) {
531-
return -1.f;
532-
});
533-
cut->SetTrackMatchingPhi([](float /*pT*/) {
534-
return -1.f;
535-
});
544+
cut->SetTrackMatchingEtaParams(-1.f, 0.f, 0.f);
545+
cut->SetTrackMatchingPhiParams(-1.f, 0.f, 0.f);
546+
cut->SetSecTrackMatchingEtaParams(-1.f, 0.f, 0.f);
547+
cut->SetSecTrackMatchingPhiParams(-1.f, 0.f, 0.f);
536548
cut->SetMinEoverP(0.f);
537549
cut->SetUseExoticCut(false);
538550
return cut;
@@ -543,12 +555,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName)
543555
cut->SetM02Range(0.1f, 0.7f);
544556
cut->SetTimeRange(-20.f, 25.f);
545557

546-
cut->SetTrackMatchingEta([](float pT) {
547-
return 0.01f + pow(pT + 4.07f, -2.5f);
548-
});
549-
cut->SetTrackMatchingPhi([](float pT) {
550-
return 0.015f + pow(pT + 3.65f, -2.f);
551-
});
558+
cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
559+
cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
560+
cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f);
561+
cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f);
552562
cut->SetMinEoverP(1.75f);
553563
cut->SetUseExoticCut(true);
554564
return cut;

PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,79 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

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

1616
#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h"
17-
17+
//
1818
#include "PWGJE/DataModel/EMCALClusters.h"
1919

20-
#include "Framework/Logger.h"
20+
#include <Framework/Logger.h>
2121

2222
#include <Rtypes.h>
2323

24-
#include <functional>
2524
#include <string>
2625

2726
ClassImp(EMCPhotonCut);
2827

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

3130
void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString)
3231
{
3332
mDefinition = static_cast<int>(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString));
3433
LOG(info) << "EMCal Photon Cut, set cluster definition to: " << mDefinition << " (" << clusterDefinitionString << ")";
3534
}
35+
3636
void EMCPhotonCut::SetMinE(float min)
3737
{
3838
mMinE = min;
3939
LOG(info) << "EMCal Photon Cut, set minimum cluster energy: " << mMinE;
4040
}
41+
4142
void EMCPhotonCut::SetMinNCell(int min)
4243
{
4344
mMinNCell = min;
4445
LOG(info) << "EMCal Photon Cut, set minimum number of cells per cluster: " << mMinNCell;
4546
}
47+
4648
void EMCPhotonCut::SetM02Range(float min, float max)
4749
{
4850
mMinM02 = min;
4951
mMaxM02 = max;
5052
LOG(info) << "EMCal Photon Cut, set minimum and maximum M02: " << mMinM02 << " <= M02 <= " << mMaxM02;
5153
}
54+
5255
void EMCPhotonCut::SetTimeRange(float min, float max)
5356
{
5457
mMinTime = min;
5558
mMaxTime = max;
5659
LOG(info) << "EMCal Photon Cut, set cluster time range in ns: " << mMinTime << " <= t <= " << mMaxTime;
5760
}
58-
void EMCPhotonCut::SetTrackMatchingEta(std::function<float(float)> funcTM)
59-
{
60-
mTrackMatchingEta = funcTM;
61-
LOG(info) << "EMCal Photon Cut, set max dEta for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingEta(1.4);
62-
}
63-
void EMCPhotonCut::SetTrackMatchingPhi(std::function<float(float)> funcTM)
64-
{
65-
mTrackMatchingPhi = funcTM;
66-
LOG(info) << "EMCal Photon Cut, set max dPhi for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingPhi(1.4);
67-
}
61+
6862
void EMCPhotonCut::SetMinEoverP(float min)
6963
{
7064
mMinEoverP = min;
7165
}
66+
7267
void EMCPhotonCut::SetUseExoticCut(bool flag)
7368
{
7469
mUseExoticCut = flag;
7570
LOG(info) << "EMCal Photon Cut, set usage of exotic cluster cut to: " << mUseExoticCut;
7671
}
72+
7773
void EMCPhotonCut::SetUseTM(bool flag)
7874
{
7975
mUseTM = flag;
8076
LOG(info) << "EM Photon Cluster Cut, using TM cut is set to : " << mUseTM;
8177
}
8278

79+
void EMCPhotonCut::SetUseSecondaryTM(bool flag)
80+
{
81+
mUseSecondaryTM = flag;
82+
LOG(info) << "EM Photon Cluster Cut, using secondary TM cut is set to : " << mUseTM;
83+
}
84+
8385
void EMCPhotonCut::print() const
8486
{
8587
LOG(info) << "EMCal Photon Cut:";
@@ -100,7 +102,7 @@ void EMCPhotonCut::print() const
100102
case EMCPhotonCuts::kTiming:
101103
LOG(info) << mCutNames[i] << " in [" << mMinTime << ", " << mMaxTime << "]";
102104
break;
103-
// currently unsure how to do this in a nice way
105+
// TODO: find a nice way to print TM cuts
104106
// case EMCPhotonCuts::kTM:
105107
// LOG(info) << mCutNames[i] << " > " << mMinNCrossedRowsOverFindableClustersTPC;
106108
// break;

0 commit comments

Comments
 (0)