Browse Source

Added Sp geant

PeterParfenov 2 years ago
parent
commit
c1bb00bbb6
1 changed files with 100 additions and 29 deletions
  1. 100 29
      bin/get-flow.cpp

+ 100 - 29
bin/get-flow.cpp

@@ -180,16 +180,20 @@ int main(int argc, char **argv)
   TProfile2D *pv2PdgYFHCal[Npid];
 
   TProfile2D *pv2PtMcTpc[NetaGaps][Npid];
+  TProfile2D *pv2PtMcSpTpc[NetaGaps][Npid];
   TProfile2D *pv1PtRp[Npid];
   TProfile2D *pv2PtRp[Npid];
   TProfile2D *pv2YMcTpc[NetaGaps][Npid];
+  TProfile2D *pv2YMcSpTpc[NetaGaps][Npid];
   TProfile2D *pv1YRp[Npid];
   TProfile2D *pv2YRp[Npid];
 
   TProfile2D *pv2PtRecoMcTpc[NetaGaps][Npid];
+  TProfile2D *pv2PtRecoMcSpTpc[NetaGaps][Npid];
   TProfile2D *pv1PtRecoRp[Npid];
   TProfile2D *pv2PtRecoRp[Npid];
   TProfile2D *pv2YRecoMcTpc[NetaGaps][Npid];
+  TProfile2D *pv2YRecoMcSpTpc[NetaGaps][Npid];
   TProfile2D *pv1YRecoRp[Npid];
   TProfile2D *pv2YRecoRp[Npid];
 
@@ -232,26 +236,40 @@ int main(int argc, char **argv)
                                                  Form("pv2YRecoMcTpc_gap%i_pid%i", iGap, iPid),
                                                  320, -1.6, 1.6, NresBin, 0., 100.);
 
+      pv2PtMcSpTpc[iGap][iPid] = new TProfile2D(Form("pv2PtMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                Form("pv2PtMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                300, 0., 3., NresBin, 0., 100.);
+      pv2YMcSpTpc[iGap][iPid] = new TProfile2D(Form("pv2YMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                               Form("pv2YMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                               320, -1.6, 1.6, NresBin, 0., 100.);
+
+      pv2PtRecoMcSpTpc[iGap][iPid] = new TProfile2D(Form("pv2PtRecoMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                    Form("pv2PtRecoMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                    300, 0., 3., NresBin, 0., 100.);
+      pv2YRecoMcSpTpc[iGap][iPid] = new TProfile2D(Form("pv2YRecoMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                   Form("pv2YRecoMcSpTpc_gap%i_pid%i", iGap, iPid),
+                                                   320, -1.6, 1.6, NresBin, 0., 100.);
+
       pv2PdgPtTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgPtTpc_gap%i_pid%i", iGap, iPid),
-                                            Form("pv2PdgPtTpc_gap%i_pid%i", iGap, iPid),
-                                            300, 0., 3., NresBin, 0., 100.);
+                                               Form("pv2PdgPtTpc_gap%i_pid%i", iGap, iPid),
+                                               300, 0., 3., NresBin, 0., 100.);
       pv2PdgYTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgYTpc_gap%i_pid%i", iGap, iPid),
-                                           Form("pv2PdgYTpc_gap%i_pid%i", iGap, iPid),
-                                           320, -1.6, 1.6, NresBin, 0., 100.);
+                                              Form("pv2PdgYTpc_gap%i_pid%i", iGap, iPid),
+                                              320, -1.6, 1.6, NresBin, 0., 100.);
 
       pv2PdgPtSpTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgPtSpTpc_gap%i_pid%i", iGap, iPid),
-                                              Form("pv2PdgPtSpTpc_gap%i_pid%i", iGap, iPid),
-                                              300, 0., 3., NresBin, 0., 100.);
+                                                 Form("pv2PdgPtSpTpc_gap%i_pid%i", iGap, iPid),
+                                                 300, 0., 3., NresBin, 0., 100.);
       pv2PdgYSpTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgYSpTpc_gap%i_pid%i", iGap, iPid),
