ATLAS Offline Software
Loading...
Searching...
No Matches
AddFlowByShifting Class Reference

#include <AddFlowByShifting.h>

Inheritance diagram for AddFlowByShifting:
Collaboration diagram for AddFlowByShifting:

Public Member Functions

 AddFlowByShifting (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static double vn_func (double x, void *params)

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  Harmonic {
  NumHar =6 , v1 =0 , v2 =1 , v3 =2 ,
  v4 =3 , v5 =4 , v6 =5
}
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, const EventContext &ctx) const
double SetParentToRanPhi (HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine)
double AddFlowToParent (HepMC::GenParticlePtr parent, const HijingEventParams *hijing_pars)
void MoveDescendantsToParent (HepMC::GenParticlePtr parent, double phishift)
void jjia_minbias_new (double b, double eta, double pt)
void jjia_minbias_new_v2only (double b, double eta, double pt)
void fixed_vn (double b, double eta, double pt)
void fixed_v2 (double b, double eta, double pt)
void jjia_minbias_old (double b, double eta, double pt)
void ao_test (double b, double eta, double pt)
void custom_vn (double b, double eta, double pt)
void p_Pb_cent_eta_indep (double b, double eta, double pt)
void OO_eta_indep (double b, double eta, double pt)
void Set_EbE_Fluctuation_Multipliers (HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

void(AddFlowByShifting::* m_flow_function )(double b, double eta, double pt)
TGraph * m_graph_fluc {}
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
StringProperty m_inkey {this, "McTruthKey" , "GEN_EVENT" }
StringProperty m_outkey {this, "McFlowKey" , "FLOW_EVENT" }
IntegerProperty m_ranphi_sw {this, "RandomizePhi" , 0 }
StringProperty m_flow_function_name {this, "FlowFunctionName" , "jjia_minbias_new"}
StringProperty m_flow_implementation {this, "FlowImplementation", "exact" }
int m_flow_implementation_type {0}
BooleanProperty m_flow_fluctuations {this, "FlowFluctuations" , false }
IntegerProperty m_floweta_sw {this, "FlowEtaSwitch" , 0 }
FloatProperty m_flow_maxeta {this, "FlowMaxEtaCut" , 10.0 }
FloatProperty m_flow_mineta {this, "FlowMinEtaCut" , 0.f }
IntegerProperty m_flowpt_sw {this, "FlowPtSwitch" , 0 }
FloatProperty m_flow_maxpt {this, "FlowMaxPtCut" , 1000000.f }
FloatProperty m_flow_minpt {this, "FlowMinPtCut" , 0.f }
IntegerProperty m_flowb_sw {this, "FlowBSwitch" , 0 }
FloatProperty m_custom_v1 {this, "custom_v1" , 0.f }
FloatProperty m_custom_v2 {this, "custom_v2" , 0.f }
FloatProperty m_custom_v3 {this, "custom_v3" , 0.f }
FloatProperty m_custom_v4 {this, "custom_v4" , 0.f }
FloatProperty m_custom_v5 {this, "custom_v5" , 0.f }
FloatProperty m_custom_v6 {this, "custom_v6" , 0.f }
int m_particles_processed {0}
float m_psi_n [Harmonic::NumHar]
float m_v_n [Harmonic::NumHar]
float m_EbE_Multiplier_vn [Harmonic::NumHar]
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 39 of file AddFlowByShifting.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ Harmonic

Enumerator
NumHar 
v1 
v2 
v3 
v4 
v5 
v6 

Definition at line 101 of file AddFlowByShifting.h.

Constructor & Destructor Documentation

◆ AddFlowByShifting()

AddFlowByShifting::AddFlowByShifting ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 56 of file AddFlowByShifting.cxx.

56 :
57 AthAlgorithm(name, pSvcLocator)
58{
59 m_flow_function= NULL;
60 for(int ihar = 0; ihar< Harmonic::NumHar; ihar++){
61 m_psi_n[ihar] =0.0;
62 m_v_n [ihar] =0.0;
63 m_EbE_Multiplier_vn[ihar]=1.0;
64 }
65}
float m_psi_n[Harmonic::NumHar]
void(AddFlowByShifting::* m_flow_function)(double b, double eta, double pt)
float m_EbE_Multiplier_vn[Harmonic::NumHar]
float m_v_n[Harmonic::NumHar]
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

Member Function Documentation

◆ AddFlowToParent()

double AddFlowByShifting::AddFlowToParent ( HepMC::GenParticlePtr parent,
const HijingEventParams * hijing_pars )
private

Definition at line 458 of file AddFlowByShifting.cxx.

459{
461 CLHEP::HepLorentzVector momentum(parent->momentum().px(),
462 parent->momentum().py(),
463 parent->momentum().pz(),
464 parent->momentum().e());
465 double pt = parent->momentum().perp();
466 double eta = parent->momentum().pseudoRapidity();
467 double phi_0 = parent->momentum().phi();
468
469 int error_=0;
470 if(pt !=pt) {ATH_MSG_ERROR("ERROR pt of track is not defined");error_=1;} //true if pt==nan
471 if(eta !=eta) {ATH_MSG_ERROR("ERROR eta of track is not defined");error_=1;}
472 if(phi_0 !=phi_0) {ATH_MSG_ERROR("ERROR phi of track is not defined");error_=1;}
473 if(error_==1){
474 ATH_MSG_ERROR("Original Particle Momentum(px,py,pz,e,m)="<<parent->momentum().px()<<" "
475 <<parent->momentum().py()<<" "
476 <<parent->momentum().pz()<<" "
477 <<parent->momentum().e() <<" "
478 <<parent->momentum().m() <<" ");
479 }
480
481
482
483
484 //Call the appropriate function to set the vn values
485 for(int ihar = 0; ihar< Harmonic::NumHar; ihar++){m_v_n [ihar]=0.0;} //reset the vn for this particle
486 double b = hijing_pars->get_b();
487 (*this.*m_flow_function)(b,eta,pt);//Set the vn for this particle
488
489 //add EbE fluctuations
491 for(int ihar = 0; ihar< Harmonic::NumHar; ihar++){
492 m_v_n[ihar] *= m_EbE_Multiplier_vn[ihar];
493 if(m_v_n[ihar]>0.5){
494 ATH_MSG_WARNING(" Vn Too large "<<ihar+1<<" "<<m_EbE_Multiplier_vn[ihar]<<" "<<m_v_n[ihar]);m_v_n[ihar]=0.5;
495 }
496 }
497 }
498
499 double phishift=0;
500
501 // Old fashioned rotation(approximate)
503 float phi=phi_0;
504 phishift= -2*( m_v_n[Harmonic::v1]*sin(1*(phi-m_psi_n[Harmonic::v1]))/1.0 +
510
511 }
512
513 // New fashioned rotation(exact)
514 else if (m_flow_implementation_type==1){
515 // Thread-safe according to https://www.gnu.org/software/gsl/doc/html/roots.html
516 const gsl_root_fsolver_type *T ATLAS_THREAD_SAFE = gsl_root_fsolver_brent;
517 gsl_root_fsolver *s = gsl_root_fsolver_alloc (T);
518 double x_lo=-2*M_PI,x_hi=2*M_PI;
519 float params[13];
520 for(int ipar=0;ipar<13;ipar++) {params[ipar]=0;}
521 gsl_function F;
522 F.function = &(AddFlowByShifting::vn_func);
523 F.params =&params;
524 gsl_root_fsolver_set (s, &F, x_lo, x_hi);
525 int iter=0;
526 params[ 0]=phi_0;
539 int status;
540 double phi=phi_0;
541 do
542 {
543 iter++;
544 status = gsl_root_fsolver_iterate (s);
545 phi = gsl_root_fsolver_root (s);
546 x_lo = gsl_root_fsolver_x_lower (s);
547 x_hi = gsl_root_fsolver_x_upper (s);
548 status = gsl_root_test_interval (x_lo, x_hi,0, 0.00001);
549 }
550 while (status == GSL_CONTINUE && iter < 1000);
551 gsl_root_fsolver_free (s);
552
553 if (iter>=1000) return 0;
554
555 phishift = phi-phi_0;
556 }
557
558 if(std::abs(phishift) > 1e-7) {
559 momentum.rotateZ(phishift*Gaudi::Units::rad);
560 parent->set_momentum( HepMC::FourVector(momentum.px(),momentum.py(),momentum.pz(),momentum.e()) );
561 }
562 ATH_MSG_DEBUG( "Parent particle:" <<
563 " V1 = " << m_v_n[Harmonic::v1] <<
564 " V2 = " << m_v_n[Harmonic::v2] <<
565 " V3 = " << m_v_n[Harmonic::v3] <<
566 " V4 = " << m_v_n[Harmonic::v4] <<
567 " V5 = " << m_v_n[Harmonic::v5] <<
568 " V6 = " << m_v_n[Harmonic::v6] <<
569 " Phi shift = " << phishift <<
570 " Phi shifted = " << momentum.phi() );
571
572 return phishift;
573}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define F(x, y, z)
Definition MD5.cxx:112
#define ATLAS_THREAD_SAFE
static double vn_func(double x, void *params)
BooleanProperty m_flow_fluctuations
HepMC3::FourVector FourVector
unsigned long long T
status
Definition merge.py:16

