@@ -111,11 +111,13 @@ struct HfTaskCharmHadronsFemtoDream {
111111 Configurable<bool > smearingByOrigin{" smearingByOrigin" , false , " Obtain the smearing matrix differential in the MC origin of particle 1 and particle 2. High memory consumption. Use with care!" };
112112 Configurable<bool > use4D{" use4D" , false , " Enable four dimensional histogramms (to be used only for analysis with high statistics): k* vs multiplicity vs multiplicity percentil vs mT" };
113113 Configurable<bool > useCPR{" useCPR" , false , " Close Pair Rejection" };
114+ Configurable<bool > fillTableWithCharm{" fillTableWithCharm" , true , " Write charm/tracks/collision table only if >=1 charm hadron in this collision" };
114115
115116 // Mixing configurables
116- Configurable<int > mixingBinPolicy{" mixingBinPolicy" , 0 , " Binning policy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both" };
117- Configurable<int > mixingDepth{" mixingDepth" , 5 , " Number of events for mixing" };
118-
117+ struct : ConfigurableGroup {
118+ Configurable<int > mixingBinPolicy{" mixingBinPolicy" , 0 , " Binning policy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both" };
119+ Configurable<int > mixingDepth{" mixingDepth" , 5 , " Number of events for mixing" };
120+ } mixSetting;
119121 // / Event selection
120122 struct : ConfigurableGroup {
121123 std::string prefix = " eventSel" ;
@@ -126,7 +128,7 @@ struct HfTaskCharmHadronsFemtoDream {
126128 } eventSel;
127129
128130 // / Particle 1 (track)
129- Configurable<femtodreamparticle::cutContainerType> cutBitTrack1{" cutBitTrack1" , 5542474 , " Particle 1 (Track) - Selection bit from cutCulator" };
131+ Configurable<femtodreamparticle::cutContainerType> cutBitTrack1{" cutBitTrack1" , 8188 , " Particle 1 (Track) - Selection bit from cutCulator" };
130132 Configurable<int > pdgCodeTrack1{" pdgCodeTrack1" , 2212 , " PDG code of Particle 1 (Track)" };
131133 Configurable<float > pidThresTrack1{" pidThresTrack1" , 0.75 , " Momentum threshold for PID selection for particle 1 (Track)" };
132134 Configurable<femtodreamparticle::cutContainerType> tpcBitTrack1{" tpcBitTrack1" , 4 , " PID TPC bit from cutCulator for particle 1 (Track)" };
@@ -441,7 +443,7 @@ struct HfTaskCharmHadronsFemtoDream {
441443 Partition<CollisionType> partitionMaskedCol2 = (aod::femtodreamcollision::bitmaskTrackTwo & bitMask) == bitMask;
442444 partitionMaskedCol2.bindTable (cols);
443445
444- for (auto const & [collision1, collision2] : combinations (soa::CombinationsBlockFullIndexPolicy (policy, mixingDepth. value , -1 , *partitionMaskedCol1.mFiltered , *partitionMaskedCol2.mFiltered ))) {
446+ for (auto const & [collision1, collision2] : combinations (soa::CombinationsBlockFullIndexPolicy (policy, mixSetting. mixingDepth , -1 , *partitionMaskedCol1.mFiltered , *partitionMaskedCol2.mFiltered ))) {
445447 // make sure that tracks in the same events are not mixed
446448 if (collision1.globalIndex () == collision2.globalIndex ()) {
447449 continue ;
@@ -532,39 +534,16 @@ struct HfTaskCharmHadronsFemtoDream {
532534 eventHisto.fillQA (col);
533535 auto sliceTrk1 = partitionTrk1->sliceByCached (aod::femtodreamparticle::fdCollisionId, col.globalIndex (), cache);
534536 auto sliceCharmHad = partitionCharmHadron->sliceByCached (aod::femtodreamparticle::fdCollisionId, col.globalIndex (), cache);
535- int64_t timeStamp = -999 ;
537+ if (fillTableWithCharm.value && sliceCharmHad.size () == 0 ) {
538+ return ;
539+ }
536540
537- // / Filling QA histograms of the all tracks and all charm hadrons before pairing
538- for (auto const & part : sliceTrk1) {
539- allTrackHisto.fillQA <false , true >(part, static_cast <aod::femtodreamparticle::MomentumType>(confTempFitVarMomentum.value ), col.multNtr (), col.multV0M ());
541+ int64_t timeStamp = -999 ;
540542
541- // proton track charge
542- float chargeTrack = 0 .;
543- if ((part.cut () & CutBitChargePositive) == CutBitChargePositive) {
544- chargeTrack = PositiveCharge;
545- } else {
546- chargeTrack = NegativeCharge;
547- }
548- timeStamp = part.timeStamp ();
549- rowFemtoResultTrk (
550- col.globalIndex (),
551- timeStamp,
552- part.pt (),
553- part.eta (),
554- part.phi (),
555- part.trackId (),
556- chargeTrack,
557- part.tpcNClsFound (),
558- part.tpcNClsFindable (),
559- part.tpcNClsCrossedRows (),
560- part.tpcNSigmaPr (),
561- part.tofNSigmaPr ());
562- }
563543 for (auto const & part : sliceCharmHad) {
564544 float invMass = getCharmHadronMass (part);
565545 registryCharmHadronQa.fill (HIST (" CharmHadronQA/hPtVsMass" ), part.pt (), invMass);
566546 timeStamp = part.timeStamp ();
567-
568547 rowFemtoResultCharm (
569548 col.globalIndex (),
570549 timeStamp,
@@ -581,8 +560,30 @@ struct HfTaskCharmHadronsFemtoDream {
581560 part.bdtFD ());
582561 }
583562
584- if (sliceCharmHad.size () || sliceTrk1.size ()) {
563+ for (auto const & part : sliceTrk1) {
564+ allTrackHisto.fillQA <false , true >(part,
565+ static_cast <aod::femtodreamparticle::MomentumType>(confTempFitVarMomentum.value ),
566+ col.multNtr (), col.multV0M ());
585567
568+ float chargeTrack = ((part.cut () & CutBitChargePositive) == CutBitChargePositive)
569+ ? PositiveCharge
570+ : NegativeCharge;
571+ timeStamp = part.timeStamp ();
572+ rowFemtoResultTrk (
573+ col.globalIndex (),
574+ timeStamp,
575+ part.pt (),
576+ part.eta (),
577+ part.phi (),
578+ part.trackId (),
579+ chargeTrack,
580+ part.tpcNClsFound (),
581+ part.tpcNClsFindable (),
582+ part.tpcNClsCrossedRows (),
583+ part.tpcNSigmaPr (),
584+ part.tofNSigmaPr ());
585+ }
586+ if (!sliceCharmHad.size () || !sliceTrk1.size ()) {
586587 rowFemtoResultColl (
587588 col.globalIndex (),
588589 timeStamp,
@@ -591,7 +592,6 @@ struct HfTaskCharmHadronsFemtoDream {
591592 } else {
592593 return ;
593594 }
594-
595595 doSameEvent<false >(sliceTrk1, sliceCharmHad, parts, col);
596596 }
597597 PROCESS_SWITCH (HfTaskCharmHadronsFemtoDream, processSameEvent, " Enable processing same event" , false );
@@ -600,7 +600,7 @@ struct HfTaskCharmHadronsFemtoDream {
600600 FilteredFDParticles const & parts,
601601 FilteredCharmCands const &)
602602 {
603- switch (mixingBinPolicy. value ) {
603+ switch (mixSetting. mixingBinPolicy ) {
604604 case femtodreamcollision::kMult :
605605 doMixedEvent<false >(cols, parts, partitionTrk1, partitionCharmHadron, colBinningMult);
606606 break ;
@@ -656,7 +656,7 @@ struct HfTaskCharmHadronsFemtoDream {
656656 o2::aod::FDExtMCParticles const &,
657657 FilteredCharmMcCands const &)
658658 {
659- switch (mixingBinPolicy. value ) {
659+ switch (mixSetting. mixingBinPolicy ) {
660660 case femtodreamcollision::kMult :
661661 doMixedEvent<true >(cols, parts, partitionMcTrk1, partitionMcCharmHadron, colBinningMult);
662662 break ;
0 commit comments