@@ -70,9 +70,10 @@ bool updateHepMCXSection(const XSectionCursor& cursor,
7070
7171 if (when == HepMCUpdate::never or
7272 (when != HepMCUpdate::always and
73- not hasKeys (header, {Key::acceptedEvents, Key::attemptedEvents, Key::xSection, Key::xSectionError}, when == HepMCUpdate::anyKey)))
73+ not hasKeys (header, {Key::acceptedEvents, Key::attemptedEvents, Key::xSection, Key::xSectionError}, when == HepMCUpdate::anyKey))) {
7474 return false ;
75-
75+ }
76+
7677 cursor (0 ,
7778 collisionID,
7879 generatorID,
@@ -95,9 +96,10 @@ bool updateHepMCPdfInfo(const PdfInfoCursor& cursor,
9596 using Key = o2::dataformats::MCInfoKeys;
9697
9798 if (when == HepMCUpdate::never or
98- (when != HepMCUpdate::always and not hasKeys (header, {Key::pdfParton1Id, Key::pdfParton2Id, Key::pdfCode1, Key::pdfCode2, Key::pdfX1, Key::pdfX2, Key::pdfScale, Key::pdfXF1, Key::pdfXF2}, when == HepMCUpdate::anyKey)))
99+ (when != HepMCUpdate::always and not hasKeys (header, {Key::pdfParton1Id, Key::pdfParton2Id, Key::pdfCode1, Key::pdfCode2, Key::pdfX1, Key::pdfX2, Key::pdfScale, Key::pdfXF1, Key::pdfXF2}, when == HepMCUpdate::anyKey))) {
99100 return false ;
100-
101+ }
102+
101103 cursor (0 ,
102104 collisionID,
103105 generatorID,
@@ -123,9 +125,10 @@ bool updateHepMCHeavyIon(const HeavyIonCursor& cursor,
123125 using Key = dataformats::MCInfoKeys;
124126
125127 if (when == HepMCUpdate::never or
126- (when != HepMCUpdate::always and not hasKeys (header, {Key::nCollHard, Key::nPartProjectile, Key::nPartTarget, Key::nColl, Key::nCollNNWounded, Key::nCollNWoundedN, Key::nCollNWoundedNwounded, Key::nSpecProjectileNeutron, Key::nSpecTargetNeutron, Key::nSpecProjectileProton, Key::nSpecTargetProton, Key::planeAngle, " eccentricity" , Key::sigmaInelNN, Key::centrality}, when == HepMCUpdate::anyKey)))
128+ (when != HepMCUpdate::always and not hasKeys (header, {Key::nCollHard, Key::nPartProjectile, Key::nPartTarget, Key::nColl, Key::nCollNNWounded, Key::nCollNWoundedN, Key::nCollNWoundedNwounded, Key::nSpecProjectileNeutron, Key::nSpecTargetNeutron, Key::nSpecProjectileProton, Key::nSpecTargetProton, Key::planeAngle, " eccentricity" , Key::sigmaInelNN, Key::centrality}, when == HepMCUpdate::anyKey))) {
127129 return false ;
128-
130+ }
131+
129132 int specNeutrons = (getEventInfo (header, Key::nSpecProjectileNeutron, -1 ) +
130133 getEventInfo (header, Key::nSpecTargetNeutron, -1 ));
131134 int specProtons = (getEventInfo (header, Key::nSpecProjectileProton, -1 ) +
@@ -168,8 +171,9 @@ void updateParticle(const ParticleCursor& cursor,
168171
169172 auto mapping = [&toStore](int trackNo) {
170173 auto iter = toStore.find (trackNo);
171- if (iter == toStore.end ())
174+ if (iter == toStore.end ()) {
172175 return -1 ;
176+ }
173177 return iter->second ;
174178 };
175179
@@ -179,30 +183,37 @@ void updateParticle(const ParticleCursor& cursor,
179183 flags = ProducedByTransport;
180184 statusCode = track.getProcess ();
181185 }
182- if (MCTrackNavigator::isPhysicalPrimary (track, tracks))
186+ if (MCTrackNavigator::isPhysicalPrimary (track, tracks)) {
183187 flags = PhysicalPrimary;
184-
188+ }
189+
185190 int daughters[2 ] = {-1 , -1 };
186191 std::vector<int > mothers;
187192 int id;
188- if ((id = mapping (track.getMotherTrackId ())) >= 0 )
193+ if ((id = mapping (track.getMotherTrackId ())) >= 0 ) {
189194 mothers.push_back (id);
190- if ((id = mapping (track.getSecondMotherTrackId ())) >= 0 )
195+ }
196+ if ((id = mapping (track.getSecondMotherTrackId ())) >= 0 ) {
191197 mothers.push_back (id);
192- if ((id = mapping (track.getFirstDaughterTrackId ())) >= 0 )
198+ }
199+ if ((id = mapping (track.getFirstDaughterTrackId ())) >= 0 ) {
193200 daughters[0 ] = id;
194- if ((id = mapping (track.getFirstDaughterTrackId ())) >= 0 )
201+ }
202+ if ((id = mapping (track.getFirstDaughterTrackId ())) >= 0 ) {
195203 daughters[1 ] = id;
196- else
204+ }
205+ else {
197206 daughters[1 ] = daughters[0 ];
207+ }
198208 if (daughters[0 ] < 0 and daughters[1 ] >= 0 ) {
199209 LOG (error) << " Problematic daughters: " << daughters[0 ] << " and "
200210 << daughters[1 ];
201211 daughters[0 ] = daughters[1 ];
202212 }
203- if (daughters[0 ] > daughters[1 ])
213+ if (daughters[0 ] > daughters[1 ]) {
204214 std::swap (daughters[0 ], daughters[1 ]);
205-
215+ }
216+
206217 float weight = track.getWeight ();
207218 float pX = float (track.Px ());
208219 float pY = float (track.Py ());
@@ -253,8 +264,9 @@ uint32_t updateParticles(const ParticleCursor& cursor,
253264 // the table exported.
254265 auto mapping = [&toStore](int trackNo) {
255266 auto iter = toStore.find (trackNo);
256- if (iter == toStore.end ())
267+ if (iter == toStore.end ()) {
257268 return -1 ;
269+ }
258270 return iter->second ;
259271 };
260272
@@ -281,14 +293,18 @@ uint32_t updateParticles(const ParticleCursor& cursor,
281293 // daughters(?) to be stored.
282294 if (filter) {
283295 int id;
284- if ((id = track.getMotherTrackId ()) >= 0 )
296+ if ((id = track.getMotherTrackId ()) >= 0 ) {
285297 toStore[id] = 1 ;
286- if ((id = track.getSecondMotherTrackId ()) >= 0 )
298+ }
299+ if ((id = track.getSecondMotherTrackId ()) >= 0 ) {
287300 toStore[id] = 1 ;
288- if ((id = track.getFirstDaughterTrackId ()) >= 0 )
301+ }
302+ if ((id = track.getFirstDaughterTrackId ()) >= 0 ) {
289303 toStore[id] = 1 ;
290- if ((id = track.getLastDaughterTrackId ()) >= 0 )
304+ }
305+ if ((id = track.getLastDaughterTrackId ()) >= 0 ) {
291306 toStore[id] = 1 ;
307+ }
292308 }
293309 }
294310
@@ -299,8 +315,9 @@ uint32_t updateParticles(const ParticleCursor& cursor,
299315 size_t index = 0 ;
300316 for (size_t trackNo = 0U ; trackNo < tracks.size (); trackNo++) {
301317 auto storeIt = mapping (trackNo);
302- if (storeIt < 0 )
318+ if (storeIt < 0 ) {
303319 continue ;
320+ }
304321
305322 toStore[trackNo] = offset + index;
306323 index++;
@@ -313,9 +330,10 @@ uint32_t updateParticles(const ParticleCursor& cursor,
313330 // Third loop to actually store the particles in the order given
314331 for (size_t trackNo = 0U ; trackNo < tracks.size (); trackNo++) {
315332 auto storeIt = mapping (trackNo);
316- if (storeIt < 0 )
333+ if (storeIt < 0 ) {
317334 continue ;
318-
335+ }
336+
319337 auto & track = tracks[trackNo];
320338 auto hepmc = getHepMCStatusCode (track.getStatusCode ());
321339 uint8_t flags = (background ? FromBackgroundEvent : 0 );
0 commit comments