ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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 ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static double vn_func (double x, void *params)
 
static double vn_func_derivative (double x, void *params)
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

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 Set_EbE_Fluctuation_Multipliers (HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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 [6]
 
float m_v_n [6]
 
float m_EbE_Multiplier_vn [6]
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 42 of file AddFlowByShifting.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.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< 6; 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 }

Member Function Documentation

◆ AddFlowToParent()

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

Definition at line 349 of file AddFlowByShifting.cxx.

350 {
352  CLHEP::HepLorentzVector momentum(parent->momentum().px(),
353  parent->momentum().py(),
354  parent->momentum().pz(),
355  parent->momentum().e());
356  double pt = parent->momentum().perp();
357  double eta = parent->momentum().pseudoRapidity();
358  double phi_0 = parent->momentum().phi();
359 
360  int error_=0;
361  if(pt !=pt) {ATH_MSG_ERROR("ERROR pt of track is not defined");error_=1;} //true if pt==nan
362  if(eta !=eta) {ATH_MSG_ERROR("ERROR eta of track is not defined");error_=1;}
363  if(phi_0 !=phi_0) {ATH_MSG_ERROR("ERROR phi of track is not defined");error_=1;}
364  if(error_==1){
365  ATH_MSG_ERROR("Original Particle Momentum(px,py,pz,e,m)="<<parent->momentum().px()<<" "
366  <<parent->momentum().py()<<" "
367  <<parent->momentum().pz()<<" "
368  <<parent->momentum().e() <<" "
369  <<parent->momentum().m() <<" ");
370  }
371 
372 
373 
374 
375  //Call the appropriate function to set the vn values
376  for(int ihar = 0; ihar< 6; ihar++){m_v_n [ihar]=0.0;} //reset the vn for this particle
377  double b = hijing_pars->get_b();
378  (*this.*m_flow_function)(b,eta,pt);//get the vn for this particle
379  if(m_flow_fluctuations){//add EbE fluctuations
380  for(int ihar = 0; ihar< 6; ihar++){
381  m_v_n[ihar] *= m_EbE_Multiplier_vn[ihar];
382  if(m_v_n[ihar]>0.5) {ATH_MSG_WARNING(" Vn Too large "<<ihar+1<<" "<<m_EbE_Multiplier_vn[ihar]<<" "<<m_v_n[ihar]);m_v_n[ihar]=0.5;}
383  }
384  }
385 
386  double phishift=0;
387 
388  // Old fashioned rotation(approximate)
390  float phi=phi_0;
391  phishift= -2*( m_v_n[0]*sin(1*(phi-m_psi_n[0]))/1.0 + m_v_n[1]*sin(2*(phi-m_psi_n[1]))/2.0 +
392  m_v_n[2]*sin(3*(phi-m_psi_n[2]))/3.0 + m_v_n[3]*sin(4*(phi-m_psi_n[3]))/4.0 +
393  m_v_n[4]*sin(5*(phi-m_psi_n[4]))/5.0 + m_v_n[5]*sin(6*(phi-m_psi_n[5]))/6.0 );
394 
395  }
396 
397  // New fashioned rotation(exact)
398  else if (m_flow_implementation_type==1){
399  // Thread-safe according to https://www.gnu.org/software/gsl/doc/html/roots.html
400  const gsl_root_fsolver_type *T ATLAS_THREAD_SAFE = gsl_root_fsolver_brent;
401  gsl_root_fsolver *s = gsl_root_fsolver_alloc (T);
402  double x_lo=-2*M_PI,x_hi=2*M_PI;
403  float params[13];
404  for(int ipar=0;ipar<13;ipar++) {params[ipar]=0;}
405  gsl_function F;
406  F.function = &(AddFlowByShifting::vn_func);
407  F.params =&params;
408  gsl_root_fsolver_set (s, &F, x_lo, x_hi);
409  int iter=0;
410  params[0]=phi_0;
411  params[1]=m_v_n [0]; params[2]=m_v_n [1]; params[3]=m_v_n [2]; params[4 ]=m_v_n [3]; params[5 ]=m_v_n [4]; params[6 ]=m_v_n [5];
412  params[7]=m_psi_n[0]; params[8]=m_psi_n[1]; params[9]=m_psi_n[2]; params[10]=m_psi_n[3]; params[11]=m_psi_n[4]; params[12]=m_psi_n[5];
413  int status;
414  double phi=phi_0;
415  do
416  {
417  iter++;
418  status = gsl_root_fsolver_iterate (s);
419  phi = gsl_root_fsolver_root (s);
420  x_lo = gsl_root_fsolver_x_lower (s);
421  x_hi = gsl_root_fsolver_x_upper (s);
422  status = gsl_root_test_interval (x_lo, x_hi,0, 0.00001);
423  }
424  while (status == GSL_CONTINUE && iter < 1000);
425  gsl_root_fsolver_free (s);
426 
427  if (iter>=1000) return 0;
428 
429  phishift = phi-phi_0;
430  }
431 
432  if(std::abs(phishift) > 1e-7) {
433  momentum.rotateZ(phishift*Gaudi::Units::rad);
434  parent->set_momentum( HepMC::FourVector(momentum.px(),momentum.py(),momentum.pz(),momentum.e()) );
435  }
436  ATH_MSG_DEBUG( "Parent particle: V1 = " << m_v_n[0] <<
437  " V2 = " << m_v_n[1] <<
438  " V3 = " << m_v_n[2] <<
439  " V4 = " << m_v_n[3] <<
440  " V5 = " << m_v_n[4] <<
441  " V6 = " << m_v_n[5] <<
442  " Phi shift = " << phishift <<
443  " Phi shifted = " << momentum.phi() );
444 
445  return phishift;
446 }

