20 #include "GaudiKernel/SmartDataPtr.h"
21 #include "GaudiKernel/DataSvc.h"
23 #include "GaudiKernel/ITHistSvc.h"
38 for (
int i = 0;
i< 6;
i++ ){
39 m_hist_Psi_n_true[
i] = 0;
40 m_hist_Psi_n_reco[
i] = 0;
41 m_hist_Psi_n_ebe[
i] = 0;
42 m_hist_Psi_n_ebe_pt[
i] = 0;
46 for (
int i = 0;
i< 36;
i++ ){
47 m_hist_psi_corr_true[
i] = 0;
48 m_hist_psi_corr_reco[
i] = 0;
58 float pt_binvals[
n_ptbin+1]={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};
59 float eta_bin_max = 4.0;
62 SmartIF<ITHistSvc> rootHistSvc{Gaudi::svcLocator()->service(
"THistSvc")};
65 return StatusCode::FAILURE;
68 std::string StreamAndPath=
"/FlowOutPut/";
69 std::string histPath = StreamAndPath;
71 for (
int ihar=0;ihar<6;ihar++){
74 sprintf(
name,
"hist_Psi_%d_true",ihar+1);
75 sprintf(
name1,
"Truth Psi_{%d} distribution;%dPsi_{%d} Truth;events",ihar+1,ihar+1,ihar+1);
83 sprintf(
name,
"hist_Psi_%d_reco",ihar+1);
84 sprintf(
name1,
"Reconstructed Psi_{%d} distribution;%dPsi_{%d} Reco;events",ihar+1,ihar+1,ihar+1);
93 for (
int ihar2=0;ihar2<6;ihar2++)
95 int ihar_i=ihar*6+ihar2;
97 sprintf(
name,
"hist_Psi_corr_true_%d_%d",ihar+1,ihar2+1);
98 sprintf(
name1,
"true 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_Psi_corr_reco_%d_%d",ihar+1,ihar2+1);
108 sprintf(
name1,
"reco Psi_{%d} -Psi_{%d};%dPsi_{%d} -%dPsi_{%d} ;events",ihar+1,ihar2+1,ihar+1,ihar+1,ihar2+1,ihar2+1);
120 sprintf(
name,
"hist_v%d_ebe",ihar+1);
121 sprintf(
name1,
"v%d;v%d;events",ihar+1,ihar+1);
129 sprintf(
name ,
"hist_Psi%d_ebe",ihar+1);
130 sprintf(
name1,
"%d#Delta#Psi;%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
138 sprintf(
name ,
"hist_Psi%d_ebe_pt",ihar+1);
139 sprintf(
name1,
"%d#Delta#Psi (pT weighted);%d(#Psi_{reco}-#Psi_{Truth});events",ihar+1,ihar+1);
152 for(
int ieta=0;ieta<
n_etabin;ieta++){
153 sprintf(
name ,
"profile_pt_dep_%d_eta%d" ,ihar+1,ieta);
154 sprintf(
name1,
"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
163 for(
int ipt=0;ipt<
n_ptbin;ipt++){
164 sprintf(
name ,
"profile_eta_dep_%d_pt%d",ihar+1,ipt);
165 sprintf(
name1,
"v%d vs #eta; (ipt%d)#eta;v%d",ihar+1,ipt,ihar+1);
175 for(
int ieta=0;ieta<
n_etabin;ieta++){
176 sprintf(
name ,
"profile_pt_dep_reco_%d_eta%d",ihar+1,ieta);
177 sprintf(
name1,
"v%d vs pT (eta%d);pT;v%d",ihar+1,ieta,ihar+1);
187 for(
int ipt=0;ipt<
n_ptbin;ipt++){
188 sprintf(
name ,
"profile_eta_dep_reco_%d_pt%d",ihar+1,ipt);
189 sprintf(
name1,
"v%d vs #eta (pt%d);#eta;v%d",ihar+1,ipt,ihar+1);
207 return StatusCode::SUCCESS;
213 msg(MSG::INFO) <<
">>> CheckFlow_New from execute" <<
endmsg;
215 float pt_binvals[
n_ptbin+1]={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};
216 float eta_bin_max = 4.0;
219 float b = hijing_pars->get_b();
220 float Psi_n[6],Psi_n_reco[6];
221 float Psi_n_reco_pos[6],Psi_n_reco_neg[6];
222 for(
int ihar=0;ihar<6;ihar++){Psi_n[ihar]=hijing_pars->get_psi(ihar+1);}
223 msg(MSG::INFO)<<
"SOUMYA "<<hijing_pars->get_psi(1)<<
" "<<hijing_pars->get_psi(2)<<
" "<<hijing_pars->get_psi(3)
224 <<hijing_pars->get_psi(4)<<
" "<<hijing_pars->get_psi(5)<<
" "<<hijing_pars->get_psi(6)<<
" "<<
b <<
endmsg;
228 if(b<m_bcut_min || b>
m_bcut_max)
return StatusCode::SUCCESS;
231 double ngenerated_pos = 0,ngenerated_pt_pos=0;
232 double cos_n_pos[6],sin_n_pos[6],cos_n_pt_pos[6],sin_n_pt_pos[6];
233 double ngenerated_neg = 0,ngenerated_pt_neg=0;
234 double cos_n_neg[6],sin_n_neg[6],cos_n_pt_neg[6],sin_n_pt_neg[6];
235 for(
int ihar=0;ihar<6;ihar++){cos_n_pos[ihar]=0;sin_n_pos[ihar]=0; cos_n_pt_pos[ihar]=0;sin_n_pt_pos[ihar]=0;
236 cos_n_neg[ihar]=0;sin_n_neg[ihar]=0; cos_n_pt_neg[ihar]=0;sin_n_pt_neg[ihar]=0;}
239 std::vector<HepMC::ConstGenParticlePtr>
particles;
241 if (
stat.isFailure()) {
246 int pid = pitr->pdg_id();
247 double pt = pitr->momentum().perp();
248 double rapid = pitr->momentum().pseudoRapidity();
249 double phi = pitr->momentum().phi();
251 <<
" PID = " <<
pid <<
" Status = " << pitr->status()
252 <<
" Eta = " << rapid <<
" Phi = " << phi<<
endmsg;
257 for(
int ihar=0;ihar<6;ihar++){
258 float temp=(ihar+1)*(phi-Psi_n[ihar]);
260 int ieta= (
int)(std::abs(rapid)*
n_etabin/eta_bin_max);
264 float temp_pt=
pt/1000;
265 for(
int ipt=0;ipt<
n_ptbin;ipt++){
266 if(temp_pt<pt_binvals[ipt+1]){
272 if( rapid >3.2 && rapid< 4.9){
273 cos_n_pos[ihar]+=
std::cos( (ihar+1)*phi);
274 sin_n_pos[ihar]+=
std::sin( (ihar+1)*phi);
277 cos_n_pt_pos[ihar]+=
pt*
std::cos( (ihar+1)*phi);
278 sin_n_pt_pos[ihar]+=
pt*
std::sin( (ihar+1)*phi);
279 ngenerated_pt_pos +=
pt;
281 if( rapid <-3.2 && rapid >-4.9){
282 cos_n_neg[ihar]+=
std::cos( (ihar+1)*phi);
283 sin_n_neg[ihar]+=
std::sin( (ihar+1)*phi);
286 cos_n_pt_neg[ihar]+=
pt*
std::cos( (ihar+1)*phi);
287 sin_n_pt_neg[ihar]+=
pt*
std::sin( (ihar+1)*phi);
288 ngenerated_pt_neg +=
pt;
298 float cos_n[6],sin_n[6],cos_n_pt[6],sin_n_pt[6];
299 for(
int ihar=0;ihar<6;ihar++){
300 cos_n[ihar] = ( cos_n_pos[ihar]+ cos_n_neg[ihar] ) / (ngenerated_pos+ngenerated_neg);
301 sin_n[ihar] = ( sin_n_pos[ihar]+ sin_n_neg[ihar] ) / (ngenerated_pos+ngenerated_neg);
303 float psi_reco=std::atan2(sin_n[ihar],cos_n[ihar])/(ihar+1);
305 m_hist_vn_ebe [ihar]->Fill(std::sqrt(cos_n[ihar]*cos_n[ihar] +sin_n[ihar]*sin_n[ihar] ));
307 Psi_n_reco_pos[ihar]=std::atan2(sin_n_pos[ihar],cos_n_pos[ihar])/ (ihar+1);
308 Psi_n_reco_neg[ihar]=std::atan2(sin_n_neg[ihar],cos_n_neg[ihar])/ (ihar+1);
309 Psi_n_reco [ihar]=psi_reco;
312 cos_n_pt[ihar] = ( cos_n_pt_pos[ihar]+ cos_n_pt_neg[ihar] ) / (ngenerated_pt_pos+ngenerated_pt_neg);
313 sin_n_pt[ihar] = ( sin_n_pt_pos[ihar]+ sin_n_pt_neg[ihar] ) / (ngenerated_pt_pos+ngenerated_pt_neg);
315 psi_reco=std::atan2(sin_n_pt[ihar],cos_n_pt[ihar])/(ihar+1);
321 for(
int ihar=0;ihar<6;ihar++){
326 for(
int ihar2=0;ihar2<6;ihar2++){
327 psi1=(ihar+1)*Psi_n[ihar];psi2=(ihar2+1)*Psi_n[ihar2];
330 psi1=(ihar+1)*Psi_n_reco[ihar];psi2=(ihar2+1)*Psi_n_reco[ihar2];
340 for(
int ihar=0;ihar<6;ihar++){
344 double pt = pitr->momentum().perp();
345 double rapid = pitr->momentum().pseudoRapidity();
346 double phi = pitr->momentum().phi();
350 for(
int ihar=0;ihar<6;ihar++){
351 float temp=(ihar+1)*(phi-Psi_n_reco_pos[ihar]);
352 if(rapid>0) temp=(ihar+1)*(phi-Psi_n_reco_neg[ihar]);
355 int ieta= (
int)(std::abs(rapid)*
n_etabin/eta_bin_max);
358 float temp_pt=
pt/1000;
359 for(
int ipt=0;ipt<
n_ptbin;ipt++){
360 if(temp_pt<pt_binvals[ipt+1]){
373 return StatusCode::SUCCESS;
377 msg(MSG::INFO) <<
">>> CheckFlow_New from finalize" <<
endmsg;
379 return StatusCode::SUCCESS;