1717#include < Framework/AnalysisDataModel.h>
1818#include < MathUtils/Utils.h>
1919#include < algorithm>
20+ #define verbosity debug
21+
2022namespace 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
0 commit comments