@@ -2138,7 +2138,6 @@ struct AnalysisDileptonTrack {
21382138 bool isDummy = context.mOptions .get <bool >(" processDummy" );
21392139 bool isMCGen_energycorrelators = context.mOptions .get <bool >(" processMCGenEnergyCorrelators" ) || context.mOptions .get <bool >(" processMCGenEnergyCorrelatorsPion" );
21402140 bool isMCGen_energycorrelatorsME = context.mOptions .get <bool >(" processMCGenEnergyCorrelatorsME" ) || context.mOptions .get <bool >(" processMCGenEnergyCorrelatorsPionME" );
2141- bool isMC_energycorrelatorsUnfolding = context.mOptions .get <bool >(" processMCEnergyCorrelatorsUnfolding" );
21422141
21432142 if (isDummy) {
21442143 if (isBarrel || isMCGen /* || isBarrelAsymmetric*/ /* || isMuon*/ ) {
@@ -2395,9 +2394,6 @@ struct AnalysisDileptonTrack {
23952394 DefineHistograms (fHistMan , Form (" DileptonTrack_%s_%s" , pairLegCutName.Data (), fTrackCutNames [iCutTrack].Data ()), fConfigOptions .fConfigHistogramSubgroups .value .data ());
23962395 for (auto & sig : fRecMCSignals ) {
23972396 DefineHistograms (fHistMan , Form (" DileptonTrackMCMatched_%s_%s_%s" , pairLegCutName.Data (), fTrackCutNames [iCutTrack].Data (), sig->GetName ()), fConfigOptions .fConfigHistogramSubgroups .value .data ());
2398- if (isMC_energycorrelatorsUnfolding) {
2399- DefineHistograms (fHistMan , Form (" DileptonTrackMCUnfold_%s_%s_%s" , pairLegCutName.Data (), fTrackCutNames [iCutTrack].Data (), sig->GetName ()), " " );
2400- }
24012397 }
24022398
24032399 if (!cfgPairing_strCommonTrackCuts.IsNull ()) {
@@ -2585,12 +2581,14 @@ struct AnalysisDileptonTrack {
25852581 // compute needed quantities
25862582 VarManager::FillDileptonHadron (dilepton, track, fValuesHadron );
25872583 VarManager::FillDileptonTrackVertexing<TCandidateType, TEventFillMap, TTrackFillMap>(event, lepton1, lepton2, track, fValuesHadron );
2588- // for the energy correlator analysis
2589- VarManager::FillEnergyCorrelator (dilepton, track, fValuesHadron , fConfigOptions .fConfigApplyMassEC );
25902584 if (!track.has_mcParticle ()) {
25912585 continue ;
25922586 }
25932587 auto trackMC = track.mcParticle ();
2588+ // for the energy correlator analysis
2589+ auto motherParticle = lepton1MC.template mothers_first_as <McParticles>();
2590+ VarManager::FillEnergyCorrelator (dilepton, track, fValuesHadron , fConfigOptions .fConfigApplyMassEC );
2591+ VarManager::FillEnergyCorrelatorsMCUnfolding<VarManager::kJpsiHadronMass >(dilepton, track, motherParticle, trackMC, fValuesHadron );
25942592 mcDecision = 0 ;
25952593 isig = 0 ;
25962594 for (auto sig = fRecMCSignals .begin (); sig != fRecMCSignals .end (); sig++, isig++) {
@@ -3083,99 +3081,6 @@ struct AnalysisDileptonTrack {
30833081 }
30843082 }
30853083
3086- void processMCEnergyCorrelatorsUnfolding (soa::Filtered<MyEventsSelected> const & events, BCsWithTimestamps const & bcs,
3087- soa::Join<aod::TrackAssoc, aod::BarrelTrackCuts> const & assocs,
3088- MyBarrelTracksWithCov const & tracks, soa::Filtered<MyDielectronCandidates> const & dileptons,
3089- McCollisions const & /* mcEvents*/ , McParticles const & /* mcTracks*/ )
3090- {
3091- // set up KF or DCAfitter
3092- if (events.size () == 0 ) {
3093- return ;
3094- }
3095- if (fCurrentRun != bcs.begin ().runNumber ()) { // start: runNumber
3096- initParamsFromCCDB (bcs.begin ().timestamp ());
3097- fCurrentRun = bcs.begin ().runNumber ();
3098- } // end: runNumber
3099- for (auto & event : events) {
3100- if (!event.isEventSelected_bit (0 )) {
3101- continue ;
3102- }
3103- auto groupedBarrelAssocs = assocs.sliceBy (trackAssocsPerCollision, event.globalIndex ());
3104- auto groupedDielectrons = dileptons.sliceBy (dielectronsPerCollision, event.globalIndex ());
3105-
3106- uint32_t mcDecision = static_cast <uint32_t >(0 );
3107- size_t isig = 0 ;
3108-
3109- for (auto dilepton : groupedDielectrons) {
3110- // get full track info of tracks based on the index
3111- auto lepton1 = tracks.rawIteratorAt (dilepton.index0Id ());
3112- auto lepton2 = tracks.rawIteratorAt (dilepton.index1Id ());
3113- if (!lepton1.has_mcParticle () || !lepton2.has_mcParticle ()) {
3114- continue ;
3115- }
3116- auto lepton1MC = lepton1.mcParticle ();
3117- auto lepton2MC = lepton2.mcParticle ();
3118- if (!lepton1MC.has_mothers ())
3119- continue ;
3120- const auto & motherParticle = lepton1MC.template mothers_first_as <McParticles>();
3121- // Check that the dilepton has zero charge
3122- if (dilepton.sign () != 0 ) {
3123- continue ;
3124- }
3125- // loop over track associations
3126- for (auto & assoc : groupedBarrelAssocs) {
3127- uint32_t trackSelection = 0 ;
3128- // check the cuts fulfilled by this candidate track; if none just continue
3129- trackSelection = (assoc.isBarrelSelected_raw () & fTrackCutBitMap );
3130- if (!trackSelection) {
3131- continue ;
3132- }
3133- // get the track from this association
3134- auto track = tracks.rawIteratorAt (assoc.trackId ());
3135- // check that this track is not included in the current dilepton
3136- if (track.globalIndex () == dilepton.index0Id () || track.globalIndex () == dilepton.index1Id ()) {
3137- continue ;
3138- }
3139-
3140- if (!track.has_mcParticle ()) {
3141- continue ;
3142- }
3143- auto trackMC = track.mcParticle ();
3144- VarManager::FillEnergyCorrelatorsMCUnfolding<VarManager::kJpsiHadronMass >(dilepton, track, motherParticle, trackMC, VarManager::fgValues);
3145-
3146- mcDecision = 0 ;
3147- isig = 0 ;
3148- for (auto sig = fRecMCSignals .begin (); sig != fRecMCSignals .end (); sig++, isig++) {
3149- if ((*sig)->CheckSignal (true , lepton1MC, lepton2MC, trackMC)) {
3150- mcDecision |= (static_cast <uint32_t >(1 ) << isig);
3151- }
3152- }
3153- // Fill histograms for the triplets
3154- // loop over dilepton / ditrack cuts and MC signals
3155- for (int icut = 0 ; icut < fNCuts ; icut++) {
3156-
3157- if (!dilepton.filterMap_bit (icut)) {
3158- continue ;
3159- }
3160-
3161- // loop over specified track cuts (the tracks to be combined with the dileptons)
3162- for (int iTrackCut = 0 ; iTrackCut < fNCuts ; iTrackCut++) {
3163-
3164- if (!(trackSelection & (static_cast <uint32_t >(1 ) << iTrackCut))) {
3165- continue ;
3166- }
3167- for (uint32_t isig = 0 ; isig < fRecMCSignals .size (); isig++) {
3168- if (mcDecision & (static_cast <uint32_t >(1 ) << isig)) {
3169- fHistMan ->FillHistClass (Form (" DileptonTrackMCUnfold_%s_%s_%s" , fLegCutNames [icut].Data (), fTrackCutNames [iTrackCut].Data (), fRecMCSignals [isig]->GetName ()), VarManager::fgValues);
3170- }
3171- }
3172- }
3173- } // end loop over track cuts
3174- } // end loop over dilepton cuts
3175- } // end loop over dileptons
3176- } // end loop over events
3177- }
3178-
31793084 void processDummy (MyEvents&)
31803085 {
31813086 // do nothing
@@ -3189,7 +3094,6 @@ struct AnalysisDileptonTrack {
31893094 PROCESS_SWITCH (AnalysisDileptonTrack, processMCGenEnergyCorrelatorsPion, " Loop over MC particle stack and fill generator level histograms(energy correlators)" , false );
31903095 PROCESS_SWITCH (AnalysisDileptonTrack, processMCGenEnergyCorrelatorsME, " Loop over MC particle stack and fill generator level histograms(energy correlators)" , false );
31913096 PROCESS_SWITCH (AnalysisDileptonTrack, processMCGenEnergyCorrelatorsPionME, " Loop over MC particle stack and fill generator level histograms(energy correlators)" , false );
3192- PROCESS_SWITCH (AnalysisDileptonTrack, processMCEnergyCorrelatorsUnfolding, " Loop over MC particle stack and fill response matrix(energy correlators)" , false );
31933097 PROCESS_SWITCH (AnalysisDileptonTrack, processDummy, " Dummy function" , true );
31943098};
31953099
@@ -3304,8 +3208,5 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char
33043208 if (classStr.Contains (" MCTruthEenergyCorrelators" )) {
33053209 dqhistograms::DefineHistograms (histMan, objArray->At (iclass)->GetName (), " energy-correlator-gen" );
33063210 }
3307- if (classStr.Contains (" DileptonTrackMCUnfold" )) {
3308- dqhistograms::DefineHistograms (histMan, objArray->At (iclass)->GetName (), " energy-correlator-unfolding" );
3309- }
33103211 } // end loop over histogram classes
33113212}
0 commit comments