@@ -645,12 +645,18 @@ struct AnalysisEventMixing {
645645 Configurable<bool > fConfigAmbiguousHist {" cfgAmbiHist" , false , " Enable Ambiguous histograms for time association studies" };
646646 Configurable<string> ccdbPathFlow{" ccdb-path-flow" , " Users/c/chizh/FlowResolution" , " path to the ccdb object for flow resolution factors" };
647647 Configurable<bool > fConfigFlowReso {" cfgFlowReso" , false , " Enable loading of flow resolution factors from CCDB" };
648+ Configurable<bool > fConfigSingleMuCumulants {" cfgSingleMuCumulants" , false , " Enable loading of flow resolution factors from CCDB" };
649+ Configurable<std::string> fConfigAddJSONHistograms {" cfgAddJSONHistograms" , " " , " Histograms in JSON format" };
648650
649651 Service<o2::ccdb::BasicCCDBManager> ccdb;
650652
651653 o2::parameters::GRPMagField* grpmag = nullptr ;
652654 TH1D* ResoFlowSP = nullptr ; // Resolution factors for flow analysis, this will be loaded from CCDB
653655 TH1D* ResoFlowEP = nullptr ; // Resolution factors for flow analysis, this will be loaded from CCDB
656+ TH2D* SingleMuv22m = nullptr ; // Single muon v22, loaded from CCDB
657+ TH2D* SingleMuv24m = nullptr ; // Single muon v24, loaded from CCDB
658+ TH2D* SingleMuv22p = nullptr ; // Single antimuon v22, loaded from CCDB
659+ TH2D* SingleMuv24p = nullptr ; // Single antimuon v24, loaded from CCDB
654660 int fCurrentRun ; // needed to detect if the run changed and trigger update of calibrations etc.
655661
656662 Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1 ;
@@ -742,6 +748,8 @@ struct AnalysisEventMixing {
742748 }
743749
744750 DefineHistograms (fHistMan , histNames.Data (), fConfigAddEventMixingHistogram ); // define all histograms
751+ // Additional histograms via JSON
752+ dqhistograms::AddHistogramsFromJSON (fHistMan , fConfigAddJSONHistograms .value .c_str ());
745753 VarManager::SetUseVars (fHistMan ->GetUsedVars ()); // provide the list of required variables so that VarManager knows what to fill
746754 fOutputList .setObject (fHistMan ->GetMainHistogramList ());
747755 }
@@ -770,6 +778,9 @@ struct AnalysisEventMixing {
770778 }
771779 if constexpr (TPairType == VarManager::kDecayToMuMu ) {
772780 twoTrackFilter = static_cast <uint32_t >(track1.isMuonSelected ()) & static_cast <uint32_t >(track2.isMuonSelected ()) & fTwoMuonFilterMask ;
781+ if (fConfigSingleMuCumulants ) {
782+ VarManager::FillTwoMixEventsCumulants (SingleMuv22m, SingleMuv24m, SingleMuv22p, SingleMuv24p, track1, track2);
783+ }
773784 }
774785 if constexpr (TPairType == VarManager::kElectronMuon ) {
775786 twoTrackFilter = static_cast <uint32_t >(track1.isBarrelSelected ()) & static_cast <uint32_t >(track2.isMuonSelected ()) & fTwoTrackFilterMask ;
@@ -829,6 +840,20 @@ struct AnalysisEventMixing {
829840 LOGF (fatal, " Resolution factor is not available in CCDB at timestamp=%llu" , events.begin ().timestamp ());
830841 }
831842 }
843+ if (fConfigSingleMuCumulants ) {
844+ TString PathFlow = ccdbPathFlow.value ;
845+ TString ccdbPathMuv22m = Form (" %s/SingleMuv22m" , PathFlow.Data ());
846+ TString ccdbPathMuv24m = Form (" %s/SingleMuv24m" , PathFlow.Data ());
847+ TString ccdbPathMuv22p = Form (" %s/SingleMuv22p" , PathFlow.Data ());
848+ TString ccdbPathMuv24p = Form (" %s/SingleMuv24p" , PathFlow.Data ());
849+ SingleMuv22m = ccdb->getForTimeStamp <TH2D>(ccdbPathMuv22m.Data (), events.begin ().timestamp ());
850+ SingleMuv24m = ccdb->getForTimeStamp <TH2D>(ccdbPathMuv24m.Data (), events.begin ().timestamp ());
851+ SingleMuv22p = ccdb->getForTimeStamp <TH2D>(ccdbPathMuv22p.Data (), events.begin ().timestamp ());
852+ SingleMuv24p = ccdb->getForTimeStamp <TH2D>(ccdbPathMuv24p.Data (), events.begin ().timestamp ());
853+ if (SingleMuv22m == nullptr || SingleMuv24m == nullptr || SingleMuv22p == nullptr || SingleMuv24p == nullptr ) {
854+ LOGF (fatal, " Single muon cumulants are not available in CCDB at timestamp=%llu" , events.begin ().timestamp ());
855+ }
856+ }
832857 fCurrentRun = events.begin ().runNumber ();
833858 }
834859
@@ -976,6 +1001,7 @@ struct AnalysisSameEventPairing {
9761001 Configurable<std::string> fCollisionSystem {" syst" , " pp" , " Collision system, pp or PbPb" };
9771002 Configurable<float > fCenterMassEnergy {" energy" , 13600 , " Center of mass energy in GeV" };
9781003 Configurable<bool > fConfigCumulants {" cfgCumulants" , false , " If true, fill Cumulants with Weights different than 0" };
1004+ Configurable<std::string> fConfigAddJSONHistograms {" cfgAddJSONHistograms" , " " , " Histograms in JSON format" };
9791005
9801006 // Configurables to create output tree (flat tables or minitree)
9811007 struct : ConfigurableGroup {
@@ -1154,6 +1180,7 @@ struct AnalysisSameEventPairing {
11541180 VarManager::SetCollisionSystem ((TString)fCollisionSystem , fCenterMassEnergy ); // set collision system and center of mass energy
11551181
11561182 DefineHistograms (fHistMan , histNames.Data (), fConfigAddSEPHistogram ); // define all histograms
1183+ dqhistograms::AddHistogramsFromJSON (fHistMan , fConfigAddJSONHistograms .value .c_str ()); // ad-hoc histograms via JSON
11571184 VarManager::SetUseVars (fHistMan ->GetUsedVars ()); // provide the list of required variables so that VarManager knows what to fill
11581185 fOutputList .setObject (fHistMan ->GetMainHistogramList ());
11591186 }
0 commit comments