◆ ao_test()

void AddFlowByShifting::ao_test ( double b,
double eta,
double pt )
private

Definition at line 655 of file AddFlowByShifting.cxx.

656{
657 for(int ihar=0;ihar<Harmonic::NumHar;ihar++){
658 m_v_n[ihar]=0.0;
659 }
660
661 pt/=1000;
662 if(pt>2) pt = 2; // flat max at pt > 2
663
664 m_v_n[Harmonic::v2] = 0.02 * b * pt;
665}

◆ custom_vn()

void AddFlowByShifting::custom_vn ( double b,
double eta,
double pt )
private

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode AddFlowByShifting::execute ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 231 of file AddFlowByShifting.cxx.

231 {
232 ATH_MSG_INFO(">>> AddFlowByShifting from execute");
233
234 CLHEP::HepRandomEngine *rndmEngine = getRandomEngine("FLOW", ctx);
235 // Get hijing event parameters
236 const HijingEventParams *hijing_pars;
237 if( evtStore()->retrieve(hijing_pars, "Hijing_event_params").isFailure() ) {
238 ATH_MSG_ERROR("Could not retrieve Hijing_event_params");
239 return StatusCode::FAILURE;
240 }
241 ATH_MSG_INFO("Event parameters: B = " << hijing_pars->get_b()<<
242 " BPhi = " << hijing_pars->get_bphi());
243
244
245 // FIXME: changing data in the event store
246 HijingEventParams *hijing_pars_nc = const_cast<HijingEventParams*> (hijing_pars);
247
248
249 // Read Data from Transient Store
250 const McEventCollection* mcCollptr;
251 if ( evtStore()->retrieve(mcCollptr, m_inkey).isFailure() ) {
252 ATH_MSG_ERROR("Could not retrieve truth McEventCollection");
253 return StatusCode::FAILURE;
254 }
255
256
257 // Loop over all events in original McEventCollection and
258 // Copy to a new (modifiable) collection
260 McEventCollection* mcFlowCollptr = new McEventCollection();
261 for (citr = mcCollptr->begin(); citr!=mcCollptr->end(); ++citr) {
262 mcFlowCollptr->push_back(new HepMC::GenEvent(*(*citr)));
263 }
264
265
266 //Geneate the event-plane angles (some of them may or may not be used later on)
267 //Store the angles into the hijing event parameters
268 for(int ihar=0;ihar<6;ihar++){
269 m_psi_n[ihar] =(CLHEP::RandFlat::shoot(rndmEngine)-0.5)*2*M_PI / (ihar+1); //Principal value must be within -PI/n to PI/n
270 hijing_pars_nc->set_psi(ihar+1,m_psi_n[ihar]);
271 }
272 m_psi_n[1]=hijing_pars->get_bphi() ;//the psi2 plane is aligned with the impact parameter
273 m_psi_n[1]=std::atan2(std::sin(2*m_psi_n[1]),std::cos(2*m_psi_n[1]))/2.0;//ensure that Psi2 is within [-PI/2,PI/2]
274 hijing_pars_nc->set_psi(2,m_psi_n[1]);
275 ATH_MSG_DEBUG(" Psi2 for event : "<<(*hijing_pars).get_psi(2));
276
277
278 // Add flow by phi angle shifting
280 for (itr = mcFlowCollptr->begin(); itr!=mcFlowCollptr->end(); ++itr) {
281 ATH_MSG_DEBUG("Next event in the bag ...");
282
283
284
285 auto mainvtx=(*itr)->vertices().front();
286 if(m_flow_fluctuations) Set_EbE_Fluctuation_Multipliers(mainvtx,hijing_pars->get_b(),rndmEngine);
287 int particles_in_event = (*itr)->particles().size();
289 for ( auto parent: mainvtx->particles_out())
290 {
291 // Process particles from main vertex
292 CLHEP::HepLorentzVector momentum(parent->momentum().px(),
293 parent->momentum().py(),
294 parent->momentum().pz(),
295 parent->momentum().e());
296 ATH_MSG_DEBUG("Parent particle: " << parent <<
297 " Eta = " << momentum.pseudoRapidity()<<
298 " Phi = " << momentum.phi() );
299
300 //skip particle if eta is outside implementation range
301 if(m_floweta_sw){
302 float eta=std::abs(momentum.pseudoRapidity());
304 }
305
306 //skip particle if pT is outside implementation range
307 if(m_flowpt_sw){
308 float pT=momentum.perp();
309 if (pT<m_flow_minpt || pT> m_flow_maxpt) continue;
310 }
311
312 // Randomize phi if explicitely requested
313 if(m_ranphi_sw) {
314 double phishift = SetParentToRanPhi(parent, rndmEngine);
315 MoveDescendantsToParent(parent, phishift) ;// adjust descendants to parent position
316 }
317
318 // Add flow to particles from main vertex
319 double phishift = AddFlowToParent(parent, hijing_pars);
320 MoveDescendantsToParent(std::move(parent), phishift);// adjust descendants to parent position
321 }
322
323 // correct for double counting
325 // correct for incoming particles
326 ATH_MSG_INFO( " Particles in event: " << particles_in_event <<
327 " Processed for flow: " << m_particles_processed+2);
328 if(particles_in_event != (m_particles_processed+2)){
329 ATH_MSG_WARNING( " Particles in event: " << particles_in_event <<
330 " Processed for flow: " << m_particles_processed+2);
331 }
332 }
333
334 if(evtStore()->record(mcFlowCollptr, m_outkey).isFailure()){
335 ATH_MSG_ERROR("Could not record flow McEventCollection");
336 return StatusCode::FAILURE;
337 }
338 return StatusCode::SUCCESS;
339}
#define ATH_MSG_INFO(x)
StringProperty m_outkey
IntegerProperty m_flowpt_sw
void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
double AddFlowToParent(HepMC::GenParticlePtr parent, const HijingEventParams *hijing_pars)
double SetParentToRanPhi(HepMC::GenParticlePtr parent, CLHEP::HepRandomEngine *rndmEngine)
IntegerProperty m_floweta_sw
FloatProperty m_flow_maxeta
void MoveDescendantsToParent(HepMC::GenParticlePtr parent, double phishift)
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
StringProperty m_inkey
IntegerProperty m_ranphi_sw
FloatProperty m_flow_maxpt
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
void set_psi(int ihar, float psi)
float get_bphi() const
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode AddFlowByShifting::finalize ( )

