Skip to content
Merged
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
95 changes: 45 additions & 50 deletions PWGJE/Tasks/statPromptPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,45 @@
///
/// \author Adrian Fereydon Nassirpour <adrian.fereydon.nassirpour@cern.ch>

#include <CCDB/BasicCCDBManager.h>

#include <iostream>
#include <vector>
#include <string>
#include <optional>

#include <TLorentzVector.h>
#include <TVector2.h>

#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include "PWGJE/Core/FastJetUtilities.h"
#include "PWGJE/Core/JetDerivedDataUtilities.h"
#include "PWGJE/DataModel/EMCALClusters.h"
#include "PWGJE/DataModel/Jet.h"

#include "Common/Core/RecoDecay.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "CommonConstants/PhysicsConstants.h"

#include "PWGJE/Core/FastJetUtilities.h"
#include "PWGJE/Core/JetDerivedDataUtilities.h"
#include "PWGJE/DataModel/Jet.h"
#include "PWGJE/DataModel/EMCALClusters.h"
#include "EMCALBase/Geometry.h"
#include "EMCALCalib/BadChannelMap.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "CommonConstants/PhysicsConstants.h"
#include "CommonDataFormat/InteractionRecord.h"
#include "DataFormatsEMCAL/AnalysisCluster.h"
#include "DataFormatsEMCAL/Cell.h"
#include "DataFormatsEMCAL/Constants.h"
#include "DataFormatsEMCAL/AnalysisCluster.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"

#include "DataFormatsParameters/GRPObject.h"
#include "DetectorsBase/Propagator.h"
#include "EMCALBase/Geometry.h"
#include "EMCALCalib/BadChannelMap.h"
#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include <CCDB/BasicCCDBManager.h>

#include "CommonDataFormat/InteractionRecord.h"
#include <TLorentzVector.h>
#include <TVector2.h>

#include <iostream>

Check failure on line 53 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <optional>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -106,7 +102,7 @@
Configurable<bool> cfgSkimmedTrigger{"cfgSkimmedTrigger", false, "Enables trigger for skimmied datasets (2023 onwards)"};
Configurable<std::string> cfgTriggerMasks{"cfgTriggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"};
Configurable<bool> cfgDebug{"cfgDebug", false, "Enables debug information for local running"};

int trackFilter = -1;
std::vector<int> triggerMaskBits;

Expand Down Expand Up @@ -259,10 +255,10 @@
using jMCClusters = o2::soa::Join<o2::aod::JMcClusterLbs, o2::aod::JClusters, o2::aod::JClusterTracks>;
using jClusters = o2::soa::Join<o2::aod::JClusters, o2::aod::JClusterTracks>;
using jselectedCollisions = soa::Join<aod::JCollisions, aod::JCollisionBCs, aod::JCollisionPIs, aod::EvSels, aod::JEMCCollisionLbs, aod::JMcCollisionLbs>;
using jselectedDataCollisions = soa::Join<aod::JCollisions, aod::JCollisionBCs, aod::JCollisionPIs, aod::EvSels, aod::JEMCCollisionLbs>;
// using jselectedDataCollisions = soa::Join<aod::JCollisions, aod::JCollisionBCs, aod::JCollisionPIs, aod::JCollisionMcInfos, aod::EvSels, aod::JEMCCollisionLbs>;
using jselectedDataCollisions = soa::Join<aod::JCollisions, aod::JCollisionBCs, aod::JCollisionPIs, aod::EvSels, aod::JEMCCollisionLbs>;
// using jselectedDataCollisions = soa::Join<aod::JCollisions, aod::JCollisionBCs, aod::JCollisionPIs, aod::JCollisionMcInfos, aod::EvSels, aod::JEMCCollisionLbs>;
using jfilteredCollisions = soa::Filtered<jselectedCollisions>;
using jfilteredDataCollisions = soa::Filtered<jselectedDataCollisions>;
using jfilteredDataCollisions = soa::Filtered<jselectedDataCollisions>;
using jfilteredMCClusters = soa::Filtered<jMCClusters>;
using jfilteredClusters = soa::Filtered<jClusters>;

Expand Down Expand Up @@ -444,7 +440,7 @@
}
}
histos.fill(HIST("GEN_nEvents"), 0.5);
if (fabs(collision.posZ()) > cfgVtxCut)

Check failure on line 443 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;

