-
Notifications
You must be signed in to change notification settings - Fork 682
[PWGJE] adding optional phi exclusion zone to jet finders #17638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
5baf289
bdaf24f
30aba7f
cb528f2
e30891d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,8 @@ class JetFinder | |
|
|
||
| float phiMin = -1. * M_PI; | ||
| float phiMax = 2. * M_PI; | ||
| float phiExclusionMin = 999.; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here also you could swap the min and max |
||
| float phiExclusionMax = -999.; | ||
| float etaMin = -.9; | ||
| float etaMax = .9; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| #include <fastjet/PseudoJet.hh> | ||
|
|
||
| #include <memory> | ||
| #include <stdexcept> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -71,6 +72,8 @@ | |
| o2::framework::Configurable<float> trackEtaMax{"trackEtaMax", 0.9, "maximum track eta"}; | ||
| o2::framework::Configurable<float> trackPhiMin{"trackPhiMin", -999, "minimum track phi"}; | ||
| o2::framework::Configurable<float> trackPhiMax{"trackPhiMax", 999, "maximum track phi"}; | ||
| o2::framework::Configurable<float> phiExclusionMin{"phiExclusionMin", 999, "minimum of phi exclusion region which is applied for tracks and for jets (jetR is added to the exclusion region for jets)"}; | ||
| o2::framework::Configurable<float> phiExclusionMax{"phiExclusionMax", -999, "maximum of phi exclusion region which is applied for tracks and for jets (jetR is added to the exclusion region for jets)"}; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arent the positive and negative the opposite way around?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or if its because you want to use the min < max inequality?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. positive and negative have to be swapped like this, because we want that if default values are used that nothing gets rejected, where we in particular by default only select tracks smalles than phiMinExclusion and larger than phiMaxExclusion
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or you can add an else after the condition you added in the init which then swaps them. This way it might be easier for the user? |
||
| o2::framework::Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections"}; | ||
| o2::framework::Configurable<std::string> particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"}; | ||
|
|
||
|
|
@@ -102,7 +105,7 @@ | |
| o2::framework::Configurable<int> jetRecombScheme{"jetRecombScheme", 0, "jet recombination scheme. 0 = E-scheme, 1 = pT-scheme, 2 = pT2-scheme"}; | ||
| o2::framework::Configurable<float> jetGhostArea{"jetGhostArea", 0.005, "jet ghost area"}; | ||
| o2::framework::Configurable<int> ghostRepeat{"ghostRepeat", 1, "set to 0 to gain speed if you dont need area calculation"}; | ||
| o2::framework::Configurable<bool> DoTriggering{"DoTriggering", false, "used for the charged jet trigger to remove the eta constraint on the jet axis"}; | ||
|
Check failure on line 108 in PWGJE/JetFinders/jetFinder.h
|
||
| o2::framework::Configurable<float> jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; | ||
| o2::framework::Configurable<int> jetPtBinWidth{"jetPtBinWidth", 5, "used to define the width of the jetPt bins for the THnSparse"}; | ||
| o2::framework::Configurable<bool> fillTHnSparse{"fillTHnSparse", false, "switch to fill the THnSparse"}; | ||
|
|
@@ -135,19 +138,28 @@ | |
| jetFinder.etaMax = trackEtaMax; | ||
| jetFinder.phiMin = trackPhiMin; | ||
| jetFinder.phiMax = trackPhiMax; | ||
| if (trackPhiMin < -98.0) { | ||
| jetFinder.phiMin = -1.0 * M_PI; | ||
| jetFinder.phiMax = 2.0 * M_PI; | ||
| } | ||
|
|
||
| if (phiExclusionMin < 998.0) { | ||
| jetFinder.phiExclusionMin = phiExclusionMin; | ||
| jetFinder.phiExclusionMax = phiExclusionMax; | ||
| if (phiExclusionMin >= phiExclusionMax) { | ||
| throw std::runtime_error("Invalid phi exclusion range: require phiExclusionMin < phiExclusionMax when both are set."); | ||
| } | ||
| } | ||
|
|
||
| jetFinder.jetPhiMin = jetPhiMin; | ||
| jetFinder.jetPhiMax = jetPhiMax; | ||
| if (jetPhiMin < -98.0) { | ||
| jetFinder.jetPhiMin = -1.0 * M_PI; | ||
| jetFinder.jetPhiMax = 2.0 * M_PI; | ||
| } | ||
| jetFinder.jetEtaMin = jetEtaMin; | ||
| jetFinder.jetEtaMax = jetEtaMax; | ||
| if (jetEtaMin < -98.0) { | ||
| jetFinder.jetEtaDefault = true; | ||
| } | ||
|
|
||
|
|
@@ -184,8 +196,8 @@ | |
|
|
||
| o2::framework::expressions::Filter collisionFilter = (nabs(o2::aod::jcollision::posZ) < vertexZCut && o2::aod::jcollision::centFT0M >= centralityMin && o2::aod::jcollision::centFT0M < centralityMax && o2::aod::jcollision::trackOccupancyInTimeRange <= trackOccupancyInTimeRangeMax); // should we add a posZ vtx cut here or leave it to analysers? | ||
| o2::framework::expressions::Filter mcCollisionFilter = (nabs(o2::aod::jmccollision::posZ) < vertexZCut); | ||
| o2::framework::expressions::Filter trackCuts = (o2::aod::jtrack::pt >= trackPtMin && o2::aod::jtrack::pt < trackPtMax && o2::aod::jtrack::eta >= trackEtaMin && o2::aod::jtrack::eta <= trackEtaMax && o2::aod::jtrack::phi >= trackPhiMin && o2::aod::jtrack::phi <= trackPhiMax); // do we need eta cut both here and in globalselection? | ||
| o2::framework::expressions::Filter partCuts = (o2::aod::jmcparticle::pt >= trackPtMin && o2::aod::jmcparticle::pt < trackPtMax && o2::aod::jmcparticle::eta >= trackEtaMin && o2::aod::jmcparticle::eta <= trackEtaMax && o2::aod::jmcparticle::phi >= trackPhiMin && o2::aod::jmcparticle::phi <= trackPhiMax); | ||
| o2::framework::expressions::Filter trackCuts = (o2::aod::jtrack::pt >= trackPtMin && o2::aod::jtrack::pt < trackPtMax && o2::aod::jtrack::eta >= trackEtaMin && o2::aod::jtrack::eta <= trackEtaMax && o2::aod::jtrack::phi >= trackPhiMin && o2::aod::jtrack::phi <= trackPhiMax && (o2::aod::jtrack::phi <= phiExclusionMin || o2::aod::jtrack::phi >= phiExclusionMax)); // do we need eta cut both here and in globalselection? | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont these overwrite the other ones? lets say if the other one is set to the EMCAL phi acceptance does it mean the exclusion one has to be as well?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for default configurables, the last part of the added selection always evaluates to true |
||
| o2::framework::expressions::Filter partCuts = (o2::aod::jmcparticle::pt >= trackPtMin && o2::aod::jmcparticle::pt < trackPtMax && o2::aod::jmcparticle::eta >= trackEtaMin && o2::aod::jmcparticle::eta <= trackEtaMax && o2::aod::jmcparticle::phi >= trackPhiMin && o2::aod::jmcparticle::phi <= trackPhiMax && (o2::aod::jmcparticle::phi <= phiExclusionMin || o2::aod::jmcparticle::phi >= phiExclusionMax)); | ||
| o2::framework::expressions::Filter clusterFilter = (o2::aod::jcluster::eta >= clusterEtaMin && o2::aod::jcluster::eta <= clusterEtaMax && o2::aod::jcluster::phi >= clusterPhiMin && o2::aod::jcluster::phi <= clusterPhiMax && o2::aod::jcluster::energy >= clusterEnergyMin && o2::aod::jcluster::time > clusterTimeMin && o2::aod::jcluster::time < clusterTimeMax && (!clusterRejectExotics || o2::aod::jcluster::isExotic != true)); | ||
|
|
||
| void processChargedJets(o2::soa::Filtered<o2::aod::JetCollisions>::iterator const& collision, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| #include <fastjet/JetDefinition.hh> | ||
| #include <fastjet/PseudoJet.hh> | ||
|
|
||
| #include <stdexcept> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this needed?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is needed to throw a runtime exception for cases where min>max |
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -72,6 +73,8 @@ | |
| o2::framework::Configurable<float> trackEtaMax{"trackEtaMax", 0.9, "maximum track eta"}; | ||
| o2::framework::Configurable<float> trackPhiMin{"trackPhiMin", -999, "minimum track phi"}; | ||
| o2::framework::Configurable<float> trackPhiMax{"trackPhiMax", 999, "maximum track phi"}; | ||
| o2::framework::Configurable<float> phiExclusionMin{"phiExclusionMin", 999, "minimum of phi exclusion region which is applied for tracks and for jets (jetR is added to the exclusion region for jets)"}; | ||
| o2::framework::Configurable<float> phiExclusionMax{"phiExclusionMax", -999, "maximum of phi exclusion region which is applied for tracks and for jets (jetR is added to the exclusion region for jets)"}; | ||
| o2::framework::Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections"}; | ||
| o2::framework::Configurable<std::string> particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"}; | ||
|
|
||
|
|
@@ -142,10 +145,19 @@ | |
| jetFinder.jetPtMax = jetPtMax; | ||
| jetFinder.phiMin = trackPhiMin; | ||
| jetFinder.phiMax = trackPhiMax; | ||
| if (trackPhiMin < -98.0) { | ||
| jetFinder.phiMin = -1.0 * M_PI; | ||
| jetFinder.phiMax = 2.0 * M_PI; | ||
| } | ||
| if (phiExclusionMin != 999.0 && phiExclusionMax != 999.0 && phiExclusionMin >= phiExclusionMax) { | ||
| throw std::runtime_error("Invalid phi exclusion range: require phiExclusionMin < phiExclusionMax when both are set."); | ||
| } | ||
| if (phiExclusionMin < 999.0) { | ||
| jetFinder.phiExclusionMin = phiExclusionMin; | ||
| } | ||
| if (phiExclusionMax > -999.0) { | ||
| jetFinder.phiExclusionMax = phiExclusionMax; | ||
| } | ||
| jetFinder.jetPhiMin = jetPhiMin; | ||
| jetFinder.jetPhiMax = jetPhiMax; | ||
| if (jetPhiMin < -98.0) { | ||
|
|
@@ -186,8 +198,8 @@ | |
|
|
||
| o2::framework::expressions::Filter collisionFilter = (nabs(o2::aod::jcollision::posZ) < vertexZCut && o2::aod::jcollision::centFT0M >= centralityMin && o2::aod::jcollision::centFT0M < centralityMax && o2::aod::jcollision::trackOccupancyInTimeRange <= trackOccupancyInTimeRangeMax); | ||
| o2::framework::expressions::Filter mcCollisionFilter = (nabs(o2::aod::jmccollision::posZ) < vertexZCut); | ||
| o2::framework::expressions::Filter trackCuts = (o2::aod::jtrack::pt >= trackPtMin && o2::aod::jtrack::pt < trackPtMax && o2::aod::jtrack::eta >= trackEtaMin && o2::aod::jtrack::eta <= trackEtaMax && o2::aod::jtrack::phi >= trackPhiMin && o2::aod::jtrack::phi <= trackPhiMax); | ||
| o2::framework::expressions::Filter partCuts = (o2::aod::jmcparticle::pt >= trackPtMin && o2::aod::jmcparticle::pt < trackPtMax && o2::aod::jmcparticle::eta >= trackEtaMin && o2::aod::jmcparticle::eta <= trackEtaMax && o2::aod::jmcparticle::phi >= trackPhiMin && o2::aod::jmcparticle::phi <= trackPhiMax); | ||
| o2::framework::expressions::Filter trackCuts = (o2::aod::jtrack::pt >= trackPtMin && o2::aod::jtrack::pt < trackPtMax && o2::aod::jtrack::eta >= trackEtaMin && o2::aod::jtrack::eta <= trackEtaMax && o2::aod::jtrack::phi >= trackPhiMin && o2::aod::jtrack::phi <= trackPhiMax && (o2::aod::jtrack::phi <= phiExclusionMin || o2::aod::jtrack::phi >= phiExclusionMax)); | ||
| o2::framework::expressions::Filter partCuts = (o2::aod::jmcparticle::pt >= trackPtMin && o2::aod::jmcparticle::pt < trackPtMax && o2::aod::jmcparticle::eta >= trackEtaMin && o2::aod::jmcparticle::eta <= trackEtaMax && o2::aod::jmcparticle::phi >= trackPhiMin && o2::aod::jmcparticle::phi <= trackPhiMax && (o2::aod::jmcparticle::phi <= phiExclusionMin || o2::aod::jmcparticle::phi >= phiExclusionMax)); | ||
| o2::framework::expressions::Filter clusterFilter = (o2::aod::jcluster::definition == static_cast<int>(clusterDefinition) && o2::aod::jcluster::eta >= clusterEtaMin && o2::aod::jcluster::eta <= clusterEtaMax && o2::aod::jcluster::phi >= clusterPhiMin && o2::aod::jcluster::phi <= clusterPhiMax && o2::aod::jcluster::energy >= clusterEnergyMin && o2::aod::jcluster::time > clusterTimeMin && o2::aod::jcluster::time < clusterTimeMax && (!clusterRejectExotics || o2::aod::jcluster::isExotic != true)); | ||
| // o2::framework::expressions::Filter candidateCuts = (o2::aod::hfcand::pt >= candPtMin && o2::aod::hfcand::pt < candPtMax && o2::aod::hfcand::y >= candYMin && o2::aod::hfcand::y < candYMax); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if here you put the min as -999 and max as 999 then you could check
if (phiExclusionMin > -998.0) {
This way the users would know that the correct thing is to make the minimum negative