Definition at line 342 of file AddFlowByShifting.cxx.

342 {
343 ATH_MSG_INFO(">>> AddFlowByShifting from finalize <<<");
344 if(m_graph_fluc){
345 delete m_graph_fluc ;
346 m_graph_fluc=nullptr;
347 }
348
349 // End of finalization step
350 return StatusCode::SUCCESS;
351}

◆ fixed_v2()

void AddFlowByShifting::fixed_v2 ( double b,
double eta,
double pt )
private

Definition at line 632 of file AddFlowByShifting.cxx.

633{
634 for(int ihar=0;ihar<Harmonic::NumHar;ihar++){
635 m_v_n[ihar]=0.0;
636 }
637 m_v_n[Harmonic::v2]=0.0500;
638}

◆ fixed_vn()

void AddFlowByShifting::fixed_vn ( double b,
double eta,
double pt )
private

Definition at line 620 of file AddFlowByShifting.cxx.

621{
622 m_v_n[Harmonic::v1]=0.0000;
623 m_v_n[Harmonic::v2]=0.0500;
624 m_v_n[Harmonic::v3]=0.0280;
625 m_v_n[Harmonic::v4]=0.0130;
626 m_v_n[Harmonic::v5]=0.0045;
627 m_v_n[Harmonic::v6]=0.0015;
628}

◆ getRandomEngine()

CLHEP::HepRandomEngine * AddFlowByShifting::getRandomEngine ( const std::string & streamName,
const EventContext & ctx ) const
private

Definition at line 221 of file AddFlowByShifting.cxx.

223{
224 ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
225 std::string rngName = name()+streamName;
226 rngWrapper->setSeed( rngName, ctx );
227 return rngWrapper->getEngine(ctx);
228}
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:154
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:108
ServiceHandle< IAthRNGSvc > m_rndmSvc

◆ initialize()

StatusCode AddFlowByShifting::initialize ( )

Definition at line 68 of file AddFlowByShifting.cxx.

