@@ -774,13 +774,13 @@ struct PseudorapidityDensityMFT {
774774 }
775775 nChargedCentral++;
776776 }
777-
778- if (nChargedCentral > 0 ) {
779- registry.fill (HIST (" EventEfficiency" ), 2 .);
780- registry.fill (HIST (" EventsNtrkZvtxGen_gt0t" ), nCharged,
781- mcCollision.posZ ());
777+ if ((mcCollision.posZ () >= cfgVzCut1) && (mcCollision.posZ () <= cfgVzCut2)) {
778+ if (nChargedCentral > 0 ) {
779+ registry.fill (HIST (" EventEfficiency" ), 2 .);
780+ registry.fill (HIST (" EventsNtrkZvtxGen_gt0t" ), nCharged,
781+ mcCollision.posZ ());
782+ }
782783 }
783-
784784 // -----------
785785 bool atLeastOne = false ;
786786 bool atLeastOne_gt0 = false ;
@@ -799,24 +799,25 @@ struct PseudorapidityDensityMFT {
799799
800800 auto perCollisionSampleCentral =
801801 midtracks.sliceBy (perColCentral, collision.globalIndex ());
802+ if ((collision.posZ () >= cfgVzCut1) && (collision.posZ () <= cfgVzCut2) && (mcCollision.posZ () >= cfgVzCut1) && (mcCollision.posZ () <= cfgVzCut2)) {
803+ if (perCollisionSampleCentral.size () > 0 ) {
804+ registry.fill (HIST (" EventEfficiency" ), 5 .);
805+ atLeastOne_gt0 = true ;
806+ registry.fill (HIST (" EventsNtrkZvtxGen_gt0" ),
807+ perCollisionSample.size (), collision.posZ ());
808+ }
802809
803- if (perCollisionSampleCentral.size () > 0 ) {
804- registry.fill (HIST (" EventEfficiency" ), 5 .);
805- atLeastOne_gt0 = true ;
806- registry.fill (HIST (" EventsNtrkZvtxGen_gt0" ),
807- perCollisionSample.size (), collision.posZ ());
808- }
809-
810- registry.fill (HIST (" EventsZposDiff" ),
811- collision.posZ () - mcCollision.posZ ());
812- if (useZDiffCut) {
813- if (std::abs (collision.posZ () - mcCollision.posZ ()) > maxZDiff) {
814- continue ;
810+ registry.fill (HIST (" EventsZposDiff" ),
811+ collision.posZ () - mcCollision.posZ ());
812+ if (useZDiffCut) {
813+ if (std::abs (collision.posZ () - mcCollision.posZ ()) > maxZDiff) {
814+ continue ;
815+ }
815816 }
817+ registry.fill (HIST (" EventsNtrkZvtxGen" ), perCollisionSample.size (),
818+ collision.posZ ());
819+ ++moreThanOne;
816820 }
817- registry.fill (HIST (" EventsNtrkZvtxGen" ), perCollisionSample.size (),
818- collision.posZ ());
819- ++moreThanOne;
820821 }
821822 }
822823 if (collisions.size () == 0 ) {
@@ -825,37 +826,38 @@ struct PseudorapidityDensityMFT {
825826 if (moreThanOne > 1 ) {
826827 registry.fill (HIST (" EventsSplitMult" ), nCharged);
827828 }
829+ if ((mcCollision.posZ () >= cfgVzCut1) && (mcCollision.posZ () <= cfgVzCut2)) {
830+ for (auto & particle : particles) {
831+ auto p = pdg->GetParticle (particle.pdgCode ());
832+ auto charge = 0 ;
833+ if (p != nullptr ) {
834+ charge = static_cast <int >(p->Charge ());
835+ }
836+ if (std::abs (charge) < 3 .) {
837+ continue ;
838+ }
828839
829- for (auto & particle : particles) {
830- auto p = pdg->GetParticle (particle.pdgCode ());
831- auto charge = 0 ;
832- if (p != nullptr ) {
833- charge = static_cast <int >(p->Charge ());
834- }
835- if (std::abs (charge) < 3 .) {
836- continue ;
837- }
838-
839- registry.fill (HIST (" TracksEtaZvtxGen_t" ), particle.eta (),
840- mcCollision.posZ ());
841- if (perCollisionMCSampleCentral.size () > 0 ) {
842- registry.fill (HIST (" TracksEtaZvtxGen_gt0t" ), particle.eta (),
843- mcCollision.posZ ());
844- }
845- if (atLeastOne) {
846- registry.fill (HIST (" TracksEtaZvtxGen" ), particle.eta (),
840+ registry.fill (HIST (" TracksEtaZvtxGen_t" ), particle.eta (),
847841 mcCollision.posZ ());
848- registry.fill (HIST (" TracksPtEtaGen" ), particle.pt (), particle.eta ());
849- if (atLeastOne_gt0) {
850- registry.fill (HIST (" TracksEtaZvtxGen_gt0" ), particle.eta (),
842+ if (perCollisionMCSampleCentral.size () > 0 ) {
843+ registry.fill (HIST (" TracksEtaZvtxGen_gt0t" ), particle.eta (),
851844 mcCollision.posZ ());
852845 }
853- }
846+ if (atLeastOne) {
847+ registry.fill (HIST (" TracksEtaZvtxGen" ), particle.eta (),
848+ mcCollision.posZ ());
849+ registry.fill (HIST (" TracksPtEtaGen" ), particle.pt (), particle.eta ());
850+ if (atLeastOne_gt0) {
851+ registry.fill (HIST (" TracksEtaZvtxGen_gt0" ), particle.eta (),
852+ mcCollision.posZ ());
853+ }
854+ }
854855
855- registry.fill (HIST (" TracksPhiEtaGen" ), particle.phi (), particle.eta ());
856- registry.fill (HIST (" TracksPhiZvtxGen" ), particle.phi (),
857- mcCollision.posZ ());
858- registry.fill (HIST (" TracksPtEtaGen_t" ), particle.pt (), particle.eta ());
856+ registry.fill (HIST (" TracksPhiEtaGen" ), particle.phi (), particle.eta ());
857+ registry.fill (HIST (" TracksPhiZvtxGen" ), particle.phi (),
858+ mcCollision.posZ ());
859+ registry.fill (HIST (" TracksPtEtaGen_t" ), particle.pt (), particle.eta ());
860+ }
859861 }
860862 }
861863
0 commit comments