ATLAS Offline Software
AddFlowByShifting.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // File: Generators/FlowAfterburnber/AddFlowByShifting.h
6 // Description:
7 // This code is used to introduce particle flow
8 // to particles from generated events
9 // It works by modifying phi angles of particles
10 // according to requested flow type and magnitude
11 //
12 // It takes from SG a container of tracks as input
13 // and registers in SG a new container with modified tracks on output
14 //
15 // It currently uses Hijing generator specific class HijingEventParams
16 // with truth event parameters information
17 //
18 // AuthorList:
19 // Andrzej Olszewski: Initial Code February 2006
20 
21 #ifndef ADDFLOWBYSHIFTING_H
22 #define ADDFLOWBYSHIFTING_H
23 
25 #include "GaudiKernel/ServiceHandle.h"
26 
27 #include <CLHEP/Random/RandomEngine.h>
30 #include "AtlasHepMC/Relatives.h"
32 
33 #include <gsl/gsl_errno.h>
34 #include <gsl/gsl_math.h>
35 #include <gsl/gsl_roots.h>
36 
37 
38 
39 
40 class TGraph;
41 
43 public:
44  AddFlowByShifting(const std::string& name, ISvcLocator* pSvcLocator);
48 
49  //functions used for root finding when using the "exact"(and not the "approximate") method
50  static double vn_func (double x, void *params);
51  static double vn_func_derivative(double x, void *params);//currently not used
52 
53 
54 private:
55  CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
56 
57  double SetParentToRanPhi(HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine);
59  const HijingEventParams *hijing_pars);
61 
62 
63  // flow functions to set the vn values
64  void (AddFlowByShifting::*m_flow_function) (double b, double eta, double pt);//function pointer which is set to one of the functions below
65  void jjia_minbias_new (double b, double eta, double pt);
66  void jjia_minbias_new_v2only(double b, double eta, double pt);
67  void fixed_vn (double b, double eta, double pt);
68  void fixed_v2 (double b, double eta, double pt);
69  void jjia_minbias_old (double b, double eta, double pt);
70  void ao_test (double b, double eta, double pt);
71  void custom_vn (double b, double eta, double pt);
72  void p_Pb_cent_eta_indep (double b, double eta, double pt); //for p_Pb
73 
74  TGraph *m_graph_fluc{};//TGraph storing the v2_RP/delta Vs b_imp
75  void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine);
76 
77  // Random number service
78  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc"};
79 
80  // Setable Properties:-
81  StringProperty m_inkey{this, "McTruthKey", "GEN_EVENT"}; //FIXME use Read/WriteHandles
82  StringProperty m_outkey{this, "McFlowKey", "FLOW_EVENT"}; //FIXME use Read/WriteHandles
83 
84  IntegerProperty m_ranphi_sw{this, "RandomizePhi", 0};
85 
86  StringProperty m_flow_function_name{this, "FlowFunctionName", "jjia_minbias_new"};
87  StringProperty m_flow_implementation{this, "FlowImplementation", "exact"};
89  BooleanProperty m_flow_fluctuations{this, "FlowFluctuations", false};
90 
91  IntegerProperty m_floweta_sw{this, "FlowEtaSwitch", 0 };
92  FloatProperty m_flow_maxeta{this, "FlowMaxEtaCut", 10.0};
93  FloatProperty m_flow_mineta{this, "FlowMinEtaCut", 0.f};
94 
95  IntegerProperty m_flowpt_sw{this, "FlowPtSwitch", 0};
96  FloatProperty m_flow_maxpt{this, "FlowMaxPtCut", 1000000.f};
97  FloatProperty m_flow_minpt{this, "FlowMinPtCut", 0.f};
98 
99  IntegerProperty m_flowb_sw{this, "FlowBSwitch", 0};//currently not used
100  FloatProperty m_custom_v1{this, "custom_v1", 0.f};
101  FloatProperty m_custom_v2{this, "custom_v2", 0.f};
102  FloatProperty m_custom_v3{this, "custom_v3", 0.f};
103  FloatProperty m_custom_v4{this, "custom_v4", 0.f};
104  FloatProperty m_custom_v5{this, "custom_v5", 0.f};
105  FloatProperty m_custom_v6{this, "custom_v6", 0.f};
106 
108 
109  //float psi_n[6],v1,v2,v3,v4,v5,v6;
110  float m_psi_n[6],m_v_n[6];
112 
113 };
114 
115 #endif
AddFlowByShifting::m_flow_function_name
StringProperty m_flow_function_name
Definition: AddFlowByShifting.h:86
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
AddFlowByShifting::m_flow_function
void(AddFlowByShifting::* m_flow_function)(double b, double eta, double pt)
Definition: AddFlowByShifting.h:64
AddFlowByShifting::finalize
StatusCode finalize()
Definition: AddFlowByShifting.cxx:266
AddFlowByShifting::m_flow_implementation
StringProperty m_flow_implementation
Definition: AddFlowByShifting.h:87
AddFlowByShifting::m_flow_implementation_type
int m_flow_implementation_type
Definition: AddFlowByShifting.h:88
AddFlowByShifting::Set_EbE_Fluctuation_Multipliers
void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
Definition: AddFlowByShifting.cxx:584
HijingEventParams.h
AddFlowByShifting::m_graph_fluc
TGraph * m_graph_fluc
Definition: AddFlowByShifting.h:74
AddFlowByShifting::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: AddFlowByShifting.cxx:140
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AddFlowByShifting::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: AddFlowByShifting.h:78
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
AddFlowByShifting::AddFlowToParent
double AddFlowToParent(HepMC::GenParticlePtr parent, const HijingEventParams *hijing_pars)
Definition: AddFlowByShifting.cxx:349
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AddFlowByShifting::m_custom_v2
FloatProperty m_custom_v2
Definition: AddFlowByShifting.h:101
AddFlowByShifting::vn_func_derivative
static double vn_func_derivative(double x, void *params)
Definition: AddFlowByShifting.cxx:44
x
#define x
AddFlowByShifting::MoveDescendantsToParent
void MoveDescendantsToParent(HepMC::GenParticlePtr parent, double phishift)
Definition: AddFlowByShifting.cxx:301
AddFlowByShifting::AddFlowByShifting
AddFlowByShifting(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AddFlowByShifting.cxx:56
AddFlowByShifting::m_custom_v4
FloatProperty m_custom_v4
Definition: AddFlowByShifting.h:103
AthAlgorithm.h
AddFlowByShifting::m_flowb_sw
IntegerProperty m_flowb_sw
Definition: AddFlowByShifting.h:99
AddFlowByShifting::m_EbE_Multiplier_vn
float m_EbE_Multiplier_vn[6]
Definition: AddFlowByShifting.h:111
AddFlowByShifting::m_psi_n
float m_psi_n[6]
Definition: AddFlowByShifting.h:110
McEventCollection.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AddFlowByShifting::m_flow_fluctuations
BooleanProperty m_flow_fluctuations
Definition: AddFlowByShifting.h:89
AddFlowByShifting::m_custom_v6
FloatProperty m_custom_v6
Definition: AddFlowByShifting.h:105
AddFlowByShifting::m_v_n
float m_v_n[6]
Definition: AddFlowByShifting.h:110
HijingEventParams
Definition: HijingEventParams.h:23
AddFlowByShifting::jjia_minbias_old
void jjia_minbias_old(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:522
AddFlowByShifting::m_flowpt_sw
IntegerProperty m_flowpt_sw
Definition: AddFlowByShifting.h:95
AddFlowByShifting::custom_vn
void custom_vn(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:542
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AddFlowByShifting::m_inkey
StringProperty m_inkey
Definition: AddFlowByShifting.h:81
AddFlowByShifting::m_flow_mineta
FloatProperty m_flow_mineta
Definition: AddFlowByShifting.h:93
AddFlowByShifting::execute
StatusCode execute()
Definition: AddFlowByShifting.cxx:150
AddFlowByShifting::m_ranphi_sw
IntegerProperty m_ranphi_sw
Definition: AddFlowByShifting.h:84
AthAlgorithm
Definition: AthAlgorithm.h:47
AddFlowByShifting::m_flow_maxeta
FloatProperty m_flow_maxeta
Definition: AddFlowByShifting.h:92
AddFlowByShifting::jjia_minbias_new_v2only
void jjia_minbias_new_v2only(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:480
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
AddFlowByShifting::m_custom_v5
FloatProperty m_custom_v5
Definition: AddFlowByShifting.h:104
AddFlowByShifting::jjia_minbias_new
void jjia_minbias_new(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:451
AddFlowByShifting::initialize
StatusCode initialize()
Definition: AddFlowByShifting.cxx:68
AddFlowByShifting::m_outkey
StringProperty m_outkey
Definition: AddFlowByShifting.h:82
AddFlowByShifting::fixed_vn
void fixed_vn(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:505
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
AddFlowByShifting::vn_func
static double vn_func(double x, void *params)
Definition: AddFlowByShifting.cxx:31
Relatives.h
AddFlowByShifting::m_particles_processed
int m_particles_processed
Definition: AddFlowByShifting.h:107
AddFlowByShifting::m_custom_v1
FloatProperty m_custom_v1
Definition: AddFlowByShifting.h:100
AddFlowByShifting::m_custom_v3
FloatProperty m_custom_v3
Definition: AddFlowByShifting.h:102
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
AddFlowByShifting
Definition: AddFlowByShifting.h:42
AddFlowByShifting::p_Pb_cent_eta_indep
void p_Pb_cent_eta_indep(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:553
AddFlowByShifting::m_floweta_sw
IntegerProperty m_floweta_sw
Definition: AddFlowByShifting.h:91
AddFlowByShifting::m_flow_minpt
FloatProperty m_flow_minpt
Definition: AddFlowByShifting.h:97
AddFlowByShifting::ao_test
void ao_test(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:533
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
AddFlowByShifting::m_flow_maxpt
FloatProperty m_flow_maxpt
Definition: AddFlowByShifting.h:96
AddFlowByShifting::fixed_v2
void fixed_v2(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:514
AddFlowByShifting::SetParentToRanPhi
double SetParentToRanPhi(HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine)
Definition: AddFlowByShifting.cxx:273