68 {
69 ATH_MSG_INFO(">>> AddFlowByShifting from Initialize <<<");
70
71 ATH_CHECK(m_rndmSvc.retrieve());
72
73 ATH_MSG_INFO("**********Settings for Afterburner************");
74 ATH_MSG_INFO("McTruthKey : " << m_inkey );
75 ATH_MSG_INFO("McFlowKey : " << m_outkey );
76
77 ATH_MSG_INFO("FlowFunctionName : " << m_flow_function_name );
78 ATH_MSG_INFO("FlowInplementation : " << m_flow_implementation);
79 ATH_MSG_INFO("FlowFluctuations : " << m_flow_fluctuations );
80
81 ATH_MSG_INFO("RandomizePhi : " << m_ranphi_sw );
82
83 ATH_MSG_INFO("FlowEtaSwitch : " << m_floweta_sw );
84 ATH_MSG_INFO("FlowMinEtaCut : " << m_flow_mineta );
85 ATH_MSG_INFO("FlowMaxEtaCut : " << m_flow_maxeta );
86
87 ATH_MSG_INFO("FlowPtSwitch : " << m_flowpt_sw );
88 ATH_MSG_INFO("FlowMinPtCut : " << m_flow_minpt );
89 ATH_MSG_INFO("FlowMaxPtCut : " << m_flow_maxpt );
90
91 ATH_MSG_INFO("FlowV1 : " << m_custom_v1 );
92 ATH_MSG_INFO("FlowV2 : " << m_custom_v2 );
93 ATH_MSG_INFO("FlowV3 : " << m_custom_v3 );
94 ATH_MSG_INFO("FlowV4 : " << m_custom_v4 );
95 ATH_MSG_INFO("FlowV5 : " << m_custom_v5 );
96 ATH_MSG_INFO("FlowV6 : " << m_custom_v6 );
97 ATH_MSG_INFO("FlowBSwitch : " << m_flowb_sw );
98 ATH_MSG_INFO("********************************r*************");
99
100
101 // Select the flow-implementing function based of the function-choice variable
112 else{
113 ATH_MSG_ERROR("Unimplemented option for setting 'FlowFunctionName' : " << m_flow_function_name);
114 return StatusCode::FAILURE;
115 }
116
117
119 if (m_flow_implementation=="approximate"){
121 ATH_MSG_WARNING("'FlowInplementation=\"approximate\"' is obsolete, please switch to 'FlowInplementation=\"exact\"' ");
122 }
123 else if(m_flow_implementation=="exact" ){
125 }
126 else{
127 ATH_MSG_ERROR("Unimplemented option for setting 'FlowInplementation' : " << m_flow_implementation);
128 return StatusCode::FAILURE;
129 }
130
131
132
133 //TGraph storing the v2_RP/delta Vs b_imp values to be used in implementing the EbyE fluctuations
134 //the values below are b_imp-low,b_imp-high, delta/v2_RP for different centralities
135 //underflow and overflow bins are added for smooth extrapolation
137 //Fluctuations for Pb+Pb
138 if(m_flow_function_name=="jjia_minbias_new" ||
139 m_flow_function_name=="jjia_minbias_new_v2only")
140 {
141 //The delta/v2_RP values are taken from Fig15 of EbE vn paper (arXiv:1305.2942)
142 // <0 , 0-1 , 1-2 , 2-3 , 3-4 , 4-5 , 5-10 , 10-15, 15-20, 20-25, 25-30,
143 float b_lo[21]={ -1.00, 0.000, 1.483, 2.098, 2.569, 2.966, 3.317, 4.687, 5.739, 6.627, 7.409,
144 8.117, 8.767, 9.373, 9.943,10.479,10.991,11.479,11.947,15.00 ,100.0};
145 // 30-35, 35-40, 40-45, 45-50, 50-55, 55-60, 60-65, 65-70, 70-
146 float b_hi[21]={ -1.00 , 1.483, 2.098, 2.569, 2.966, 3.317, 4.687, 5.739, 6.627, 7.409, 8.117,//bimp_high
147 8.767, 9.373, 9.943,10.479,10.991,11.479,11.947,12.399,15.00 ,100.0};
148 float val [21]={ 5.600, 5.600, 5.600,1.175 ,0.8253,0.7209,0.5324,0.4431,0.3984,0.3844,0.3847,
149 0.3935,0.4106,0.4310,0.4574,0.4674,0.4873,0.4796,0.4856,0.5130,0.5130};
150 float bimp_vals[21];
151
152 for(int i=0;i<21;i++){
153 bimp_vals[i]=(b_lo[i]+b_hi[i])/2.0f;
154 val [i]=1.0f/val[i];//change to v2_RP/delta
155 val [i]=1.0/val[i];//change to v2_RP/delta
156 }
157
158 m_graph_fluc=new TGraph(21,bimp_vals,val);
159 }
160
161 //Fluctuations for O+O
162 if(m_flow_function_name=="OO_eta_indep")
163 {
164 //The v2{2} and v2{4} values are taken from the OO paper (arXiv:2509.05171)
165 //The v2{4} values beyond the 50-60% bin are put in by hand
166 //The v2{2} values beyond the 75-80% bin are put in by hand
167 //The impact parameters are obtained from HIJING
168
169 //4-particle cumulant v2 (v2{4})
170 // <0, 0-1, 1-2, 2-3, 3-4, 4-5, 5-10, 10-15, 15-20, 20-25, 25-30,
171 // 30-35, 35-40, 40-50, 50-60, 60-80, 80-100, >100,
172 float v2_4 [18]={ 0.0444322, 0.0444322, 0.0476009, 0.0495882, 0.0513053, 0.0527020, 0.0563533, 0.0614435, 0.0650522, 0.0675199, 0.0693970,
173 0.0705456, 0.0706748, 0.0686654, 0.0571383, 0.04 , 0.02 , 0.0 };//last three bins are put in by hand
174 float bimp4[18]={-1 , 0.481843, 0.886609 , 1.13462 , 1.33981 , 1.52064 , 1.95342 , 2.51881 , 2.97665 , 3.37416 , 3.72876 ,
175 4.05377 , 4.35564 , 4.77463 , 5.30719 , 6.08296 , 7.6415 , 15 };
176
177
178 // template-fit v2 (v2{2})
179 // <0, 0-1, 1-2, 2-3, 3-4, 4-5, 5-10, 10-15, 15-20, 20-25, 25-30,
180 // 30-35, 35-40, 40-45, 45-50, 50-55, 55-60, 60-65, 65-70, 70-75, 75-80, 80-100,>100
181 float v2_2 [23]={ 0.0749381, 0.0749381, 0.0782992, 0.0801742, 0.0814646, 0.0826611, 0.0853616, 0.0889407, 0.0913229, 0.0928072, 0.0933774,
182 0.0933299, 0.0926254, 0.0910148, 0.0889322, 0.086161 , 0.0828212, 0.0793132, 0.0755036, 0.0714726, 0.0668264, 0.055 , 0.05};//last two bins are put in by hand
183 float bimp2[23]={-1 , 0.481843, 0.886609 , 1.13462 , 1.33981 , 1.52064 , 1.95342 , 2.51881 , 2.97665 , 3.37416 , 3.72876 ,
184 4.05377 , 4.35564 , 4.63868 , 4.91057 , 5.17773 , 5.43665 , 5.68739 , 5.94258 , 6.20668 , 6.49519 , 7.6415 , 15};
185
186
187 //Evaluate ratio of v2{4}/delta
188 TGraph *graph_v2_4=new TGraph(18,bimp4,v2_4);
189 TGraph *graph_v2_2=new TGraph(23,bimp2,v2_2);
190 float ratio[23]={0};
191 for(int i=0;i<23;i++){
192 double vn_RP=graph_v2_4->Eval(bimp2[i]);
193 double vn_2 =graph_v2_2->Eval(bimp2[i]);
194 double delta=vn_2*vn_2 - vn_RP*vn_RP;
195 if(delta>0){
196 ratio[i]= vn_RP/sqrt(delta/2.0);
197 }
198 else{
199 ATH_MSG_ERROR("vn{2}<vn{4} for b_imp = " << bimp2[i]);
200 return StatusCode::FAILURE;
201 }
202 }
203
204 m_graph_fluc=new TGraph(23,bimp2,ratio);
205 delete graph_v2_4;
206 delete graph_v2_2;
207 }
208 //Fluctuations for Ne+Ne (TODO)
209
210 else{
211 ATH_MSG_ERROR("Flow fluctuations are not implemented for the following case: " << m_flow_function_name);
212 }
213 }
214
215
216 // Initialization terminated
217 return StatusCode::SUCCESS;
218}
#define ATH_CHECK
Evaluate an expression and check for errors.
StringProperty m_flow_function_name
FloatProperty m_flow_mineta
void jjia_minbias_new(double b, double eta, double pt)
void ao_test(double b, double eta, double pt)
StringProperty m_flow_implementation
void p_Pb_cent_eta_indep(double b, double eta, double pt)
FloatProperty m_flow_minpt
IntegerProperty m_flowb_sw
void jjia_minbias_new_v2only(double b, double eta, double pt)
void jjia_minbias_old(double b, double eta, double pt)
void fixed_v2(double b, double eta, double pt)
void OO_eta_indep(double b, double eta, double pt)
void custom_vn(double b, double eta, double pt)
void fixed_vn(double b, double eta, double pt)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ jjia_minbias_new()

