TEvePointSet* pointset(Int_t npoints = 512, TEveElement* parent=0) { TEveManager::Create(); if (!gRandom) gRandom = new TRandom(0); TRandom& r= *gRandom; Float_t s = 100; TEvePointSet* ps = new TEvePointSet(); ps->SetOwnIds(kTRUE); for(Int_t i = 0; i<npoints; i++) { ps->SetNextPoint(r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s)); ps->SetPointId(new TNamed(Form("Point %d", i), "")); } ps->SetMarkerColor(TMath::Nint(r.Uniform(2, 9))); ps->SetMarkerSize(r.Uniform(1, 2)); ps->SetMarkerStyle(4); if (parent) { parent->AddElement(ps); } else { gEve->AddElement(ps); gEve->Redraw3D(); } return ps; }
TEvePointSet* esd_kink_points() { TEvePointSet* points = new TEvePointSet("Kink vertex locations"); esd_kink_fill_pointset(points); points->SetTitle(Form("N=%d", points->Size())); points->SetMarkerStyle(4); points->SetMarkerSize(1.5); points->SetMarkerColor(kOrange+8); gEve->AddElement(points); gEve->Redraw3D(); return points; }
void renderHLTClusters(TTree* clustersTree) { /************************** * Visualization of Clusters **************************/ const Int_t kMaxCl=100*160; Int_t fNColorBins = 5; TEvePointSet* clusters = new TEvePointSet(kMaxCl); clusters->SetOwnIds(kTRUE); TEvePointSetArray * cc = new TEvePointSetArray("TPC Clusters Colorized"); cc->SetMainColor(kRed); cc->SetMarkerStyle(8); cc->SetMarkerSize(1.0); cc->InitBins("Cluster Charge", fNColorBins, 0., fNColorBins*60.); cc->GetBin(0)->SetMainColor(kGray); cc->GetBin(0)->SetMarkerSize(1.0); cc->GetBin(1)->SetMainColor(kBlue); cc->GetBin(1)->SetMarkerSize(1.0); cc->GetBin(2)->SetMainColor(kCyan); cc->GetBin(2)->SetMarkerSize(1.0); cc->GetBin(3)->SetMainColor(kGreen); cc->GetBin(3)->SetMarkerSize(1.0); cc->GetBin(4)->SetMainColor(kYellow); cc->GetBin(4)->SetMarkerSize(1.0); cc->GetBin(5)->SetMainColor(kRed); cc->GetBin(5)->SetMarkerSize(1.0); cc->GetBin(6)->SetMainColor(kMagenta); cc->GetBin(6)->SetMarkerSize(1.0); // Loop over clusters Int_t nentries = clustersTree->GetEntriesFast(); AliTPCClustersRow *clrow = new AliTPCClustersRow(); clrow->SetClass("AliTPCclusterMI"); //clrow->SetArray(kMaxCl); clustersTree->SetBranchAddress("Segment", &clrow); for (Int_t i=0; i<nentries; i++) { if (!clustersTree->GetEvent(i)) continue; TClonesArray *cl = clrow->GetArray(); Int_t ncl = cl->GetEntriesFast(); while (ncl--) { AliTPCclusterMI* clusterMI = (AliTPCclusterMI*) cl->At(ncl); AliCluster *c = (AliCluster*) cl->UncheckedAt(ncl); Float_t g[3]; //global coordinates c->GetGlobalXYZ(g); cout<<g[0]<<"\t"<<g[1]<<"\t"<<g[2]<<endl; cc->Fill(g[0], g[1], g[2], clusterMI->GetQ()); clusters->SetNextPoint(g[0], g[1], g[2]); AliCluster *atp = new AliCluster(*clusterMI); clusters->SetPointId(atp); } cl->Clear(); } // delete clrow; clusters->SetName("TPC Clusters"); clusters->SetTitle(Form("N=%d", clusters->Size())); // const TString viz_tag("REC Clusters TPC"); // to be changed // clusters->ApplyVizTag(viz_tag, "Clusters"); cc->SetRnrSelf(kTRUE); gEve->AddElement(cc); return; }
void clusters() { IlcEveEventManager::AssertGeometry(); IlcRunLoader *rl = IlcEveEventManager::AssertRunLoader(); IlcESDEvent *esd = IlcEveEventManager::AssertESD(); IlcEveEventManager::AssertESDfriend(); IlcEveEventManager::AssertMagField(); const char* detNames[] = { "ITS", "TPC", /*"TRD",*/ "TOF", "HMPID" }; const Int_t detIds[] = { 0, 1, /* 2, */ 3, 5 }; const Int_t detN = sizeof(detNames)/sizeof(char*); // Hack - IlcReconstruction does wonders with gGeoManager. TGeoManager* xxx = gGeoManager; gGeoManager = 0; IlcReconstruction* reco = new IlcReconstruction; gGeoManager = xxx; // Hack for ITS - it requires RecoParams outside event-loop! reco->SetRecoParam("ITS", IlcITSRecoParam::GetLowFluxParam()); reco->ImportRunLoader(rl); { TString alldets; for (Int_t i = 0; i < detN; ++i) { alldets += detNames[i]; alldets += " "; } reco->CreateTrackers(alldets); } TObjArray* clarr = new TObjArray(); // Load clusters, fill them into clarr. for (Int_t i = 0; i < detN; ++i) { Int_t det = detIds[i]; rl->LoadRecPoints(detNames[i]); TTree *cTree = rl->GetTreeR(detNames[i], false); if (cTree == 0) continue; IlcTracker* tracker = reco->GetTracker(det); if (tracker == 0) continue; tracker->LoadClusters(cTree); tracker->FillClusterArray(clarr); } // Loop over tracks and friends, tag used clusters. for (Int_t n = 0; n < esd->GetNumberOfTracks(); ++n) { IlcESDtrack* at = esd->GetTrack(n); Int_t idx[200]; for (Int_t i = 0; i < detN; ++i) { Int_t det = detIds[i]; IlcTracker* tracker = reco->GetTracker(det); if (tracker == 0) continue; Int_t nclusters = at->GetClusters(det, idx); Int_t p=0; for (Int_t c = 0; c < nclusters; ) { Int_t index = idx[p++]; if (index < 0) continue; c++; IlcCluster* cluster = tracker->GetCluster(index); if (cluster) cluster->IncreaseClusterUsage(); //else printf("Zero cluster pointer for detector: %s\n",detNames[i]); } } } for (Int_t i = 0; i < detN; ++i) rl->UnloadRecPoints(detNames[i]); // Fill visualization structs TEveElementList* list = new TEveElementList("Clusters"); gEve->AddElement(list); TEvePointSet* shared = new TEvePointSet("Shared Clusters"); shared->SetMainColor(2); shared->SetMarkerSize(0.4); shared->SetMarkerStyle(2); list->AddElement(shared); TEvePointSet* used = new TEvePointSet("Single-used Clusters"); used->SetMainColor(3); used->SetMarkerSize(0.4); used->SetMarkerStyle(2); list->AddElement(used); TEvePointSet* nonused = new TEvePointSet("Not-used Clusters"); nonused->SetMainColor(4); nonused->SetMarkerSize(0.4); nonused->SetMarkerStyle(2); list->AddElement(nonused); // Loop over all clusters, fill appropriate container based // on shared/used information. Int_t ncl = clarr->GetEntriesFast(); for (Int_t i = 0; i < ncl; ++i) { IlcCluster *cluster = (IlcCluster*) clarr->UncheckedAt(i); TEvePointSet *dest = 0; if (cluster->IsClusterShared()) dest = shared; else if (cluster->IsClusterUsed()) dest = used; else dest = nonused; Float_t g[3]; //global coordinates cluster->GetGlobalXYZ(g); dest->SetNextPoint(g[0], g[1], g[2]); dest->SetPointId(cluster); } delete clarr; // ??? What to do with trackers ??? // I'd propose: have global reconstruction that owns them. // IlcEveEventManager::AssertIlcReconstruction(); // do we have bit-field for detectors, like // enum IlcDetectors_e { // kITS = BIT(0), // kTPC = BIT(1), // ... // kCentralTracking = kITS | kTPC | kTRD | kTOF, // ... // }; gEve->Redraw3D(); }
void VizDB_scan_screen() { TEvePointSet *ps = 0; TEveStraightLineSet *ls = 0; //============================================================================ // Hits //============================================================================ ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("Hits", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("SIM Hits ITS", ps); ps = new TEvePointSet(); ps->SetMarkerColor(3); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("SIM Hits TPC", ps); ps = new TEvePointSet(); ps->SetMarkerColor(3); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits T0", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits FMD", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits ACORDE", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits EMCAL", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits PMD", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits TOF", ps); ps = new TEvePointSet(); ps->SetMarkerColor(7); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits TRD", ps); ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("SIM Hits VZERO", ps); //============================================================================ // Clusters //============================================================================ ps = new TEvePointSet(); ps->SetMarkerColor(2); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("Clusters", ps); ps = new TEvePointSet(); ps->SetMarkerColor(5); ps->SetMarkerSize(0.2); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("REC Clusters ITS", ps); ps = new TEvePointSet(); ps->SetMarkerColor(4); ps->SetMarkerSize(0.2); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("REC Clusters TPC", ps); ps = new TEvePointSet(); ps->SetMarkerColor(7); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("REC Clusters TRD", ps); ps = new TEvePointSet(); ps->SetMarkerColor(kOrange); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(4); gEve->InsertVizDBEntry("REC Clusters TOF", ps); ps = new TEvePointSet(); ps->SetMarkerColor(4); ps->SetMarkerSize(0.2); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("REC Clusters HMPID", ps); ps = new TEvePointSet(); ps->SetMarkerColor(4); ps->SetMarkerSize(0.5); ps->SetMarkerStyle(2); gEve->InsertVizDBEntry("REC Clusters PHOS", ps); //============================================================================ // Primary vertex //============================================================================ // Combined vertex ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(7); ls->SetLineColor(7); ls->SetLineWidth(3); gEve->InsertVizDBEntry("REC PVTX", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(7); ls->SetLineColor(7); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Ellipse", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(7); ls->SetLineColor(7); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Box", ls); // SPD vertex ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(6); ls->SetLineColor(6); ls->SetLineWidth(3); gEve->InsertVizDBEntry("REC PVTX SPD", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(6); ls->SetLineColor(6); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Ellipse SPD", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(6); ls->SetLineColor(6); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Box SPD", ls); // TPC vertex ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(5); ls->SetLineColor(5); ls->SetLineWidth(3); gEve->InsertVizDBEntry("REC PVTX TPC", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(5); ls->SetLineColor(5); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Ellipse TPC", ls); ls = new TEveStraightLineSet; ls->SetMarkerStyle(2); ls->SetMarkerColor(5); ls->SetLineColor(5); ls->SetLineWidth(1); gEve->InsertVizDBEntry("REC PVTX Box TPC", ls); //Tracks tl = new TEveTrackList("ESD Tracks"); tl->SetLineStyle(6); tl->SetMainColor(1); tl->SetLineWidth(1); gEve->InsertVizDBEntry("REC Tracks",tl); tl = new TEveTrackList("ESD Tracks MI"); tl->SetLineStyle(6); tl->SetMainColor(1); tl->SetLineWidth(1); gEve->InsertVizDBEntry("REC Tracks MI",tl); TEveElementList* el = new TEveElementList("ESD Tracks by category"); TEveTrackList *tltemp[7]; tltemp[0] = new TEveTrackList("Sigma < 3"); tltemp[0]->SetLineStyle(6); tltemp[0]->SetLineColor(1); tltemp[0]->SetLineWidth(1); el->AddElement(tltemp[0]); tltemp[1] = new TEveTrackList("3 < Sigma < 5"); tltemp[1]->SetLineStyle(6); tltemp[1]->SetLineColor(1); tltemp[1]->SetLineWidth(1); el->AddElement(tltemp[1]); tltemp[2] = new TEveTrackList("5 < Sigma"); tltemp[2]->SetLineStyle(6); tltemp[2]->SetLineColor(1); tltemp[2]->SetLineWidth(1); el->AddElement(tltemp[2]); tltemp[3] = new TEveTrackList("no ITS refit; Sigma < 5"); tltemp[3]->SetLineStyle(6); tltemp[3]->SetLineColor(1); tltemp[3]->SetLineWidth(1); el->AddElement(tltemp[3]); tltemp[4] = new TEveTrackList("no ITS refit; Sigma > 5"); tltemp[4]->SetLineStyle(6); tltemp[4]->SetLineColor(1); tltemp[4]->SetLineWidth(1); el->AddElement(tltemp[4]); tltemp[5] = new TEveTrackList("no TPC refit"); tltemp[5]->SetLineStyle(6); tltemp[5]->SetLineColor(1); tltemp[5]->SetLineWidth(1); el->AddElement(tltemp[5]); tltemp[6] = new TEveTrackList("ITS stand-alone"); tltemp[6]->SetLineStyle(6); tltemp[6]->SetLineColor(1); tltemp[6]->SetLineWidth(1); el->AddElement(tltemp[6]); el->SetVizTag("ESD Tracks by category"); gEve->AddElement(el); TEveElementList* el = new TEveElementList("ESD Tracks by anal cuts"); TEveTrackList *tlac[2]; tlac[0] = new TEveTrackList("Passed"); tlac[0]->SetLineStyle(6); tlac[0]->SetMainColor(1); tlac[0]->SetLineWidth(1); el->AddElement(tlac[0]); tlac[1] = new TEveTrackList("Rejected"); tlac[1]->SetLineStyle(6); tlac[1]->SetMainColor(1); tlac[1]->SetLineWidth(1); el->AddElement(tlac[1]); el->SetVizTag("ESD Tracks by anal cut"); gEve->AddElement(el); TEveElementList* el = new TEveElementList("ESD Tracklets SPD"); TEveTrackList *tlac[2]; tlac[0] = new TEveTrackList("Good"); tlac[0]->SetLineStyle(6); tlac[0]->SetMainColor(1); tlac[0]->SetLineWidth(1); el->AddElement(tlac[0]); tlac[1] = new TEveTrackList("Bad"); tlac[1]->SetLineStyle(6); tlac[1]->SetMainColor(1); tlac[1]->SetLineWidth(1); el->AddElement(tlac[1]); el->SetVizTag("ESD Tracklets SPD"); gEve->AddElement(el); }