30 #include "TMinuitMinimizer.h"
40 double lineFunction(
double*
x,
double* par) {
return par[0]; }
41 double flowFunction(
double*
x,
double* par) {
42 return par[0] * (1. + 2. * (par[1] *
std::cos(2. * (
x[0] - par[2])) + par[3] *
std::cos(3. * (
x[0] - par[4]))));
65 : doEvtPlane_(iConfig.getParameter<
bool>(
"doEvtPlane")),
66 doFreePlaneFit_(iConfig.getParameter<
bool>(
"doFreePlaneFit")),
67 doJettyExclusion_(iConfig.getParameter<
bool>(
"doJettyExclusion")),
68 evtPlaneLevel_(iConfig.getParameter<
int>(
"evtPlaneLevel")),
73 produces<std::vector<double>>(
"rhoFlowFitParams");
74 TMinuitMinimizer::UseStaticMinuit(
false);
83 static constexpr
int kMaxEvtPlane = 29;
100 double eventPlane2 = -100;
101 double eventPlane3 = -100;
103 constexpr
int nParamVals = 9;
104 auto rhoFlowFitParamsOut = std::make_unique<std::vector<double>>(nParamVals, 1
e-6);
106 rhoFlowFitParamsOut->at(0) = 0;
107 rhoFlowFitParamsOut->at(1) = 0;
108 rhoFlowFitParamsOut->at(2) = 0;
109 rhoFlowFitParamsOut->at(3) = 0;
110 rhoFlowFitParamsOut->at(4) = 0;
112 double eventPlane2Cos = 0;
113 double eventPlane2Sin = 0;
115 double eventPlane3Cos = 0;
116 double eventPlane3Sin = 0;
118 std::vector<bool> pfcuts(pfCands.size(),
false);
120 for (
auto const& pfCandidate : pfCands) {
122 if (pfCandidate.particleId() != 1 ||
std::abs(pfCandidate.eta()) > 1.0 || pfCandidate.pt() < .3 ||
123 pfCandidate.pt() > 3.) {
129 for (
auto const&
jet : *
jets) {
141 pfcuts[iCand] =
true;
144 eventPlane2Cos +=
std::cos(2 * pfCandidate.phi());
145 eventPlane2Sin +=
std::sin(2 * pfCandidate.phi());
147 eventPlane3Cos +=
std::cos(3 * pfCandidate.phi());
148 eventPlane3Sin +=
std::sin(3 * pfCandidate.phi());
153 eventPlane2 = std::atan2(eventPlane2Sin, eventPlane2Cos) / 2.;
154 eventPlane3 = std::atan2(eventPlane3Sin, eventPlane3Cos) / 3.;
159 int pfcuts_count = 0;
160 if (nFill >= 100 && eventPlane2 > -99) {
164 std::string nameFlat =
"phiTestIEta4_Flat_" + std::to_string(
iEvent.id().event()) +
"_h";
166 phi_h->SetDirectory(
nullptr);
167 for (
auto const& pfCandidate : pfCands) {
168 if (pfcuts.at(pfcuts_count))
169 phi_h->Fill(pfCandidate.phi());
186 rhoFlowFitParamsOut->at(0) =
flowFit_p_->GetParameter(0);
187 rhoFlowFitParamsOut->at(1) =
flowFit_p_->GetParameter(1);
188 rhoFlowFitParamsOut->at(2) =
flowFit_p_->GetParameter(2);
189 rhoFlowFitParamsOut->at(3) =
flowFit_p_->GetParameter(3);
190 rhoFlowFitParamsOut->at(4) =
flowFit_p_->GetParameter(4);
192 rhoFlowFitParamsOut->at(5) =
flowFit_p_->GetChisquare();
193 rhoFlowFitParamsOut->at(6) =
flowFit_p_->GetNDF();
195 rhoFlowFitParamsOut->at(7) =
lineFit_p_->GetChisquare();
196 rhoFlowFitParamsOut->at(8) =
lineFit_p_->GetNDF();
208 desc.add<
bool>(
"doEvtPlane",
false);
210 desc.add<
bool>(
"doJettyExclusion",
false);
211 desc.add<
bool>(
"doFreePlaneFit",
false);
212 desc.add<
bool>(
"doFlatTest",
false);
215 desc.add<
int>(
"evtPlaneLevel", 0);
216 descriptions.
add(
"hiFJRhoFlowModulationProducer",
desc);