void AddFlowByShifting::jjia_minbias_new ( double b,
double eta,
double pt )
private

Definition at line 578 of file AddFlowByShifting.cxx.

579{
580 pt=pt/1000.0; //convert to GeV
581
582 float a1,a2,a3,a4;
583 a1=0.4397*std::exp(-(b-4.526)*(b-4.526)/72.0) + 0.636;
584 a2=1.916/(b+2) +0.1;
585 a3=4.79*0.0001*(b-0.621)*(b-10.172)*(b-23)+1.2; // this is >0 for b>0
586 a4=0.135*std::exp(-0.5*(b-10.855)*(b-10.855)/4.607/4.607) +0.0120;
587
588 float temp1 = std::pow(pt , a1) / (1+std::exp( (pt-3.0)/a3));
589 float temp2 = std::pow(pt+0.1,-a2) / (1+std::exp(-(pt-4.5)/a3));
590 float temp3 = 0.01 / (1+std::exp(-(pt-4.5)/a3));
591
592 m_v_n[Harmonic::v2] = ( a4*(temp1+temp2) + temp3 )* std::exp(-0.5* eta*eta /6.27/6.27) ;
593
594 float fb=0.97 +1.06*std::exp(-0.5*b*b/3.2/3.2);
595 m_v_n[Harmonic::v3]=std::pow(fb*std::sqrt(m_v_n[1]),3);
596
597 float gb= 1.096 +1.36 *std::exp(-0.5*b*b/3.0/3.0);
598 gb=gb*sqrt(m_v_n[1]);
599 m_v_n[Harmonic::v4]=pow(gb,4);
600 m_v_n[Harmonic::v5]=pow(gb,5);
601 m_v_n[Harmonic::v6]=pow(gb,6);
603}
constexpr int pow(int x)
Definition conifer.h:27

◆ jjia_minbias_new_v2only()

void AddFlowByShifting::jjia_minbias_new_v2only ( double b,
double eta,
double pt )
private

Definition at line 607 of file AddFlowByShifting.cxx.

608{
609 jjia_minbias_new(b, eta, pt);
610 //Set all harmonics except v2 to 0
611 m_v_n[Harmonic::v1] = 0;
612 m_v_n[Harmonic::v3] = 0;
613 m_v_n[Harmonic::v4] = 0;
614 m_v_n[Harmonic::v5] = 0;
615 m_v_n[Harmonic::v6] = 0;
616}

◆ jjia_minbias_old()

void AddFlowByShifting::jjia_minbias_old ( double b,
double eta,
double pt )
private

Definition at line 642 of file AddFlowByShifting.cxx.

643{
644 m_v_n[Harmonic::v1] = 0;
645 m_v_n[Harmonic::v2] = 0.03968 * b
646 * (1 - 2.1/(1 + std::exp(1.357*(pt/1000))))
647 * std::exp(-(eta*eta)/(2*6.37*6.37));
648 m_v_n[Harmonic::v3]=0.0000;
649 m_v_n[Harmonic::v4]=0.0000;
650 m_v_n[Harmonic::v5]=0.0000;
651 m_v_n[Harmonic::v6]=0.0000;
652}

◆ MoveDescendantsToParent()

void AddFlowByShifting::MoveDescendantsToParent ( HepMC::GenParticlePtr parent,
double phishift )
private

Definition at line 381 of file AddFlowByShifting.cxx.

383{
384 // Move the branch of descendant vertices and particles
385 // by phishift to parent particle position
386 auto endvtx = parent->end_vertex();
387 if ( endvtx ) {
388 ATH_MSG_DEBUG("Processing branch of parent particle "<< parent);
389
390 //Added October 2025
391 // --- Rotate the parent’s end vertex itself ---
392 if (std::abs(phishift) > 1e-7) {
393 CLHEP::HepLorentzVector pos(endvtx->position().x(),
394 endvtx->position().y(),
395 endvtx->position().z(),
396 endvtx->position().t());
397 pos.rotateZ(phishift * Gaudi::Units::rad);
398 endvtx->set_position(HepMC::FourVector(pos.x(), pos.y(), pos.z(), pos.t()));
399 }
400
401
402 //Added October 2025
403 // --- Rotate the parent’s immediate daughters (outgoing of endvtx) ---
404 for (auto child : endvtx->particles_out())
405 {
406 CLHEP::HepLorentzVector p(child->momentum().px(),
407 child->momentum().py(),
408 child->momentum().pz(),
409 child->momentum().e());
410 if (std::abs(phishift) > 1e-7) {
411 p.rotateZ(phishift * Gaudi::Units::rad);
412 child->set_momentum(HepMC::FourVector(p.px(), p.py(), p.pz(), p.e()));
413 }
415 }
416
417
418 // now rotate descendant vertices
419 for (HepMC::GenVertexPtr descvtx: HepMC::descendant_vertices(endvtx)) { //}
420
421 ATH_MSG_DEBUG("Processing vertex " << descvtx);
422
423 // rotate vertex
424 if(std::abs(phishift) > 1e-7) {
425 CLHEP::HepLorentzVector position(descvtx->position().x(),
426 descvtx->position().y(),
427 descvtx->position().z(),
428 descvtx->position().t());
429 position.rotateZ(phishift*Gaudi::Units::rad);
430 descvtx->set_position(HepMC::FourVector( position.x(),position.y(),position.z(),position.t()) );
431 }
432
433 // now rotate their associated particles
434 for (auto descpart: descvtx->particles_out())
435 {
436 CLHEP::HepLorentzVector momentum(descpart->momentum().px(),
437 descpart->momentum().py(),
438 descpart->momentum().pz(),
439 descpart->momentum().e());
440 ATH_MSG_DEBUG("Descendant particle: " << descpart <<
441 " Eta = " << descpart->momentum().pseudoRapidity() <<
442 " Phi = " << descpart->momentum().phi() );
444 // rotate particle
445 if(std::abs(phishift) > 1e-7) {
446 momentum.rotateZ(phishift*Gaudi::Units::rad);
447 descpart->set_momentum( HepMC::FourVector(momentum.px(),momentum.py(),momentum.pz(),momentum.e()) );
448 ATH_MSG_DEBUG(" Phi shift = " << phishift<<
449 " Phi shifted = " << momentum.phi());
450 }
451 }
452 }
453 }
454 return;
455}
HepMC3::GenVertexPtr GenVertexPtr
Definition GenVertex.h:23
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ OO_eta_indep()

