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/FlowAfterburner/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 //
28 #include "AtlasHepMC/GenParticle.h" //typedef GenParticlePtr
29 #include "AtlasHepMC/GenVertex.h" //GenParticlePtr
30 
31 
32 
33 class HijingEventParams;
34 namespace CLHEP{
35  class HepRandomEngine;
36 }
37 class TGraph;
38 
40 public:
41  AddFlowByShifting(const std::string& name, ISvcLocator* pSvcLocator);
45 
46  //functions used for root finding when using the "exact"(and not the "approximate") method
47  static double vn_func (double x, void *params);
48  static double vn_func_derivative(double x, void *params);//currently not used
49 
50 
51 private:
52  CLHEP::HepRandomEngine* getRandomEngine(const std::string& streamName, const EventContext& ctx) const;
53 
54  double SetParentToRanPhi(HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine);
56  const HijingEventParams *hijing_pars);
58 
59 
60  // flow functions to set the vn values
61  void (AddFlowByShifting::*m_flow_function) (double b, double eta, double pt);//function pointer which is set to one of the functions below
62  void jjia_minbias_new (double b, double eta, double pt);
63  void jjia_minbias_new_v2only(double b, double eta, double pt);
64  void fixed_vn (double b, double eta, double pt);
65  void fixed_v2 (double b, double eta, double pt);
66  void jjia_minbias_old (double b, double eta, double pt);
67  void ao_test (double b, double eta, double pt);
68  void custom_vn (double b, double eta, double pt);
69  void p_Pb_cent_eta_indep (double b, double eta, double pt); //for p_Pb
70 
71  TGraph *m_graph_fluc{};//TGraph storing the v2_RP/delta Vs b_imp
72  void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine);
73 
74  // Random number service
75  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc"};
76 
77  // Setable Properties:-
78  StringProperty m_inkey{this, "McTruthKey", "GEN_EVENT"}; //FIXME use Read/WriteHandles
79  StringProperty m_outkey{this, "McFlowKey", "FLOW_EVENT"}; //FIXME use Read/WriteHandles
80 
81  IntegerProperty m_ranphi_sw{this, "RandomizePhi", 0};
82 
83  StringProperty m_flow_function_name{this, "FlowFunctionName", "jjia_minbias_new"};
84  StringProperty m_flow_implementation{this, "FlowImplementation", "exact"};
86  BooleanProperty m_flow_fluctuations{this, "FlowFluctuations", false};
87 
88  IntegerProperty m_floweta_sw{this, "FlowEtaSwitch", 0 };
89  FloatProperty m_flow_maxeta{this, "FlowMaxEtaCut", 10.0};
90  FloatProperty m_flow_mineta{this, "FlowMinEtaCut", 0.f};
91 
92  IntegerProperty m_flowpt_sw{this, "FlowPtSwitch", 0};
93  FloatProperty m_flow_maxpt{this, "FlowMaxPtCut", 1000000.f};
94  FloatProperty m_flow_minpt{this, "FlowMinPtCut", 0.f};
95 
96  IntegerProperty m_flowb_sw{this, "FlowBSwitch", 0};//currently not used
97  FloatProperty m_custom_v1{this, "custom_v1", 0.f};
98  FloatProperty m_custom_v2{this, "custom_v2", 0.f};
99  FloatProperty m_custom_v3{this, "custom_v3", 0.f};
100  FloatProperty m_custom_v4{this, "custom_v4", 0.f};
101  FloatProperty m_custom_v5{this, "custom_v5", 0.f};
102  FloatProperty m_custom_v6{this, "custom_v6", 0.f};
103 
105 
106  //float psi_n[6],v1,v2,v3,v4,v5,v6;
107  float m_psi_n[6],m_v_n[6];
109 
110 };
111 
112 #endif
AddFlowByShifting::m_flow_function_name
StringProperty m_flow_function_name
Definition: AddFlowByShifting.h:83
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:61
AddFlowByShifting::finalize
StatusCode finalize()
Definition: AddFlowByShifting.cxx:275
AddFlowByShifting::m_flow_implementation
StringProperty m_flow_implementation
Definition: AddFlowByShifting.h:84
AddFlowByShifting::m_flow_implementation_type
int m_flow_implementation_type
Definition: AddFlowByShifting.h:85
AddFlowByShifting::Set_EbE_Fluctuation_Multipliers
void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
Definition: AddFlowByShifting.cxx:593
AddFlowByShifting::m_graph_fluc
TGraph * m_graph_fluc
Definition: AddFlowByShifting.h:71
AddFlowByShifting::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: AddFlowByShifting.cxx:149
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AddFlowByShifting::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: AddFlowByShifting.h:75
GenVertex.h
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
AddFlowByShifting::AddFlowToParent
double AddFlowToParent(HepMC::GenParticlePtr parent, const HijingEventParams *hijing_pars)
Definition: AddFlowByShifting.cxx:358
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AddFlowByShifting::m_custom_v2
FloatProperty m_custom_v2
Definition: AddFlowByShifting.h:98
AddFlowByShifting::vn_func_derivative
static double vn_func_derivative(double x, void *params)
Definition: AddFlowByShifting.cxx:53
x
#define x
GenParticle.h
AddFlowByShifting::MoveDescendantsToParent
void MoveDescendantsToParent(HepMC::GenParticlePtr parent, double phishift)
Definition: AddFlowByShifting.cxx:310
AddFlowByShifting::AddFlowByShifting
AddFlowByShifting(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AddFlowByShifting.cxx:65
AddFlowByShifting::m_custom_v4
FloatProperty m_custom_v4
Definition: AddFlowByShifting.h:100
AthAlgorithm.h
AddFlowByShifting::m_flowb_sw
IntegerProperty m_flowb_sw
Definition: AddFlowByShifting.h:96
AddFlowByShifting::m_EbE_Multiplier_vn
float m_EbE_Multiplier_vn[6]
Definition: AddFlowByShifting.h:108
AddFlowByShifting::m_psi_n
float m_psi_n[6]
Definition: AddFlowByShifting.h:107
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:86
AddFlowByShifting::m_custom_v6
FloatProperty m_custom_v6
Definition: AddFlowByShifting.h:102
AddFlowByShifting::m_v_n
float m_v_n[6]
Definition: AddFlowByShifting.h:107
HijingEventParams
Definition: HijingEventParams.h:23
CLHEP
STD'S.
Definition: CaloNoiseCompCondAlg.h:58
AddFlowByShifting::jjia_minbias_old
void jjia_minbias_old(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:531
AddFlowByShifting::m_flowpt_sw
IntegerProperty m_flowpt_sw
Definition: AddFlowByShifting.h:92
AddFlowByShifting::custom_vn
void custom_vn(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:551
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AddFlowByShifting::m_inkey
StringProperty m_inkey
Definition: AddFlowByShifting.h:78
AddFlowByShifting::m_flow_mineta
FloatProperty m_flow_mineta
Definition: AddFlowByShifting.h:90
AddFlowByShifting::execute
StatusCode execute()
Definition: AddFlowByShifting.cxx:159
AddFlowByShifting::m_ranphi_sw
IntegerProperty m_ranphi_sw
Definition: AddFlowByShifting.h:81
AthAlgorithm
Definition: AthAlgorithm.h:47
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:23
AddFlowByShifting::m_flow_maxeta
FloatProperty m_flow_maxeta
Definition: AddFlowByShifting.h:89
AddFlowByShifting::jjia_minbias_new_v2only
void jjia_minbias_new_v2only(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:489
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
AddFlowByShifting::m_custom_v5
FloatProperty m_custom_v5
Definition: AddFlowByShifting.h:101
AddFlowByShifting::jjia_minbias_new
void jjia_minbias_new(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:460
AddFlowByShifting::initialize
StatusCode initialize()
Definition: AddFlowByShifting.cxx:77
AddFlowByShifting::m_outkey
StringProperty m_outkey
Definition: AddFlowByShifting.h:79
AddFlowByShifting::fixed_vn
void fixed_vn(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:514
AddFlowByShifting::vn_func
static double vn_func(double x, void *params)
Definition: AddFlowByShifting.cxx:40
AddFlowByShifting::m_particles_processed
int m_particles_processed
Definition: AddFlowByShifting.h:104
AddFlowByShifting::m_custom_v1
FloatProperty m_custom_v1
Definition: AddFlowByShifting.h:97
AddFlowByShifting::m_custom_v3
FloatProperty m_custom_v3
Definition: AddFlowByShifting.h:99
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
AddFlowByShifting
Definition: AddFlowByShifting.h:39
AddFlowByShifting::p_Pb_cent_eta_indep
void p_Pb_cent_eta_indep(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:562
AddFlowByShifting::m_floweta_sw
IntegerProperty m_floweta_sw
Definition: AddFlowByShifting.h:88
AddFlowByShifting::m_flow_minpt
FloatProperty m_flow_minpt
Definition: AddFlowByShifting.h:94
AddFlowByShifting::ao_test
void ao_test(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:542
IAthRNGSvc.h
ServiceHandle< IAthRNGSvc >
AddFlowByShifting::m_flow_maxpt
FloatProperty m_flow_maxpt
Definition: AddFlowByShifting.h:93
AddFlowByShifting::fixed_v2
void fixed_v2(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:523
AddFlowByShifting::SetParentToRanPhi
double SetParentToRanPhi(HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine)
Definition: AddFlowByShifting.cxx:282