X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FMUONcombi.C;h=24c7f89dac01e37e2b933ff7d0084bc3b75346cf;hb=e749bb3d335bc90775fbb89ab930c15ad8991e78;hp=5ec65ea3d1834d36d0055a9a3362aedc667ca872;hpb=fe4da5cc22f890b04843f1aebec0f1bf4f9c3fc9;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/MUONcombi.C b/MUON/MUONcombi.C index 5ec65ea3d18..24c7f89dac0 100644 --- a/MUON/MUONcombi.C +++ b/MUON/MUONcombi.C @@ -1,30 +1,16 @@ -void MUONcombi (Int_t evNumber=0) +void MUONcombi (Int_t evNumber=0) { -///////////////////////////////////////////////////////////////////////// -// This macro is a small example of a ROOT macro -// illustrating how to read the output of GALICE -// and fill some histograms. -// -// Root > .L anal.C //this loads the macro in memory -// Root > anal(); //by default process first event -// Root > anal(2); //process third event -//Begin_Html -/* - -*/ -//End_Html -///////////////////////////////////////////////////////////////////////// + const Float_t runWeight = 4.e8; + // Dynamically link some shared libs - if (gClassTable->GetID("AliRun") < 0) { - gSystem->Load("$ALITOP/cern.so/lib/libpdfDUMMY.so"); - gSystem->Load("$ALITOP/cern.so/lib/libPythia.so"); - gSystem->Load("$ROOTSYS/lib/libEG.so"); - gSystem->Load("$ROOTSYS/lib/libEGPythia.so"); - gSystem->Load("libGeant3Dummy.so"); //a dummy version of Geant3 - gSystem->Load("PHOS/libPHOSdummy.so"); //the standard Alice classes - gSystem->Load("libgalice.so"); // the standard Alice classes - } -// + if (gClassTable->GetID("AliRun") < 0) { + gROOT->LoadMacro("loadlibs.C"); + loadlibs(); + } else { + delete gAlice; + gAlice = 0; + } + // Connect the Root Galice file containing Geometry, Kine and Hits TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); if (!file) file = new TFile("galice.root"); @@ -35,24 +21,29 @@ void MUONcombi (Int_t evNumber=0) if (gAlice) printf("AliRun object found on file\n"); if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); } -// TClonesArray &Partarray = *(gAlice->Particles()); - TClonesArray *PartArray = gAlice->Particles(); - GParticle *Part; - // Import the Kine and Hits Trees for the event evNumber in the file Int_t nparticles = gAlice->GetEvent(evNumber); if (nparticles <= 0) return; // // - TH1F *dmass = new TH1F("dmass","Dimuon-Mass Distribution" - ,50,0.,10.); - TH1F *pt = new TH1F("pt","pT-single" - ,50,0.,10.); + TH1F *dmass = new TH1F("dmass","Dimuon-Mass Distribution" + ,100,0.,5.); + + TH1F *dmassc = new TH1F("dmassc","Dimuon-Mass Distribution" + ,200,0.,10.); + TH1F *dmassd = new TH1F("dmassd","Dimuon-Mass Distribution" + ,200,0.,10.); + + TH1F *pt = new TH1F("pt","pT-single" + ,50,0.,10.); + TH1F *hCont[30]; + // // Generator Loop // - + + Int_t i=0; AliGenCocktailEntry *Entry, *e1, *e2; AliGenCocktail* Cocktail = (AliGenCocktail*) gAlice->Generator(); @@ -63,65 +54,59 @@ void MUONcombi (Int_t evNumber=0) ) { Entry->PrintInfo(); } -// Pairs of Generators - // // Initialize Combinator - DimuonCombinator Combinator = DimuonCombinator(PartArray); - Combinator->SetEtaCut(-4, 4); - Combinator->SetPtMin(0.5); - - Int_t i=0; +// + AliDimuCombinator* Combinator = new AliDimuCombinator(); + Combinator->SetEtaCut(2.5, 4.); + Combinator->SetPtMin(1.0); + + i=0; + // // Single Muon Loop // -/* + Combinator->ResetRange(); + + - for(Muon=Combinator.FirstMuon(); + for(Muon=Combinator->FirstMuon(); Muon; - Muon=Combinator.NextMuon()) { + Muon=Combinator->NextMuon()) { // - Int_t chfirst= Muon->GetFirstChild(); - Int_t chlast = Muon->GetLastChild(); - Int_t parent = Muon->GetParent(); - Float_t ptm = Muon->GetPT(); - Float_t eta = Muon->GetEta(); + Int_t chfirst = Muon->GetFirstDaughter(); + Int_t chlast = Muon->GetLastDaughter(); + Int_t parent = Muon->GetFirstMother(); + Float_t ptm = Muon->Pt(); + Float_t eta = Muon->Eta(); - printf("\n Particle %d Parent %d first child %d last child %d", - i,parent, chfirst, chlast); - printf("\n Particle pt, eta: %f , %f ",pt,eta); - i++; +// printf("\n Particle %d Parent %d first child %d last child %d", +// i,parent, chfirst, chlast); +// printf("\n Particle pt, eta: %f , %f ", ptm, eta); + i++; } -*/ // // Di-Muon Loop Float_t pt1,pt2; - GParticle* Muon1, *Muon2; -/* + TParticle* Muon1; + TParticle* Muon2; + Combinator->ResetRange(); - for (Combinator->FirstMuonPairSelected(Muon1,Muon2); - (Muon1 && Muon2); - Combinator->NextMuonPairSelected(Muon1,Muon2)) - { - pt1=Muon1->GetPT(); - pt2=Muon2->GetPT(); - Float_t mass=Combinator->Mass(Muon1, Muon2); - Float_t wgt =Combinator->Weight(Muon1, Muon2); - pt->Fill(pt1, wgt); - pt->Fill(pt2, wgt); - Float_t smeared_mass=mass; - Combinator->SmearGauss(0.05*mass, smeared_mass); - dmass->Fill(smeared_mass , wgt); - } -*/ + // // Dimuon Loop controlled by Generator Loop // + Float_t sig = 0; + Int_t icont = 0; + char name[30]; for (Cocktail->FirstGeneratorPair(e1,e2); (e1&&e2); Cocktail->NextGeneratorPair(e1,e2) ){ + + sprintf(name, "%s-%s", e1->GetName(), e2->GetName()); + hCont[icont] = new TH1F(name,"Dimuon-Mass Distribution",100,0.,5.); printf("\n ----------------------------------------------------"); e1->PrintInfo(); e2->PrintInfo(); @@ -133,18 +118,33 @@ void MUONcombi (Int_t evNumber=0) (Muon1 && Muon2); Combinator->NextMuonPairSelected(Muon1,Muon2)) { - pt1=Muon1->GetPT(); - pt2=Muon2->GetPT(); - Float_t mass=Combinator->Mass(Muon1, Muon2); - Float_t wgt =Combinator->Weight(Muon1, Muon2); + pt1 = Muon1->Pt(); + pt2 = Muon2->Pt(); + Float_t mass = Combinator->Mass(Muon1, Muon2); + Float_t wgt = runWeight*Combinator->Weight(Muon1, Muon2)* + Combinator->DecayProbability(Muon1)* + Combinator->DecayProbability(Muon2); pt->Fill(pt1, wgt); pt->Fill(pt2, wgt); - Float_t smeared_mass=mass; - Combinator->SmearGauss(0.05*mass, smeared_mass); - dmass->Fill(smeared_mass , wgt); + Float_t smeared_mass = mass; + Combinator->SmearGauss(0.02*mass, smeared_mass); + + if (TMath::Min(pt1,pt2) > -0.5*TMath::Max(pt1,pt2)+2.) { + if (Combinator->Correlated(Muon1, Muon2)) { + dmassc->Fill(smeared_mass, wgt); + sig += wgt; + } else { +// account for the fact that we sum like-sign and unlike-sign + wgt *= 0.5; + } + dmass->Fill(smeared_mass, wgt); + hCont[icont]->Fill(smeared_mass, wgt); + } } // Dimuon Loop + icont++; }// Generator Loop - + printf("\n Signal %e \n \n", sig); + // //Create a canvas, set the view range, show histograms // @@ -168,9 +168,24 @@ void MUONcombi (Int_t evNumber=0) pt->Draw(); pad12->cd(); + pad12->SetLogy(0); dmass->SetFillColor(42); dmass->SetXTitle("m (GeV)"); dmass->Draw(); + + pad13->cd(); + pad13->SetLogy(0); + dmassc->SetFillColor(42); + dmassc->SetXTitle("m (GeV)"); + dmassc->Draw(); + + pad14->cd(); + pad14->SetLogy(0); + dmassd->SetFillColor(42); + dmassd->SetXTitle("m (GeV)"); + dmassd->Draw(); + + } @@ -182,3 +197,4 @@ void MUONcombi (Int_t evNumber=0) +