]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Id$ |
2 | ||
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") | |
6 | { | |
7 | // Extracts 'major' TPC hits (not the compressed ones). | |
8 | // This gives ~2.5% of all hits. | |
9 | ||
10 | AliRunLoader* rl = Alieve::Event::AssertRunLoader(); | |
11 | rl->LoadHits("TPC"); | |
12 | ||
13 | TTree* ht = rl->GetTreeH("TPC", false); | |
a6c06134 | 14 | ht->SetEstimate(800*ht->GetEntries()); |
5a5a1232 | 15 | ht->Draw(varexp, selection, option); |
16 | ||
17 | gReve->DisableRedraw(); | |
18 | ||
19 | Reve::PointSetArray* l = new Reve::PointSetArray | |
20 | ("TPC hits - Eta Slices", ""); | |
02fe340a | 21 | l->SetMarkerColor((Color_t)3); |
22 | l->SetMarkerStyle(20); // full circle | |
23 | l->SetMarkerSize(1); | |
24 | ||
5a5a1232 | 25 | TGListTreeItem *ti = gReve->AddRenderElement(l); |
26 | ||
27 | l->InitBins(ti, "Eta", 20, -2, 2); | |
28 | ||
29 | Double_t *vr = ht->GetV1(), *vphi = ht->GetV2(), *vz = ht->GetV3(); | |
30 | Long64_t nr = ht->GetSelectedRows(); | |
31 | while(nr-- > 0) { | |
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); | |
39 | ++vr; ++vphi; ++vz; | |
40 | } | |
41 | ||
02fe340a | 42 | l->CloseBins(); |
5a5a1232 | 43 | |
44 | gReve->DrawRenderElement(l); | |
45 | gReve->EnableRedraw(); | |
46 | } |