Skip to content

Commit a5e6740

Browse files
author
ayatsuji
committed
Update analysis task with clang format
1 parent bc2f00c commit a5e6740

2 files changed

Lines changed: 33 additions & 35 deletions

File tree

PWGDQ/Core/VarManager.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include <TObject.h>
6565
#include <TRandom.h>
6666
#include <TString.h>
67+
6768
#include <KFPTrack.h>
6869
#include <KFPVertex.h>
6970
#include <KFParticle.h>
@@ -1362,7 +1363,7 @@ class VarManager : public TObject
13621363
static void FillGlobalMuonRefitCov(T1 const& muontrack, T2 const& mfttrack, const C& collision, C2 const& mftcov, float* values = nullptr);
13631364
template <int pairType, uint32_t fillMap, typename T1, typename T2>
13641365
static void FillPair(T1 const& t1, T2 const& t2, float* values = nullptr);
1365-
template <int pairType, uint32_t fillMap, typename T1, typename T2>
1366+
template <int pairType, uint32_t fillMap, typename T1, typename T2>
13661367
static void FillPairRotation(T1 const& t1, T2 const& t2, float* values = nullptr);
13671368
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2>
13681369
static void FillPairCollision(C const& collision, T1 const& t1, T2 const& t2, float* values = nullptr);
@@ -3712,7 +3713,7 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values)
37123713
}
37133714
}
37143715

3715-
//change_start: rotation pair
3716+
// change_start: rotation pair
37163717
template <int pairType, uint32_t fillMap, typename T1, typename T2>
37173718
void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
37183719
{
@@ -3747,7 +3748,8 @@ void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
37473748
double dphi = gRandom->Uniform(0., 2. * TMath::Pi());
37483749
double rotationphi2 = t2.phi() + dphi;
37493750

3750-
if (rotationphi2 > 2. * TMath::Pi()) rotationphi2 -= 2. * TMath::Pi();
3751+
if (rotationphi2 > 2. * TMath::Pi())
3752+
rotationphi2 -= 2. * TMath::Pi();
37513753

37523754
values[kCharge] = t1.sign() + t2.sign();
37533755
values[kCharge1] = t1.sign();
@@ -3771,10 +3773,8 @@ void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
37713773
values[kPt2] = t2.pt();
37723774
values[kEta2] = t2.eta();
37733775
values[kPhi2] = rotationphi2;
3774-
37753776
}
37763777

3777-
37783778
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2>
37793779
void VarManager::FillPairCollision(const C& collision, T1 const& t1, T2 const& t2, float* values)
37803780
{

PWGDQ/Tasks/tableReader_withAssoc.cxx

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ struct AnalysisSameEventPairing {
14691469

14701470
if (fEnableBarrelHistos) {
14711471
names = {
1472-
//change define histname
1472+
// change define histname
14731473
Form("PairsBarrelSEPM_%s", objArray->At(icut)->GetName()),
14741474
Form("PairsBarrelSEPP_%s", objArray->At(icut)->GetName()),
14751475
Form("PairsBarrelSEMM_%s", objArray->At(icut)->GetName()),
@@ -2131,8 +2131,8 @@ struct AnalysisSameEventPairing {
21312131
}
21322132
} // end loop (cuts)
21332133

2134-
//edit
2135-
//rotation 20 times
2134+
// edit
2135+
// rotation 20 times
21362136
if constexpr (TPairType == VarManager::kDecayToEE) {
21372137
twoTrackFilter = a1.isBarrelSelected_raw() & a2.isBarrelSelected_raw() & a1.isBarrelSelectedPrefilter_raw() & a2.isBarrelSelectedPrefilter_raw() & fTrackFilterMask;
21382138

@@ -2144,8 +2144,6 @@ struct AnalysisSameEventPairing {
21442144
auto t2 = a2.template reducedtrack_as<TTracks>();
21452145
sign1 = t1.sign();
21462146
sign2 = t2.sign();
2147-
// store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter
2148-
// TODO: Make sure that we do not work with more than 28 track bits
21492147
if (t1.barrelAmbiguityInBunch() > 1) {
21502148
twoTrackFilter |= (static_cast<uint32_t>(1) << 28);
21512149
}
@@ -2158,43 +2156,43 @@ struct AnalysisSameEventPairing {
21582156
if (t2.barrelAmbiguityOutOfBunch() > 1) {
21592157
twoTrackFilter |= (static_cast<uint32_t>(1) << 31);
21602158
}
2161-
2162-
for (int icut = 0; icut < ncuts; icut++) {
2163-
if (twoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
2164-
isAmbiInBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 28)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 29));
2165-
isAmbiOutOfBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 30)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31));
2166-
isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch);
2167-
isLeg1Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 28) || (twoTrackFilter & (static_cast<uint32_t>(1) << 30)));
2168-
isLeg2Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 29) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31)));
2169-
if constexpr (TPairType == VarManager::kDecayToEE) {
2170-
if (isLeg1Ambi && isLeg2Ambi) {
2171-
std::pair<uint32_t, uint32_t> iPair(a1.reducedtrackId(), a2.reducedtrackId());
2172-
if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) {
2173-
if (fAmbiguousPairs[iPair] & (static_cast<uint32_t>(1) << icut)) { // if this pair is already stored with this cut
2174-
isAmbiExtra = true;
2159+
2160+
for (int icut = 0; icut < ncuts; icut++) {
2161+
if (twoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
2162+
isAmbiInBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 28)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 29));
2163+
isAmbiOutOfBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 30)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31));
2164+
isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch);
2165+
isLeg1Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 28) || (twoTrackFilter & (static_cast<uint32_t>(1) << 30)));
2166+
isLeg2Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 29) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31)));
2167+
if constexpr (TPairType == VarManager::kDecayToEE) {
2168+
if (isLeg1Ambi && isLeg2Ambi) {
2169+
std::pair<uint32_t, uint32_t> iPair(a1.reducedtrackId(), a2.reducedtrackId());
2170+
if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) {
2171+
if (fAmbiguousPairs[iPair] & (static_cast<uint32_t>(1) << icut)) { // if this pair is already stored with this cut
2172+
isAmbiExtra = true;
2173+
} else {
2174+
fAmbiguousPairs[iPair] |= static_cast<uint32_t>(1) << icut;
2175+
}
21752176
} else {
2176-
fAmbiguousPairs[iPair] |= static_cast<uint32_t>(1) << icut;
2177+
fAmbiguousPairs[iPair] = static_cast<uint32_t>(1) << icut;
21772178
}
2178-
} else {
2179-
fAmbiguousPairs[iPair] = static_cast<uint32_t>(1) << icut;
21802179
}
21812180
}
2182-
}
2183-
if (sign1 * sign2 < 0) {
2184-
for (int i = 0; i < 20; i++) {
2181+
if (sign1 * sign2 < 0) {
2182+
for (int i = 0; i < 20; i++) {
21852183
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2);
21862184
if constexpr (TPairType == VarManager::kDecayToEE) {
2187-
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
2188-
if (isAmbiExtra) {
2189-
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
2185+
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
2186+
if (isAmbiExtra) {
2187+
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), VarManager::fgValues);
2188+
}
21902189
}
21912190
}
21922191
}
21932192
}
21942193
}
21952194
}
2196-
}
2197-
//end
2195+
// end
21982196
} // end loop over pairs of track associations
21992197
VarManager::fgValues[VarManager::kNPairsPerEvent] = fNPairPerEvent;
22002198
if (fEnableBarrelHistos && fConfigQA) {

0 commit comments

Comments
 (0)