3 void tpc_hits_eta_split(const char *varexp = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
4 const char *selection = "TPC2.fArray.fR>80",
5 Option_t *option = "goff")
7 // Extracts 'major' TPC hits (not the compressed ones).
8 // This gives ~2.5% of all hits.
10 AliRunLoader* rl = Alieve::Event::AssertRunLoader();
13 TTree* ht = rl->GetTreeH("TPC", false);
14 ht->SetEstimate(800*ht->GetEntries());
15 ht->Draw(varexp, selection, option);
17 gReve->DisableRedraw();
19 Reve::PointSetArray* l = new Reve::PointSetArray
20 ("TPC hits - Eta Slices", "");
21 l->SetMarkerColor((Color_t)3);
22 l->SetMarkerStyle(20); // full circle
25 TGListTreeItem *ti = gReve->AddRenderElement(l);
27 l->InitBins(ti, "Eta", 20, -2, 2);
29 Double_t *vr = ht->GetV1(), *vphi = ht->GetV2(), *vz = ht->GetV3();
30 Long64_t nr = ht->GetSelectedRows();
32 using namespace TMath;
33 Double_t ctg = *vz / *vr;
34 Double_t eta = -Log(Hypot(1,ctg)-Abs(ctg)); if(ctg < 0) eta = -eta;
35 Double_t cos_theta = *vz / Hypot(*vr, *vz);
36 Double_t eta1 = -0.5*Log( (1.0-cos_theta)/(1.0+cos_theta) );
37 if(Abs(eta1 - eta) > 0.01) printf("etadiff %lf %lf\n", eta1, eta);
38 l->Fill(eta, *vr * Cos(*vphi), *vr * Sin(*vphi), *vz);
44 gReve->DrawRenderElement(l);
45 gReve->EnableRedraw();