//-------------------------------------------------
#define AliAnalysisTaskV0QA_cxx
-#include "Riostream.h"
-
#include "TChain.h"
#include "TH1.h"
#include "TH2.h"
//#include "TLorentzVector.h"
-#include "AliAnalysisTask.h"
+#include "AliAnalysisTaskSE.h"
#include "AliTrackReference.h"
#include "AliKFParticle.h"
#include "AliKFVertex.h"
#include "AliAnalysisTaskV0QA.h"
ClassImp(AliAnalysisTaskV0QA)
+AliAnalysisTaskV0QA::AliAnalysisTaskV0QA() :AliAnalysisTaskSE(),
+fESD(0),
+fStack(0),
+fMCtruth(0),
+fChain(0),
+fOutputContainer(0),
+fSparseV0(0),
+fSparseK0(0),
+fSparseL(0),
+fSparseAL(0),
+fnEv(0),
+fgDim(50),
+fnConvGamGeant(-1),
+fgConvGamGeantIndex(0),
+feNegConvGamGeantIndex(0),
+fePosConvGamGeantIndex(0),
+feNegConvGamGeantLength(0),
+fePosConvGamGeantLength(0),
+feNegConvGamSingleRecIndex(0),
+fePosConvGamSingleRecIndex(0),
+feNegConvGamV0RecIndex(0),
+fePosConvGamV0RecIndex(0),
+fConvGamV0RecIndexPos(0),
+fConvGamV0RecIndexNeg(0),
+fnDecayLGeant(-1),
+flDecayLGeantIndex(0),
+fpiNegDecayLGeantIndex(0),
+fpPosDecayLGeantIndex(0),
+fpiNegDecayLGeantLength(0),
+fpPosDecayLGeantLength(0),
+fpiNegDecayLSingleRecIndex(0),
+fpPosDecayLSingleRecIndex(0),
+fpiNegDecayLV0RecIndex(0),
+fpPosDecayLV0RecIndex(0),
+fDecayLV0RecIndexPos(0),
+fDecayLV0RecIndexNeg(0),
+fnDecayALGeant(-1),
+falDecayALGeantIndex(0),
+fpiPosDecayALGeantIndex(0),
+fapNegDecayALGeantIndex(0),
+fpiPosDecayALGeantLength(0),
+fapNegDecayALGeantLength(0),
+fpiPosDecayALSingleRecIndex(0),
+fapNegDecayALSingleRecIndex(0),
+fpiPosDecayALV0RecIndex(0),
+fapNegDecayALV0RecIndex(0),
+fDecayALV0RecIndexPos(0),
+fDecayALV0RecIndexNeg(0),
+fnDecayK0Geant(-1),
+fK0DecayK0GeantIndex(0),
+fpiNegDecayK0GeantIndex(0),
+fpiPosDecayK0GeantIndex(0),
+fpiNegDecayK0GeantLength(0),
+fpiPosDecayK0GeantLength(0),
+fpiNegDecayK0SingleRecIndex(0),
+fpiPosDecayK0SingleRecIndex(0),
+fpiNegDecayK0V0RecIndex(0),
+fpiPosDecayK0V0RecIndex(0),
+fDecayK0V0RecIndexPos(0),
+fDecayK0V0RecIndexNeg(0),
+fpiPosK0Index(-1),
+fpiNegK0Index(-1),
+fnTracksPrim(-1),
+ftpcRefit(0),
+fitsRefit(0),
+ftrdRefit(0),
+ftrdOut(0),
+fDim(37),
+fValueL(0),
+fValueAL(0),
+fValueK0(0),
+fValueV0(0),
+fxminV0(0),
+fxmaxV0(0),
+fbinsV0(0),
+fRefTPC(0),
+fclRefsN(0),
+fclRefsP(0)
+
+ {
+ // Default Constructor.
+
+ }
//________________________________________________________________________
-AliAnalysisTaskV0QA::AliAnalysisTaskV0QA(const char *name) :AliAnalysisTask(name,""),
+AliAnalysisTaskV0QA::AliAnalysisTaskV0QA(const char *name) :AliAnalysisTaskSE(name),
fESD(0),
fStack(0),
fMCtruth(0),
fSparseL(0),
fSparseAL(0),
fnEv(0),
+fgDim(50),
fnConvGamGeant(-1),
fgConvGamGeantIndex(0),
feNegConvGamGeantIndex(0),
fePosConvGamV0RecIndex(0),
fConvGamV0RecIndexPos(0),
fConvGamV0RecIndexNeg(0),
-fgDim(50),
fnDecayLGeant(-1),
flDecayLGeantIndex(0),
fpiNegDecayLGeantIndex(0),
fitsRefit(0),
ftrdRefit(0),
ftrdOut(0),
+fDim(37),
fValueL(0),
fValueAL(0),
fValueK0(0),
fxminV0(0),
fxmaxV0(0),
fbinsV0(0),
-fDim(37),
fRefTPC(0),
fclRefsN(0),
fclRefsP(0)
{
- // Constructor.
- // Input slot #0 works with an Ntuple
- DefineInput(0, TChain::Class());
- // Output slot #0 writes into a TH1 container
- // DefineOutput(0,TObjArray::Class());
- DefineOutput(0,TList::Class());
-
- // Reconstructed arrays
-
- fnEv=0;
- fDim=37;
- fValueK0 = new Double_t[fDim];
- fValueL = new Double_t[fDim];
- fValueAL = new Double_t[fDim];
- fValueV0 = new Double_t[fDim];
- fxminV0 = new Double_t[fDim];
- fxmaxV0 = new Double_t[fDim];
- fbinsV0 = new Int_t[fDim];
+
+ fnEv=0;
+ fDim=37;
+
+ fValueK0 = new Double_t[fDim];
+ fValueL = new Double_t[fDim];
+ fValueAL = new Double_t[fDim];
+ fValueV0 = new Double_t[fDim];
+ fxminV0 = new Double_t[fDim];
+ fxmaxV0 = new Double_t[fDim];
+ fbinsV0 = new Int_t[fDim];
fgDim=50;
AliLog::SetGlobalLogLevel(AliLog::kError);
-
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskV0QA::ConnectInputData(Option_t *) {
- printf(" ConnectInputData %s\n", GetName());
- // Connect Input Data
-
- AliESDInputHandler* esdH = (AliESDInputHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
- fESD = esdH->GetEvent();
-
- fChain = (TChain*)GetInputData(0);
-
+//
+ DefineOutput(1, TList::Class());
}
//_____________________________________________________
//________________________________________________________________________
-void AliAnalysisTaskV0QA::CreateOutputObjects() {
+void AliAnalysisTaskV0QA::UserCreateOutputObjects() {
// Create Ouptut objects
for(Int_t d=0;d<fDim;d++){
}
//________________________________________________________________________
-void AliAnalysisTaskV0QA::Exec(Option_t *) {
+void AliAnalysisTaskV0QA::UserExec(Option_t *) {
// Execution of the Task
+ fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+
if (!fESD) {
- cout<< "not a tree"<< endl;
+ //cout<< "not a tree"<< endl;
return;
}
int nPointsP = fclRefsP->GetEntries();
- if (fRefTPC) delete fRefTPC;
+ if (fRefTPC) delete fRefTPC;fRefTPC=NULL;
fRefTPC = new TObjArray();
for(int iPoint=0; iPoint<nPointsP; iPoint++) {
Float_t tpcTrackLengtheNeg = mcParticleNeg->GetTPCTrackLength(fESD->GetMagneticField(),0.05,counterN,3.0);
int nPointsN = fclRefsN->GetEntries();
- if (fRefTPC) delete fRefTPC;
+ if (fRefTPC) delete fRefTPC; fRefTPC=NULL;
fRefTPC = new TObjArray();
for(int iPoint=0; iPoint<nPointsN; iPoint++) {
int nPointsP = fclRefsP->GetEntries();
- if (fRefTPC) delete fRefTPC;
+ if (fRefTPC) delete fRefTPC; fRefTPC=NULL;
fRefTPC = new TObjArray();
for(int iPoint=0; iPoint<nPointsP; iPoint++) {
Float_t tpcTrackLengtheNeg = mcParticleNeg->GetTPCTrackLength(fESD->GetMagneticField(),0.05,counterN,3.0);
int nPointsN = fclRefsN->GetEntries();
- if (fRefTPC) delete fRefTPC;
+ if (fRefTPC) delete fRefTPC; fRefTPC=NULL;
fRefTPC = new TObjArray();
for(int iPoint=0; iPoint<nPointsN; iPoint++) {
int nPointsP = fclRefsP->GetEntries();
- if (fRefTPC) delete fRefTPC;
+ if (fRefTPC) delete fRefTPC; fRefTPC=NULL;
fRefTPC = new TObjArray();
for(int iPoint=0; iPoint<nPointsP; iPoint++) {
}
- PostData(0,fOutputContainer );
+ PostData(1, fOutputContainer );
}