◆ ao_test()

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

Definition at line 533 of file AddFlowByShifting.cxx.

534 {
535  pt/=1000;
536  if(pt>2) pt = 2; // flat max at pt > 2
537  m_v_n[1] = 0.02 * b * pt;
538  m_v_n[0] = 0;
539 }

◆ custom_vn()

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

Definition at line 542 of file AddFlowByShifting.cxx.

543 {
544  m_v_n[0]=m_custom_v1;
545  m_v_n[1]=m_custom_v2;
546  m_v_n[2]=m_custom_v3;
547  m_v_n[3]=m_custom_v4;
548  m_v_n[4]=m_custom_v5;
549  m_v_n[5]=m_custom_v6;
550 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode AddFlowByShifting::execute ( )

Definition at line 150 of file AddFlowByShifting.cxx.

150  {
151  ATH_MSG_INFO(">>> AddFlowByShifting from execute");
152 
153  const EventContext& ctx = Gaudi::Hive::currentContext();
154  CLHEP::HepRandomEngine *rndmEngine = getRandomEngine("FLOW", ctx);
155  // Get hijing event parameters
156  const HijingEventParams *hijing_pars;
157  if( evtStore()->retrieve(hijing_pars, "Hijing_event_params").isFailure() ) {
158  ATH_MSG_ERROR("Could not retrieve Hijing_event_params");
159  return StatusCode::FAILURE;
160  }
161  ATH_MSG_INFO("Event parameters: B = " << hijing_pars->get_b()<<
162  " BPhi = " << hijing_pars->get_bphi());
163 
164 
165  // FIXME: changing data in the event store
166  HijingEventParams *hijing_pars_nc = const_cast<HijingEventParams*> (hijing_pars);
167 
168 
169  // Read Data from Transient Store
170  const McEventCollection* mcCollptr;
171  if ( evtStore()->retrieve(mcCollptr, m_inkey).isFailure() ) {
172  ATH_MSG_ERROR("Could not retrieve truth McEventCollection");
173  return StatusCode::FAILURE;
174  }
175 
176 
177  // Loop over all events in original McEventCollection and
178  // Copy to a new (modifiable) collection
180  McEventCollection* mcFlowCollptr = new McEventCollection();
181  for (citr = mcCollptr->begin(); citr!=mcCollptr->end(); ++citr) {
182  mcFlowCollptr->push_back(new HepMC::GenEvent(*(*citr)));
183  }
184 
185 
186  //Geneate the event-plane angles (some of them may or may not be used later on)
187  //Store the angles into the hijing event parameters
188  for(int ihar=0;ihar<6;ihar++){
189  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
190  hijing_pars_nc->set_psi(ihar+1,m_psi_n[ihar]);
191  }
192  m_psi_n[1]=hijing_pars->get_bphi() ;//the psi2 plane is aligned with the impact parameter
193  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]
194  hijing_pars_nc->set_psi(2,m_psi_n[1]);
195  ATH_MSG_DEBUG(" Psi2 for event : "<<(*hijing_pars).get_psi(2));
196 
197 
198  // Add flow by phi angle shifting
200  for (itr = mcFlowCollptr->begin(); itr!=mcFlowCollptr->end(); ++itr) {
201  ATH_MSG_DEBUG("Next event in the bag ...");
202 
203 
204 
205 #ifdef HEPMC3
206  auto mainvtx=(*itr)->vertices().front();
207  if(m_flow_fluctuations) Set_EbE_Fluctuation_Multipliers(mainvtx,hijing_pars->get_b(),rndmEngine);
208  int particles_in_event = (*itr)->particles().size();
210  for ( auto parent: mainvtx->particles_out())
211 #else
212  auto mainvtx=*((*itr)->vertices_begin());
213  if(m_flow_fluctuations) Set_EbE_Fluctuation_Multipliers(mainvtx,hijing_pars->get_b(),rndmEngine);
214  int particles_in_event = (*itr)->particles_size();
216  for ( auto parent: *mainvtx)
217 #endif
218  {
219  // Process particles from main vertex
220  CLHEP::HepLorentzVector momentum(parent->momentum().px(),
221  parent->momentum().py(),
222  parent->momentum().pz(),
223  parent->momentum().e());
224  ATH_MSG_DEBUG("Parent particle: " << parent <<
225  " Eta = " << momentum.pseudoRapidity()<<
226  " Phi = " << momentum.phi() );
227 
228  //skip particle if eta is outside implementation range
229  if(m_floweta_sw){
230  float eta=std::abs(momentum.pseudoRapidity());
231  if (eta<m_flow_mineta || eta> m_flow_maxeta) continue;
232  }
233 
234  //skip particle if pT is outside implementation range
235  if(m_flowpt_sw){
236  float pT=momentum.perp();
237  if (pT<m_flow_minpt || pT> m_flow_maxpt) continue;
238  }
239 
240  // Randomize phi if explicitely requested
241  if(m_ranphi_sw) {
242  double phishift = SetParentToRanPhi(parent, rndmEngine);
243  MoveDescendantsToParent(parent, phishift) ;// adjust decsandants to parent position
244  }
245 
246  // Add flow to particles from main vertex
247  double phishift = AddFlowToParent(parent, hijing_pars);
248  MoveDescendantsToParent(parent, phishift);// adjust decsandants to parent position
249  }
250 
251  // correct for double counting
253  // correct for incoming particles
254  ATH_MSG_INFO( " Particles in event: " << particles_in_event <<
255  " Processed for flow: " << m_particles_processed+2);
256  }
257 
258  if(evtStore()->record(mcFlowCollptr, m_outkey).isFailure()){
259  ATH_MSG_ERROR("Could not record flow McEventCollection");
260  return StatusCode::FAILURE;
261  }
262  return StatusCode::SUCCESS;
263 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode AddFlowByShifting::finalize ( )

Definition at line 266 of file AddFlowByShifting.cxx.

266  {
267  ATH_MSG_INFO(">>> AddFlowByShifting from finalize <<<");
268  // End of finalization step
269  return StatusCode::SUCCESS;
270 }

◆ fixed_v2()

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

Definition at line 514 of file AddFlowByShifting.cxx.

515 {
516  m_v_n[0]=0.0000; m_v_n[1]=0.0500;
517  m_v_n[2]=0.0000; m_v_n[3]=0.0000;
518  m_v_n[4]=0.0000; m_v_n[5]=0.0000;
519 }

◆ fixed_vn()

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

Definition at line 505 of file AddFlowByShifting.cxx.

506 {
507  m_v_n[0]=0.0000; m_v_n[1]=0.0500;
508  m_v_n[2]=0.0280; m_v_n[3]=0.0130;
509  m_v_n[4]=0.0045; m_v_n[5]=0.0015;
510 }

◆ getRandomEngine()

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

Definition at line 140 of file AddFlowByShifting.cxx.

142 {
143  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
144  std::string rngName = name()+streamName;
145  rngWrapper->setSeed( rngName, ctx );
146  return rngWrapper->getEngine(ctx);
147 }

◆ 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
111 
115 
116 
117 
118  //TGraph storing the v2_RP/delta Vs b_imp values to be used in implementing the EbyE fluctuations
119  //the values below are b_imp-low,b_imp-high, delta/v2_RP for different centralities
120  //underflow and overflow bins are added for smooth extrapolation
121  //The delta/v2_RP values are taken from Fig15 of EbE vn paper (arXiv:1305.2942)
122  // <0 , 0-1 , 1-2 , 2-3 , 3-4 , 4-5 , 5-10 , 10-15, 15-20, 20-25, 25-30,
123  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,
124  8.117, 8.767, 9.373, 9.943,10.479,10.991,11.479,11.947,15.00 ,100.0};
125  // 30-35, 35-40, 40-45, 45-50, 50-55, 55-60, 60-65, 65-70, 70-
126  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
127  8.767, 9.373, 9.943,10.479,10.991,11.479,11.947,12.399,15.00 ,100.0};
128  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,
129  0.3935,0.4106,0.4310,0.4574,0.4674,0.4873,0.4796,0.4856,0.5130,0.5130};
130  float bimp_vals[21];
131  for(int i=0;i<21;i++) bimp_vals[i]=(b_lo[i]+b_hi[i])/2.0;
132  if(m_flow_fluctuations) m_graph_fluc=new TGraph(21,bimp_vals,val);
133 
134 
135  // Initialization terminated
136  return StatusCode::SUCCESS;
137 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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.

