Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1e70185
charged jet v2 code
YubiaoWang Jan 14, 2025
793761e
Add files via upload
YubiaoWang Jan 14, 2025
ebb9a6b
Merge branch 'AliceO2Group:master' into master
YubiaoWang Jan 14, 2025
80e8c44
Update jetChargedV2.cxx
YubiaoWang Jan 14, 2025
60b2bd3
Update jetChargedV2.cxx
YubiaoWang Jan 14, 2025
1cb86af
Add files via upload
YubiaoWang Jan 14, 2025
aa51f09
jetChargedV2.cxx
YubiaoWang Jan 14, 2025
ca5a3d6
jetChargedV2.cxx
YubiaoWang Jan 14, 2025
3652c97
jetChargedV2.cxx
YubiaoWang Jan 14, 2025
441925e
jetChargedV2.cxx
YubiaoWang Jan 15, 2025
7ec71ad
Update jetChargedV2.cxx
YubiaoWang Jan 15, 2025
2da6059
Update jetChargedV2.cxx
YubiaoWang Jan 15, 2025
710a318
Update jetChargedV2.cxx
YubiaoWang Jan 15, 2025
f135cac
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
ad7dc80
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
b5decae
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
c32e582
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
3a0970e
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
edce429
Update jetChargedV2.cxx
YubiaoWang Jan 16, 2025
8641428
Update jetChargedV2.cxx
YubiaoWang Jan 17, 2025
56cc00c
Update jetChargedV2.cxx
YubiaoWang Jan 17, 2025
3d6bfc7
Update jetChargedV2.cxx
YubiaoWang Jan 17, 2025
c228936
Update jetChargedV2.cxx
YubiaoWang Jan 17, 2025
cbfb2d3
Merge branch 'AliceO2Group:master' into master
YubiaoWang Jan 17, 2025
4925a9b
Merge branch 'AliceO2Group:master' into master
YubiaoWang Jan 17, 2025
a0a587b
Add files via upload
YubiaoWang Jan 17, 2025
dc82dcb
Update jetChargedV2.cxx
YubiaoWang Jan 18, 2025
6a87789
Please consider the following formatting changes
alibuild Jan 18, 2025
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
20 changes: 4 additions & 16 deletions PWGJE/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ o2physics_add_dpl_workflow(emc-tmmonitor
SOURCES emcTmMonitor.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(hadron-photon-correlation
SOURCES hadronPhotonCorrelation.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(mc-generator-studies
SOURCES mcGeneratorStudies.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
Expand All @@ -48,10 +44,6 @@ o2physics_add_dpl_workflow(photon-isolation-qa
COMPONENT_NAME Analysis)

if(FastJet_FOUND)
o2physics_add_dpl_workflow(jet-background-analysis
SOURCES jetBackgroundAnalysis.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-substructure
SOURCES jetSubstructure.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
Expand Down Expand Up @@ -112,6 +104,10 @@ o2physics_add_dpl_workflow(jet-substructure-bplus
SOURCES jetChargedV2.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-charged-v2ept
SOURCES jetChargedV2EPTable.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-finder-d0-qa
SOURCES jetFinderD0QA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
Expand All @@ -136,10 +132,6 @@ o2physics_add_dpl_workflow(jet-substructure-bplus
SOURCES jetFinderV0QA.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-spectra-charged
SOURCES jetSpectraCharged.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(trigger-correlations
SOURCES triggerCorrelations.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::PWGJECore O2Physics::AnalysisCore
Expand Down Expand Up @@ -180,10 +172,6 @@ o2physics_add_dpl_workflow(jet-substructure-bplus
SOURCES jetHadronRecoil.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(recoil-jets
SOURCES recoilJets.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
o2physics_add_dpl_workflow(jet-nsubjettiness
SOURCES nsubjettiness.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
Expand Down
2 changes: 1 addition & 1 deletion PWGJE/Tasks/jetChargedV2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ struct JetChargedV2 {
fFitModulationV2v3->FixParameter(4, ep3);
}

hPtsumSumptFit->Fit(fFitModulationV2v3, "V+", "ep", 0, o2::constants::math::TwoPI);
hPtsumSumptFit->Fit(fFitModulationV2v3, "Q", "ep", 0, o2::constants::math::TwoPI);

double temppara[5];
temppara[0] = fFitModulationV2v3->GetParameter(0);
Expand Down
224 changes: 224 additions & 0 deletions PWGJE/Tasks/jetChargedV2EPTable.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// jet v2 task
/// \author Yubiao Wang <yubiao.wang@cern.ch>
// C++/ROOT includes.

#include <chrono>
#include <string>
#include <vector>
#include <TComplex.h>
#include <TH3F.h>
#include <cmath>
#include <TRandom3.h>
#include <TF1.h>
#include <algorithm>
#include <unordered_map>
// o2Physics includes.

#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPMagField.h"

#include "Framework/runDataProcessing.h"

#include "Common/DataModel/FT0Corrected.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/CCDB/ctpRateFetcher.h"

//< evt pln .h >//
#include "Framework/ASoAHelpers.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/StaticFor.h"

#include "Common/DataModel/Qvectors.h"
#include "Common/Core/EventPlaneHelper.h"
//< evt pln .h | end >//

// o2 includes.
#include "DetectorsCommonDataFormats/AlignParam.h"

#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/HistogramRegistry.h"

#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"

#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "PWGJE/Core/FastJetUtilities.h"
#include "PWGJE/Core/JetFinder.h"
#include "PWGJE/Core/JetFindingUtilities.h"
#include "PWGJE/DataModel/Jet.h"

#include "PWGJE/Core/JetDerivedDataUtilities.h"
#include "EventFiltering/filterTables.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

namespace o2::aod
{
DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision
o2::soa::Index<>, collision::PosZ);
using MyCollision = MyCollisions::iterator;

namespace myTable
{
DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision);

DECLARE_SOA_COLUMN(Psi2, psi2, Float_t);
DECLARE_SOA_COLUMN(Psi3, psi3, Float_t);
DECLARE_SOA_COLUMN(EvtPlRes, evtplres, Float_t);
} // namespace myTable
DECLARE_SOA_TABLE(MyTable, "AOD", "MYTABLE", o2::soa::Index<>,
myTable::Psi2,
myTable::Psi3,
myTable::EvtPlRes);
} // namespace o2::aod

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct jetChargedV2EPTable {
Produces<o2::aod::MyTable> myTable;
Produces<o2::aod::MyCollision> outputCollisions;

HistogramRegistry registry;

Configurable<std::string> eventSelections{"eventSelections", "sel8", "choose event selection"};
Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections"};

Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"};
Configurable<float> centralityMin{"centralityMin", -999.0, "minimum centrality"};
Configurable<float> centralityMax{"centralityMax", 999.0, "maximum centrality"};
Configurable<float> trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"};
Configurable<float> trackPtMax{"trackPtMax", 1000., "maximum pT acceptance for tracks"};
Configurable<float> trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"};
Configurable<float> trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"};

Configurable<float> jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"};
Configurable<float> leadingConstituentPtMin{"leadingConstituentPtMin", -99.0, "minimum pT selection on jet constituent"};
Configurable<float> jetPtMin{"jetPtMin", 0.15, "minimum pT acceptance for jets"};
Configurable<float> jetPtMax{"jetPtMax", 200.0, "maximum pT acceptance for jets"};

Configurable<int> trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"};
Configurable<int> trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"};

//=====================< evt pln >=====================//
Configurable<bool> cfgAddEvtSel{"cfgAddEvtSel", true, "event selection"};
Configurable<std::vector<int>> cfgnMods{"cfgnMods", {2}, "Modulation of interest"};
Configurable<int> cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvect 56 or number"};
Configurable<std::string> cfgDetName{"cfgDetName", "FT0M", "The name of detector to be analyzed"};
Configurable<std::string> cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"};
Configurable<std::string> cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"};

EventPlaneHelper helperEP;
int DetId;
int RefAId;
int RefBId;

template <typename T>
int GetDetId(const T& name)
{
if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") {
LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value);
}
if (name.value == "FT0C") {
return 0;
} else if (name.value == "FT0A") {
return 1;
} else if (name.value == "FT0M") {
return 2;
} else if (name.value == "FV0A") {
return 3;
} else if (name.value == "TPCpos" || name.value == "BPos") {
return 4;
} else if (name.value == "TPCneg" || name.value == "BNeg") {
return 5;
} else if (name.value == "TPCall" || name.value == "BTot") {
return 6;
} else {
return 0;
}
}
//=====================< evt pln | end >=====================//

Configurable<float> selectedJetsRadius{"selectedJetsRadius", 0.4, "resolution parameter for histograms without radius"};

std::vector<double> jetPtBins;
std::vector<double> jetPtBinsRhoAreaSub;

int eventSelectiont = -1;
int trackSelectiont = -1;

void init(o2::framework::InitContext&)
{
DetId = GetDetId(cfgDetName);
RefAId = GetDetId(cfgRefAName);
RefBId = GetDetId(cfgRefBName);
if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) {
LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems");
DetId = 0;
RefAId = 4;
RefBId = 5;
}
eventSelectiont = jetderiveddatautilities::initialiseEventSelection(static_cast<std::string>(eventSelections));
trackSelectiont = jetderiveddatautilities::initialiseTrackSelection(static_cast<std::string>(trackSelections));
}

Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax);
Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax);

void processJetV2Table(soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos, aod::Qvectors>>::iterator const& collision,
soa::Join<aod::ChargedJets, aod::ChargedJetConstituents> const& jets,
aod::JetTracks const& tracks)
{
if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) {
return;
}
if (!jetderiveddatautilities::selectCollision(collision, eventSelectiont)) {
return;
}
outputCollisions(collision.posZ());
//=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================//
double ep2 = 0;
double ep3 = 0;
double res2 = 0;

for (uint i = 0; i < cfgnMods->size(); i++) {
int nmode = cfgnMods->at(i);
int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2);
if (nmode == 2) {
if (collision.qvecAmp()[DetId] > 1e-8) {
ep2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode);
res2 = helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), nmode);
}
} else if (nmode == 3) {
if (collision.qvecAmp()[DetId] > 1e-8) {
ep3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode);
}
}
}
myTable(ep2, ep3, res2);
LOGF(info, "table producer Psi2 as %f, Psi3 as %f, Res2 as %f", ep2, ep3, res2);
}
PROCESS_SWITCH(jetChargedV2EPTable, processJetV2Table, "Jet V2 table for fit", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<jetChargedV2EPTable>(cfgc, TaskName{"jet-charged-v2ept"})};
}
Loading