示例#1
0
//______________________________________________________________________________
void alice_esd_read()
{
   // Read tracks and associated clusters from current event.

   AliESDRun    *esdrun = (AliESDRun*)    esd->fESDObjects->FindObject("AliESDRun");
   TClonesArray *tracks = (TClonesArray*) esd->fESDObjects->FindObject("Tracks");

   // This needs further investigation. Clusters not shown.
   // AliESDfriend *frnd   = (AliESDfriend*) esd->fESDObjects->FindObject("AliESDfriend");
   // printf("Friend %p, n_tracks:%d\n", frnd, frnd->fTracks.GetEntries());

   if (track_list == 0) {
      track_list = new TEveTrackList("ESD Tracks"); 
      track_list->SetMainColor(6);
      //track_list->SetLineWidth(2);
      track_list->SetMarkerColor(kYellow);
      track_list->SetMarkerStyle(4);
      track_list->SetMarkerSize(0.5);

      gEve->AddElement(track_list);
   }

   TEveTrackPropagator* trkProp = track_list->GetPropagator();
   trkProp->SetMagField( 0.1 * esdrun->fMagneticField ); // kGaus to Tesla

   gProgress->Reset();
   gProgress->SetMax(tracks->GetEntriesFast());
   for (Int_t n=0; n<tracks->GetEntriesFast(); ++n)
   {
      AliESDtrack* at = (AliESDtrack*) tracks->At(n);

      // If ITS refit failed, take track parameters at inner TPC radius.
      AliExternalTrackParam* tp = at;
      if (! trackIsOn(at, kITSrefit)) {
         tp = at->fIp;
      }

      TEveTrack* track = esd_make_track(trkProp, n, at, tp);
      track->SetAttLineAttMarker(track_list);
      track_list->AddElement(track);

      // This needs further investigation. Clusters not shown.
      // if (frnd)
      // {
      //     AliESDfriendTrack* ft = (AliESDfriendTrack*) frnd->fTracks->At(n);
      //     printf("%d friend = %p\n", ft);
      // }
      gProgress->Increment(1);
   }

   track_list->MakeTracks();
}
示例#2
0
void pythia_display()
{
   if (g_pythia != 0)
   {
      Warning("pythia_display()", "Already initialized.");
      return;
   }
#ifndef G__WIN32 // libPythia6 is a static library on Windoze
   if (gSystem->Load("libPythia6") < 0)
   {
      Error("pythia_display()",
            "Could not load 'libPythia6', make sure it is available!");
      return;
   }
#endif
   gSystem->Load("libEGPythia6");

   if (gROOT->LoadMacro("MultiView.C+") != 0)
   {
      Error("pythia_display()", "Failed loading MultiView.C in compiled mode.");
      return;
   }

   //========================================================================
   //========================================================================

   // Create an instance of the Pythia event generator ... 
   g_pythia = new TPythia6; 
   TPythia6& P = * g_pythia;

   P.SetMSEL(0);           // full user controll;
   P.SetMSUB(102, 1);      // g + g -> H0
   //P.SetMSUB(123, 1);    // f + f' -> f + f' + H0
   //P.SetMSUB(124, 1);    // f + f' -> f" + f"' + H0

   P.SetPMAS(6,  1, 175);  // mass of TOP
   P.SetPMAS(25, 1, 180);  // mass of Higgs


   P.SetCKIN(1, 170.0);    // range of allowed mass
   P.SetCKIN(2, 190.0);

   P.SetMSTP(61, 0);   // switch off ISR
   P.SetMSTP(71, 0);   // switch off FSR
   P.SetMSTP(81, 0);   // switch off multiple interactions

   P.SetMSTP(111, 0);  // Switch off fragmentation

   // Force h0 -> ZZ
   for (Int_t i = 210; i <= 288; ++i)
      P.SetMDME(i, 1, 0);
   P.SetMDME(225, 1, 1);

   // Force Z -> mumu
   for (Int_t i = 174; i <= 189; ++i)
      P.SetMDME(i, 1, 0);
   P.SetMDME(184, 1, 1);


   P.Initialize("cms", "p", "p", 14000);

   //========================================================================
   // Create views and containers.
   //========================================================================

   TEveManager::Create();

   TEveElementList *fake_geom = new TEveElementList("Geometry");

   TEveGeoShape *b;

   b = new TEveGeoShape("Barell 1");
   b->SetShape(new TGeoTube(kR_min, kR_max, kZ_d));
   b->SetMainColor(kCyan);
   b->SetMainTransparency(80);
   fake_geom->AddElement(b);

   b = new TEveGeoShape("Barell 2");
   b->SetShape(new TGeoTube(2*kR_min, 2*kR_max, 2*kZ_d));
   b->SetMainColor(kPink-3);
   b->SetMainTransparency(80);
   fake_geom->AddElement(b);

   gEve->AddGlobalElement(fake_geom);


   gMultiView = new MultiView;

   gMultiView->ImportGeomRPhi(fake_geom);
   gMultiView->ImportGeomRhoZ(fake_geom);

   gEve->GetBrowser()->GetTabRight()->SetTab(1);

   gTrackList = new TEveTrackList("Pythia Tracks"); 
   gTrackList->SetMainColor(kYellow);
   gTrackList->SetMarkerColor(kRed);
   gTrackList->SetMarkerStyle(4);
   gTrackList->SetMarkerSize(0.5);
   gEve->AddElement(gTrackList);

   TEveTrackPropagator* trkProp = gTrackList->GetPropagator();
   trkProp->SetMagField(kMagField);
   trkProp->SetMaxR(2*kR_max);
   trkProp->SetMaxZ(2*kZ_d);

   //========================================================================
   //========================================================================

   pythia_make_gui();
   pythia_next_event();

   gEve->Redraw3D(kTRUE);
}
示例#3
0
文件: aod_HF.C 项目: alisw/AliRoot
AliEveHFList* aod_HF()
{
  Bool_t useParFiles=kFALSE;
  
//  TEveUtil::LoadMacro("$ALICE_ROOT/PWGHF/vertexingHF/macros/LoadLibraries.C+");
//  LoadLibraries(useParFiles);
  
  AliAODEvent* aod = AliEveEventManager::AssertAOD();
  AliESDEvent* esd = AliEveEventManager::Instance()->AssertESD();

  /*
    gSystem->Load("libANALYSIS");
    gSystem->Load("libANALYSISalice");
    gSystem->Load("libCORRFW");
    gSystem->Load("libPWG3base");
    gSystem->Load("libPWG3vertexingHF");
  */

  // load MC particles
  TClonesArray *mcArray =
    (TClonesArray*) aod->FindListObject(AliAODMCParticle::StdBranchName());
  if (!mcArray) {
    printf("MC particles branch not found!\n");
    return 0;
  }

  AliAODVertex* primVtx_aod = (AliAODVertex*) aod->GetPrimaryVertex();
  // AliESDVertex *primVtx_esd = (AliESDVertex*) esd->GetPrimaryVertex();

  AliEveHFList* cont = new AliEveHFList("AOD HF vertices");
  cont->SetMainColor(2);
  TEveTrackPropagator* rnrStyle = cont->GetPropagator();
  rnrStyle->SetMagField( 0.1*aod->GetMagneticField() );

  gEve->AddElement(cont);

  TEvePointSet* pointsD0toKpi = new TEvePointSet("D0->Kpi vertex locations");

  // load D0->Kpi candidates
  TClonesArray *arrayD0toKpi = (TClonesArray*) aod->FindListObject("D0toKpi");

  // load 3prong candidates
  // TClonesArray *array3Prong =
  // (TClonesArray*)aod->GetList()->FindObject("Charm3Prong");

  Int_t countD0 = 0;
  for (Int_t iD0toKpi=0; iD0toKpi<arrayD0toKpi->GetEntriesFast(); iD0toKpi++)
  {
    AliAODRecoDecayHF2Prong *rd = (AliAODRecoDecayHF2Prong*)arrayD0toKpi->UncheckedAt(iD0toKpi);
    Bool_t unsetvtx=kFALSE;
    if (!rd->GetOwnPrimaryVtx()) {
      rd->SetOwnPrimaryVtx(primVtx_aod);
      unsetvtx=kTRUE;
    }
    // REAL D0 particle. If you want to draw only real D0 un-comment these lines
    //Int_t labD0 = rd->MatchToMC(421,mcArray);
    //if(labD0<0) continue;

    AliAODTrack *negAODTr = dynamic_cast<AliAODTrack *>(rd->GetDaughter(0));
    AliAODTrack *posAODTr = dynamic_cast<AliAODTrack *>(rd->GetDaughter(1));

    AliVVertex  *secv = rd->GetSecondaryVtx();

    AliESDtrack *negTr = new AliESDtrack(negAODTr);
    AliESDtrack *posTr = new AliESDtrack(posAODTr);

    negTr->PropagateToDCA((AliAODVertex*)secv,aod->GetMagneticField(),100.);
    posTr->PropagateToDCA((AliAODVertex*)secv,aod->GetMagneticField(),100.);

    AliEveHF* myD0 = aod_make_HF(rnrStyle,primVtx_aod,negTr,posTr,rd,iD0toKpi);
    if (myD0) {
      gEve->AddElement(myD0,cont);
      countD0++;
    }

    pointsD0toKpi->SetNextPoint(rd->Xv(),rd->Yv(),rd->Zv());
    pointsD0toKpi->SetPointId(rd);

    if(unsetvtx) {
      rd->UnsetOwnPrimaryVtx();
    }
  }

  //cont->SetTitle("test");

  cont->MakeHFs();
  gEve->Redraw3D();

  pointsD0toKpi->SetTitle(Form("N=%d", pointsD0toKpi->Size()));
  pointsD0toKpi->SetMarkerStyle(4);
  pointsD0toKpi->SetMarkerSize(1.5);
  pointsD0toKpi->SetMarkerColor(kViolet);

  gEve->AddElement(pointsD0toKpi);
  gEve->Redraw3D();

  return cont;
}