@@ -707,6 +707,45 @@ void FlowPtContainer::fillPtProfiles(const double& centmult, const double& rn)
707707 }
708708 return ;
709709}
710+ bool FlowPtContainer::addPtProfile (const char * name, int observableOrder)
711+ {
712+ if (!fCorrList || !name || !name[0 ] || observableOrder < 1 || observableOrder > mpar) {
713+ LOGF (error, " Cannot add pT profile %s for order %d" , name ? name : " (null)" , observableOrder);
714+ return false ;
715+ }
716+ const std::string profileName{name};
717+ if (fCorrList ->FindObject (profileName.c_str ())) {
718+ LOGF (error, " pT profile %s already exists" , profileName.c_str ());
719+ return false ;
720+ }
721+ auto * original = dynamic_cast <BootstrapProfile*>(fCorrList ->At (observableOrder - 1 ));
722+ const auto * axis = original->GetXaxis ();
723+ BootstrapProfile* profile = nullptr ;
724+ if (axis->GetXbins ()->GetSize ()) {
725+ profile = new BootstrapProfile (profileName.c_str (), profileName.c_str (), axis->GetNbins (), axis->GetXbins ()->GetArray ());
726+ } else {
727+ profile = new BootstrapProfile (profileName.c_str (), profileName.c_str (), axis->GetNbins (), axis->GetXmin (), axis->GetXmax ());
728+ }
729+ if (original->fListOfEntries ) {
730+ profile->InitializeSubsamples (original->fListOfEntries ->GetEntries ());
731+ }
732+ fCorrList ->Add (profile);
733+ return true ;
734+ }
735+ bool FlowPtContainer::fillPtProfile (const char * name, int observableOrder, double mult, double eventWeight, double rn)
736+ {
737+ if (!fCorrList || !name || observableOrder < 1 || observableOrder > mpar ||
738+ static_cast <size_t >(observableOrder) >= corrDen.size () || corrDen[observableOrder] == 0 . || eventWeight == 0 .) {
739+ return false ;
740+ }
741+ auto * profile = dynamic_cast <BootstrapProfile*>(fCorrList ->FindObject (name));
742+ if (!profile) {
743+ LOGF (error, " pT profile %s has not been booked" , name);
744+ return false ;
745+ }
746+ profile->FillProfile (mult, corrNum[observableOrder] / corrDen[observableOrder], eventWeight, rn);
747+ return true ;
748+ }
710749void FlowPtContainer::fillSubeventPtProfiles (const double & centmult, const double & rn)
711750{
712751 int histCounter = 0 ;
0 commit comments