Skip to content

Commit

Permalink
Please consider the following formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alibuild committed Oct 25, 2023
1 parent 1daa6e2 commit 5e0e1a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Tutorials/Skimming/derivedBasicConsumer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace o2::framework::expressions;

struct DerivedBasicConsumer {
SliceCache cache;

/// Function to aid in calculating delta-phi
/// \param phi1 first phi value
/// \param phi2 second phi value
Expand Down Expand Up @@ -55,7 +55,7 @@ struct DerivedBasicConsumer {
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Partition<aod::DerivedTracks> triggerTracks = aod::track::pt > minPtTrig;
Partition<aod::DerivedTracks> assocTracks = aod::track::pt > minPtAssoc && aod::track::pt < maxPtAssoc;
Partition<aod::DerivedTracks> assocTracks = aod::track::pt > minPtAssoc&& aod::track::pt < maxPtAssoc;

Preslice<aod::Tracks> perCollision = aod::track::collisionId;

Expand All @@ -64,8 +64,8 @@ struct DerivedBasicConsumer {
// define axes you want to use
const AxisSpec axisCounter{1, 0, +1, ""};
histos.add("eventCounter", "eventCounter", kTH1F, {axisCounter});
// for correlation study

// for correlation study
histos.add("etaHistogramTrigger", "etaHistogramTrigger", kTH1F, {axisEta});
histos.add("etaHistogramAssoc", "etaHistogramAssoc", kTH1F, {axisEta});
histos.add("phiHistogramTrigger", "phiHistogramTrigger", kTH1F, {axisPhi});
Expand All @@ -77,23 +77,23 @@ struct DerivedBasicConsumer {
{
histos.fill(HIST("eventCounter"), 0.5);

//partitions are not grouped by default
// partitions are not grouped by default
auto triggerTracksGrouped = triggerTracks->sliceByCached(aod::exampleTrackSpace::derivedCollisionId, collision.globalIndex(), cache);
auto assocTracksGrouped = assocTracks->sliceByCached(aod::exampleTrackSpace::derivedCollisionId, collision.globalIndex(), cache);

//Inspect the trigger and associated populations
for (auto& track : triggerTracksGrouped) { //<- only for a subset
// Inspect the trigger and associated populations
for (auto& track : triggerTracksGrouped) { //<- only for a subset
histos.get<TH1>(HIST("etaHistogramTrigger"))->Fill(track.eta()); //<- this should show the selection
histos.get<TH1>(HIST("ptHistogramTrigger"))->Fill(track.pt());
}
for (auto& track : assocTracksGrouped) { //<- only for a subset
for (auto& track : assocTracksGrouped) { //<- only for a subset
histos.get<TH1>(HIST("etaHistogramAssoc"))->Fill(track.eta()); //<- this should show the selection
histos.get<TH1>(HIST("ptHistogramAssoc"))->Fill(track.pt());
}

//Now we do two-particle correlations, using "combinations"
// Now we do two-particle correlations, using "combinations"
for (auto& [trackTrigger, trackAssoc] : combinations(o2::soa::CombinationsFullIndexPolicy(triggerTracksGrouped, assocTracksGrouped))) {
histos.get<TH1>(HIST("correlationFunction"))->Fill( ComputeDeltaPhi(trackTrigger.phi(), trackAssoc.phi() ));
histos.get<TH1>(HIST("correlationFunction"))->Fill(ComputeDeltaPhi(trackTrigger.phi(), trackAssoc.phi()));
}
}
};
Expand Down
7 changes: 4 additions & 3 deletions Tutorials/Skimming/derivedBasicProvider.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct DerivedBasicProvider {
// Look at primary tracks only
Filter trackFilter = nabs(aod::track::dcaXY) < 0.2f && nabs(aod::track::eta) < 0.5f && aod::track::pt > minPt;

//This is an example of a convenient declaration of "using"
// This is an example of a convenient declaration of "using"
using myCompleteTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA>;
using myFilteredTracks = soa::Filtered<myCompleteTracks>; // do not forget this!

Expand All @@ -57,9 +57,10 @@ struct DerivedBasicProvider {
histos.fill(HIST("eventCounter"), 0.5);
outputCollisions(collision.posZ());
for (const auto& track : tracks) {
if( track.tpcNClsCrossedRows() < 70 ) continue; //remove badly tracked
if (track.tpcNClsCrossedRows() < 70)
continue; // remove badly tracked
histos.get<TH1>(HIST("ptHistogram"))->Fill(track.pt());
outputTracks( outputCollisions.lastIndex(), track.pt(), track.eta(), track.phi() ); // all that I need for posterior analysis!
outputTracks(outputCollisions.lastIndex(), track.pt(), track.eta(), track.phi()); // all that I need for posterior analysis!
}
}
};
Expand Down

0 comments on commit 5e0e1a5

Please sign in to comment.