Skip to content

Commit 9a61906

Browse files
authored
[PWGJE] First update tagging QA (#4589)
* First update tagging QA * add cmakelist for tagging qa * remove num * add line eof * delete line * add line * remove line * remove comma * remove species number
1 parent f5c45ac commit 9a61906

File tree

4 files changed

+449
-11
lines changed

4 files changed

+449
-11
lines changed

PWGJE/Core/JetTaggingUtilities.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ enum JetTaggingSpecies {
3838

3939
namespace jettaggingutilities
4040
{
41+
const int cmTomum = 10000; // using cm -> #mum for impact parameter (dca)
42+
4143
/**
4244
* returns the globalIndex of the earliest mother of a particle in the shower. returns -1 if a suitable mother is not found
4345
*
@@ -275,6 +277,36 @@ int jetOrigin(T const& jet, U const& particles, float dRMax = 0.25)
275277
return 0;
276278
}
277279

280+
/**
281+
* return geometric sign which is calculated scalar product between jet axis with DCA (track propagated to PV )
282+
* positive and negative value are expected from primary vertex
283+
* positive value is expected from secondary vertex
284+
*
285+
* @param collision which is needed external table of collision due to postion X and Y
286+
* @param jet
287+
* @param track which is needed each DCA_X and Y which is measured in jettaggerhfExtension.cxx
288+
*/
289+
template <typename T, typename U, typename V>
290+
int getGeoSign(T const& collision, U const& jet, V const& track)
291+
{
292+
auto trackPar = getTrackPar(track);
293+
auto xyz = trackPar.getXYZGlo();
294+
auto dcaX = xyz.X() - collision.posX();
295+
auto dcaY = xyz.Y() - collision.posY();
296+
auto sign = TMath::Sign(1, dcaX * jet.px() + dcaY * jet.py() + track.dcaZ() * jet.pz());
297+
if (sign < -1 || sign > 1)
298+
LOGF(info, Form("Sign is %d", sign));
299+
return sign;
300+
}
301+
302+
void calculateDcaXYZ(float& dcaXYZ, float& sigmaDcaXYZ2, float dcaXY, float dcaZ, float cYY, float cZY, float cZZ, float sigmaDcaXY2, float sigmaDcaZ2)
303+
{
304+
dcaXYZ = std::sqrt(dcaXY * dcaXY + dcaZ * dcaZ);
305+
float dFdxy = 2 * dcaXY / dcaXYZ;
306+
float dFdz = 2 * dcaZ / dcaXYZ;
307+
sigmaDcaXYZ2 = std::abs(cYY * dFdxy * dFdxy + cZZ * dFdz * dFdz + 2 * cZY * dFdxy * dFdz);
308+
}
309+
278310
}; // namespace jettaggingutilities
279311

280312
#endif // PWGJE_CORE_JETTAGGINGUTILITIES_H_

PWGJE/TableProducer/jettaggerhf.cxx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// Task to produce a table joinable to the jet tables for hf jet tagging
1313
//
1414
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>
15+
/// \author Hanseo Park <hanseo.park@cern.ch>
1516

1617
#include "Framework/AnalysisTask.h"
1718
#include "Framework/AnalysisDataModel.h"
@@ -34,9 +35,10 @@ struct JetTaggerHFTask {
3435
Produces<JetTaggingTableData> taggingTableData;
3536
Produces<JetTaggingTableMCD> taggingTableMCD;
3637

37-
Configurable<bool> doAlgorithm1{"doAlgorithm1", false, "fill table for algoithm 1"};
38-
Configurable<bool> doAlgorithm2{"doAlgorithm2", false, "fill table for algoithm 2"};
39-
Configurable<bool> doAlgorithm3{"doAlgorithm3", false, "fill table for algoithm 3"};
38+
Configurable<bool> doWShower{"doWShower", false, "find jet origin included gluon spliting"}; // true:: remove gluon spliting
39+
Configurable<bool> doTC{"doTC", false, "fill table for track counting algorithm"};
40+
Configurable<bool> doSV{"doSV", false, "fill table for secondary vertex algorithm"};
41+
Configurable<bool> doML{"doML", false, "fill table for machine learning"};
4042
Configurable<float> maxDeltaR{"maxDeltaR", 0.25, "maximum distance of jet axis from flavour initiating parton"};
4143

4244
void processDummy(JetCollisions const& collision)
@@ -51,9 +53,9 @@ struct JetTaggerHFTask {
5153
int algorithm1 = jet.globalIndex(); // This needs to be changed. It is only done because O2Physics compilation breaks if jet is unused
5254
int algorithm2 = 0;
5355
int algorithm3 = 0;
54-
// if (doAlgorithm1) algorithm1 = jettaggingutilities::Algorithm1((mcdjet, tracks);
55-
// if (doAlgorithm2) algorithm2 = jettaggingutilities::Algorithm2((mcdjet, tracks);
56-
// if (doAlgorithm3) algorithm3 = jettaggingutilities::Algorithm3((mcdjet, tracks);
56+
// if (doTC) algorithm1 = jettaggingutilities::Algorithm1((mcdjet, tracks);
57+
// if (doSV) algorithm2 = jettaggingutilities::Algorithm2((mcdjet, tracks);
58+
// if (doML) algorithm3 = jettaggingutilities::Algorithm3((mcdjet, tracks);
5759
taggingTableData(0, algorithm1, algorithm2, algorithm3);
5860
}
5961
}
@@ -62,14 +64,18 @@ struct JetTaggerHFTask {
6264
void processMCD(JetCollision const& collision, JetTableMCD const& mcdjets, JetTracksMCD const& tracks, JetParticles const& particles)
6365
{
6466
for (auto& mcdjet : mcdjets) {
65-
66-
int origin = jettaggingutilities::mcdJetFromHFShower(mcdjet, tracks, particles, maxDeltaR);
67+
typename JetTracksMCD::iterator hftrack;
68+
int origin = 0;
69+
if (!doWShower)
70+
origin = jettaggingutilities::mcdJetFromHFShower(mcdjet, tracks, particles, maxDeltaR);
71+
else
72+
origin = jettaggingutilities::jetTrackFromHFShower(mcdjet, tracks, particles, hftrack);
6773
int algorithm1 = 0;
6874
int algorithm2 = 0;
6975
int algorithm3 = 0;
70-
// if (doAlgorithm1) algorithm1 = jettaggingutilities::Algorithm1((mcdjet, tracks);
71-
// if (doAlgorithm2) algorithm2 = jettaggingutilities::Algorithm2((mcdjet, tracks);
72-
// if (doAlgorithm3) algorithm3 = jettaggingutilities::Algorithm3((mcdjet, tracks);
76+
// if (doTC) algorithm1 = jettaggingutilities::Algorithm1((mcdjet, tracks);
77+
// if (doSV) algorithm2 = jettaggingutilities::Algorithm2((mcdjet, tracks);
78+
// if (doML) algorithm3 = jettaggingutilities::Algorithm3((mcdjet, tracks);
7379
taggingTableMCD(origin, algorithm1, algorithm2, algorithm3);
7480
}
7581
}

PWGJE/Tasks/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ if(FastJet_FOUND)
112112
SOURCES phiInJets.cxx
113113
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
114114
COMPONENT_NAME Analysis)
115+
o2physics_add_dpl_workflow(jet-taggerhf-qa
116+
SOURCES jettaggerhfQA.cxx
117+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
118+
COMPONENT_NAME Analysis)
115119
o2physics_add_dpl_workflow(jet-lund-reclustering
116120
SOURCES jetLundReclustering.cxx
117121
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib

0 commit comments

Comments
 (0)