20 #include "GaudiKernel/SmartDataPtr.h"
21 #include "GaudiKernel/DataSvc.h"
23 #include "GaudiKernel/ITHistSvc.h"
59 ATH_MSG_INFO(
">>> CheckFlow_New_Minbias from Initialize");
63 CHECK( rootHistSvc.retrieve() );
64 std::string histPath =
"/FlowOutPut/";
65 std::vector<TH1*> hist_vec;
69 for (
int ihar=0;ihar<6;ihar++){
70 for(
int ib_imp=0;ib_imp<
n_b_bins;ib_imp++){
72 const float pt_binvals[]={0.0,0.25,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,6.0,8.0,12.0,16.0,20.0,30.0,40.0};
75 const float eta_bin_max = 4.0;
77 sprintf(
name,
"hist_Psi_%d_true_b%d",ihar+1,ib_imp);
78 sprintf(
name1,
"Truth Psi_{%d} distribution;%dPsi_{%d} Truth;events",ihar+1,ihar+1,ihar+1);
82 sprintf(
name,
"hist_Psi_%d_reco_b%d",ihar+1,ib_imp);
83 sprintf(
name1,
"Reconstructed Psi_{%d} distribution;%dPsi_{%d} Reco;events",ihar+1,ihar+1,ihar+1);
88 for (
int ihar2=0;ihar2<6;ihar2++){
89 int ihar_i=ihar*6+ihar2;
91 sprintf(
name,
"hist_Psi_corr_true_b%d_%d_%d",ib_imp,ihar+1,ihar2+1);
92 sprintf(
name1,
"true Psi_{%d} -Psi_{%d};%dPsi_{%d} -%dPsi_{%d} ;events",ihar+1,ihar2+1,ihar+1,ihar+1,ihar2+1,ihar2+1);
96 sprintf(
name,
"hist_Psi_corr_reco_%d_%d_%d",ib_imp,ihar+1,ihar2+1);
97 sprintf(
name1,
"reco Psi_{%d} -Psi_{%d};%dPsi_{%d} -%dPsi_{%d} ;events",ihar+1,ihar2+1,ihar+1,ihar+1,ihar2+1,ihar2+1);
107 sprintf(
name,
"hist_v%d_b%d_ebe",ihar+1,ib_imp);
108 sprintf(
name1,
"v%d;v%d;events",ihar+1,ihar+1);
112 sprintf(
name,
"hist_v%d_b%d_ebe_ID1",ihar+1,ib_imp);
113 sprintf(
name1,
"v%d;v%d;events",ihar+1,ihar+1);
115 sprintf(
name,
"hist_v%d_b%d_ebe_ID2",ihar+1,ib_imp);
120 sprintf(
name ,
"hist_Psi%d_b%d_ebe",ihar+1,ib_imp);
121 sprintf(
name1,
"%d#Delta#Psi;%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
125 sprintf(
name ,
"hist_Psi%d_b%d_ebe_pt",ihar+1,ib_imp);
126 sprintf(
name1,
"%d#Delta#Psi (pT weighted);%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
136 for(
int ieta=0;ieta<
n_etabin;ieta++){
137 sprintf(
name ,
"profile_pt_dep_%d_eta%d_b%d" ,ihar+1,ieta,ib_imp);
138 sprintf(
name1,
"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
143 for(
int ipt=0;ipt<
n_ptbin;ipt++){
144 sprintf(
name ,
"profile_eta_dep_%d_pt%d_b%d",ihar+1,ipt,ib_imp);
145 sprintf(
name1,
"v%d vs #eta; (ipt%d)#eta;v%d",ihar+1,ipt,ihar+1);
151 for(
int ieta=0;ieta<
n_etabin;ieta++){
152 sprintf(
name ,
"profile_pt_dep_reco_%d_eta%d_b%d",ihar+1,ieta,ib_imp);
153 sprintf(
name1,
"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
159 for(
int ipt=0;ipt<
n_ptbin;ipt++){
160 sprintf(
name ,
"profile_eta_dep_reco_%d_pt%d_b%d",ihar+1,ipt,ib_imp);
161 sprintf(
name1,
"v%d vs #eta (pt%d);#eta;v%d",ihar+1,ipt,ihar+1);
169 for(
int ipt=0;ipt<
n_ptbin;ipt++){
170 for(
int ieta=0;ieta<
n_etabin;ieta++){
171 sprintf(
name ,
"profile_b_dep_%d_pt%d_eta%d",ihar+1,ipt,ieta);
172 sprintf(
name1,
"v%d vs cent ;cent;v%d",ihar+1,ihar+1);
176 sprintf(
name ,
"profile_b_dep_reco_%d_pt%d_eta%d",ihar+1,ipt,ieta);
177 sprintf(
name1,
"v%d vs cent ;cent;v%d",ihar+1,ihar+1);
183 sprintf(
name,
"profile_resolution_%d",ihar+1);
189 for(
auto&
hist: hist_vec){
191 hist->GetXaxis()->CenterTitle();
192 hist->GetYaxis()->CenterTitle();
206 const float pt_binvals[]={0.0,0.25,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,6.0,8.0,12.0,16.0,20.0,30.0,40.0};
207 const float b_bin_vals[]={0.0,3.4955,4.9315,6.0375,6.9695,7.7895,8.5335,9.2135,9.8515,10.4485,11.0175,11.554,12.070,12.560,13.033,13.492,13.944,14.409,14.929,15.6425};
208 const float eta_bin_max = 4.0;
213 float b = hijing_pars->
get_b();
214 float Psi_n[6],Psi_n_reco[6];
215 for(
int ihar=0;ihar<6;ihar++){Psi_n[ihar]=hijing_pars->
get_psi(ihar+1);}
225 if(ib_imp<0)
return StatusCode::SUCCESS;
226 if(ib_imp==0) {std::cout<<
"AAAAAAAAAAAAAAAAAAAA "<<
b<<std::endl;}
229 if(b<m_bcut_min || b>
m_bcut_max)
return StatusCode::SUCCESS;
232 double ngenerated_pos = 0,ngenerated_pt_pos=0;
233 double ngenerated_neg = 0,ngenerated_pt_neg=0;
234 double cos_n_pos[6],sin_n_pos[6],cos_n_pt_pos[6],sin_n_pt_pos[6];
235 double cos_n_neg[6],sin_n_neg[6],cos_n_pt_neg[6],sin_n_pt_neg[6];
236 double cos_ID1[6],sin_ID1[6],tot_ID1=0.0;
237 double cos_ID2[6],sin_ID2[6],tot_ID2=0.0;
238 for(
int ihar=0;ihar<6;ihar++){
241 cos_n_pt_pos[ihar]=0;
242 sin_n_pt_pos[ihar]=0;
245 cos_n_pt_neg[ihar]=0;
246 sin_n_pt_neg[ihar]=0;
255 std::vector<HepMC::ConstGenParticlePtr>
particles;
259 int pid = pitr->pdg_id();
260 int p_stat = pitr->status();
261 double pt = pitr->momentum().perp();
262 double rapid = pitr->momentum().pseudoRapidity();
263 double phi = pitr->momentum().phi();
265 <<
" Eta = " << rapid <<
" Phi = " << phi);
272 for(
int ihar=0;ihar<6;ihar++){
273 float temp=(ihar+1)*(phi-Psi_n[ihar]);
275 int ieta= (
int)(std::abs(rapid)*
n_etabin/eta_bin_max);
279 float temp_pt=
pt/1000;
280 for(
int ipt=0;ipt<
n_ptbin;ipt++){
281 if(temp_pt<pt_binvals[ipt+1]){
288 if( rapid >3.2 && rapid< 4.9){
289 cos_n_pos[ihar]+=
std::cos( (ihar+1)*phi);
290 sin_n_pos[ihar]+=
std::sin( (ihar+1)*phi);
293 cos_n_pt_pos[ihar]+=
pt*
cos( (ihar+1)*phi);
294 sin_n_pt_pos[ihar]+=
pt*
sin( (ihar+1)*phi);
295 ngenerated_pt_pos +=
pt;
297 if( rapid <-3.2 && rapid >-4.9){
298 cos_n_neg[ihar]+=
std::cos( (ihar+1)*phi);
299 sin_n_neg[ihar]+=
std::sin( (ihar+1)*phi);
302 cos_n_pt_neg[ihar]+=
pt*
std::cos( (ihar+1)*phi);
303 sin_n_pt_neg[ihar]+=
pt*
std::sin( (ihar+1)*phi);
304 ngenerated_pt_neg +=
pt;
310 if(std::abs(
pt)>=500){
312 for(
int ihar=0;ihar<6;ihar++){
313 cos_ID1[ihar]+=
cos((ihar+1)*phi);
314 sin_ID1[ihar]+=
sin((ihar+1)*phi);
319 for(
int ihar=0;ihar<6;ihar++){
320 cos_ID2[ihar]+=
cos((ihar+1)*phi);
321 sin_ID2[ihar]+=
sin((ihar+1)*phi);
328 for(
int ihar=0;ihar<6;ihar++){
330 double temp1= std::sqrt(cos_ID1[ihar]*cos_ID1[ihar] + sin_ID1[ihar]*sin_ID1[ihar])/tot_ID1;
334 double temp2= std::sqrt(cos_ID2[ihar]*cos_ID2[ihar] + sin_ID2[ihar]*sin_ID2[ihar])/tot_ID2;
342 float cos_n[6],sin_n[6],cos_n_pt[6],sin_n_pt[6];
343 float Psi_n_reco_pos[6],Psi_n_reco_neg[6];
344 for(
int ihar=0;ihar<6;ihar++){
345 cos_n[ihar] = ( cos_n_pos[ihar]+ cos_n_neg[ihar] ) / (ngenerated_pos+ngenerated_neg);
346 sin_n[ihar] = ( sin_n_pos[ihar]+ sin_n_neg[ihar] ) / (ngenerated_pos+ngenerated_neg);
348 float psi_reco=std::atan2(sin_n[ihar],cos_n[ihar])/(ihar+1);
350 m_hist_vn_ebe [ihar][ib_imp]->Fill(std::sqrt(cos_n[ihar]*cos_n[ihar] +sin_n[ihar]*sin_n[ihar] ));
352 Psi_n_reco_pos[ihar]=std::atan2(sin_n_pos[ihar],cos_n_pos[ihar])/ (ihar+1);
353 Psi_n_reco_neg[ihar]=std::atan2(sin_n_neg[ihar],cos_n_neg[ihar])/ (ihar+1);
354 Psi_n_reco [ihar]=psi_reco;
357 cos_n_pt[ihar] = ( cos_n_pt_pos[ihar]+ cos_n_pt_neg[ihar] ) / (ngenerated_pt_pos+ngenerated_pt_neg);
358 sin_n_pt[ihar] = ( sin_n_pt_pos[ihar]+ sin_n_pt_neg[ihar] ) / (ngenerated_pt_pos+ngenerated_pt_neg);
360 psi_reco=std::atan2(sin_n_pt[ihar],cos_n_pt[ihar])/(ihar+1);
366 for(
int ihar=0;ihar<6;ihar++){
371 for(
int ihar2=0;ihar2<6;ihar2++){
372 psi1=(ihar+1)*Psi_n[ihar];psi2=(ihar2+1)*Psi_n[ihar2];
375 psi1=(ihar+1)*Psi_n_reco[ihar];psi2=(ihar2+1)*Psi_n_reco[ihar2];
385 for(
int ihar=0;ihar<6;ihar++){
387 if(ib_imp==0) {std::cout<<
"i11111111111111111111 "<<
b<<std::endl;}
390 double pt = pitr->momentum().perp();
391 double rapid = pitr->momentum().pseudoRapidity();
392 double phi = pitr->momentum().phi();
396 for(
int ihar=0;ihar<6;ihar++){
397 float temp=(ihar+1)*(phi-Psi_n_reco_pos[ihar]);
398 if(rapid>0) temp=(ihar+1)*(phi-Psi_n_reco_neg[ihar]);
401 int ieta= (
int)(std::abs(rapid)*
n_etabin/eta_bin_max);
404 float temp_pt=
pt/1000;
405 for(
int ipt=0;ipt<
n_ptbin;ipt++){
406 if(temp_pt<pt_binvals[ipt+1]){
416 return StatusCode::SUCCESS;
423 return StatusCode::SUCCESS;