-                                             Form("pv2PdgYSpTpc_gap%i_pid%i", iGap, iPid),
-                                             320, -1.6, 1.6, NresBin, 0., 100.);
+                                                Form("pv2PdgYSpTpc_gap%i_pid%i", iGap, iPid),
+                                                320, -1.6, 1.6, NresBin, 0., 100.);
 
       pv2PdgPtRecoMcTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgPtRecoMcTpc_gap%i_pid%i", iGap, iPid),
-                                                  Form("pv2PdgPtRecoMcTpc_gap%i_pid%i", iGap, iPid),
-                                                  300, 0., 3., NresBin, 0., 100.);
+                                                     Form("pv2PdgPtRecoMcTpc_gap%i_pid%i", iGap, iPid),
+                                                     300, 0., 3., NresBin, 0., 100.);
       pv2PdgYRecoMcTpc[iGap][iPid] = new TProfile2D(Form("pv2PdgYRecoMcTpc_gap%i_pid%i", iGap, iPid),
-                                                 Form("pv2PdgYRecoMcTpc_gap%i_pid%i", iGap, iPid),
-                                                 320, -1.6, 1.6, NresBin, 0., 100.);
+                                                    Form("pv2PdgYRecoMcTpc_gap%i_pid%i", iGap, iPid),
+                                                    320, -1.6, 1.6, NresBin, 0., 100.);
     }
   }
   for (int iPid = 0; iPid < Npid; iPid++)
@@ -270,17 +288,17 @@ int main(int argc, char **argv)
                                      320, -1.6, 1.6, NresBin, 0., 100.);
 
     pv1PdgPtFHCal[iPid] = new TProfile2D(Form("pv1PdgPtFHCal_pid%i", iPid),
-                                      Form("pv1PdgPtFHCal_pid%i", iPid),
-                                      300, 0., 3., NresBin, 0., 100.);
+                                         Form("pv1PdgPtFHCal_pid%i", iPid),
+                                         300, 0., 3., NresBin, 0., 100.);
     pv2PdgPtFHCal[iPid] = new TProfile2D(Form("pv2PdgPtFHCal_pid%i", iPid),
-                                      Form("pv2PdgPtFHCal_pid%i", iPid),
-                                      300, 0., 3., NresBin, 0., 100.);
+                                         Form("pv2PdgPtFHCal_pid%i", iPid),
+                                         300, 0., 3., NresBin, 0., 100.);
     pv1PdgYFHCal[iPid] = new TProfile2D(Form("pv1PdgYFHCal_pid%i", iPid),
-                                     Form("pv1PdgYFHCal_pid%i", iPid),
-                                     320, -1.6, 1.6, NresBin, 0., 100.);
+                                        Form("pv1PdgYFHCal_pid%i", iPid),
+                                        320, -1.6, 1.6, NresBin, 0., 100.);
     pv2PdgYFHCal[iPid] = new TProfile2D(Form("pv2PdgYFHCal_pid%i", iPid),
-                                     Form("pv2PdgYFHCal_pid%i", iPid),
-                                     320, -1.6, 1.6, NresBin, 0., 100.);
+                                        Form("pv2PdgYFHCal_pid%i", iPid),
+                                        320, -1.6, 1.6, NresBin, 0., 100.);
 
     pv1PtRp[iPid] = new TProfile2D(Form("pv1PtRp_pid%i", iPid),
                                    Form("pv1PtRp_pid%i", iPid),
@@ -309,17 +327,17 @@ int main(int argc, char **argv)
                                       320, -1.6, 1.6, NresBin, 0., 100.);
 
     pv1PdgPtRecoRp[iPid] = new TProfile2D(Form("pv1PdgPtRecoRp_pid%i", iPid),
-                                       Form("pv1PdgPtRecoRp_pid%i", iPid),
-                                       300, 0., 3., NresBin, 0., 100.);
+                                          Form("pv1PdgPtRecoRp_pid%i", iPid),
+                                          300, 0., 3., NresBin, 0., 100.);
     pv2PdgPtRecoRp[iPid] = new TProfile2D(Form("pv2PdgPtRecoRp_pid%i", iPid),
-                                       Form("pv2PdgPtRecoRp_pid%i", iPid),
-                                       300, 0., 3., NresBin, 0., 100.);
+                                          Form("pv2PdgPtRecoRp_pid%i", iPid),
+                                          300, 0., 3., NresBin, 0., 100.);
     pv1PdgYRecoRp[iPid] = new TProfile2D(Form("pv1PdgYRecoRp_pid%i", iPid),
-                                      Form("pv1PdgYRecoRp_pid%i", iPid),
-                                      320, -1.6, 1.6, NresBin, 0., 100.);
+                                         Form("pv1PdgYRecoRp_pid%i", iPid),
+                                         320, -1.6, 1.6, NresBin, 0., 100.);
     pv2PdgYRecoRp[iPid] = new TProfile2D(Form("pv2PdgYRecoRp_pid%i", iPid),
-                                      Form("pv2PdgYRecoRp_pid%i", iPid),
-                                      320, -1.6, 1.6, NresBin, 0., 100.);
+                                         Form("pv2PdgYRecoRp_pid%i", iPid),
+                                         320, -1.6, 1.6, NresBin, 0., 100.);
   }
 
   PicoDstMCEvent *mcEvent = nullptr;
