Skip to content

Commit fda6a94

Browse files
committed
Hack formatting
1 parent d95865d commit fda6a94

2 files changed

Lines changed: 53 additions & 18 deletions

File tree

Detectors/AOD/src/AODMcProducerHelpers.cxx

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <Framework/AnalysisDataModel.h>
1818
#include <MathUtils/Utils.h>
1919
#include <algorithm>
20+
#define verbosity debug
21+
2022
namespace o2::aodmchelpers
2123
{
2224
//==================================================================
@@ -53,6 +55,8 @@ short updateMCCollisions(const CollisionCursor& cursor,
5355
auto encodedGeneratorId = o2::mcgenid::getEncodedGenId(genId,
5456
sourceId,
5557
subGenId);
58+
59+
LOG(verbosity) << "Updating MC Collisions table w/bcId=" << bcId;
5660
cursor(0,
5761
bcId,
5862
encodedGeneratorId,
@@ -84,6 +88,7 @@ bool updateHepMCXSection(const XSectionCursor& cursor,
8488
return false;
8589
}
8690

91+
LOG(verbosity) << "Updating HepMC cross-section table w/bcId" << collisionID;
8792
cursor(0,
8893
collisionID,
8994
generatorID,
@@ -120,6 +125,7 @@ bool updateHepMCPdfInfo(const PdfInfoCursor& cursor,
120125
return false;
121126
}
122127

128+
LOG(verbosity) << "Updating HepMC PDF table w/bcId" << collisionID;
123129
cursor(0,
124130
collisionID,
125131
generatorID,
@@ -169,6 +175,8 @@ bool updateHepMCHeavyIon(const HeavyIonCursor& cursor,
169175
getEventInfo(header, Key::nSpecTargetNeutron, -1));
170176
int specProtons = (getEventInfo(header, Key::nSpecProjectileProton, -1) +
171177
getEventInfo(header, Key::nSpecTargetProton, -1));
178+
179+
LOG(verbosity) << "Updating HepMC heavy-ion table w/bcId" << collisionID;
172180
cursor(0,
173181
collisionID,
174182
generatorID,
@@ -259,6 +267,14 @@ void updateParticle(const ParticleCursor& cursor,
259267
float vZ = float(track.Vz());
260268
float time = float(track.T());
261269

270+
LOG(verbosity) << "McParticle bcId=" << collisionID << ","
271+
<< "status=" << statusCode << ","
272+
<< "hepmc=" << hepmc << ","
273+
<< "pdg=" << track.GetPdgCode() << ","
274+
<< "nMothers=" << mothers.size() << ","
275+
<< "daughters=" << daughters[0] << ","
276+
<< daughters[1];
277+
262278
cursor(0,
263279
collisionID,
264280
track.GetPdgCode(),
@@ -305,7 +321,7 @@ uint32_t updateParticles(const ParticleCursor& cursor,
305321
return iter->second;
306322
};
307323

308-
LOG(debug) << "Got a total of " << tracks.size();
324+
LOG(verbosity) << "Got a total of " << tracks.size();
309325
for (int trackNo = tracks.size() - 1; trackNo >= 0; trackNo--) {
310326
auto& track = tracks[trackNo];
311327
auto hepmc = getHepMCStatusCode(track.getStatusCode());
@@ -314,7 +330,11 @@ uint32_t updateParticles(const ParticleCursor& cursor,
314330
not track.isPrimary() and
315331
not MCTrackNavigator::isPhysicalPrimary(track, tracks) and
316332
not MCTrackNavigator::isKeepPhysics(track, tracks)) {
317-
LOG(debug) << "Skipping track " << trackNo << " " << hepmc;
333+
LOG(verbosity) << "Skipping track " << trackNo << " " << hepmc << " "
334+
<< mapping(trackNo) << " "
335+
<< track.isPrimary() << " "
336+
<< MCTrackNavigator::isPhysicalPrimary(track, tracks)
337+
<< MCTrackNavigator::isKeepPhysics(track, tracks);
318338
continue;
319339
}
320340
}
@@ -346,7 +366,7 @@ uint32_t updateParticles(const ParticleCursor& cursor,
346366
// Second loop to set indexes. This is needed to be done before
347367
// we actually update the table, because a particle may point to a
348368
// later particle.
349-
LOG(debug) << "Will store " << toStore.size() << " particles";
369+
LOG(verbosity) << "Will store " << toStore.size() << " particles";
350370
size_t index = 0;
351371
for (size_t trackNo = 0U; trackNo < tracks.size(); trackNo++) {
352372
auto storeIt = mapping(trackNo);
@@ -361,7 +381,7 @@ uint32_t updateParticles(const ParticleCursor& cursor,
361381
// Make sure we have the right number
362382
assert(index == toStore.size());
363383

364-
LOG(debug) << "Starting index " << offset << ", last index" << index;
384+
LOG(verbosity) << "Starting index " << offset << ", last index " << index;
365385
// Third loop to actually store the particles in the order given
366386
for (size_t trackNo = 0U; trackNo < tracks.size(); trackNo++) {
367387
auto storeIt = mapping(trackNo);
@@ -382,7 +402,7 @@ uint32_t updateParticles(const ParticleCursor& cursor,
382402
momentumMask,
383403
positionMask);
384404
}
385-
LOG(debug) << "Return new offset " << offset + index;
405+
LOG(verbosity) << "Return new offset " << offset + index;
386406
return offset + index;
387407
}
388408
} // namespace o2::aodmchelpers

Detectors/AOD/src/AODMcProducerWorkflowSpec.cxx

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ void AODMcProducerWorkflowDPL::init(InitContext& ic)
5555
mSimPrefix = ic.options().get<std::string>("mckine-fname");
5656
}
5757
std::string hepmcUpdate = ic.options().get<std::string>("hepmc-update");
58-
HepMCUpdate when = (hepmcUpdate == "never" ? HepMCUpdate::never : hepmcUpdate == "always" ? HepMCUpdate::always
59-
: hepmcUpdate == "all" ? HepMCUpdate::allKeys
60-
: HepMCUpdate::anyKey);
58+
HepMCUpdate when = (hepmcUpdate == "never" //
59+
? HepMCUpdate::never //
60+
: hepmcUpdate == "always" //
61+
? HepMCUpdate::always //
62+
: hepmcUpdate == "all" //
63+
? HepMCUpdate::allKeys //
64+
: HepMCUpdate::anyKey);
6165
mXSectionUpdate = when;
6266
mPdfInfoUpdate = when;
6367
mHeavyIonUpdate = when;
@@ -88,17 +92,26 @@ void AODMcProducerWorkflowDPL::updateHeader(CollisionCursor& collisionCursor,
8892
generatorID,
8993
sourceID,
9094
mCollisionPosition);
91-
mXSectionUpdate = (updateHepMCXSection(xSectionCursor, eventID, genID, header,
92-
mXSectionUpdate)
93-
? HepMCUpdate::always
95+
mXSectionUpdate = (updateHepMCXSection(xSectionCursor, //
96+
eventID, //
97+
genID, //
98+
header, //
99+
mXSectionUpdate) //
100+
? HepMCUpdate::always //
94101
: HepMCUpdate::never);
95-
mPdfInfoUpdate = (updateHepMCPdfInfo(pdfInfoCursor, eventID, genID, header,
96-
mPdfInfoUpdate)
97-
? HepMCUpdate::always
102+
mPdfInfoUpdate = (updateHepMCPdfInfo(pdfInfoCursor, //
103+
eventID, //
104+
genID, //
105+
header, //
106+
mPdfInfoUpdate) //
107+
? HepMCUpdate::always //
98108
: HepMCUpdate::never);
99-
mHeavyIonUpdate = (updateHepMCHeavyIon(heavyIonCursor, eventID, genID, header,
100-
mHeavyIonUpdate)
101-
? HepMCUpdate::always
109+
mHeavyIonUpdate = (updateHepMCHeavyIon(heavyIonCursor, //
110+
eventID, //
111+
genID, //
112+
header, //
113+
mHeavyIonUpdate) //
114+
? HepMCUpdate::always //
102115
: HepMCUpdate::never);
103116
}
104117

@@ -199,7 +212,9 @@ void AODMcProducerWorkflowDPL::run(ProcessingContext& pc)
199212
// Sort the event information
200213
std::sort(eventInfo.begin(), eventInfo.end(),
201214
[](typename EventInfo::const_reference left,
202-
typename EventInfo::const_reference right) { return (std::get<0>(left) < std::get<0>(right)); });
215+
typename EventInfo::const_reference right) { //
216+
return (std::get<0>(left) < std::get<0>(right));
217+
});
203218

204219
// Loop over available events and update the tracks table
205220
size_t offset = 0;

0 commit comments

Comments
 (0)