]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONefficiency.C
Adding FMD
[u/mrichter/AliRoot.git] / MUON / MUONefficiency.C
index 459a7747ea4afde7de44dc9e6a14d68b17dfec48..e4326ccc4f7a2dc205c1b351fc6ed5d14eca1e09 100644 (file)
@@ -35,7 +35,7 @@
 // MUON includes
 #include "AliMUONTrackParam.h"
 #include "AliMUONTrackExtrap.h"
-#include "AliESDMuonTrack.h"
+#include "AliMUONESDInterface.h"
 
 // STEER includes
 #include "AliRun.h"
@@ -48,6 +48,7 @@
 #include "AliESDVertex.h"
 #include "AliTracker.h"
 #include "AliCDBManager.h"
+#include "AliESDMuonTrack.h"
 
 // ROOT includes
 #include "TTree.h"
@@ -64,6 +65,7 @@
 #include <Riostream.h>
 #include <TGeoManager.h>
 #include <TROOT.h>
+#include <TF1.h>
 
 #endif
 
@@ -349,17 +351,20 @@ Bool_t MUONefficiency( char* filename = "galice.root", char* geoFilename = "geom
     // loop over all reconstructed tracks (also first track of combination)
     for (Int_t iTrack = 0; iTrack <  nTracks;  iTrack++) {
 
+      // skip ghosts
+      if (!esd->GetMuonTrack(iTrack)->ContainTrackerData()) continue;
+
       AliESDMuonTrack* muonTrack = new AliESDMuonTrack(*(esd->GetMuonTrack(iTrack)));
 
       // extrapolate to vertex if required and available
       if (ExtrapToVertex > 0 && Vertex->GetNContributors()) {
-        trackParam.GetParamFromUncorrected(*muonTrack);
+       AliMUONESDInterface::GetParamAtFirstCluster(*muonTrack, trackParam);
        AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex, errXVtx, errYVtx);
-       trackParam.SetParamFor(*muonTrack); // put the new parameters in this copy of AliESDMuonTrack
+       AliMUONESDInterface::SetParamAtVertex(trackParam, *muonTrack); // put the new parameters in this copy of AliESDMuonTrack
       } else if ((ExtrapToVertex > 0 && !Vertex->GetNContributors()) || ExtrapToVertex == 0){
-        trackParam.GetParamFromUncorrected(*muonTrack);
+       AliMUONESDInterface::GetParamAtFirstCluster(*muonTrack, trackParam);
        AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0., 0., 0.);
-       trackParam.SetParamFor(*muonTrack); // put the new parameters in this copy of AliESDMuonTrack
+       AliMUONESDInterface::SetParamAtVertex(trackParam, *muonTrack); // put the new parameters in this copy of AliESDMuonTrack
       }
 
       // Trigger
@@ -412,17 +417,20 @@ Bool_t MUONefficiency( char* filename = "galice.root", char* geoFilename = "geom
        // loop over second track of combination
        for (Int_t iTrack2 = iTrack + 1; iTrack2 < nTracks; iTrack2++) {
          
+         // skip ghosts
+         if (!esd->GetMuonTrack(iTrack2)->ContainTrackerData()) continue;
+         
          AliESDMuonTrack* muonTrack2 = new AliESDMuonTrack(*(esd->GetMuonTrack(iTrack2)));
           
          // extrapolate to vertex if required and available
          if (ExtrapToVertex > 0 && Vertex->GetNContributors()) {
-           trackParam.GetParamFromUncorrected(*muonTrack2);
+           AliMUONESDInterface::GetParamAtFirstCluster(*muonTrack2, trackParam);
            AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex, errXVtx, errYVtx);
-           trackParam.SetParamFor(*muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
+           AliMUONESDInterface::SetParamAtVertex(trackParam, *muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
          } else if ((ExtrapToVertex > 0 && !Vertex->GetNContributors()) || ExtrapToVertex == 0){
-            trackParam.GetParamFromUncorrected(*muonTrack2);
+           AliMUONESDInterface::GetParamAtFirstCluster(*muonTrack2, trackParam);
            AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0., 0., 0.);
-           trackParam.SetParamFor(*muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
+           AliMUONESDInterface::SetParamAtVertex(trackParam, *muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
          }
 
          track2Trigger = muonTrack2->GetMatchTrigger();
@@ -587,7 +595,16 @@ Bool_t MUONefficiency( char* filename = "galice.root", char* geoFilename = "geom
   cout << "Chi2Cut for muon tracks = " << Chi2Cut << endl;
   cout << "PtCutMin for muon tracks = " << PtCutMin << endl;
   cout << "PtCutMax for muon tracks = " << PtCutMax << endl;
+  
+  hInvMassAll->Fit("gaus","q0");
+                   
+  TF1* f1 = hInvMassAll->GetFunction("gaus");
+  
+  cout << "Entries (unlike sign dimuons) : " << hInvMassAll->GetEntries() 
+    << Form(". Rough sigma = %7.2f MeV/c2",f1->GetParameter(2)*1000.0) << endl;
+  
   cout << "Entries (unlike sign dimuons) in the mass range  ["<<invMassMinInPeak<<";"<<invMassMaxInPeak<<"] : " << EventInMass <<endl;
+  
   if (ptTrig==0x800) cout << "Unlike Pair - All Pt" ;   
   if (ptTrig==0x400) cout << "Unlike Pair - High Pt" ;   
   if (ptTrig==0x200) cout << "Unlike Pair - Low Pt" ;