@@ -356,6 +374,7 @@ int main(int argc, char **argv)
   float PsiFHCal;
   std::vector<TVector2> Q_R_SP, Q_L_SP;
   TVector2 u_R_SP, u_L_SP;
+  TVector2 u_R_SP_Mc, u_L_SP_Mc;
 
   // Start event loop
   int n_entries = inChain->GetEntries();
@@ -509,7 +528,7 @@ int main(int argc, char **argv)
       // v2 (TPC EP)
       for (int iGap = 0; iGap < NetaGaps; iGap++)
       {
-        double v2Tpc, v2TpcMc, v2SpTpc;
+        double v2Tpc, v2TpcMc, v2SpTpc, v2SpTpcMc;
         if (vPsiTpcR.at(iGap) == -999. || (Q_R_SP.at(iGap).X() == 0. && Q_R_SP.at(iGap).Y() == 0.))
           continue;
         if (vPsiTpcL.at(iGap) == -999. || (Q_L_SP.at(iGap).X() == 0. && Q_L_SP.at(iGap).Y() == 0.))
@@ -517,16 +536,20 @@ int main(int argc, char **argv)
         if (recoTrack->GetEta() < -1. * TpcEtaGap[iGap])
         {
           u_L_SP.Set(Cos(2. * recoTrack->GetPhi()), Sin(2. * recoTrack->GetPhi()));
+          u_L_SP_Mc.Set(Cos(2. * mcTrack->GetPhi()), Sin(2. * mcTrack->GetPhi()));
           v2SpTpc = (double)(u_L_SP * Q_R_SP.at(iGap)) / fResSpTpc[iGap]->Eval(cent);
           v2Tpc = Cos(2. * (recoTrack->GetPhi() - vPsiTpcR.at(iGap))) / fResTpc[iGap]->Eval(cent);
           v2TpcMc = Cos(2. * (mcTrack->GetPhi() - vPsiTpcR.at(iGap))) / fResTpc[iGap]->Eval(cent);
+          v2SpTpcMc = (double)(u_L_SP_Mc * Q_R_SP.at(iGap)) / fResSpTpc[iGap]->Eval(cent);
         }
         if (recoTrack->GetEta() > TpcEtaGap[iGap])
         {
           u_R_SP.Set(Cos(2. * recoTrack->GetPhi()), Sin(2. * recoTrack->GetPhi()));
+          u_R_SP_Mc.Set(Cos(2. * mcTrack->GetPhi()), Sin(2. * mcTrack->GetPhi()));
           v2SpTpc = (double)(u_R_SP * Q_L_SP.at(iGap)) / fResSpTpc[iGap]->Eval(cent);
           v2Tpc = Cos(2. * (recoTrack->GetPhi() - vPsiTpcL.at(iGap))) / fResTpc[iGap]->Eval(cent);
           v2TpcMc = Cos(2. * (mcTrack->GetPhi() - vPsiTpcL.at(iGap))) / fResTpc[iGap]->Eval(cent);
+          v2SpTpcMc = (double)(u_R_SP_Mc * Q_L_SP.at(iGap)) / fResSpTpc[iGap]->Eval(cent);
         }
 
         if (Abs(recoTrack->GetEta()) > TpcEtaGap[iGap])
@@ -611,6 +634,22 @@ int main(int argc, char **argv)
           if (selector->isPdgProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() > 0)
             pv2PdgYSpTpc[iGap][3]->Fill(Rapidity, cent, v2SpTpc);
 
+          if (recoTrack->GetCharge() > 0)
+            pv2PtRecoMcSpTpc[iGap][0]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgPion(mcTrack)) //if (selector->isPion(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2PtRecoMcSpTpc[iGap][1]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgKaon(mcTrack)) //if (selector->isKaon(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2PtRecoMcSpTpc[iGap][2]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2PtRecoMcSpTpc[iGap][3]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+
+          if (selector->isPdgPion(mcTrack)) //if (selector->isPion(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2YRecoMcSpTpc[iGap][1]->Fill(RapidityMc, cent, v2SpTpcMc);
+          if (selector->isPdgKaon(mcTrack)) //if (selector->isKaon(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2YRecoMcSpTpc[iGap][2]->Fill(RapidityMc, cent, v2SpTpcMc);
+          if (selector->isPdgProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() > 0)
+            pv2YRecoMcSpTpc[iGap][3]->Fill(RapidityMc, cent, v2SpTpcMc);
+
           if (recoTrack->GetCharge() < 0)
             pv2PtTpc[iGap][4]->Fill(recoTrack->GetPt(), cent, v2Tpc);
           if (selector->isPion(recoTrack) && recoTrack->GetCharge() < 0)
