}
//________________________________________________________________________
-void AliAnalysisTaskEmcal::UserCreateOutputObjects()
+void AliAnalysisTaskEmcal::UserExec(Option_t *)
+{
+ // Main loop, called for each event.
+
+ if (!fInitialized)
+ Init();
+
+ if (!RetrieveEventObjects())
+ return;
+
+ if (!Run())
+ return;
+
+ if (!FillHistograms())
+ return;
+
+ if (fCreateHisto) {
+ // information for this iteration of the UserExec in the container
+ PostData(1, fOutput);
+ }
+}
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskEmcal::AcceptCluster(AliVCluster *clus, Bool_t acceptMC) const
{
- // User create outputs.
+ // Return true if cluster is accepted.
+
+ if (!clus)
+ return kFALSE;
+
+ if (!clus->IsEMCAL())
+ return kFALSE;
+
+ if (!acceptMC && clus->Chi2() == 100)
+ return kFALSE;
+
+ TLorentzVector nPart;
+ clus->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
+
+ if (nPart.Et() < fPtCut)
+ return kFALSE;
+
+ return kTRUE;
+}
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskEmcal::AcceptEmcalPart(AliEmcalParticle *part, Bool_t acceptMC) const
+{
+ // Return true if EMCal particle is accepted.
+
+ if (!part)
+ return kFALSE;
+
+ if (fAnaType == kEMCAL && !part->IsEMCAL())
+ return kFALSE;
+
+ if (part->Pt() < fPtCut)
+ return kFALSE;
+
+ if (!acceptMC && part->IsMC())
+ return kFALSE;
+
+ return kTRUE;
+}
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVTrack *track, Bool_t acceptMC) const
+{
+ // Return true if track is accepted.
+
+ if (!track)
+ return kFALSE;
+
+ if (!acceptMC && track->GetLabel() == 100)
+ return kFALSE;
+
+ if (track->Pt() < fPtCut)
+ return kFALSE;
+
+ return kTRUE;
}
//_____________________________________________________
}
}
+//________________________________________________________________________
void AliAnalysisTaskEmcal::Init()
{
// Init the analysis.
return kTRUE;
}
-//________________________________________________________________________
-Bool_t AliAnalysisTaskEmcal::AcceptCluster(AliVCluster *clus, Bool_t acceptMC) const
-{
- // Return true if cluster is accepted.
-
- if (!clus)
- return kFALSE;
-
- if (!clus->IsEMCAL())
- return kFALSE;
-
- if (!acceptMC && clus->Chi2() == 100)
- return kFALSE;
-
- TLorentzVector nPart;
- clus->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
-
- if (nPart.Et() < fPtCut)
- return kFALSE;
-
- return kTRUE;
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskEmcal::AcceptEmcalPart(AliEmcalParticle *part, Bool_t acceptMC) const
-{
- // Return true if EMCal particle is accepted.
-
- if (!part)
- return kFALSE;
-
- if (fAnaType == kEMCAL && !part->IsEMCAL())
- return kFALSE;
-
- if (part->Pt() < fPtCut)
- return kFALSE;
-
- if (!acceptMC && part->IsMC())
- return kFALSE;
-
- return kTRUE;
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskEmcal::AcceptTrack(AliVTrack *track, Bool_t acceptMC) const
-{
- // Return true if track is accepted.
-
- if (!track)
- return kFALSE;
-
- if (!acceptMC && track->GetLabel() == 100)
- return kFALSE;
-
- if (track->Pt() < fPtCut)
- return kFALSE;
-
- return kTRUE;
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskEmcal::UserExec(Option_t *)
-{
- // Main loop, called for each event.
-
- if (!fInitialized)
- Init();
-
- if (!RetrieveEventObjects())
- return;
-
- if (!Run())
- return;
-
- if (!FillHistograms())
- return;
-
- if (fCreateHisto) {
- // information for this iteration of the UserExec in the container
- PostData(1, fOutput);
- }
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskEmcal::Terminate(Option_t *)
-{
- // Called once at the end of the analysis.
-}
AliAnalysisTaskEmcal(const char *name, Bool_t histo=kFALSE);
virtual ~AliAnalysisTaskEmcal();
- virtual void Init();
- virtual void UserCreateOutputObjects();
- virtual void UserExec(Option_t *option);
- virtual void Terminate(Option_t *option);
+ void UserExec(Option_t *option);
void SetAnaType(EmcalAnaType type) { fAnaType = type ; }
void SetClusName(const char *n) { fCaloName = n ; }
Bool_t AcceptEmcalPart(AliEmcalParticle *part, Bool_t acceptMC = kFALSE) const;
Bool_t AcceptTrack(AliVTrack *track, Bool_t acceptMC = kFALSE) const;
BeamType GetBeamType() ;
+ virtual void Init();
virtual Bool_t FillHistograms() { return fCreateHisto; }
void SetInitialized(Bool_t ini = kTRUE) { fInitialized = ini ; }
virtual Bool_t RetrieveEventObjects();