@@ -68,6 +68,9 @@ using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;
6868using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec>;
6969using MyCollision = MyCollisions::iterator;
7070
71+ using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMSWTriggerInfos>;
72+ using MyCollisionWithSWT = MyCollisionsWithSWT::iterator;
73+
7174using MyElectrons = soa::Join<aod::EMPrimaryElectrons, aod::EMPrimaryElectronsCov, aod::EMPrimaryElectronEMEventIds, aod::EMAmbiguousElectronSelfIds, aod::EMPrimaryElectronsPrefilterBit>;
7275using MyElectron = MyElectrons::iterator;
7376using FilteredMyElectrons = soa::Filtered<MyElectrons>;
@@ -103,6 +106,7 @@ struct Dilepton {
103106 ConfigurableAxis ConfCentBins{" ConfCentBins" , {VARIABLE_WIDTH, 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f , 100 .f , 999 .f }, " Mixing bins - centrality" };
104107 ConfigurableAxis ConfEPBins{" ConfEPBins" , {VARIABLE_WIDTH, -M_PI / 2 , -M_PI / 4 , 0 .0f , +M_PI / 4 , +M_PI / 2 }, " Mixing bins - event plane angle" };
105108 ConfigurableAxis ConfOccupancyBins{" ConfOccupancyBins" , {VARIABLE_WIDTH, -1 , 1e+10 }, " Mixing bins - occupancy" };
109+ Configurable<std::string> cfg_swt_name{" cfg_swt_name" , " fHighTrackMult" , " desired software trigger name" }; // 1 trigger name per 1 task. fHighTrackMult, fHighFt0Mult
106110
107111 ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mee bins for output histograms"};
108112 ConfigurableAxis ConfPtllBins{" ConfPtllBins" , {VARIABLE_WIDTH, 0.00 , 0.10 , 0.20 , 0.30 , 0.40 , 0.50 , 0.60 , 0.70 , 0.80 , 0.90 , 1.00 , 1.10 , 1.20 , 1.30 , 1.40 , 1.50 , 1.60 , 1.70 , 1.80 , 1.90 , 2.00 , 2.10 , 2.20 , 2.30 , 2.40 , 2.50 , 2.60 , 2.70 , 2.80 , 2.90 , 3.00 , 3.10 , 3.20 , 3.30 , 3.40 , 3.50 , 3.60 , 3.70 , 3.80 , 3.90 , 4.00 , 4.10 , 4.20 , 4.30 , 4.40 , 4.50 , 4.60 , 4.70 , 4.80 , 4.90 , 5.00 , 5.50 , 6.00 , 6.50 , 7.00 , 7.50 , 8.00 , 8.50 , 9.00 , 9.50 , 10.00 }, " pTee bins for output histograms" };
@@ -282,9 +286,13 @@ struct Dilepton {
282286 // fwdfitter.setUseAbsDCA(true);
283287 // fwdfitter.setTGeoMat(false);
284288 }
289+
290+ if (doprocessTriggerAnalysis) {
291+ fRegistry .add (" Event/hNInspectedTVX" , " N inspected TVX;run number;N_{TVX}" , kTProfile , {{80000 , 520000.5 , 600000.5 }}, true );
292+ }
285293 }
286294
287- template <typename TCollision>
295+ template <bool isTriggerAnalysis, typename TCollision>
288296 void initCCDB (TCollision const & collision)
289297 {
290298 if (mRunNumber == collision.runNumber ()) {
@@ -338,6 +346,12 @@ struct Dilepton {
338346 beamP1 = std::sqrt (std::pow (beamE1, 2 ) - std::pow (beamM1, 2 ));
339347 beamP2 = std::sqrt (std::pow (beamE2, 2 ) - std::pow (beamM2, 2 ));
340348 LOGF (info, " beamZ1 = %d, beamZ2 = %d, beamA1 = %d, beamA2 = %d, beamE1 = %f (GeV), beamE2 = %f (GeV), beamM1 = %f (GeV), beamM2 = %f (GeV), beamP1 = %f (GeV), beamP2 = %f (GeV)" , beamZ1, beamZ2, beamA1, beamA2, beamE1, beamE2, beamM1, beamM2, beamP1, beamP2);
349+
350+ if constexpr (isTriggerAnalysis) {
351+ LOGF (info, " Trigger analysis is enabled. Desired trigger name = %s" , cfg_swt_name.value );
352+ LOGF (info, " total inspected TVX events = %d in run number %d" , collision.nInspectedTVX (), collision.runNumber ());
353+ fRegistry .fill (HIST (" Event/hNInspectedTVX" ), collision.runNumber (), collision.nInspectedTVX ());
354+ }
341355 }
342356
343357 ~Dilepton ()
@@ -944,17 +958,23 @@ struct Dilepton {
944958 std::vector<std::pair<int , int >> used_trackIds;
945959 int ndf = 0 ;
946960
947- template <typename TCollisions, typename TLeptons, typename TPresilce, typename TCut>
961+ template <bool isTriggerAnalysis, typename TCollisions, typename TLeptons, typename TPresilce, typename TCut>
948962 void runPairing (TCollisions const & collisions, TLeptons const & posTracks, TLeptons const & negTracks, TPresilce const & perCollision, TCut const & cut)
949963 {
950964 for (auto & collision : collisions) {
951- initCCDB (collision);
965+ initCCDB<isTriggerAnalysis> (collision);
952966 const float centralities[4 ] = {collision.centFT0M (), collision.centFT0A (), collision.centFT0C (), collision.centNTPV ()};
953967 float centrality = centralities[cfgCentEstimator];
954968 if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) {
955969 continue ;
956970 }
957971
972+ if constexpr (isTriggerAnalysis) {
973+ if (!collision.swtalias_bit (o2::aod::pwgem::dilepton::swt::aliasLabels.at (cfg_swt_name.value ))) {
974+ continue ;
975+ }
976+ }
977+
958978 std::array<float , 2 > q2ft0m = {collision.q2xft0m (), collision.q2yft0m ()};
959979 std::array<float , 2 > q2ft0a = {collision.q2xft0a (), collision.q2yft0a ()};
960980 std::array<float , 2 > q2ft0c = {collision.q2xft0c (), collision.q2yft0c ()};
@@ -1139,13 +1159,24 @@ struct Dilepton {
11391159 void processAnalysis (FilteredMyCollisions const & collisions, Types const &...)
11401160 {
11411161 if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron ) {
1142- runPairing (collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut );
1162+ runPairing< false > (collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut );
11431163 } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon ) {
1144- runPairing (collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut );
1164+ runPairing< false > (collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut );
11451165 }
11461166 }
11471167 PROCESS_SWITCH (Dilepton, processAnalysis, " run dilepton analysis" , true );
11481168
1169+ using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
1170+ void processTriggerAnalysis (FilteredMyCollisionsWithSWT const & collisions, Types const &...)
1171+ {
1172+ if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron ) {
1173+ runPairing<true >(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut );
1174+ } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon ) {
1175+ runPairing<true >(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut );
1176+ }
1177+ }
1178+ PROCESS_SWITCH (Dilepton, processTriggerAnalysis, " run dilepton analysis on triggered data" , false );
1179+
11491180 void processDummy (MyCollisions const &) {}
11501181 PROCESS_SWITCH (Dilepton, processDummy, " Dummy function" , false );
11511182};
0 commit comments