1 void printProfile(char* g3 = "geant3/timing_200_woZDC.root", char* g4 ="geant4/timing_200_woZDC.root")
4 AliTransportMonitor* mon3 = AliTransportMonitor::Import(g3);
5 AliTransportMonitor* mon4 = AliTransportMonitor::Import(g4);
7 // Create timing histos and volume lists
9 tH3 = (TH1F*) volume_timing->Clone();
10 TObjArray* volumes3 = mon3->GetVolumes();
12 tH4 = (TH1F*) volume_timing->Clone();
13 TObjArray* volumes4 = mon4->GetVolumes();
15 // Normalise the geant 3 histo
16 // Fraction of time in %
17 Float_t ri = tH3->Integral();
20 Float_t cumulant = 0.; // cumulant
21 Int_t i = 1; // position in list
23 // print up to 90% of total time
25 printf(" Pos. Volume t (%) ct (%) Time_G3 Time_G4 perStepG3 perStepG4 StepsG3 StepsG4 te+e- tgam thad te+e- tgam thad\n");
26 while (cumulant < 90.) {
27 Float_t rt = tH3->GetBinContent(i);
29 // extract the corresponding geant3 and geant4 volumes
30 char* volN = (tH3->GetXaxis())->GetBinLabel(i);
31 AliTransportMonitor::AliTransportMonitorVol* vol4 = (AliTransportMonitor::AliTransportMonitorVol*)
32 volumes4->FindObject(volN);
33 AliTransportMonitor::AliTransportMonitorVol* vol3 = 0;
35 vol3 = (AliTransportMonitor::AliTransportMonitorVol*)
36 volumes3->FindObject(volN);
38 vol3 = (AliTransportMonitor::AliTransportMonitorVol*)
46 t4[0] = vol4->GetTotalTime();
48 t3[0] = vol3->GetTotalTime();
51 t4[1] = ElectronTime(vol4);
52 t3[1] = ElectronTime(vol3);
55 t4[2] = PhotonTime(vol4);
56 t3[2] = PhotonTime(vol3);
59 t4[3] = HadronTime(vol4);
60 t3[3] = HadronTime(vol3);
62 printf("%5d %20s %6.2f %6.2f %8.3f %8.3f %8.3e %8.3e %8.3e %8.3e %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n",
65 rt, cumulant, t3[0], t4[0], t3[0]/(1.+vol3->GetNSteps()),
66 t4[0]/(1.+vol4->GetNSteps()), vol3->GetNSteps(), vol4->GetNSteps(),
67 t3[1]/t3[0] * 100., t3[2]/t3[0] * 100., t3[3]/t3[0] * 100.,
68 t4[1]/t4[0] * 100., t4[2]/t4[0] * 100., t4[3]/t4[0] * 100.
75 Float_t ElectronTime(AliTransportMonitor::AliTransportMonitorVol* vol)
77 Int_t nt = vol->GetNtypes();
79 for (Int_t i = 0; i < nt; i++) {
80 Int_t pdg = TMath::Abs(vol->GetPDG(i));
81 if (pdg == 11) t += vol->GetTime(i);
87 Float_t PhotonTime(AliTransportMonitor::AliTransportMonitorVol* vol)
89 Int_t nt = vol->GetNtypes();
91 for (Int_t i = 0; i < nt; i++) {
92 Int_t pdg = TMath::Abs(vol->GetPDG(i));
93 if (pdg == 22) t += vol->GetTime(i);
98 Float_t HadronTime(AliTransportMonitor::AliTransportMonitorVol* vol)
100 Int_t nt = vol->GetNtypes();
102 for (Int_t i = 0; i < nt; i++) {
103 Int_t pdg = TMath::Abs(vol->GetPDG(i));
104 if (pdg == 211 || pdg == 2212 || pdg == 2112 || pdg == 130 || pdg == 321) t += vol->GetTime(i);