void AddFlowByShifting::OO_eta_indep ( double b,
double eta,
double pt )
private

Definition at line 710 of file AddFlowByShifting.cxx.

710 {
711 pt=pt/1000.0; //convert to GeV
712
713
714 //For Testing
715 /*
716 m_v_n[Harmonic::v1]=0;
717 m_v_n[Harmonic::v2]=0.1;
718 m_v_n[Harmonic::v3]=0.05;
719 m_v_n[Harmonic::v4]=0.03;
720 m_v_n[Harmonic::v5]=0;
721 m_v_n[Harmonic::v6]=0;
722 return;
723 */
724
725
726 //pT differential vn for 0-5% centrality
727 static TGraph gr_v2pt;
728 static TGraph gr_v3pt;
729 static TGraph gr_v4pt;
730 //centrality dependent scale-factors for other centralities
731 static TGraph gr_v2_cent_scale;
732 static TGraph gr_v3_cent_scale;
733 static TGraph gr_v4_cent_scale;
734
735 static bool is_initialized=false;
736 if(is_initialized==false){
737 //----------------------------------------------------------------------------------
738 //The pt Dependent v2,v3,v4 for the 0-5% centrality interval from template-fit method
739 //https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/HION-2025-02/fig_05.png
740 const int NumPtBins=23;
741 float v2_pt[NumPtBins]={
742 0.0 ,//extrapolation
743 0.049533 ,0.0622719,0.0776591,0.0906141,0.101341 ,0.110451 ,0.117545,
744 0.123217 ,0.126643 ,0.129142 ,0.129176 ,0.128795 ,0.126009 ,0.120966,
745 0.109416 ,0.0966881,0.0825195,0.0708585,0.0615164,0.0508748,
746 0.015 ,0.015 //extrapolation to 1.5% v2 at high-pT
747 };
748 float v3_pt[NumPtBins]={
749 0.0 ,//extrapolation
750 0.0186328,0.0262968,0.0366394,0.0467804,0.0562739,0.0639566,0.0714195,
751 0.0783429,0.0838629,0.0886202,0.0907969,0.0922756,0.0948961,0.0947266,
752 0.0898434,0.0839913,0.0801961,0.0685197,0.0648406,0.0600871,
753 0.00 ,0.00//extrapolation
754 };
755 //----------------------------------------------------
756 //For v3, we use the average of the template and 2PC values
757 float v3_pt_2PC[NumPtBins]={
758 0.0 ,//extrapolation
759 0.0182106,0.0255873,0.0355349,0.0451583,0.0537545,0.0611133,0.0675791,
760 0.0732434,0.0778371,0.0812549,0.0823093,0.0826907,0.082954 ,0.0800712,
761 0.0719686,0.062255 ,0.0498296,0.0370541,0.027638 ,0.0139785,
762 0.00 ,0.00//extrapolation
763 };
764 for(int i=0;i<NumPtBins;i++) v3_pt[i]=(v3_pt[i]+v3_pt_2PC[i])/2.0;
765 //----------------------------------------------------
766
767 float v4_pt[NumPtBins]={
768 0.0 ,//extrapolation
769 0.00446155,0.00710366,0.0117637,0.0158203,0.01931 ,0.0234234,0.0268995,
770 0.0299693 ,0.0321662 ,0.0335182,0.0358789,0.0374195,0.0359359,0.0327255,
771 0.0254762 ,0.0273239 ,0.0212901,0.0152591, -0 ,-0 ,//-ve values replaced by -0
772 0.0 , 0.00//extrapolation
773 };
774 float pt_bins[NumPtBins]={
775 0.0 ,//extrapolation
776 0.55 ,0.7 ,0.9 ,1.1 , 1.3, 1.5, 1.7,
777 1.9 ,2.1 ,2.3 ,2.5 , 2.7, 2.9, 3.25,
778 3.75 ,4.25 ,4.75 ,5.25 , 5.75, 6.5,
779 10.0 ,10000 //extrapolation
780 };
781 gr_v2pt=TGraph(NumPtBins,pt_bins,v2_pt);
782 gr_v3pt=TGraph(NumPtBins,pt_bins,v3_pt);
783 gr_v4pt=TGraph(NumPtBins,pt_bins,v4_pt);
784 gr_v2pt.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
785 gr_v3pt.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
786 gr_v4pt.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
787 //----------------------------------------------------------------------------------
788
789
790 //----------------------------------------------------------------------------------
791 //centrality dependent v2, v3, v4 (template-fit method)
792 //https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/HION-2025-02/figaux_03.png
793 const int NumCentBins=23;
794 float v2_cent[NumCentBins]={
795 0.0749381,//underflow
796 0.0749381,0.0782992,0.0801742,0.0814646,0.0826611,0.0853616,0.0889407,
797 0.0913229,0.0928072,0.0933774,0.0933299,0.0926254,0.0910148,0.0889322,
798 0.086161 ,0.0828212,0.0793132,0.0755036,0.0714726,0.0668264,
799 0.055 , 0.05 //80-100 and overflow, put by hand ; using 5% v2 asymptotically
800 };
801 float v3_cent[NumCentBins]={
802 0.0409694,//underflow
803 0.0409694,0.0399241,0.0394262,0.0388545,0.0385726,0.0375281,0.0360179,
804 0.0345174,0.0330085,0.0314149,0.0298081,0.0282141,0.02664 ,0.0253094,
805 0.0239221,0.0220779,0.0213821,0.0203176,0.0175276,0.0151146,
806 0.010 , 0.0 //80-100 and overflow, put by hand; using 0% v3 asymptotically
807 };
808 float v4_cent[NumCentBins]={
809 0.0131927 ,//underflow
810 0.0131927 ,0.0129838,0.0135232 ,0.0132689 ,0.0130435 ,0.0134254 ,0.013706 ,
811 0.0136456 ,0.0136656,0.013245 ,0.0130861 ,0.0125356 ,0.0118006 ,0.0110316,
812 0.00987005,0.0106963,0.00933145,0.00784534,0.00393584,0.00308131,
813 0.003 , 0.0 //80-100 and overflow, put by hand; using 0% v4 asymptotically
814 };
815 //b_imp values for differen centralities
816 float b_imp[NumCentBins]={
817 -1 , //underflow
818 0.481843 ,0.886609 , 1.13462 , 1.33981 , 1.52064 , 1.95342 , 2.51881 ,
819 2.97665 ,3.37416 , 3.72876 , 4.05377 , 4.35564 , 4.63868 , 4.91057 ,
820 5.17773 ,5.43665 , 5.68739 , 5.94258 , 6.20668 , 6.49519 ,
821 7.6415 , 15 , //80-100 and overflow
822 };
823
824 //Integrated v2, v3, v4, for 0-5% centrality bin
825 float vn_0_5[3]={0.078963056, 0.039746672, 0.013202649};
826 //divide by integrated vn for 0-5% centrality
827 for(int i=0;i<NumCentBins;i++){
828 v2_cent[i]/=vn_0_5[0];
829 v3_cent[i]/=vn_0_5[1];
830 v4_cent[i]/=vn_0_5[2];
831 }
832 gr_v2_cent_scale=TGraph(NumCentBins, b_imp, v2_cent);
833 gr_v3_cent_scale=TGraph(NumCentBins, b_imp, v3_cent);
834 gr_v4_cent_scale=TGraph(NumCentBins, b_imp, v4_cent);
835 gr_v2_cent_scale.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
836 gr_v3_cent_scale.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
837 gr_v4_cent_scale.SetBit(TGraph::kIsSortedX);//For faster return From Eval()
838 //----------------------------------------------------------------------------------
839 is_initialized=true;
840 }
841
842
844 m_v_n[Harmonic::v2]=gr_v2pt.Eval(pt) * gr_v2_cent_scale.Eval(b);
845 m_v_n[Harmonic::v3]=gr_v3pt.Eval(pt) * gr_v3_cent_scale.Eval(b);
846 m_v_n[Harmonic::v4]=gr_v4pt.Eval(pt) * gr_v4_cent_scale.Eval(b);
849}

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ p_Pb_cent_eta_indep()

