示例#1
0
void	ProcessVisualize()
{
	TEveManager::Create();

	TEvePointSetArray	*evp =
	    new TEvePointSetArray("Event points", "Event points");
	TEvePointSetArray	*chp =
	    new TEvePointSetArray("Chamber points", "Chamber points");
	evp->SetMarkerColor(kGreen);
	evp->InitBins("Event cause", 8, 0.5, 8.5);
	chp->SetMarkerColor(kCyan);
	chp->InitBins("Nothing", 1, -0.5, 0.5);
	TEveTrackList *list = new TEveTrackList();
	list->SetLineColor(kMagenta);
	list->SetName("Incident tracks");
	TEveTrackPropagator* prop = list->GetPropagator();
	prop->SetMaxR(2000);
	prop->SetMaxZ(4000);

	int	j = 0;
	BOOST_FOREACH(event_t &e, vis_result)
	{
		evp->Fill(e.i1.x, e.i1.y, e.i1.z, e.event_cause);
		chp->Fill(e.inc.a(0), e.inc.a(1), e.inc.a(2), 0);
		chp->Fill(e.l.a(0), e.l.a(1), e.l.a(2), 0);
		chp->Fill(e.r.a(0), e.r.a(1), e.r.a(2), 0);
		if ((++j % 1000) == 0)
		{
			TEveTrack	*track = make_track(e.inc, prop);
			track->SetLineColor(list->GetLineColor());
			list->AddElement(track);
			track = make_track(e.l, prop);
			track->SetLineColor(list->GetLineColor());
			list->AddElement(track);
			track = make_track(e.r, prop);
			track->SetLineColor(list->GetLineColor());
			list->AddElement(track);
		}
	}
示例#2
0
文件: tpc_raw.C 项目: alisw/AliRoot
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;
}
示例#3
0
文件: pointset.C 项目: My-Source/root
TEvePointSetArray* pointsetarray()
{
   TEveManager::Create();

   TRandom r(0);

   TEvePointSetArray* l = new TEvePointSetArray("TPC hits - Charge Slices", "");
   l->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
   l->SetMarkerColor(3);
   l->SetMarkerStyle(4); // antialiased circle
   l->SetMarkerSize(0.8);

   gEve->AddElement(l);
   l->InitBins("Charge", 9, 10, 100);

   TColor::SetPalette(1, 0); // Spectrum palette
   const Int_t nCol = TColor::GetNumberOfColors();
   for (Int_t i = 1; i <= 9; ++i)
      l->GetBin(i)->SetMainColor(TColor::GetColorPalette(i * nCol / 10));

   l->GetBin(0) ->SetMainColor(kGray);
   l->GetBin(10)->SetMainColor(kWhite);

   Double_t rad, phi, z;
   for (Int_t i = 0; i < 10000; ++i)
   {
      rad = r.Uniform(60, 180);
      phi = r.Uniform(0, TMath::TwoPi());
      z   = r.Uniform(-250, 250);
      l->Fill(rad*TMath::Cos(phi), rad*TMath::Sin(phi), z,
              r.Uniform(0, 110));
   }

   l->CloseBins();

   gEve->Redraw3D();

   return l;
}