/* $Id$ */
-// Macro (upgraded version of MUONmassPlot_ESD.C, better handling of Jpsi) to make :
-// 1) Ntuple (Ktuple) containing Upsilon kinematics variables (from kinematics.root files)
-// 2) Ntuple (ESDtuple) containing Upsilon kinematics variables from reconstruction and
-// combinations of 2 muons with opposite charges (ESDtupleBck will be used later)
-// 3) Some QA histograms
-// Ntuple are stored in the file MUONefficiency.root and ESD tree and QA histograms in AliESDs.root
+/// \ingroup macros
+/// \file MUONefficiency.C
+/// \brief add brief description
+///
+/// Macro (upgraded version of MUONmassPlot_ESD.C, better handling of Jpsi) to make :
+/// - Ntuple (Ktuple) containing Upsilon kinematics variables (from kinematics.root files)
+/// - Ntuple (ESDtuple) containing Upsilon kinematics variables from reconstruction and
+/// combinations of 2 muons with opposite charges (ESDtupleBck will be used later)
+/// - Some QA histograms
+/// Ntuple are stored in the file MUONefficiency.root and ESD tree and QA histograms in AliESDs.root
+///
+/// \author Christophe Suire, IPN Orsay
-// Christophe Suire, IPN Orsay
+#if !defined(__CINT__) || defined(__MAKECINT__)
-// Arguments:
-// FirstEvent (default 0)
-// LastEvent (default 1.e6)
-// ResType (default 553)
-// 553 for Upsilon, 443 for J/Psi
-// Chi2Cut (default 100)
-// to keep only tracks with chi2 per d.o.f. < Chi2Cut
-
+// MUON includes
+#include "AliMUONTrackParam.h"
+#include "AliMUONTrackExtrap.h"
+#include "AliESDMuonTrack.h"
+// STEER includes
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliHeader.h"
+#include "AliLoader.h"
+#include "AliStack.h"
+#include "AliMagFMaps.h"
+#include "AliESDEvent.h"
+#include "AliESDVertex.h"
+#include "AliTracker.h"
+#include "AliCDBManager.h"
-#if !defined(__CINT__) || defined(__MAKECINT__)
// ROOT includes
#include "TTree.h"
#include "TNtuple.h"
#include <TGeoManager.h>
#include <TROOT.h>
-// STEER includes
-#include "AliRun.h"
-#include "AliRunLoader.h"
-#include "AliHeader.h"
-#include "AliLoader.h"
-#include "AliStack.h"
-#include "AliMagFMaps.h"
-#include "AliESD.h"
-#include "AliTracker.h"
-
-// MUON includes
-#include "AliMUONTrackParam.h"
-#include "AliMUONTrackExtrap.h"
-#include "AliESDMuonTrack.h"
#endif
-// Arguments:
-// ExtrapToVertex (default -1)
-// <0: no extrapolation;
-// =0: extrapolation to (0,0,0);
-// >0: extrapolation to ESDVertex if available, else to (0,0,0)
-// ResType (default 553)
-// 553 for Upsilon, anything else for J/Psi
-
Bool_t MUONefficiency( char* filename = "galice.root", char* geoFilename = "geometry.root", char* esdFileName = "AliESDs.root",
Int_t ExtrapToVertex = -1, Int_t ResType = 553, Int_t FirstEvent = 0, Int_t LastEvent = 1000000 )
-{ // MUONefficiency starts
+{
+/// \param ExtrapToVertex (default -1)
+/// - <0: no extrapolation;
+/// - =0: extrapolation to (0,0,0);
+/// - >0: extrapolation to ESDVertex if available, else to (0,0,0)
+/// \param ResType 553 for Upsilon, 443 for J/Psi (default 553)
+/// \param FirstEvent (default 0)
+/// \param LastEvent (default 1.e6)
+/// \param Chi2Cut to keep only tracks with chi2 per d.o.f. < Chi2Cut (default 100)
+
+
+ // MUONefficiency starts
+
+ // Set default CDB storage
+ AliCDBManager* man = AliCDBManager::Instance();
+ man->SetDefaultStorage("local://$ALICE_ROOT");
Double_t MUON_MASS = 0.105658369;
Double_t UPSILON_MASS = 9.4603 ;
Double_t fXVertex=0;
Double_t fYVertex=0;
Double_t fZVertex=0;
+ Double_t errXVtx=0;
+ Double_t errYVtx=0;
Double_t fPxRec1, fPyRec1, fPzRec1, fE1;
Double_t fPxRec2, fPyRec2, fPzRec2, fE2;
return kFALSE;
}
- AliESD* esd = new AliESD();
+ AliESDEvent* esd = new AliESDEvent();
TTree* tree = (TTree*) esdFile->Get("esdTree");
if (!tree) {
Error("CheckESD", "no ESD tree found");
esd->ReadFromTree(tree);
runLoader->LoadHeader();
+ Int_t runNumber = runLoader->GetHeader()->GetRun();
+ AliCDBManager::Instance()->SetRun(runNumber);
+
nevents = runLoader->GetNumberOfEvents();
AliMUONTrackParam trackParam;
fZVertex = Vertex->GetZv();
fYVertex = Vertex->GetYv();
fXVertex = Vertex->GetXv();
+ errXVtx = Vertex->GetXRes();
+ errYVtx = Vertex->GetYRes();
}
hPrimaryVertex->Fill(fZVertex);
// extrapolate to vertex if required and available
if (ExtrapToVertex > 0 && Vertex->GetNContributors()) {
trackParam.GetParamFromUncorrected(*muonTrack);
- AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex);
+ AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex, errXVtx, errYVtx);
trackParam.SetParamFor(*muonTrack); // put the new parameters in this copy of AliESDMuonTrack
} else if ((ExtrapToVertex > 0 && !Vertex->GetNContributors()) || ExtrapToVertex == 0){
trackParam.GetParamFromUncorrected(*muonTrack);
- AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0.);
+ AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0., 0., 0.);
trackParam.SetParamFor(*muonTrack); // put the new parameters in this copy of AliESDMuonTrack
}
// extrapolate to vertex if required and available
if (ExtrapToVertex > 0 && Vertex->GetNContributors()) {
trackParam.GetParamFromUncorrected(*muonTrack2);
- AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex);
+ AliMUONTrackExtrap::ExtrapToVertex(&trackParam, fXVertex, fYVertex, fZVertex, errXVtx, errYVtx);
trackParam.SetParamFor(*muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
} else if ((ExtrapToVertex > 0 && !Vertex->GetNContributors()) || ExtrapToVertex == 0){
trackParam.GetParamFromUncorrected(*muonTrack2);
- AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0.);
+ AliMUONTrackExtrap::ExtrapToVertex(&trackParam, 0., 0., 0., 0., 0.);
trackParam.SetParamFor(*muonTrack2); // put the new parameters in this copy of AliESDMuonTrack
}
//trigger info
if (ResType == 553)
- ptTrig = 0x20;// mask for Hpt unlike sign pair
+ ptTrig = 0x08;// mask for Hpt unlike sign pair
else if (ResType == 443)
- ptTrig = 0x10;// mask for Lpt unlike sign pair
+ ptTrig = 0x04;// mask for Lpt unlike sign pair
if (esd->GetTriggerMask() & ptTrig) NbTrigger++;