if (recocolls.size() <= 0) // not reconstructed
Expand All @@ -452,7 +448,7 @@
for (auto& recocoll : recocolls) { // poorly reconstructed
if (!recocoll.sel8())
return;
if (fabs(recocoll.posZ()) > cfgVtxCut)

Check failure on line 451 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

return;
histos.fill(HIST("GEN_nEvents"), 1.5);
Expand All @@ -470,7 +466,7 @@
continue;
if (std::abs(mcPhoton.eta()) > cfgtrkMaxEta)
continue;
double pdgcode = fabs(mcPhoton.pdgCode());

Check failure on line 469 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (mcPhoton.isPhysicalPrimary()) {
if (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11) {
histos.fill(HIST("GEN_Particle_Pt"), mcPhoton.pt());
Expand All @@ -486,7 +482,7 @@
bool sterntrigger = false;
double sternPt = 0.0;
if (mcPhoton.pt() > cfgMinTrig && mcPhoton.pt() < cfgMaxTrig) {
if (fabs(mcPhoton.eta()) <= cfgtrkMaxEta) {

Check failure on line 485 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
sterntrigger = true;
sternPt = mcPhoton.pt();
}
Expand Down Expand Up @@ -514,7 +510,7 @@
if (mcPhoton.pdgCode() == 22) {
histos.fill(HIST("GEN_True_Photon_Energy"), mcPhoton.e());
if (mcPhoton.pt() > cfgMinTrig && mcPhoton.pt() < cfgMaxTrig) {
if (fabs(mcPhoton.eta()) <= cfgtrkMaxEta) {

Check failure on line 513 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
photontrigger = true;
}
} // check for photon trigger
Expand Down Expand Up @@ -626,7 +622,7 @@
histos.fill(HIST("REC_nEvents"), 0.5);

// required cuts
if (fabs(collision.posZ()) > cfgVtxCut)

Check failure on line 625 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
if (!collision.sel8())
return;
Expand All @@ -639,20 +635,19 @@
}
histos.fill(HIST("REC_nEvents"), 2.5);


if(cfgSkimmedTrigger){
if (cfgSkimmedTrigger) {
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
return;
return;
}
}//JE Software Triggers
} // JE Software Triggers

histos.fill(HIST("REC_nEvents"), 3.5);

double weight = 1;
if (collision.has_mcCollision()) {
weight = collision.mcCollision().weight();
}

bool noTrk = true;
for (auto& track : tracks) {
if (cfgJETracks) {
Expand Down Expand Up @@ -687,7 +682,7 @@
continue;
if (mccluster.energy() > cfgHighClusterE)
continue;
if (fabs(mccluster.eta()) > cfgtrkMaxEta)

Check failure on line 685 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;

histos.fill(HIST("REC_Cluster_QA"), 0.5);
Expand Down Expand Up @@ -762,11 +757,11 @@
double etadiff = mccluster.eta() - ctrack.eta();

if (cfgPtClusterCut) {
if (fabs(etaT - etaC) < (0.010 + pow(ptT + 4.07, -2.5))) {

Check failure on line 760 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
etatrigger = true;
}

if (fabs(TVector2::Phi_mpi_pi(phiT - phiC)) < (0.015 + pow(ptT + 3.65, -2.0))) {

Check failure on line 764 in PWGJE/Tasks/statPromptPhoton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
phitrigger = true;
}
} else {
Expand Down Expand Up @@ -1071,12 +1066,12 @@
}
}
double pthadsum = GetPtHadSum(tracks, track, cfgMinR, cfgMaxR, true, false, true);
histos.fill(HIST("REC_Trigger_V_PtHadSum_Nch"), sternPt, pthadsum,weight);
histos.fill(HIST("REC_Trigger_V_PtHadSum_Nch"), sternPt, pthadsum, weight);
if (sterntrigger) {
bool doStern = true;
double sterncount = 1.0;
while (doStern) {
histos.fill(HIST("REC_Trigger_V_PtHadSum_Stern"), sterncount, pthadsum, (2.0 / sternPt)*weight);
histos.fill(HIST("REC_Trigger_V_PtHadSum_Stern"), sterncount, pthadsum, (2.0 / sternPt) * weight);
if (sterncount < sternPt) {
sterncount++;
} else {
Expand All @@ -1100,9 +1095,9 @@
}
if ((nEventsData + 1) % 10000 == 0) {
std::cout << "Processed Data Events: " << nEventsData << std::endl;
std::cout << "Events Trigger Bit: " << collision.triggerSel() << std::endl;
std::cout << "Trigger Mask Bit: " << triggerMaskBits[0] << std::endl;
std::cout << "Trigger Mask Cfg Line: " << cfgTriggerMasks << std::endl;
std::cout << "Events Trigger Bit: " << collision.triggerSel() << std::endl;
std::cout << "Trigger Mask Bit: " << triggerMaskBits[0] << std::endl;
std::cout << "Trigger Mask Cfg Line: " << cfgTriggerMasks << std::endl;
}
}

Expand All @@ -1122,14 +1117,14 @@

histos.fill(HIST("DATA_nEvents"), 2.5);

if(cfgSkimmedTrigger){
if (cfgSkimmedTrigger) {
if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) {
return;
return;
}
}//JE Software Triggers
} // JE Software Triggers

histos.fill(HIST("DATA_nEvents"), 3.5);

bool noTrk = true;
for (auto& track : tracks) {

Expand Down
Loading