@@ -151,6 +151,9 @@ struct NetprotonCumulantsMc {
151151
152152 Configurable<bool > cfgLoadEff{" cfgLoadEff" , true , " Load efficiency from file" };
153153 Configurable<bool > cfgEvSelkNoSameBunchPileup{" cfgEvSelkNoSameBunchPileup" , true , " Pileup removal" };
154+ Configurable<bool > cfgUseGoodITSLayerAllCut{" cfgUseGoodITSLayerAllCut" , true , " Remove time interval with dead ITS zone" };
155+ Configurable<bool > cfgIfRejectElectron{" cfgIfRejectElectron" , true , " Remove electrons" };
156+ Configurable<bool > cfgIfMandatoryTOF{" cfgIfMandatoryTOF" , true , " Mandatory TOF requirement to remove pileup" };
154157
155158 ConfigurableAxis cfgCentralityBins{" cfgCentralityBins" , {90 , 0 ., 90 .}, " Centrality/Multiplicity percentile bining" };
156159
@@ -170,7 +173,7 @@ struct NetprotonCumulantsMc {
170173
171174 // Filter command for rec (data)***********
172175 Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
173- Filter trackFilter = (nabs(aod::track::eta) < 0 . 8f ) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5 .0f ) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t ) true )) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (aod::track::dcaZ < cfgCutDCAz) && (aod::track::dcaXY < cfgCutDCAxy);
176+ Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta ) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5 .0f ) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t ) true )) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (aod::track::dcaZ < cfgCutDCAz) && (aod::track::dcaXY < cfgCutDCAxy);
174177
175178 // filtering collisions and tracks for real data***********
176179 using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFDDMs>>;
@@ -913,6 +916,16 @@ struct NetprotonCumulantsMc {
913916 return false ;
914917 }
915918
919+ // electron rejection function
920+ template <typename T>
921+ bool isElectron (const T& candidate) // Victor's BF analysis
922+ {
923+ if (candidate.tpcNSigmaEl () > -3 .0f && candidate.tpcNSigmaEl () < 5 .0f && std::abs (candidate.tpcNSigmaPi ()) > 3 .0f && std::abs (candidate.tpcNSigmaKa ()) > 3 .0f && std::abs (candidate.tpcNSigmaPr ()) > 3 .0f ) {
924+ return true ;
925+ }
926+ return false ;
927+ }
928+
916929 template <typename T>
917930 bool selectionPIDnew (const T& candidate) // Victor's BF analysis
918931 {
@@ -959,10 +972,6 @@ struct NetprotonCumulantsMc {
959972 } else {
960973 // Find the pt bin index based on the track's pt value
961974 int binIndex = -1 ;
962- // Get the array from the Configurable
963- // auto ptBins = (std::vector<float>)cfgPtBins;
964- // auto effProt = (std::vector<float>)cfgProtonEff;
965- // auto effAntiprot = (std::vector<float>)cfgAntiprotonEff;
966975
967976 for (int i = 0 ; i < 16 ; ++i) {
968977 if (candidate.pt () >= cfgPtBins.value [i] && candidate.pt () < cfgPtBins.value [i + 1 ]) {
@@ -1010,6 +1019,13 @@ struct NetprotonCumulantsMc {
10101019 if (!collision.sel8 () || std::abs (collision.mcCollision ().posZ ()) > cfgCutVertex) {
10111020 continue ;
10121021 }
1022+ if (cfgUseGoodITSLayerAllCut && !(collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll ))) {
1023+ continue ;
1024+ }
1025+ if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))) {
1026+ continue ;
1027+ }
1028+
10131029 cent = collision.centFT0M ();
10141030
10151031 selectedEvents[nevts++] = collision.mcCollision_as <aod::McCollisions>().globalIndex ();
@@ -1030,7 +1046,7 @@ struct NetprotonCumulantsMc {
10301046
10311047 for (const auto & mcParticle : mcParticles) {
10321048 if (mcParticle.isPhysicalPrimary ()) {
1033- if ((mcParticle.pt () > cfgCutPtLower) && (mcParticle.pt () < 5 .0f ) && (std::abs (mcParticle.eta ()) < 0 . 8f )) {
1049+ if ((mcParticle.pt () > cfgCutPtLower) && (mcParticle.pt () < 5 .0f ) && (std::abs (mcParticle.eta ()) < cfgCutEta )) {
10341050 histos.fill (HIST (" hgenPtAll" ), mcParticle.pt ());
10351051 histos.fill (HIST (" hgenEtaAll" ), mcParticle.eta ());
10361052 histos.fill (HIST (" hgenPhiAll" ), mcParticle.phi ());
@@ -1106,14 +1122,21 @@ struct NetprotonCumulantsMc {
11061122
11071123 void processMCRec (MyMCRecCollision const & collision, MyMCTracks const & tracks, aod::McCollisions const &, aod::McParticles const &)
11081124 {
1109- // auto tracksWithITSPid = soa::Attach<MyMCTracks, aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr>(tracks);
1125+ if (!collision.has_mcCollision ()) {
1126+ return ;
1127+ }
11101128
11111129 if (!collision.sel8 ()) {
11121130 return ;
11131131 }
1114- if (! collision.has_mcCollision ( )) {
1132+ if (cfgUseGoodITSLayerAllCut && !( collision.selection_bit (o2::aod::evsel:: kIsGoodITSLayersAll ) )) {
11151133 return ;
11161134 }
1135+ if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))) {
1136+ return ;
1137+ ;
1138+ }
1139+
11171140 auto cent = collision.centFT0M ();
11181141 histos.fill (HIST (" hCentrec" ), cent);
11191142 histos.fill (HIST (" hMC" ), 5.5 );
@@ -1141,7 +1164,7 @@ struct NetprotonCumulantsMc {
11411164 }
11421165
11431166 auto particle = track.mcParticle ();
1144- if ((particle.pt () < cfgCutPtLower) || (particle.pt () > 5 .0f ) || (std::abs (particle.eta ()) > 0 . 8f )) {
1167+ if ((particle.pt () < cfgCutPtLower) || (particle.pt () > 5 .0f ) || (std::abs (particle.eta ()) > cfgCutEta )) {
11451168 continue ;
11461169 }
11471170 if (!(track.itsNCls () > cfgITScluster) || !(track.tpcNClsFound () >= cfgTPCcluster) || !(track.tpcNClsCrossedRows () >= cfgTPCnCrossedRows)) {
@@ -1156,6 +1179,19 @@ struct NetprotonCumulantsMc {
11561179 histos.fill (HIST (" hrecDcaXYAll" ), track.dcaXY ());
11571180 histos.fill (HIST (" hrecDcaZAll" ), track.dcaZ ());
11581181
1182+ // rejecting electron
1183+ if (cfgIfRejectElectron && isElectron (track)) {
1184+ continue ;
1185+ }
1186+ // use ITS pid as well
1187+ if (cfgUseItsPid && (std::abs (itsResponse.nSigmaITS <o2::track::PID::Proton>(track)) > 3.0 )) {
1188+ continue ;
1189+ }
1190+ // required tracks with TOF mandatory to avoid pileup
1191+ if (cfgIfMandatoryTOF && !track.hasTOF ()) {
1192+ continue ;
1193+ }
1194+
11591195 bool trackSelected = false ;
11601196 if (cfgPIDchoice == 0 )
11611197 trackSelected = selectionPIDoldTOFveto (track);
@@ -1164,11 +1200,6 @@ struct NetprotonCumulantsMc {
11641200 if (cfgPIDchoice == 2 )
11651201 trackSelected = selectionPIDold (track);
11661202
1167- if (cfgUseItsPid) {
1168- if (std::abs (itsResponse.nSigmaITS <o2::track::PID::Proton>(track)) > 3.0 )
1169- continue ;
1170- }
1171-
11721203 if (trackSelected) {
11731204 recEbyeCompleteCollisions (recCollisions.lastIndex (), particle.pt (), particle.eta (), track.sign ());
11741205 // filling nSigma distribution
@@ -2033,13 +2064,13 @@ struct NetprotonCumulantsMc {
20332064
20342065 void processDataRec (AodCollisions::iterator const & coll, aod::BCsWithTimestamps const &, AodTracks const & inputTracks)
20352066 {
2036- // auto inputTracksWithPid = soa::Attach<AodTracks, aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr>(inputTracks);
2037-
20382067 if (!coll.sel8 ()) {
20392068 return ;
20402069 }
2041-
2042- if (cfgEvSelkNoSameBunchPileup && !coll.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
2070+ if (cfgUseGoodITSLayerAllCut && !(coll.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll ))) {
2071+ return ;
2072+ }
2073+ if (cfgEvSelkNoSameBunchPileup && !(coll.selection_bit (o2::aod::evsel::kNoSameBunchPileup ))) {
20432074 // rejects collisions which are associated with the same "found-by-T0" bunch crossing
20442075 // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof
20452076 return ;
@@ -2066,7 +2097,7 @@ struct NetprotonCumulantsMc {
20662097 {
20672098 continue ;
20682099 }
2069- if ((track.pt () < cfgCutPtLower) || (track.pt () > 5 .0f ) || (std::abs (track.eta ()) > 0 . 8f )) {
2100+ if ((track.pt () < cfgCutPtLower) || (track.pt () > 5 .0f ) || (std::abs (track.eta ()) > cfgCutEta )) {
20702101 continue ;
20712102 }
20722103 if (!(track.itsNCls () > cfgITScluster) || !(track.tpcNClsFound () >= cfgTPCcluster) || !(track.tpcNClsCrossedRows () >= cfgTPCnCrossedRows)) {
@@ -2079,6 +2110,19 @@ struct NetprotonCumulantsMc {
20792110 histos.fill (HIST (" hrecDcaXYAll" ), track.dcaXY ());
20802111 histos.fill (HIST (" hrecDcaZAll" ), track.dcaZ ());
20812112
2113+ // rejecting electron
2114+ if (cfgIfRejectElectron && isElectron (track)) {
2115+ continue ;
2116+ }
2117+ // use ITS pid as well
2118+ if (cfgUseItsPid && (std::abs (itsResponse.nSigmaITS <o2::track::PID::Proton>(track)) > 3.0 )) {
2119+ continue ;
2120+ }
2121+ // required tracks with TOF mandatory to avoid pileup
2122+ if (cfgIfMandatoryTOF && !track.hasTOF ()) {
2123+ continue ;
2124+ }
2125+
20822126 bool trackSelected = false ;
20832127 if (cfgPIDchoice == 0 )
20842128 trackSelected = selectionPIDoldTOFveto (track);
@@ -2087,11 +2131,6 @@ struct NetprotonCumulantsMc {
20872131 if (cfgPIDchoice == 2 )
20882132 trackSelected = selectionPIDold (track);
20892133
2090- if (cfgUseItsPid) {
2091- if (std::abs (itsResponse.nSigmaITS <o2::track::PID::Proton>(track)) > 3.0 )
2092- continue ;
2093- }
2094-
20952134 if (trackSelected) {
20962135 recEbyeCompleteCollisions (recCollisions.lastIndex (), track.pt (), track.eta (), track.sign ());
20972136 // filling nSigma distribution
0 commit comments