◆ jjia_minbias_new()

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

Definition at line 451 of file AddFlowByShifting.cxx.

452 {
453  pt=pt/1000.0; //convert to GeV
454 
455  float a1,a2,a3,a4;
456  a1=0.4397*std::exp(-(b-4.526)*(b-4.526)/72.0) + 0.636;
457  a2=1.916/(b+2) +0.1;
458  a3=4.79*0.0001*(b-0.621)*(b-10.172)*(b-23)+1.2; // this is >0 for b>0
459  a4=0.135*std::exp(-0.5*(b-10.855)*(b-10.855)/4.607/4.607) +0.0120;
460 
461  float temp1 = std::pow(pt , a1) / (1+std::exp( (pt-3.0)/a3));
462  float temp2 = std::pow(pt+0.1,-a2) / (1+std::exp(-(pt-4.5)/a3));
463  float temp3 = 0.01 / (1+std::exp(-(pt-4.5)/a3));
464 
465  m_v_n[1] = ( a4*(temp1+temp2) + temp3 )* std::exp(-0.5* eta*eta /6.27/6.27) ;
466 
467  float fb=0.97 +1.06*std::exp(-0.5*b*b/3.2/3.2);
468  m_v_n[2]=std::pow(fb*std::sqrt(m_v_n[1]),3);
469 
470  float gb= 1.096 +1.36 *std::exp(-0.5*b*b/3.0/3.0);
471  gb=gb*sqrt(m_v_n[1]);
472  m_v_n[3]=pow(gb,4);
473  m_v_n[4]=pow(gb,5);
474  m_v_n[5]=pow(gb,6);
475  m_v_n[0]=0;
476 }