void AddFlowByShifting::p_Pb_cent_eta_indep ( double b,
double eta,
double pt )
private

Definition at line 679 of file AddFlowByShifting.cxx.

680{
681 pt=pt/1000.0; //convert to GeV
682
683 float an_val[4][3];
684
685 an_val[0][0] = 0.1149;
686 an_val[0][1] = 1.181;
687 an_val[0][2] = 0.3767;
688
689 an_val[1][0] = 0.0498;
690 an_val[1][1] = 1.688;
691 an_val[1][2] = 0.5046;
692
693 an_val[2][0] = 0.02095;
694 an_val[2][1] = 2.196;
695 an_val[2][2] = 0.6259;
696
697 an_val[3][0] = 0.00682*0.5;//added in 0.5 factor by hand
698 an_val[3][1] = 4.938;
699 an_val[3][2] = 1.237;
700
702 m_v_n[Harmonic::v2]=an_val[0][0]*std::pow(pt,an_val[0][1])*std::exp(-an_val[0][2]*pt);
703 m_v_n[Harmonic::v3]=an_val[1][0]*std::pow(pt,an_val[1][1])*std::exp(-an_val[1][2]*pt);
704 m_v_n[Harmonic::v4]=an_val[2][0]*std::pow(pt,an_val[2][1])*std::exp(-an_val[2][2]*pt);
705 m_v_n[Harmonic::v5]=an_val[3][0]*std::pow(pt,an_val[3][1])*std::exp(-an_val[3][2]*pt);
707}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ Set_EbE_Fluctuation_Multipliers()

void AddFlowByShifting::Set_EbE_Fluctuation_Multipliers ( HepMC::GenVertexPtr mainvtx,
float b,
CLHEP::HepRandomEngine * rndmEngine )
private

Definition at line 851 of file AddFlowByShifting.cxx.

851 {
852 for(int ihar=0;ihar<Harmonic::NumHar;ihar++){
853 m_EbE_Multiplier_vn[ihar]=1.0;
854 }
855
856
857 for(int ihar=0;ihar<Harmonic::NumHar;ihar++){
858 float vn_rp=0,delta=0;//BG parameterizations
859
860 //in the following we assume that the vn in the event is sqrt(<vn^2>)
861 //This is because the vn(pT) were tuned to 2PC/EP measurements
862 //then : vn_evt=vn_rp^2 + 2*(delta^2)
863 //which is used together with the "alpha" to get the "vn_rp" and "delta"
864
865 //No EbE fluctuation for v1
866 if (ihar==Harmonic::v1) continue;
867 //v2
868 else if(ihar==Harmonic::v2){
869 //alpha stores ratio of V2_RP over delta
870 float alpha=m_graph_fluc->Eval(b);
871 delta=1.0f/sqrt(2.0f+alpha*alpha); //stores delta /v2{2}
872 vn_rp=alpha*delta ; //stores v2^{RP}/v2{2}
873 }
874 //v3-v6
875 else{
876 vn_rp =0;
877 delta=1.0f/sqrt(2.0f);
878 }
879 float X=CLHEP::RandGaussQ::shoot(rndmEngine,vn_rp,delta);
880 float Y=CLHEP::RandGaussQ::shoot(rndmEngine,0.0 ,delta);
881 m_EbE_Multiplier_vn[ihar]=sqrt(X*X+ Y*Y);
882 ATH_MSG_INFO("EbE_Multiplier_v"<<ihar+1<<"="<<m_EbE_Multiplier_vn[ihar]);
883 }
884}

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ SetParentToRanPhi()

double AddFlowByShifting::SetParentToRanPhi ( HepMC::GenParticlePtr parent,
CLHEP::HepRandomEngine * rndmEngine )
private

Definition at line 354 of file AddFlowByShifting.cxx.

356{
357 // Set particle to random phi
358 // Return phi shift
360
361 double phi, phishift;
362 CLHEP::HepLorentzVector momentum(parent->momentum().px(),
363 parent->momentum().py(),
364 parent->momentum().pz(),
365 parent->momentum().e());
366 phi = momentum.phi();
367
368 double rannum = CLHEP::RandFlat::shoot(rndmEngine);
369 double ranphi = (rannum-0.5)*2*M_PI;
370 phishift = ranphi - phi;
371
372 momentum.setPhi(ranphi*Gaudi::Units::rad);
373 parent->set_momentum( HepMC::FourVector(momentum.px(),momentum.py(),momentum.pz(),momentum.e()) );
374
375 ATH_MSG_DEBUG("Parent phi randomized = " << momentum.phi());
376
377 return phishift;
378}

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

◆ vn_func()

double AddFlowByShifting::vn_func ( double x,
void * params )
static

Definition at line 40 of file AddFlowByShifting.cxx.

41{
42 float *par_float = (float*) params;
43 double phi_0 = par_float[0];
44 float *vn = par_float+1;
45 float *psi_n = vn+Harmonic::NumHar;
46 double val=x +2*( vn[Harmonic::v1]*sin(1*(x-psi_n[Harmonic::v1]))/1.0 +
47 vn[Harmonic::v2]*sin(2*(x-psi_n[Harmonic::v2]))/2.0 +
48 vn[Harmonic::v3]*sin(3*(x-psi_n[Harmonic::v3]))/3.0 +
49 vn[Harmonic::v4]*sin(4*(x-psi_n[Harmonic::v4]))/4.0 +
50 vn[Harmonic::v5]*sin(5*(x-psi_n[Harmonic::v5]))/5.0 +
51 vn[Harmonic::v6]*sin(6*(x-psi_n[Harmonic::v6]))/6.0 );
52 return val-phi_0;
53}
#define x