@@ -690,6 +729,22 @@ int main(int argc, char **argv)
             pv2PdgYSpTpc[iGap][6]->Fill(Rapidity, cent, v2SpTpc);
           if (selector->isPdgAntiProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() > 0)
             pv2PdgYSpTpc[iGap][7]->Fill(Rapidity, cent, v2SpTpc);
+
+          if (recoTrack->GetCharge() < 0)
+            pv2PtRecoMcSpTpc[iGap][4]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgAntiPion(mcTrack)) //if (selector->isPion(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2PtRecoMcSpTpc[iGap][5]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgAntiKaon(mcTrack)) //if (selector->isKaon(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2PtRecoMcSpTpc[iGap][6]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+          if (selector->isPdgAntiProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2PtRecoMcSpTpc[iGap][7]->Fill(mcTrack->GetPt(), cent, v2SpTpcMc);
+
+          if (selector->isPdgAntiPion(mcTrack)) //if (selector->isPion(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2YRecoMcSpTpc[iGap][5]->Fill(RapidityMc, cent, v2SpTpcMc);
+          if (selector->isPdgAntiKaon(mcTrack)) //if (selector->isKaon(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2YRecoMcSpTpc[iGap][6]->Fill(RapidityMc, cent, v2SpTpcMc);
+          if (selector->isPdgAntiProton(mcTrack)) //if (selector->isProton(recoTrack) && recoTrack->GetCharge() < 0)
+            pv2YRecoMcSpTpc[iGap][7]->Fill(RapidityMc, cent, v2SpTpcMc);
         }
       }
 
@@ -1105,6 +1160,7 @@ int main(int argc, char **argv)
   fo->mkdir("TpcSpPdg");
   fo->mkdir("McTpcEp");
   fo->mkdir("RecoMcTpcEp");
+  fo->mkdir("RecoMcTpcSp");
   fo->mkdir("FHCalEp");
   fo->mkdir("FHCalEpPdg");
   fo->mkdir("FHCalRp");
@@ -1203,6 +1259,21 @@ int main(int argc, char **argv)
       pv2YRecoMcTpc[iGap][iPid]->Write();
     }
   }
+  fo->cd("RecoMcTpcSp");
+  for (int iGap = 0; iGap < NetaGaps; iGap++)
+  {
+    for (int iPid = 0; iPid < Npid; iPid++)
+    {
+      pv2PtRecoMcSpTpc[iGap][iPid]->Write();
+    }
+  }
+  for (int iGap = 0; iGap < NetaGaps; iGap++)
+  {
+    for (int iPid = 0; iPid < Npid; iPid++)
+    {
+      pv2YRecoMcSpTpc[iGap][iPid]->Write();
+    }
+  }
   fo->cd("Rp");
   for (int iPid = 0; iPid < Npid; iPid++)
   {