◆ jjia_minbias_new_v2only()

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

Definition at line 480 of file AddFlowByShifting.cxx.

481 {
482  pt=pt/1000.0; //convert to GeV
483 
484  float a1,a2,a3,a4;
485  a1=0.4397*std::exp(-(b-4.526)*(b-4.526)/72.0) + 0.636;
486  a2=1.916/(b+2) +0.1;
487  a3=4.79*0.0001*(b-0.621)*(b-10.172)*(b-23)+1.2; // this is >0 for b>0
488  a4=0.135*std::exp(-0.5*(b-10.855)*(b-10.855)/4.607/4.607) +0.0120;
489 
490  float temp1 = std::pow(pt , a1) / (1+std::exp( (pt-3.0)/a3));
491  float temp2 = std::pow(pt+0.1,-a2) / (1+std::exp(-(pt-4.5)/a3));
492  float temp3 = 0.01 / (1+std::exp(-(pt-4.5)/a3));
493 
494  m_v_n[1] = ( a4*(temp1+temp2) + temp3 )* std::exp(-0.5* eta*eta /6.27/6.27) ;
495 
496  m_v_n[0]=0;
497  m_v_n[2]=0;
498  m_v_n[3]=0;
499  m_v_n[4]=0;
500  m_v_n[5]=0;
501 }

