ComPWA
Common Partial-Wave-Analysis Framework
DataSet.cpp
Go to the documentation of this file.
1 // Copyright (c) 2013, 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #include "DataSet.hpp"
6 #include "Core/Kinematics.hpp"
7 #include "Core/Logging.hpp"
8 
9 namespace ComPWA {
10 namespace Data {
11 
13 addIntensityWeights(std::shared_ptr<ComPWA::Intensity> Intensity,
14  const EventCollection &DataSample,
16  auto DataSet = Kinematics.convert(DataSample);
17  auto Weights = Intensity->evaluate(DataSet.Data);
18  ComPWA::EventCollection NewEventList{DataSample.Pids};
19  std::transform(DataSample.Events.begin(), DataSample.Events.end(),
20  Weights.begin(), NewEventList.Events.begin(),
21  [](Event Event, double Weight) {
22  Event.Weight *= Weight;
23  return Event;
24  });
25  return NewEventList;
26 }
27 
28 } // namespace Data
29 } // namespace ComPWA
virtual ComPWA::Data::DataSet convert(const EventCollection &Events) const =0
ComPWA::DataMap Data
Definition: DataSet.hpp:18
std::vector< Event > Events
Definition: Event.hpp:34
ComPWA::EventCollection addIntensityWeights(std::shared_ptr< ComPWA::Intensity > Intensity, const EventCollection &DataSample, const ComPWA::Kinematics &Kinematics)
Definition: DataSet.cpp:13
double Weight
Definition: Event.hpp:22
The Kinematics interface defines the conversion of Events to a DataSet.
Definition: Kinematics.hpp:19
Data structure containing all kinematic information of a physics event.
Definition: Event.hpp:20
std::vector< pid > Pids
Definition: Event.hpp:33
Interface template for a general Function of the form OutputType Function(InputTypes) The concept clo...
Definition: Function.hpp:24