Member Data Documentation

◆ m_custom_v1

FloatProperty AddFlowByShifting::m_custom_v1 {this, "custom_v1" , 0.f }
private

Definition at line 92 of file AddFlowByShifting.h.

92{this, "custom_v1" , 0.f };

◆ m_custom_v2

FloatProperty AddFlowByShifting::m_custom_v2 {this, "custom_v2" , 0.f }
private

Definition at line 93 of file AddFlowByShifting.h.

93{this, "custom_v2" , 0.f };

◆ m_custom_v3

FloatProperty AddFlowByShifting::m_custom_v3 {this, "custom_v3" , 0.f }
private

Definition at line 94 of file AddFlowByShifting.h.

94{this, "custom_v3" , 0.f };

◆ m_custom_v4

FloatProperty AddFlowByShifting::m_custom_v4 {this, "custom_v4" , 0.f }
private

Definition at line 95 of file AddFlowByShifting.h.

95{this, "custom_v4" , 0.f };

◆ m_custom_v5

FloatProperty AddFlowByShifting::m_custom_v5 {this, "custom_v5" , 0.f }
private

Definition at line 96 of file AddFlowByShifting.h.

96{this, "custom_v5" , 0.f };

◆ m_custom_v6

FloatProperty AddFlowByShifting::m_custom_v6 {this, "custom_v6" , 0.f }
private

Definition at line 97 of file AddFlowByShifting.h.

97{this, "custom_v6" , 0.f };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EbE_Multiplier_vn

float AddFlowByShifting::m_EbE_Multiplier_vn[Harmonic::NumHar]
private

Definition at line 112 of file AddFlowByShifting.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_flow_fluctuations

BooleanProperty AddFlowByShifting::m_flow_fluctuations {this, "FlowFluctuations" , false }
private

Definition at line 84 of file AddFlowByShifting.h.

84{this, "FlowFluctuations" , false };

◆ m_flow_function

void(AddFlowByShifting::* AddFlowByShifting::m_flow_function) (double b, double eta, double pt)
private

Definition at line 60 of file AddFlowByShifting.h.

◆ m_flow_function_name

StringProperty AddFlowByShifting::m_flow_function_name {this, "FlowFunctionName" , "jjia_minbias_new"}
private

Definition at line 81 of file AddFlowByShifting.h.

81{this, "FlowFunctionName" , "jjia_minbias_new"};

◆ m_flow_implementation

StringProperty AddFlowByShifting::m_flow_implementation {this, "FlowImplementation", "exact" }
private

Definition at line 82 of file AddFlowByShifting.h.

82{this, "FlowImplementation", "exact" };

◆ m_flow_implementation_type

int AddFlowByShifting::m_flow_implementation_type {0}
private

Definition at line 83 of file AddFlowByShifting.h.

83{0};

◆ m_flow_maxeta

FloatProperty AddFlowByShifting::m_flow_maxeta {this, "FlowMaxEtaCut" , 10.0 }
private

Definition at line 86 of file AddFlowByShifting.h.

86{this, "FlowMaxEtaCut" , 10.0 };

◆ m_flow_maxpt

FloatProperty AddFlowByShifting::m_flow_maxpt {this, "FlowMaxPtCut" , 1000000.f }
private

Definition at line 89 of file AddFlowByShifting.h.

89{this, "FlowMaxPtCut" , 1000000.f };

◆ m_flow_mineta

FloatProperty AddFlowByShifting::m_flow_mineta {this, "FlowMinEtaCut" , 0.f }
private

Definition at line 87 of file AddFlowByShifting.h.

87{this, "FlowMinEtaCut" , 0.f };

◆ m_flow_minpt

FloatProperty AddFlowByShifting::m_flow_minpt {this, "FlowMinPtCut" , 0.f }
private

Definition at line 90 of file AddFlowByShifting.h.

90{this, "FlowMinPtCut" , 0.f };

◆ m_flowb_sw

IntegerProperty AddFlowByShifting::m_flowb_sw {this, "FlowBSwitch" , 0 }
private

Definition at line 91 of file AddFlowByShifting.h.

91{this, "FlowBSwitch" , 0 };//currently not used

◆ m_floweta_sw

IntegerProperty AddFlowByShifting::m_floweta_sw {this, "FlowEtaSwitch" , 0 }
private

Definition at line 85 of file AddFlowByShifting.h.

85{this, "FlowEtaSwitch" , 0 };

◆ m_flowpt_sw

IntegerProperty AddFlowByShifting::m_flowpt_sw {this, "FlowPtSwitch" , 0 }
private

Definition at line 88 of file AddFlowByShifting.h.

88{this, "FlowPtSwitch" , 0 };

◆ m_graph_fluc

TGraph* AddFlowByShifting::m_graph_fluc {}
private

Definition at line 71 of file AddFlowByShifting.h.

71{};//TGraph storing the v2_RP/delta Vs b_imp

◆ m_inkey

StringProperty AddFlowByShifting::m_inkey {this, "McTruthKey" , "GEN_EVENT" }
private

Definition at line 78 of file AddFlowByShifting.h.

78{this, "McTruthKey" , "GEN_EVENT" }; //FIXME use Read/WriteHandles

◆ m_outkey

StringProperty AddFlowByShifting::m_outkey {this, "McFlowKey" , "FLOW_EVENT" }
private

Definition at line 79 of file AddFlowByShifting.h.

79{this, "McFlowKey" , "FLOW_EVENT" }; //FIXME use Read/WriteHandles

◆ m_particles_processed

int AddFlowByShifting::m_particles_processed {0}
private

Definition at line 99 of file AddFlowByShifting.h.

99{0};

◆ m_psi_n

float AddFlowByShifting::m_psi_n[Harmonic::NumHar]
private

Definition at line 110 of file AddFlowByShifting.h.

◆ m_ranphi_sw

IntegerProperty AddFlowByShifting::m_ranphi_sw {this, "RandomizePhi" , 0 }
private

Definition at line 80 of file AddFlowByShifting.h.

80{this, "RandomizePhi" , 0 };

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> AddFlowByShifting::m_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
private

Definition at line 75 of file AddFlowByShifting.h.

75{this, "RndmSvc", "AthRNGSvc"};

◆ m_v_n

float AddFlowByShifting::m_v_n[Harmonic::NumHar]
private

Definition at line 111 of file AddFlowByShifting.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: