29 #include "TMinuitMinimizer.h" 39 double lineFunction(
double*
x,
double* par) {
return par[0]; }
40 double flowFunction(
double*
x,
double* par) {
41 return par[0] * (1. + 2. * (par[1] *
std::cos(2. * (
x[0] - par[2])) + par[3] *
std::cos(3. * (
x[0] - par[4]))));
64 : doEvtPlane_(iConfig.getParameter<
bool>(
"doEvtPlane")),
65 doFreePlaneFit_(iConfig.getParameter<
bool>(
"doFreePlaneFit")),
66 doJettyExclusion_(iConfig.getParameter<
bool>(
"doJettyExclusion")),
67 evtPlaneLevel_(iConfig.getParameter<
int>(
"evtPlaneLevel")),
72 produces<std::vector<double>>(
"rhoFlowFitParams");
73 TMinuitMinimizer::UseStaticMinuit(
false);
82 static constexpr
int kMaxEvtPlane = 29;
99 double eventPlane2 = -100;
100 double eventPlane3 = -100;
102 constexpr
int nParamVals = 9;
103 auto rhoFlowFitParamsOut = std::make_unique<std::vector<double>>(nParamVals, 1
e-6);
105 rhoFlowFitParamsOut->at(0) = 0;
106 rhoFlowFitParamsOut->at(1) = 0;
107 rhoFlowFitParamsOut->at(2) = 0;
108 rhoFlowFitParamsOut->at(3) = 0;
109 rhoFlowFitParamsOut->at(4) = 0;
111 double eventPlane2Cos = 0;
112 double eventPlane2Sin = 0;
114 double eventPlane3Cos = 0;
115 double eventPlane3Sin = 0;
117 std::vector<bool> pfcuts(pfCands.size(),
false);
119 for (
auto const& pfCandidate : pfCands) {
121 if (pfCandidate.particleId() != 1 ||
std::abs(pfCandidate.eta()) > 1.0 || pfCandidate.pt() < .3 ||
122 pfCandidate.pt() > 3.) {
128 for (
auto const&
jet : *
jets) {
140 pfcuts[iCand] =
true;
143 eventPlane2Cos +=
std::cos(2 * pfCandidate.phi());
144 eventPlane2Sin +=
std::sin(2 * pfCandidate.phi());
146 eventPlane3Cos +=
std::cos(3 * pfCandidate.phi());
147 eventPlane3Sin +=
std::sin(3 * pfCandidate.phi());
152 eventPlane2 = std::atan2(eventPlane2Sin, eventPlane2Cos) / 2.;
153 eventPlane3 = std::atan2(eventPlane3Sin, eventPlane3Cos) / 3.;
158 int pfcuts_count = 0;
159 if (nFill >= 100 && eventPlane2 > -99) {
165 phi_h->SetDirectory(
nullptr);
166 for (
auto const& pfCandidate : pfCands) {
167 if (pfcuts.at(pfcuts_count))
168 phi_h->Fill(pfCandidate.phi());
185 rhoFlowFitParamsOut->at(0) =
flowFit_p_->GetParameter(0);
186 rhoFlowFitParamsOut->at(1) =
flowFit_p_->GetParameter(1);
187 rhoFlowFitParamsOut->at(2) =
flowFit_p_->GetParameter(2);
188 rhoFlowFitParamsOut->at(3) =
flowFit_p_->GetParameter(3);
189 rhoFlowFitParamsOut->at(4) =
flowFit_p_->GetParameter(4);
191 rhoFlowFitParamsOut->at(5) =
flowFit_p_->GetChisquare();
192 rhoFlowFitParamsOut->at(6) =
flowFit_p_->GetNDF();
194 rhoFlowFitParamsOut->at(7) =
lineFit_p_->GetChisquare();
195 rhoFlowFitParamsOut->at(8) =
lineFit_p_->GetNDF();
207 desc.add<
bool>(
"doEvtPlane",
false);
209 desc.add<
bool>(
"doJettyExclusion",
false);
210 desc.add<
bool>(
"doFreePlaneFit",
false);
211 desc.add<
bool>(
"doFlatTest",
false);
214 desc.add<
int>(
"evtPlaneLevel", 0);
215 descriptions.
add(
"hiFJRhoFlowModulationProducer",
desc);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::EvtPlaneCollection > evtPlaneToken_
#define DEFINE_FWK_MODULE(type)
std::vector< l1t::PFCandidate > PFCandidateCollection
Sin< T >::type sin(const T &t)
std::string to_string(const V &value)
edm::View< Jet > JetView
edm references
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< reco::PFCandidateCollection > pfCandsToken_
Cos< T >::type cos(const T &t)
std::vector< EvtPlane > EvtPlaneCollection
Abs< T >::type abs(const T &t)
const bool doFreePlaneFit_
const edm::EDGetTokenT< reco::JetView > jetToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const bool doJettyExclusion_
static const int NumEPNames
HiFJRhoFlowModulationProducer(const edm::ParameterSet &)
std::unique_ptr< TF1 > lineFit_p_
std::unique_ptr< TF1 > flowFit_p_