From 2303543417447e075cf208a9a42018f396b7ae74 Mon Sep 17 00:00:00 2001 From: ivana Date: Tue, 1 Sep 2009 10:29:50 +0000 Subject: [PATCH] Minor corrections + small improvement of macro to study fake tracks (Philippe P.) --- MUON/DIMUONFakes.C | 14 +++++------ MUON/MUONFakes.C | 61 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 12 deletions(-) diff --git a/MUON/DIMUONFakes.C b/MUON/DIMUONFakes.C index 7d090af2110..115c1474cc2 100644 --- a/MUON/DIMUONFakes.C +++ b/MUON/DIMUONFakes.C @@ -57,22 +57,22 @@ void DIMUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent // File for histograms and histogram booking TFile *histoFile = new TFile("DiFakes.root", "RECREATE"); - TH1F *hMass = new TH1F("hMass", "Muon mass distribution (GeV/c^{2})", 100, 0., 12.); + TH1F *hMass = new TH1F("hMass", "Dimuon mass distribution (GeV/c^{2})", 100, 0., 12.); TH1F *hMassM = new TH1F("hMassM", "matched track mass distribution (GeV/c^{2})", 100, 0., 12.); TH1F *hMassF = new TH1F("hMassF", "fake track mass distribution (GeV/c^{2})", 100, 0., 12.); - TH1F *hP = new TH1F("hP", "Muon P distribution (GeV/c)", 100, 0., 200.); + TH1F *hP = new TH1F("hP", "Dimuon P distribution (GeV/c)", 100, 0., 200.); TH1F *hPM = new TH1F("hPM", "matched track P distribution (GeV/c)", 100, 0., 200.); TH1F *hPF = new TH1F("hPF", "fake track P distribution (GeV/c)", 100, 0., 200.); - TH1F *hPt = new TH1F("hPt", "Muon Pt distribution (GeV/c)", 100, 0., 20.); + TH1F *hPt = new TH1F("hPt", "Dimuon Pt distribution (GeV/c)", 100, 0., 20.); TH1F *hPtM = new TH1F("hPtM", "matched track Pt distribution (GeV/c)", 100, 0., 20.); TH1F *hPtF = new TH1F("hPtF", "fake track Pt distribution (GeV/c)", 100, 0., 20.); - TH1F *hY = new TH1F("hY"," Muon rapidity distribution",100,-10,0); + TH1F *hY = new TH1F("hY"," Dimuon rapidity distribution",100,-10,0); TH1F *hYM = new TH1F("hYM"," matched track rapidity distribution",100,-10,0); TH1F *hYF = new TH1F("hYF"," fake track rapidity distribution",100,-10,0); - TH1F *hEta = new TH1F("hEta"," Muon pseudo-rapidity distribution",100,-10,0); + TH1F *hEta = new TH1F("hEta"," Dimuon pseudo-rapidity distribution",100,-10,0); TH1F *hEtaM = new TH1F("hEtaM"," matched track pseudo-rapidity distribution",100,-10,0); TH1F *hEtaF = new TH1F("hEtaF"," fake track pseudo-rapidity distribution",100,-10,0); - TH1F *hPhi = new TH1F("hPhi"," Muon phi distribution",100,-1.,9.); + TH1F *hPhi = new TH1F("hPhi"," Dimuon phi distribution",100,-1.,9.); TH1F *hPhiM = new TH1F("hPhiM"," matched track phi distribution",100,-1.,9.); TH1F *hPhiF = new TH1F("hPhiF"," fake track phi distribution",100,-1.,9.); @@ -171,7 +171,7 @@ void DIMUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent Float_t pt = vDiMu.Pt(); Float_t y = vDiMu.Rapidity(); Float_t eta = vDiMu.Eta(); - Float_t phi = vMu1.Phi(); + Float_t phi = vDiMu.Phi(); if (phi < 0) phi += 2.*TMath::Pi(); // fill global histograms diff --git a/MUON/MUONFakes.C b/MUON/MUONFakes.C index 24746549808..70ed78f1a80 100644 --- a/MUON/MUONFakes.C +++ b/MUON/MUONFakes.C @@ -8,6 +8,7 @@ #include #include #include +#include // STEER includes #include "AliLog.h" @@ -100,12 +101,20 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = AliMUONRecoCheck rc(esdFileName, SimDir); // initialize global counters + Int_t nReconstructibleTracks = 0; + Int_t nReconstructedTracks = 0; + Int_t nEventsWithTrackReconstructedYet = 0; Int_t nEventsWithFake = 0; Int_t nEventsWithAdditionalFake = 0; Int_t nTotMatchedTracks = 0; Int_t nTotTracksReconstructedYet = 0; Int_t nTotFakeTracks = 0; + Int_t nTotConnectedTracks = 0; Int_t nTotAdditionalTracks = 0; + Bool_t trackReconstructedYet; + TArrayI eventsWithTrackReconstructedYet(10); + TArrayI eventsWithFake(10); + TArrayI eventsWithAdditionalFake(10); // Loop over ESD events FirstEvent = TMath::Max(0, FirstEvent); @@ -122,8 +131,16 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = // convert TrackRef to MUON tracks AliMUONVTrackStore* trackRefStore = rc.TrackRefs(iEvent); + // count the number of reconstructible tracks + TIter next(trackRefStore->CreateIterator()); + AliMUONTrack* trackRef; + while ( ( trackRef = static_cast(next()) ) ) { + if (IsRecontructible(*trackRef,*recoParam)) nReconstructibleTracks++; + } + // loop over ESD tracks Int_t nTrackerTracks = 0; + trackReconstructedYet = kFALSE; AliMUONVTrackStore *fakeTrackStore = AliMUONESDInterface::NewTrackStore(); Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ; for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) { @@ -159,7 +176,10 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = // global counter nTotMatchedTracks++; - if (!IsRecontructible(*matchedTrackRef,*recoParam)) nTotTracksReconstructedYet++; + if (!IsRecontructible(*matchedTrackRef,*recoParam)) { + trackReconstructedYet = kTRUE; + nTotTracksReconstructedYet++; + } // fill histograms hFractionOfMatchedClusters->Fill(fractionOfMatchCluster); @@ -196,6 +216,8 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = // fill histograms hNumberOfTracks->Fill(nTrackerTracks); + nReconstructedTracks += nTrackerTracks; + if (trackReconstructedYet) eventsWithTrackReconstructedYet[nEventsWithTrackReconstructedYet++] = iEvent; // count the number the additional fake tracks if (fakeTrackStore->GetSize() > 0) { @@ -208,8 +230,10 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = Int_t nAdditionalTracks = fakeTrackStore->GetSize() - nFreeMissingTracks; // fill histograms + eventsWithFake[nEventsWithFake] = iEvent; nEventsWithFake++; if (nAdditionalTracks > 0) { + eventsWithAdditionalFake[nEventsWithAdditionalFake] = iEvent; nEventsWithAdditionalFake++; nTotAdditionalTracks += nAdditionalTracks; hNumberOfAdditionalTracks->Fill(nAdditionalTracks); @@ -220,6 +244,9 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = delete fakeTrackStore; } // end of loop over events + + // total number of connected tracks + nTotConnectedTracks = hFractionOfConnectedClusters->GetEntries(); // plot results TCanvas cFakesSummary("cFakesSummary","cFakesSummary",900,600); @@ -293,12 +320,36 @@ void MUONFakes(Bool_t useLabel = kFALSE, Int_t FirstEvent = 0, Int_t LastEvent = // print results cout << endl; + cout << "- Number of reconstructible tracks: " << nReconstructibleTracks << endl; + cout << "- Number of reconstructed tracks: " << nReconstructedTracks << endl; cout << "- Number of matched tracks: " << nTotMatchedTracks << endl; - cout << " (including " << nTotTracksReconstructedYet << " tracks matched with a TrackRef that is not reconstructible)" << endl; + cout << " (including " << nTotTracksReconstructedYet << " track(s) matched with a TrackRef that is not reconstructible"; + if (nTotTracksReconstructedYet > 0) { + for(Int_t i=0; i 0) { + for(Int_t i=0; i 0) { + for(Int_t i=0; i