<commit_before><commit_msg>New macro from Jouri: display TPC clusters.<commit_after>
Reve::PointSet* tpc_clusters(RenderElement* cont=0, Float_t maxR=270)
{
  const Int_t kMaxCl=100*160;

  Alieve::Event::AssertGeometry();

  Reve::PointSet* clusters = new Reve::PointSet(kMaxCl);
  clusters->SetOwnIds(kTRUE);

  AliRunLoader* rl = Alieve::Event::AssertRunLoader();
  rl->LoadRecPoints("TPC");

  AliTPCClustersRow *clrow=new AliTPCClustersRow();
  clrow->SetClass("AliTPCclusterMI");
  clrow->SetArray(kMaxCl);

  TTree *cTree = rl->GetTreeR("TPC", false);
  TBranch *branch=cTree->SetBranchAddress("Segment",&clrow);

  Float_t maxRsqr = maxR*maxR;
  TClonesArray *cl=clrow->GetArray(); 
  Int_t nentr=(Int_t)cTree->GetEntries();
  for (Int_t i=0; i<nentr; i++) {
    if (!cTree->GetEvent(i)) continue;

    Int_t ncl=cl->GetEntriesFast();

    while (ncl--) {
      AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
      Float_t g[3]; //global coordinates
      c->GetGlobalXYZ(g);
      if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
      {
	clusters->SetNextPoint(g[0], g[1], g[2]);
	AliCluster *atp = new AliCluster(*c);
	clusters->SetPointId(atp);
      }
    }
    cl->Clear();
  }

  delete clrow;

  if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
    Warning("tpc_clusters", "No TPC clusters");
    delete clusters;
    return 0;
  }

  clusters->SetMarkerStyle(2);
  clusters->SetMarkerSize(0.2);
  clusters->SetMarkerColor(4);

  char form[1000];
  sprintf(form,"TPC Clusters");
  clusters->SetName(form);

  char tip[1000];
  sprintf(tip,"N=%d", clusters->Size());
  clusters->SetTitle(tip);

  using namespace Reve;
  gReve->AddRenderElement(clusters);
  gReve->Redraw3D();

  return clusters;
}
{'fraction_non_alphanumeric': 0.17568353694008143, 'fraction_numerical': 0.01977894124490983, 'mean_word_length': 4.566343042071197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '338933', 'n_tokens_mistral': 683, 'n_tokens_neox': 661, 'n_words': 108}