Skip to content

Commit 68cf462

Browse files
committed
clang
1 parent 8f4460e commit 68cf462

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

PWGLF/Tasks/Strangeness/nonPromptCascade.cxx

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
#include "Math/Vector4D.h"
3939
#include "TDatabasePDG.h"
40+
#include "THnSparse.h"
4041
#include "TParticlePDG.h"
4142
#include "TTree.h"
42-
#include "THnSparse.h"
4343

4444
#include <cmath>
4545
#include <memory>
@@ -189,7 +189,6 @@ struct NonPromptCascadeTask {
189189
using CollisionsWithLabel = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::MultsGlobal>;
190190
using TracksWithLabel = soa::Join<aod::Tracks, aod::McTrackLabels>;
191191

192-
193192
Preslice<TracksExtData> perCollision = aod::track::collisionId;
194193
Preslice<TracksExtMC> perCollisionMC = aod::track::collisionId;
195194

@@ -216,7 +215,7 @@ struct NonPromptCascadeTask {
216215

217216
Configurable<float> cfgMaxMult{"cfgMaxMult", 8000.f, "Upper range of multiplicty histo"};
218217
Configurable<float> cfgMaxMultFV0{"cfgMaxMultFV0", 10000.f, "Upper range of multiplicty FV0 histo"};
219-
Configurable<std::string> cfgPtEdgesdNdeta{ "ptEdges", "0,0.2,0.4,0.6,0.8,1,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4,4.5,5,5.5,6,7,8,10", "Pt bin edges (comma-separated)"};
218+
Configurable<std::string> cfgPtEdgesdNdeta{"ptEdges", "0,0.2,0.4,0.6,0.8,1,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4,4.5,5,5.5,6,7,8,10", "Pt bin edges (comma-separated)"};
220219

221220
Zorro mZorro;
222221
OutputObj<ZorroSummary> mZorroSummary{"ZorroSummary"};
@@ -253,7 +252,7 @@ struct NonPromptCascadeTask {
253252
}
254253
}
255254

256-
void init(InitContext & context)
255+
void init(InitContext& context)
257256
{
258257
mZorroSummary.setObject(mZorro.getZorroSummary());
259258
mCCDB->setURL(ccdbUrl);
@@ -291,11 +290,11 @@ struct NonPromptCascadeTask {
291290
std::vector<double> trackBinning;
292291
std::vector<double> runsBinning;
293292
double cent = -0.0;
294-
while(cent < 100) {
295-
if(cent < 0.1) {
293+
while (cent < 100) {
294+
if (cent < 0.1) {
296295
centBinning.push_back(cent);
297296
cent += 0.01;
298-
} else if(cent < 1) {
297+
} else if (cent < 1) {
299298
centBinning.push_back(cent);
300299
cent += 0.1;
301300
} else {
@@ -304,17 +303,17 @@ struct NonPromptCascadeTask {
304303
}
305304
}
306305
double ntracks = 0;
307-
while(ntracks < 100) {
306+
while (ntracks < 100) {
308307
trackBinning.push_back(ntracks);
309308
ntracks++;
310309
}
311310
double run = 550367 - 0.5;
312-
for(int i = 0; i < 9000; i++) {
311+
for (int i = 0; i < 9000; i++) {
313312
runsBinning.push_back(run);
314313
run++;
315314
}
316315
AxisSpec centAxis{centBinning, "Centrality (%)"};
317-
//AxisSpec multAxis{multBinning, "Multiplicity"};
316+
// AxisSpec multAxis{multBinning, "Multiplicity"};
318317
AxisSpec trackAxisMC{trackBinning, "NTracks MC"};
319318
AxisSpec trackAxis{trackBinning, "NTracks Global Reco"};
320319
AxisSpec runsAxis{runsBinning, "Run Number"};
@@ -323,14 +322,14 @@ struct NonPromptCascadeTask {
323322
//
324323
// dN/deta
325324
//
326-
bool runMCdNdeta = context.options().get<bool>("processdNdetaMC");
327-
//std::cout << "runMCdNdeta: " << runMCdNdeta << std::endl;
328-
if(runMCdNdeta) {
325+
bool runMCdNdeta = context.options().get<bool>("processdNdetaMC");
326+
// std::cout << "runMCdNdeta: " << runMCdNdeta << std::endl;
327+
if (runMCdNdeta) {
329328
std::vector<double> ptBins;
330329
std::vector<std::string> tokens = o2::utils::Str::tokenize(cfgPtEdgesdNdeta, ',');
331-
for(auto const& pts: tokens){
330+
for (auto const& pts : tokens) {
332331
double pt = 0;
333-
try{
332+
try {
334333
pt = std::stof(pts);
335334
} catch (...) {
336335
LOG(error) << "Wrong cfgPtEdgesdNdeta string:" << cfgPtEdgesdNdeta << std::endl;
@@ -811,8 +810,8 @@ struct NonPromptCascadeTask {
811810
}
812811
accept = accept && (q != 0);
813812
if (accept) {
814-
++mult;
815-
ptMCvec.push_back(mcp.pt());
813+
++mult;
814+
ptMCvec.push_back(mcp.pt());
816815
}
817816
}
818817
}
@@ -834,28 +833,28 @@ struct NonPromptCascadeTask {
834833
std::vector<int> isReco(mcParticles.size(), 0);
835834
std::vector<int> isRecoMult(mcParticles.size(), 0);
836835
std::vector<int> mcReconstructed(mcCollisions.size(), 0);
837-
//std::cout << " reco cols with mc:" << colls.size() << " tracks:" << tracks.size() << " mccols:" << mcCollisions.size() << "mcParticles:" << mcParticles.size() << std::endl;
836+
// std::cout << " reco cols with mc:" << colls.size() << " tracks:" << tracks.size() << " mccols:" << mcCollisions.size() << "mcParticles:" << mcParticles.size() << std::endl;
838837
for (auto const& col : colls) {
839838
int mcCollId = col.mcCollisionId(); // col.template mcCollision_as<aod::McCollisions>();
840-
int collId = col.globalIndex();
841-
//auto mc = col.mcCollision();
842-
//int mcId = mc.globalIndex();
843-
//std::cout << "globalIndex:" << mcId << " colID:" << mcCollId << std::endl;
839+
int collId = col.globalIndex();
840+
// auto mc = col.mcCollision();
841+
// int mcId = mc.globalIndex();
842+
// std::cout << "globalIndex:" << mcId << " colID:" << mcCollId << std::endl;
844843
std::vector<float> mcptvec;
845844
float mult = getMCMult(mcParticles, mcCollId, mcptvec);
846845
mcReconstructed[mcCollId] = 1;
847846
for (auto const& trk : tracks) {
848-
int mcPid = trk.mcParticleId(); // depends on your label table
847+
int mcPid = trk.mcParticleId(); // depends on your label table
849848
if (mcPid >= 0 && mcPid < (int)mcParticles.size()) {
850-
isReco[mcPid] = 1;
851-
isRecoMult[mcPid] = mult;
849+
isReco[mcPid] = 1;
850+
isRecoMult[mcPid] = mult;
852851
} else {
853852
continue;
854853
}
855854
if (trk.collisionId() != collId) {
856855
continue; // different event
857856
}
858-
auto mcPar = mcParticles.rawIteratorAt(mcPid);
857+
auto mcPar = mcParticles.rawIteratorAt(mcPid);
859858
// Apply same acceptance as in MC multiplicity
860859
if (!mcPar.isPhysicalPrimary()) {
861860
continue;
@@ -868,37 +867,36 @@ struct NonPromptCascadeTask {
868867
if (pdgEntry) {
869868
q = int(std::round(pdgEntry->Charge() / 3.0));
870869
}
871-
if(q == 0) {
870+
if (q == 0) {
872871
continue;
873872
}
874-
//float multReco = recoMult[collId];
873+
// float multReco = recoMult[collId];
875874
float multReco = col.multNTracksGlobal();
876875
float ptReco = trk.pt();
877-
float ptMC = mcPar.pt();
876+
float ptMC = mcPar.pt();
878877
mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRM"), mult, multReco, ptMC, ptReco);
879-
880878
}
881879

882-
//mRegistry.fill(HIST("hNTracksMCVsTracksReco"), mult, col.multNTracksGlobal());
880+
// mRegistry.fill(HIST("hNTracksMCVsTracksReco"), mult, col.multNTracksGlobal());
883881
}
884882
// count mc particles with no reco tracks
885883
for (auto const& mcp : mcParticles) {
886884
int mcPidG = mcp.globalIndex();
887-
//std::cout << "mcPidG:" << mcPidG << std::endl;
885+
// std::cout << "mcPidG:" << mcPidG << std::endl;
888886
if (!isReco[mcPidG]) {
889887
mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRMNotInRecoTrk"), isRecoMult[mcPidG], mcp.pt());
890888
}
891889
}
892890
// count unreconstructed mc collisions
893891
for (auto const& mc : mcCollisions) {
894892
int gindex = mc.globalIndex();
895-
//std::cout << "mc globalIndex:" << gindex << std::endl;
893+
// std::cout << "mc globalIndex:" << gindex << std::endl;
896894
if (!mcReconstructed[gindex]) {
897895
std::vector<float> mcptvec;
898896
int mult = getMCMult(mcParticles, gindex, mcptvec);
899-
//std::cout << "===> unreconstructed:" << mult << std::endl;
900-
for(auto const& pt: mcptvec){
901-
mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRMNotInRecoCol"), mult,pt);
897+
// std::cout << "===> unreconstructed:" << mult << std::endl;
898+
for (auto const& pt : mcptvec) {
899+
mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRMNotInRecoCol"), mult, pt);
902900
}
903901
}
904902
}

0 commit comments

Comments
 (0)