◆ jjia_minbias_old()

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

Definition at line 522 of file AddFlowByShifting.cxx.

523 {
524  m_v_n[0] = 0;
525  m_v_n[1] = 0.03968 * b
526  * (1 - 2.1/(1 + std::exp(1.357*(pt/1000))))
527  * std::exp(-(eta*eta)/(2*6.37*6.37));
528  m_v_n[2]=0.0000; m_v_n[3]=0.0000;
529  m_v_n[4]=0.0000; m_v_n[5]=0.0000;
530 }

◆ MoveDescendantsToParent()

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

Definition at line 300 of file AddFlowByShifting.cxx.

302 {
303  // Move the branch of descendant vertices and particles
304  // by phishift to parent particle position
305  auto endvtx = parent->end_vertex();
306  if ( endvtx ) {
307  ATH_MSG_DEBUG("Processing branch of parent particle "<< parent);
308 
309  // now rotate descendant vertices
310 #ifdef HEPMC3
311  for (HepMC::GenVertexPtr descvtx: HepMC::descendant_vertices(endvtx)) {
312 #else
313  for ( HepMC::GenVertex::vertex_iterator
314  descvtxit = endvtx->vertices_begin(HepMC::descendants);
315  descvtxit != endvtx->vertices_end(HepMC::descendants);
316  ++descvtxit) {
317  auto descvtx = (*descvtxit);
318 #endif
319 
320  ATH_MSG_DEBUG("Processing vertex " << descvtx);
321 
322  // rotate vertex
323  if(std::abs(phishift) > 1e-7) {
324  CLHEP::HepLorentzVector position(descvtx->position().x(),
325  descvtx->position().y(),
326  descvtx->position().z(),
327  descvtx->position().t());
328  position.rotateZ(phishift*Gaudi::Units::rad);
329  descvtx->set_position(HepMC::FourVector( position.x(),position.y(),position.z(),position.t()) );
330  }
331 
332  // now rotate their associated particles
333 #ifdef HEPMC3
334  for (auto descpart: descvtx->particles_out())
335 #else
336  for (auto descpart: *descvtx)
337 #endif
338  {
339  ATH_MSG_DEBUG("Descendant particle: " << descpart <<
340  " Eta = " << descpart->momentum().pseudoRapidity() <<
341  " Phi = " << descpart->momentum().phi() );
342  }
343  }
344  }
345  return;
346 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< 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 553 of file AddFlowByShifting.cxx.

554 {
555  pt=pt/1000.0; //convert to GeV
556 
557  float an_val[4][3];
558 
559  an_val[0][0] = 0.1149;
560  an_val[0][1] = 1.181;
561  an_val[0][2] = 0.3767;
562 
563  an_val[1][0] = 0.0498;
564  an_val[1][1] = 1.688;
565  an_val[1][2] = 0.5046;
566 
567  an_val[2][0] = 0.02095;
568  an_val[2][1] = 2.196;
569  an_val[2][2] = 0.6259;
570 
571  an_val[3][0] = 0.00682*0.5;//added in 0.5 factor by hand
572  an_val[3][1] = 4.938;
573  an_val[3][2] = 1.237;
574 
575  m_v_n[0]=0;
576  m_v_n[1]=an_val[0][0]*std::pow(pt,an_val[0][1])*std::exp(-an_val[0][2]*pt);
577  m_v_n[2]=an_val[1][0]*std::pow(pt,an_val[1][1])*std::exp(-an_val[1][2]*pt);
578  m_v_n[3]=an_val[2][0]*std::pow(pt,an_val[2][1])*std::exp(-an_val[2][2]*pt);
579  m_v_n[4]=an_val[3][0]*std::pow(pt,an_val[3][1])*std::exp(-an_val[3][2]*pt);
580  m_v_n[5]=0;
581 }

◆ 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< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ Set_EbE_Fluctuation_Multipliers()

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

Definition at line 584 of file AddFlowByShifting.cxx.

584  {
585  int Total_Multiplicity=0;
586  double EbE_Vn[6];
587  for(int ihar=0;ihar<6;ihar++){m_EbE_Multiplier_vn[ihar]=1.0;EbE_Vn[ihar]=0.0;}
588 
589  for(auto parent: *mainvtx) {
590  float eta= parent->momentum().pseudoRapidity();
591  float pT = parent->momentum().perp();
592 
593  for(int ihar = 0; ihar< 6; ihar++){m_v_n [ihar]=0.0;}
594  (*this.*m_flow_function)(b,eta,pT);
595  for(int ihar = 0; ihar< 6; ihar++){EbE_Vn[ihar] += m_v_n [ihar];}
596  Total_Multiplicity++;
597  }
598 
599 
600  for(int ihar = 0; ihar< 6; ihar++){m_v_n [ihar]=0.0;}//keep vn as zero before we return from function
601  if(Total_Multiplicity<=0) return;
602 
603 
604  for(int ihar=0;ihar<6;ihar++){
605  EbE_Vn[ihar]/=Total_Multiplicity;
606  float vn_rp=0,delta=0;//BG parameterizations
607 
608  //in the following we assume that the vn in the event is sqrt(<vn^2>)
609  //This is because the vn(pT) were tuned to 2PC/EP measurements
610  //then : vn_evt=vn_rp^2 + 2*(delta^2)
611  //which is used together with the "alpha" to get the "vn_rp" and "delta"
612  if(ihar==0) continue; //No EbE fluctuation for v1
613  else if(ihar==1) { //v2
614  float alpha=1.0/m_graph_fluc->Eval(b);// ratio of V2_RP over delta (from Fig 15 of EbE vn paper)
615  delta=EbE_Vn[ihar]/sqrt(2.0+alpha*alpha);
616  vn_rp=alpha*delta;
617  }
618  else if(ihar>=2) { //v3-v6
619  vn_rp =0;
620  delta=EbE_Vn[ihar]/sqrt(2.0);
621  }
622  if(EbE_Vn[ihar]==0) {ATH_MSG_WARNING("Zero EbeV"<<ihar+1); continue;}
623  float X=CLHEP::RandGaussQ::shoot(rndmEngine,vn_rp,delta);
624  float Y=CLHEP::RandGaussQ::shoot(rndmEngine,0.0 ,delta);
625  m_EbE_Multiplier_vn[ihar]=sqrt(X*X+ Y*Y)/EbE_Vn[ihar];
626  ATH_MSG_INFO("EbE_Multiplier_v"<<ihar+1<<"="<<m_EbE_Multiplier_vn[ihar]);
627  }
628 }

◆ SetParentToRanPhi()

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

Definition at line 273 of file AddFlowByShifting.cxx.

275 {
276  // Set particle to random phi
277  // Return phi shift
279 
280  double phi, phishift;
281  CLHEP::HepLorentzVector momentum(parent->momentum().px(),
282  parent->momentum().py(),
283  parent->momentum().pz(),
284  parent->momentum().e());
285  phi = momentum.phi();
286 
287  double rannum = CLHEP::RandFlat::shoot(rndmEngine);
288  double ranphi = (rannum-0.5)*2*M_PI;
289  phishift = ranphi - phi;
290 
291  momentum.setPhi(ranphi*Gaudi::Units::rad);
292  parent->set_momentum( HepMC::FourVector(momentum.px(),momentum.py(),momentum.pz(),momentum.e()) );
293 
294  ATH_MSG_INFO("Parent phi randomized = " << momentum.phi());
295 
296  return phishift;
297 }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
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 31 of file AddFlowByShifting.cxx.

32 {
33  float *par_float = (float*) params;
34  float phi_0 = par_float[0];
35  float *vn = par_float+1;
36  float *psi_n = vn+6;
37  double val=x +2*( vn[0]*sin(1*(x-psi_n[0]))/1.0 + vn[1]*sin(2*(x-psi_n[1]))/2.0 +
38  vn[2]*sin(3*(x-psi_n[2]))/3.0 + vn[3]*sin(4*(x-psi_n[3]))/4.0 +
39  vn[4]*sin(5*(x-psi_n[4]))/5.0 + vn[5]*sin(6*(x-psi_n[5]))/6.0 );
40  return val-phi_0;
41 }

◆ vn_func_derivative()

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

Definition at line 44 of file AddFlowByShifting.cxx.

45 {
46  float *par_float = (float*) params;
47  float *vn = par_float+1;
48  float *psi_n = vn+6;
49  double val=1 +2*( vn[0]*cos(1*(x-psi_n[0]))/1.0 + vn[1]*cos(2*(x-psi_n[1]))/2.0 +
50  vn[2]*cos(3*(x-psi_n[2]))/3.0 + vn[3]*cos(4*(x-psi_n[3]))/4.0 +
51  vn[4]*cos(5*(x-psi_n[4]))/5.0 + vn[5]*cos(6*(x-psi_n[5]))/6.0 );
52  return val;
53 }

Member Data Documentation

◆ m_custom_v1

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

Definition at line 100 of file AddFlowByShifting.h.

◆ m_custom_v2

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

Definition at line 101 of file AddFlowByShifting.h.

◆ m_custom_v3

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

Definition at line 102 of file AddFlowByShifting.h.

◆ m_custom_v4

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

Definition at line 103 of file AddFlowByShifting.h.

◆ m_custom_v5

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

Definition at line 104 of file AddFlowByShifting.h.

◆ m_custom_v6

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

Definition at line 105 of file AddFlowByShifting.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< 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[6]
private

Definition at line 111 of file AddFlowByShifting.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_flow_fluctuations

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

Definition at line 89 of file AddFlowByShifting.h.

◆ m_flow_function

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

Definition at line 64 of file AddFlowByShifting.h.

◆ m_flow_function_name

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

Definition at line 86 of file AddFlowByShifting.h.

◆ m_flow_implementation

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

Definition at line 87 of file AddFlowByShifting.h.

◆ m_flow_implementation_type

int AddFlowByShifting::m_flow_implementation_type {0}
private

Definition at line 88 of file AddFlowByShifting.h.

◆ m_flow_maxeta

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

Definition at line 92 of file AddFlowByShifting.h.

◆ m_flow_maxpt

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

Definition at line 96 of file AddFlowByShifting.h.

◆ m_flow_mineta

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

Definition at line 93 of file AddFlowByShifting.h.

◆ m_flow_minpt

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

Definition at line 97 of file AddFlowByShifting.h.

◆ m_flowb_sw

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

Definition at line 99 of file AddFlowByShifting.h.

◆ m_floweta_sw

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

Definition at line 91 of file AddFlowByShifting.h.

◆ m_flowpt_sw

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

Definition at line 95 of file AddFlowByShifting.h.

◆ m_graph_fluc

TGraph* AddFlowByShifting::m_graph_fluc {}
private

Definition at line 74 of file AddFlowByShifting.h.

◆ m_inkey

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

Definition at line 81 of file AddFlowByShifting.h.

◆ m_outkey

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

Definition at line 82 of file AddFlowByShifting.h.

◆ m_particles_processed

int AddFlowByShifting::m_particles_processed {0}
private

Definition at line 107 of file AddFlowByShifting.h.

◆ m_psi_n

float AddFlowByShifting::m_psi_n[6]
private

Definition at line 110 of file AddFlowByShifting.h.

◆ m_ranphi_sw

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

Definition at line 84 of file AddFlowByShifting.h.

◆ m_rndmSvc

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

Definition at line 78 of file AddFlowByShifting.h.

◆ m_v_n

float AddFlowByShifting::m_v_n[6]
private

Definition at line 110 of file AddFlowByShifting.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
AddFlowByShifting::m_flow_function_name
StringProperty m_flow_function_name
Definition: AddFlowByShifting.h:86
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AddFlowByShifting::m_flow_function
void(AddFlowByShifting::* m_flow_function)(double b, double eta, double pt)
Definition: AddFlowByShifting.h:64
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
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
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
AddFlowByShifting::Set_EbE_Fluctuation_Multipliers
void Set_EbE_Fluctuation_Multipliers(HepMC::GenVertexPtr mainvtx, float b, CLHEP::HepRandomEngine *rndmEngine)
Definition: AddFlowByShifting.cxx:584
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
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:79
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AddFlowByShifting::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: AddFlowByShifting.h:78
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
AddFlowByShifting::AddFlowToParent
double AddFlowToParent(HepMC::GenParticlePtr parent, const HijingEventParams *hijing_pars)
Definition: AddFlowByShifting.cxx:349
McEventCollection
McEventCollection
Definition: GeneratorObjectsTPCnv.cxx:60
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AddFlowByShifting::m_custom_v2
FloatProperty m_custom_v2
Definition: AddFlowByShifting.h:101
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
x
#define x
AddFlowByShifting::MoveDescendantsToParent
void MoveDescendantsToParent(HepMC::GenParticlePtr parent, double phishift)
Definition: AddFlowByShifting.cxx:301
AddFlowByShifting::m_custom_v4
FloatProperty m_custom_v4
Definition: AddFlowByShifting.h:103
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AddFlowByShifting::m_flowb_sw
IntegerProperty m_flowb_sw
Definition: AddFlowByShifting.h:99
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AddFlowByShifting::m_flow_fluctuations
BooleanProperty m_flow_fluctuations
Definition: AddFlowByShifting.h:89
AddFlowByShifting::m_custom_v6
FloatProperty m_custom_v6
Definition: AddFlowByShifting.h:105
HijingEventParams
Definition: HijingEventParams.h:23
AddFlowByShifting::m_v_n
float m_v_n[6]
Definition: AddFlowByShifting.h:110
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
HijingEventParams::set_psi
void set_psi(int ihar, float psi)
Definition: HijingEventParams.h:107
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
HijingEventParams::get_bphi
float get_bphi() const
Definition: HijingEventParams.h:92
AddFlowByShifting::m_ranphi_sw
IntegerProperty m_ranphi_sw
Definition: AddFlowByShifting.h:84
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
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:195
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
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::m_outkey
StringProperty m_outkey
Definition: AddFlowByShifting.h:82
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
HijingEventParams::get_b
float get_b() const
Definition: HijingEventParams.h:91
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
AddFlowByShifting::fixed_vn
void fixed_vn(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:505
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
AddFlowByShifting::vn_func
static double vn_func(double x, void *params)
Definition: AddFlowByShifting.cxx:31
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
F
#define F(x, y, z)
Definition: MD5.cxx:112
AddFlowByShifting::m_particles_processed
int m_particles_processed
Definition: AddFlowByShifting.h:107
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AddFlowByShifting::m_custom_v1
FloatProperty m_custom_v1
Definition: AddFlowByShifting.h:100
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AddFlowByShifting::m_custom_v3
FloatProperty m_custom_v3
Definition: AddFlowByShifting.h:102
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
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
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AddFlowByShifting::m_flow_minpt
FloatProperty m_flow_minpt
Definition: AddFlowByShifting.h:97
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
AddFlowByShifting::ao_test
void ao_test(double b, double eta, double pt)
Definition: AddFlowByShifting.cxx:533
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
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