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->SetMainColor((Color_t)3);
22 TGListTreeItem *ti = gReve->AddRenderElement(l);
24 l->InitBins(ti, "Eta", 20, -2, 2);
26 Double_t *vr = ht->GetV1(), *vphi = ht->GetV2(), *vz = ht->GetV3();
27 Long64_t nr = ht->GetSelectedRows();
29 using namespace TMath;
30 Double_t ctg = *vz / *vr;
31 Double_t eta = -Log(Hypot(1,ctg)-Abs(ctg)); if(ctg < 0) eta = -eta;
32 Double_t cos_theta = *vz / Hypot(*vr, *vz);
33 Double_t eta1 = -0.5*Log( (1.0-cos_theta)/(1.0+cos_theta) );
34 if(Abs(eta1 - eta) > 0.01) printf("etadiff %lf %lf\n", eta1, eta);
35 l->Fill(eta, *vr * Cos(*vphi), *vr * Sin(*vphi), *vz);
39 l->CloseBins(20, 1); // Full circle, size 1.
41 gReve->DrawRenderElement(l);
42 gReve->EnableRedraw();