#ifdef __CINT__
-#pragma link off all glols;
+#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class TGliteXmlEventlist+;
+#pragma link C++ class AliAnalysisDataContainer+;
+#pragma link C++ class AliAnalysisTask+;
+#pragma link C++ class AliAnalysisDataSlot+;
+#pragma link C++ class AliAnalysisManager+;
-#pragma link C++ class AliD0toKpi+;
-#pragma link C++ class AliD0toKpiAnalysis+;
-#pragma link C++ class AliRunAnalysis+;
-#pragma link C++ class AliAnalysis+;
-
-#pragma link C++ class AliAOD+;
-#pragma link C++ class AliEventBuffer+;
-#pragma link C++ class AliVAODParticle+;
-#pragma link C++ class AliAODParticle+;
-#pragma link C++ class AliAODPair+;
-
-#pragma link C++ class AliAODRun+;
-
-#pragma link C++ class AliTrackPoints+;
-#pragma link C++ class AliClusterMap+;
-
-#pragma link C++ class AliReader+;
-#pragma link C++ class AliReaderAOD+;
-#pragma link C++ class AliReaderESD+;
-#pragma link C++ class AliReaderESDTree+;
-#pragma link C++ class AliReaderKineTree+;
-
-#pragma link C++ class AliFlowAnalysis+;
-#pragma link C++ class AliMuonAnalysis+;
-
-#pragma link C++ class AliEventCut+;
-#pragma link C++ class AliEventEmptyCut+;
-#pragma link C++ class AliEventBaseCut+;
-
-#pragma link C++ class AliPrimVertexXCut+;
-#pragma link C++ class AliPrimVertexYCut+;
-#pragma link C++ class AliPrimVertexZCut+;
-#pragma link C++ class AliNChargedCut+;
-
-#pragma link C++ class AliAODParticleCut-;
-#pragma link C++ class AliAODParticleEmptyCut-;
-#pragma link C++ class AliAODParticleBaseCut+;
-
-#pragma link C++ class AliAODMomentumCut+;
-#pragma link C++ class AliAODPtCut+;
-#pragma link C++ class AliAODEnergyCut+;
-#pragma link C++ class AliAODRapidityCut+;
-#pragma link C++ class AliAODPseudoRapidityCut+;
-#pragma link C++ class AliAODPxCut+;
-#pragma link C++ class AliAODPyCut+;
-#pragma link C++ class AliAODPzCut+;
-#pragma link C++ class AliAODPhiCut+;
-#pragma link C++ class AliAODThetaCut+;
-#pragma link C++ class AliAODVxCut+;
-#pragma link C++ class AliAODVyCut+;
-#pragma link C++ class AliAODVzCut+;
-#pragma link C++ class AliAODPIDCut+;
-#pragma link C++ class AliAODLogicalOperCut-;
-#pragma link C++ class AliAODAndCut+;
-#pragma link C++ class AliAODOrCut+;
-
-
-#pragma link C++ class AliAODPairCut-;
-#pragma link C++ class AliAODPairEmptyCut-;
-#pragma link C++ class AliAODPairBaseCut+;
-
-#pragma link C++ class AliAODQInvCut+;
-#pragma link C++ class AliAODKtCut+;
-#pragma link C++ class AliAODKStarCut+;
-#pragma link C++ class AliAODKStarOutCut+;
-#pragma link C++ class AliAODKStarSideCut+;
-#pragma link C++ class AliAODKStarLongCut+;
-#pragma link C++ class AliAODQSideLCMSCut+;
-#pragma link C++ class AliAODQOutLCMSCut+;
-#pragma link C++ class AliAODQLongLCMSCut+;
-#pragma link C++ class AliAODDeltaECut+;
-#pragma link C++ class AliAODDeltaPCut+;
-#pragma link C++ class AliAODDeltaPvectorCut+;
-#pragma link C++ class AliAODDeltaPhiCut+;
-#pragma link C++ class AliAODDeltaThetaCut+;
-#pragma link C++ class AliAODAvSeparationCut+;
-#pragma link C++ class AliAODSeparationCut+;
-#pragma link C++ class AliAODITSSeparationCut+;
-#pragma link C++ class AliAODCluterOverlapCut+;
-#pragma link C++ class AliAODOutSideSameSignCut+;
-#pragma link C++ class AliAODOutSideDiffSignCut+;
-#pragma link C++ class AliAODLogicalOperPairCut-;
-#pragma link C++ class AliAODOrPairCut+;
-#pragma link C++ class AliAODAndPairCut+;
-
-#pragma link C++ class AliAODevent+;
-#pragma link C++ class AliAODv0+;
-#pragma link C++ class AliAODxi+;
-
-#pragma link C++ class AliAnalysisEventCuts+;
-#pragma link C++ class AliAnalysisTrackCuts+;
+#pragma link C++ class AliAnalysisGoodies+;
#endif
//
//==============================================================================
-#include "Riostream.h"
+#include <Riostream.h>
+#include <TMethodCall.h>
-#include "TClass.h"
-#include "TTree.h"
-#include "TFile.h"
-//#include "AliLog.h"
+#include <TClass.h>
+#include <TTree.h>
+#include <TROOT.h>
#include "AliAnalysisDataContainer.h"
#include "AliAnalysisDataSlot.h"
AliAnalysisDataContainer::AliAnalysisDataContainer() : TNamed(),
fDataReady(kFALSE),
fOwnedData(kFALSE),
- fFile(NULL),
+ fFileName(),
fData(NULL),
fType(NULL),
fProducer(NULL),
fConsumers(NULL)
{
-// Default ctor.
+// Dummy ctor.
}
//______________________________________________________________________________
:TNamed(name,""),
fDataReady(kFALSE),
fOwnedData(kTRUE),
- fFile(NULL),
+ fFileName(),
fData(NULL),
fType(type),
fProducer(NULL),
fConsumers(NULL)
{
-// Normal constructor.
+// Default constructor.
+ SetTitle(fType->GetName());
}
//______________________________________________________________________________
:TNamed(cont),
fDataReady(cont.fDataReady),
fOwnedData(kFALSE),
- fFile(cont.fFile),
+ fFileName(cont.fFileName),
fData(cont.fData),
- fType(cont.fType),
+ fType(NULL),
fProducer(cont.fProducer),
fConsumers(NULL)
{
// Copy ctor.
+ GetType();
if (cont.fConsumers) {
fConsumers = new TObjArray(2);
Int_t ncons = cont.fConsumers->GetEntriesFast();
// Destructor. Deletes data ! (What happens if data is a container ???)
if (fData && fOwnedData) delete fData;
if (fConsumers) delete fConsumers;
- if (fFile) {
- fFile->Close();
- delete fFile;
- }
}
//______________________________________________________________________________
TNamed::operator=(cont);
fDataReady = cont.fDataReady;
fOwnedData = kFALSE; // !!! Data owned by cont.
- fFile = cont.fFile;
+ fFileName = cont.fFileName;
fData = cont.fData;
- fType = cont.fType;
+ GetType();
fProducer = cont.fProducer;
if (cont.fConsumers) {
fConsumers = new TObjArray(2);
return *this;
}
+//______________________________________________________________________________
+void AliAnalysisDataContainer::AddConsumer(AliAnalysisTask *consumer, Int_t islot)
+{
+// Add a consumer for contained data;
+ AliAnalysisDataSlot *slot = consumer->GetInputSlot(islot);
+ if (!slot || !slot->GetType()) {
+ cout<<"Consumer task "<< consumer->GetName()<<" does not have an input/type #"<<islot<<endl;
+ //AliError(Form("Consumer task %s does not have an input #%i", consumer->GetName(),islot));
+ return;
+ }
+ if (!slot->GetType()->InheritsFrom(GetType())) {
+ cout<<"Data type "<<slot->GetTitle()<<" for input slot "<<islot<<" of task "<<consumer->GetName()<<" does not match container type "<<GetTitle()<<endl;
+ //AliError(Form("Data type %s for input slot %i of task %s does not match container type %s", slot->GetType()->GetName(),islot,consumer->GetName(),fType->GetName()));
+ return;
+ }
+
+ if (!fConsumers) fConsumers = new TObjArray(2);
+ fConsumers->Add(consumer);
+ // Add the consumer task to the list of task of the producer
+ if (fProducer && !fProducer->GetListOfTasks()->FindObject(consumer))
+ fProducer->Add(consumer);
+}
+
+//______________________________________________________________________________
+Bool_t AliAnalysisDataContainer::ClientsExecuted() const
+{
+// Check if all client tasks have executed.
+ TIter next(fConsumers);
+ AliAnalysisTask *task;
+ while ((task=(AliAnalysisTask*)next())) {
+ if (!task->HasExecuted()) return kFALSE;
+ }
+ return kTRUE;
+}
+
+//______________________________________________________________________________
+void AliAnalysisDataContainer::DeleteData()
+{
+// Delete data if not needed anymore.
+ if (!fDataReady || !ClientsExecuted()) {
+ cout<<"Data not ready or not all clients of container "<<GetName()<<" executed. Data not deleted."<<endl;
+ //AliWarning(Form("Data not ready or not all clients of container %s executed. Data not deleted.", GetName()));
+ return;
+ }
+ if (!fOwnedData) {
+ cout<<"Data not owned by container "<<GetName()<<". Not deleted."<<endl;
+ //AliWarning(Form("Data not owned by container %s. Not deleted.", GetName()));
+ return;
+ }
+ delete fData;
+ fData = 0;
+ fDataReady = kFALSE;
+}
+
+//______________________________________________________________________________
+TClass *AliAnalysisDataContainer::GetType() const
+{
+// Get class type for this slot.
+ AliAnalysisDataContainer *cont = (AliAnalysisDataContainer*)this;
+ if (!fType) cont->SetType(gROOT->GetClass(fTitle.Data()));
+ if (!fType) printf("AliAnalysisDataContainer: Unknown class: %s\n", GetTitle());
+ return fType;
+}
+
+//______________________________________________________________________________
+void AliAnalysisDataContainer::GetEntry(Long64_t ientry)
+{
+// If data is ready and derives from TTree or from TBranch, this will get the
+// requested entry in memory if not already loaded.
+ if (!fDataReady || !GetType()) return;
+ Bool_t istree = fType->InheritsFrom(TTree::Class());
+ if (istree) {
+ TTree *tree = (TTree*)fData;
+ if (tree->GetReadEntry() != ientry) tree->GetEntry(ientry);
+ return;
+ }
+ Bool_t isbranch = fType->InheritsFrom(TBranch::Class());
+ if (isbranch) {
+ TBranch *branch = (TBranch*)fData;
+ if (branch->GetReadEntry() != ientry) branch->GetEntry(ientry);
+ return;
+ }
+}
+
+//______________________________________________________________________________
+Long64_t AliAnalysisDataContainer::Merge(TCollection *list)
+{
+// Merge a list of containers with this one. Containers in the list must have
+// data of the same type.
+ if (!list || !fData) return 0;
+ printf("Merging %d containers %s\n", list->GetSize()+1, GetName());
+ TMethodCall callEnv;
+ if (fData->IsA())
+ callEnv.InitWithPrototype(fData->IsA(), "Merge", "TCollection*");
+ if (!callEnv.IsValid() && !list->IsEmpty()) {
+ cout << "No merge interface for data stored by " << GetName() << ". Merging not possible !" << endl;
+ return 1;
+ }
+
+ if (list->IsEmpty()) return 1;
+
+ TIter next(list);
+ AliAnalysisDataContainer *cont;
+ // Make a list where to temporary store the data to be merged.
+ TList *collectionData = new TList();
+ Int_t count = 0; // object counter
+ while ((cont=(AliAnalysisDataContainer*)next())) {
+ TObject *data = cont->GetData();
+ if (!data) continue;
+ if (strcmp(cont->GetName(), GetName())) {
+ cout << "Not merging containers with different names !" << endl;
+ continue;
+ }
+ printf(" ... merging object %s\n", data->GetName());
+ collectionData->Add(data);
+ count++;
+ }
+ callEnv.SetParam((Long_t) collectionData);
+ callEnv.Execute(fData);
+ delete collectionData;
+
+ return count+1;
+}
+
+//______________________________________________________________________________
+void AliAnalysisDataContainer::PrintContainer(Option_t *option, Int_t indent) const
+{
+// Print info about this container.
+ TString ind;
+ for (Int_t i=0; i<indent; i++) ind += " ";
+ TString opt(option);
+ opt.ToLower();
+ Bool_t dep = (opt.Contains("dep"))?kTRUE:kFALSE;
+ if (!dep) {
+ printf("%s\n", Form("%sContainer: %s type: %s", ind.Data(), GetName(), GetTitle()));
+ if (fProducer)
+ printf("%s\n", Form("%s = Data producer: task %s",ind.Data(),fProducer->GetName()));
+ else
+ printf("%s\n", Form("%s= No data producer"));
+ printf("%s", Form("%s = Consumer tasks: "));
+ if (!fConsumers || !fConsumers->GetEntriesFast()) printf("-none-\n");
+ else printf("\n");
+ }
+ TIter next(fConsumers);
+ AliAnalysisTask *task;
+ while ((task=(AliAnalysisTask*)next())) task->PrintTask(option, indent+3);
+}
+
//______________________________________________________________________________
Bool_t AliAnalysisDataContainer::SetData(TObject *data, Option_t *)
{
}
}
-//______________________________________________________________________________
-void AliAnalysisDataContainer::OpenFile(const char *name, Option_t *option)
-{
-// Data will be written to this file at the end of processing.
-// Option represent the way the file is accessed: NEW, APPEND, ...
- if (fFile) {
- fFile->Close();
- delete fFile;
- }
- fFile = new TFile(name, option);
- if (fFile->IsZombie()) {
- cout<<"Cannot open file "<<name<<" with option "<<option<<endl;
- //AliError(Form("Cannot open file %s with option %s",name,option));
- fFile = 0;
- }
-}
-
-//______________________________________________________________________________
-void AliAnalysisDataContainer::WriteData()
-{
-// Write data to the file.
- if (fFile) {
- TDirectory *cursav = gDirectory;
- fFile->cd();
- fData->Write();
-// fFile->Write();
- if (cursav) cursav->cd();
- }
-}
-
-//______________________________________________________________________________
-void AliAnalysisDataContainer::GetEntry(Long64_t ientry)
-{
-// If data is ready and derives from TTree or from TBranch, this will get the
-// requested entry in memory if not already loaded.
- if (!fDataReady) return;
- Bool_t istree = fType->InheritsFrom(TTree::Class());
- if (istree) {
- TTree *tree = (TTree*)fData;
- if (tree->GetReadEntry() != ientry) tree->GetEntry(ientry);
- return;
- }
- Bool_t isbranch = fType->InheritsFrom(TBranch::Class());
- if (isbranch) {
- TBranch *branch = (TBranch*)fData;
- if (branch->GetReadEntry() != ientry) branch->GetEntry(ientry);
- return;
- }
-}
-
//______________________________________________________________________________
void AliAnalysisDataContainer::SetProducer(AliAnalysisTask *prod, Int_t islot)
{
//AliError(Form("Producer task %s does not have an output #%i", prod->GetName(),islot));
return;
}
- if (!slot->GetType()->InheritsFrom(fType)) {
- cout<<"Data type "<<slot->GetType()->GetName()<<"for output slot "<<islot<<" of task "<<prod->GetName()<<" does not match container type "<<fType->GetName()<<endl;
+ if (!slot->GetType()->InheritsFrom(GetType())) {
+ cout<<"Data type "<<slot->GetTitle()<<"for output slot "<<islot<<" of task "<<prod->GetName()<<" does not match container type "<<GetTitle()<<endl;
//AliError(Form("Data type %s for output slot %i of task %s does not match container type %s", slot->GetType()->GetName(),islot,prod->GetName(),fType->GetName()));
return;
}
if (!prod->GetListOfTasks()->FindObject(cons)) prod->Add(cons);
}
}
-
-//______________________________________________________________________________
-void AliAnalysisDataContainer::AddConsumer(AliAnalysisTask *consumer, Int_t islot)
-{
-// Add a consumer for contained data;
- AliAnalysisDataSlot *slot = consumer->GetInputSlot(islot);
- if (!slot) {
- cout<<"Consumer task "<< consumer->GetName()<<" does not have an input #"<<islot<<endl;
- //AliError(Form("Consumer task %s does not have an input #%i", consumer->GetName(),islot));
- return;
- }
- if (!slot->GetType()->InheritsFrom(fType)) {
- cout<<"Data type "<<slot->GetType()->GetName()<<" for input slot "<<islot<<" of task "<<consumer->GetName()<<" does not match container type "<<fType->GetName()<<endl;
- //AliError(Form("Data type %s for input slot %i of task %s does not match container type %s", slot->GetType()->GetName(),islot,consumer->GetName(),fType->GetName()));
- return;
- }
-
- if (!fConsumers) fConsumers = new TObjArray(2);
- fConsumers->Add(consumer);
- // Add the consumer task to the list of task of the producer
- if (fProducer && !fProducer->GetListOfTasks()->FindObject(consumer))
- fProducer->Add(consumer);
-}
-
-//______________________________________________________________________________
-Bool_t AliAnalysisDataContainer::ClientsExecuted() const
-{
-// Check if all client tasks have executed.
- TIter next(fConsumers);
- AliAnalysisTask *task;
- while ((task=(AliAnalysisTask*)next())) {
- if (!task->HasExecuted()) return kFALSE;
- }
- return kTRUE;
-}
-
-//______________________________________________________________________________
-void AliAnalysisDataContainer::DeleteData()
-{
-// Delete data if not needed anymore.
- if (!fDataReady || !ClientsExecuted()) {
- cout<<"Data not ready or not all clients of container "<<GetName()<<" executed. Data not deleted."<<endl;
- //AliWarning(Form("Data not ready or not all clients of container %s executed. Data not deleted.", GetName()));
- return;
- }
- if (!fOwnedData) {
- cout<<"Data not owned by container "<<GetName()<<". Not deleted."<<endl;
- //AliWarning(Form("Data not owned by container %s. Not deleted.", GetName()));
- return;
- }
- delete fData;
- fData = 0;
- fDataReady = kFALSE;
-}
-//______________________________________________________________________________
-void AliAnalysisDataContainer::PrintContainer(Option_t *option, Int_t indent) const
-{
-// Print info about this container.
- TString ind;
- for (Int_t i=0; i<indent; i++) ind += " ";
- TString opt(option);
- opt.ToLower();
- Bool_t dep = (opt.Contains("dep"))?kTRUE:kFALSE;
- if (!dep) {
- printf("%s\n", Form("%sContainer: %s type: %s", ind.Data(), GetName(), fType->GetName()));
- if (fProducer)
- printf("%s\n", Form("%s = Data producer: task %s",ind.Data(),fProducer->GetName()));
- else
- printf("%s\n", Form("%s= No data producer"));
- printf("%s", Form("%s = Consumer tasks: "));
- if (!fConsumers || !fConsumers->GetEntriesFast()) printf("-none-\n");
- else printf("\n");
- }
- TIter next(fConsumers);
- AliAnalysisTask *task;
- while ((task=(AliAnalysisTask*)next())) task->PrintTask(option, indent+3);
-}
#include "TNamed.h"
#endif
+#ifndef ROOT_TString
+#include "TString.h"
+#endif
+
class TClass;
-class TFile;
class TObjArray;
+class TCollection;
class AliAnalysisTask;
class AliESD;
AliAnalysisDataContainer &operator=(const AliAnalysisDataContainer &cont);
// Getters
TObject *GetData() const {return fData;}
- TClass *GetType() const {return fType;}
+ const char *GetFileName() const {return fFileName.Data();}
+ TClass *GetType() const;
AliAnalysisTask *GetProducer() const {return fProducer;}
TObjArray *GetConsumers() const {return fConsumers;}
virtual void GetEntry(Long64_t ientry);
void ResetDataReady() {fDataReady = kFALSE;}
virtual Bool_t SetData(TObject *data, Option_t *option="");
void SetDataOwned(Bool_t flag) {fOwnedData = flag;}
- void OpenFile(const char *name, Option_t *option="RECREATE");
+ void SetFileName(const char *filename) {fFileName = filename;}
void SetProducer(AliAnalysisTask *prod, Int_t islot);
void AddConsumer(AliAnalysisTask *cons, Int_t islot);
void DeleteData();
Bool_t ClientsExecuted() const;
Bool_t HasConsumers() const {return (fConsumers != 0);}
Bool_t HasProducer() const {return (fProducer != 0);}
+ // Container merging
+ virtual Long64_t Merge(TCollection *list);
// Send a notify signal to the container
virtual void NotifyChange(ENotifyMessage /*type*/) {;}
// Print connected tasks/status
void PrintContainer(Option_t *option="all", Int_t indent=0) const;
- void WriteData();
-
+
+private:
+ void SetType(TClass *type) {fType = type;}
+
protected:
Bool_t fDataReady; // Flag that data is ready
Bool_t fOwnedData; // Flag data ownership
- TFile *fFile; // File storing the data
+ TString fFileName; // File storing the data
TObject *fData; // Contained data
- TClass *fType; // Type of contained data
+ TClass *fType; //! Type of contained data
AliAnalysisTask *fProducer; // Analysis task to which the slot belongs
TObjArray *fConsumers; // List of consumers of the data
// match.
//==============================================================================
-#include "Riostream.h"
-
-#include "TClass.h"
-#include "TTree.h"
-//#include "AliLog.h"
+#include <Riostream.h>
+#include <TROOT.h>
+#include <TClass.h>
+#include <TTree.h>
#include "AliAnalysisDataSlot.h"
#include "AliAnalysisTask.h"
ClassImp(AliAnalysisDataSlot)
+//______________________________________________________________________________
+AliAnalysisDataSlot::AliAnalysisDataSlot(TClass *type, AliAnalysisTask *task)
+ :TNamed(),
+ fType(type),
+ fParent(task),
+ fContainer(NULL)
+{
+// Default constructor.
+ SetTitle(fType->GetName());
+}
+
+//______________________________________________________________________________
+AliAnalysisDataSlot::AliAnalysisDataSlot(const AliAnalysisDataSlot &slot)
+ :TNamed(slot),
+ fType(NULL),
+ fParent(slot.fParent),
+ fContainer(slot.fContainer)
+{
+// Copy ctor.
+ GetType();
+}
+
//______________________________________________________________________________
AliAnalysisDataSlot& AliAnalysisDataSlot::operator=(const AliAnalysisDataSlot &slot)
{
// Assignment
if (&slot == this) return *this;
- TObject::operator=(slot);
- fType = slot.fType;
+ TNamed::operator=(slot);
+ GetType();
fParent = slot.fParent;
fContainer = slot.fContainer;
return *this;
// Connect the data slot with a given container. The operation will succeed only
// if the type defined by the slot inherits from the type enforced by the container.
// The error message in case of failure is posted by the caller.
- if (!cont || !fType) return kFALSE;
+ if (!cont || !GetType()) return kFALSE;
if (!fType->InheritsFrom(cont->GetType())) {
- cout<<"Data slot of type "<<fType->GetName()<<" of task "<<fParent->GetName()<<" cannot be connected to data container "<<cont->GetName()<<" of type "<<cont->GetType()->GetName()<<endl;
+ cout<<"Data slot of type "<<GetTitle()<<" of task "<<fParent->GetName()<<" cannot be connected to data container "<<cont->GetName()<<" of type "<<cont->GetTitle()<<endl;
//AliError(Form("Data slot of type %s of task %s cannot be connected to data container %s of type %s", fType->GetName(), fParent->GetName(), cont->GetName(), cont->GetType()->GetName()));
return kFALSE;
}
return kTRUE;
}
+//______________________________________________________________________________
+TClass *AliAnalysisDataSlot::GetType() const
+{
+// Get class type for this slot.
+ AliAnalysisDataSlot *slot = (AliAnalysisDataSlot*)this;
+ if (!fType) slot->SetType(gROOT->GetClass(fTitle.Data()));
+ if (!fType) printf("AliAnalysisDataSlot: Unknown class: %s\n", GetTitle());
+ return fType;
+}
+
//______________________________________________________________________________
void *AliAnalysisDataSlot::GetBranchAddress(const char *branchname) const
{
// Retrieve the address for a given branch. One should always test this before
// using SetBranchAddress because the address gets set by the first caller.
// Call this in MyTask::Init()
+ if (!GetType()) return NULL;
if (!fType->InheritsFrom(TTree::Class())) {
cout<<"Cannot call GetBranchAddress() for data slot of task "<<fParent->GetName()<<" not pointing to tree-type data"<<endl;
//AliFatal(Form("Cannot call GetBranchAddress() for data slot of task %s not pointing to tree-type data", fParent->GetName()));
{
// Retreives the data from the container if it is ready.
if (!fContainer) {
- cout<<"Data slot of type "<<fType->GetName()<<" of task "<<fParent->GetName()<<" has no connected data container"<<endl;
+ cout<<"Data slot of type "<<GetTitle()<<" of task "<<fParent->GetName()<<" has no connected data container"<<endl;
//AliError(Form("Data slot of type %s of task %s has no connected data container",fType->GetName(), fParent->GetName()));
return NULL;
}
{
// Check if data for this slot is ready in its container.
if (!fContainer) {
- cout<<"Data slot of type "<<fType->GetName()<<" of task "<<fParent->GetName()<<" has no connected data container"<<endl;
+ cout<<"Data slot of type "<<GetTitle()<<" of task "<<fParent->GetName()<<" has no connected data container"<<endl;
//AliError(Form("Data slot of type %s of task %s has no connected data container",fType->GetName(), fParent->GetName()));
return kFALSE;
}
// container with data of the same type.
//==============================================================================
-#ifndef ROOT_TObject
-#include "TObject.h"
+#ifndef ROOT_TNamed
+#include "TNamed.h"
#endif
class TClass;
class AliAnalysisDataContainer;
class AliAnalysisTask;
-class AliAnalysisDataSlot : public TObject {
+class AliAnalysisDataSlot : public TNamed {
public:
- AliAnalysisDataSlot() : fType(NULL), fParent(NULL), fContainer(NULL) {}
- AliAnalysisDataSlot(TClass *type, AliAnalysisTask *task) : fType(type), fParent(task), fContainer(NULL) {}
- AliAnalysisDataSlot(const AliAnalysisDataSlot &slot) : TObject(), fType(slot.fType), fParent(slot.fParent), fContainer(slot.fContainer) {}
+ AliAnalysisDataSlot() : TNamed(), fType(NULL), fParent(NULL), fContainer(NULL) {}
+ AliAnalysisDataSlot(TClass *type, AliAnalysisTask *task);
+ AliAnalysisDataSlot(const AliAnalysisDataSlot &slot);
virtual ~AliAnalysisDataSlot() {}
// Assignment
// Getters
void *GetBranchAddress(const char *branch) const;
Bool_t SetBranchAddress(const char *branch, void *address);
- TClass *GetType() const {return fType;}
+ TClass *GetType() const;
AliAnalysisTask *GetParent() const {return fParent;}
AliAnalysisDataContainer *GetContainer() const {return fContainer;}
TObject *GetData() const;
// Slot status checking
Bool_t IsConnected() const {return ((fContainer)?kTRUE:kFALSE);}
Bool_t IsDataReady() const;
+
+private:
+ void SetType(TClass *type) {fType = type;}
protected:
- TClass *fType; // Data type required by the slot
+ TClass *fType; //! Type of the slot
AliAnalysisTask *fParent; // Analysis task to which the slot belongs
AliAnalysisDataContainer *fContainer; // Container connected to the slot
// Make tasks
// The top input must be common to all top tasks
TClass * classIn = fTaskInType[0] ;
- AliAnalysisDataContainer * taskInput = mgr->CreateContainer("Input Container", classIn, AliAnalysisManager::kInputContainer) ;
+ AliAnalysisDataContainer * taskInput = mgr->CreateContainer("InputContainer", classIn, AliAnalysisManager::kInputContainer) ;
Int_t index ;
for (index = 0; index < fnumberOfTasks; index++) {
AliAnalysisTask * task = fTaskList[index] ;
// Create containers for input/output
TClass * classOu = fTaskOuType[index] ;
- AliAnalysisDataContainer * taskOutput = mgr->CreateContainer("Output Container", classOu, AliAnalysisManager::kOutputContainer) ;
+ AliAnalysisDataContainer * taskOutput = mgr->CreateContainer(Form("OutputContainer%d",index), classOu, AliAnalysisManager::kOutputContainer,
+ Form("%s.root",task->GetName())) ;
mgr->ConnectInput (task, 0, taskInput);
mgr->ConnectOutput(task, 0, taskOutput);
}
// Open data
- taskInput->SetData(chain);
+// taskInput->SetData(chain);
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
- chain->Process(mgr);
+// chain->Process(mgr);
+ mgr->StartAnalysis("local",chain);
} else
rv = kFALSE ;
//
//==============================================================================
-#include "Riostream.h"
+#include <Riostream.h>
-#include "TClass.h"
-#include "TFile.h"
-#include "TTree.h"
-//#include "AliLog.h"
+#include <TClass.h>
+#include <TFile.h>
+#include <TMethodCall.h>
+#include <TChain.h>
+#include <TSystem.h>
+#include <TROOT.h>
-#include "AliAnalysisManager.h"
#include "AliAnalysisTask.h"
#include "AliAnalysisDataContainer.h"
#include "AliAnalysisDataSlot.h"
+#include "AliAnalysisManager.h"
ClassImp(AliAnalysisManager)
+AliAnalysisManager *AliAnalysisManager::fgAnalysisManager = NULL;
+
//______________________________________________________________________________
-AliAnalysisManager::AliAnalysisManager() : TSelector(),
+AliAnalysisManager::AliAnalysisManager()
+ :TNamed(),
fTree(NULL),
+ fCurrentEntry(-1),
+ fMode(kLocalAnalysis),
fInitOK(kFALSE),
+ fTasks(NULL),
+ fTopTasks(NULL),
+ fZombies(NULL),
fContainers(NULL),
fInputs(NULL),
- fOutputs(NULL),
+ fOutputs(NULL)
+{
+// Dummy constructor.
+ fgAnalysisManager = this;
+}
+
+//______________________________________________________________________________
+AliAnalysisManager::AliAnalysisManager(const char *name, const char *title)
+ :TNamed(name,title),
+ fTree(NULL),
+ fCurrentEntry(-1),
+ fMode(kLocalAnalysis),
+ fInitOK(kFALSE),
+ fDebug(0),
fTasks(NULL),
fTopTasks(NULL),
- fZombies(NULL)
+ fZombies(NULL),
+ fContainers(NULL),
+ fInputs(NULL),
+ fOutputs(NULL)
{
// Default constructor.
- if (TClass::IsCallingNew() != TClass::kDummyNew) {
- fContainers = new TObjArray();
- fInputs = new TObjArray();
- fOutputs = new TObjArray();
- fTasks = new TObjArray();
- fTopTasks = new TObjArray();
- fZombies = new TObjArray();
-// fStatus = new AliAnalysisInfo(this);
- }
+ fgAnalysisManager = this;
+ fTasks = new TObjArray();
+ fTopTasks = new TObjArray();
+ fZombies = new TObjArray();
+ fContainers = new TObjArray();
+ fInputs = new TObjArray();
+ fOutputs = new TObjArray();
}
-#ifdef NEVER
//______________________________________________________________________________
AliAnalysisManager::AliAnalysisManager(const AliAnalysisManager& other)
- :TSelector(other),
+ :TNamed(other),
fTree(NULL),
- fInitOK(kFALSE),
- fContainers(NULL),
- fInputs(NULL),
- fOutputs(NULL),
+ fCurrentEntry(-1),
+ fMode(other.fMode),
+ fInitOK(other.fInitOK),
+ fDebug(other.fDebug),
fTasks(NULL),
fTopTasks(NULL),
- fZombies(NULL)
+ fZombies(NULL),
+ fContainers(NULL),
+ fInputs(NULL),
+ fOutputs(NULL)
{
// Copy constructor.
- fInitOK = other.fInitOK;
- fContainers = new TObjArray(*other.fContainers);
- fInputs = new TObjArray(*other.fInputs);
- fOutputs = new TObjArray(*other.fOutputs);
fTasks = new TObjArray(*other.fTasks);
fTopTasks = new TObjArray(*other.fTopTasks);
fZombies = new TObjArray(*other.fZombies);
-// fStatus = new AliAnalysisInfo(this);
+ fContainers = new TObjArray(*other.fContainers);
+ fInputs = new TObjArray(*other.fInputs);
+ fOutputs = new TObjArray(*other.fOutputs);
+ fgAnalysisManager = this;
}
//______________________________________________________________________________
{
// Assignment
if (&other != this) {
- TSelector::operator=(other);
- fTree = other.fTree;
+ TNamed::operator=(other);
+ fTree = NULL;
+ fCurrentEntry = -1;
+ fMode = other.fMode;
fInitOK = other.fInitOK;
- fContainers = new TObjArray(*other.fContainers);
- fInputs = new TObjArray(*other.fInputs);
- fOutputs = new TObjArray(*other.fOutputs);
+ fDebug = other.fDebug;
fTasks = new TObjArray(*other.fTasks);
fTopTasks = new TObjArray(*other.fTopTasks);
fZombies = new TObjArray(*other.fZombies);
-// fStatus = new AliAnalysisInfo(this);
+ fContainers = new TObjArray(*other.fContainers);
+ fInputs = new TObjArray(*other.fInputs);
+ fOutputs = new TObjArray(*other.fOutputs);
+ fgAnalysisManager = this;
}
return *this;
}
-#endif
//______________________________________________________________________________
AliAnalysisManager::~AliAnalysisManager()
{
// Destructor.
- if (fContainers) {fContainers->Delete(); delete fContainers;}
- if (fInputs) delete fInputs;
- if (fOutputs) delete fOutputs;
if (fTasks) {fTasks->Delete(); delete fTasks;}
if (fTopTasks) delete fTopTasks;
if (fZombies) delete fZombies;
+ if (fContainers) {fContainers->Delete(); delete fContainers;}
+ if (fInputs) delete fInputs;
+ if (fOutputs) delete fOutputs;
+ if (fgAnalysisManager==this) fgAnalysisManager = NULL;
}
+
//______________________________________________________________________________
Int_t AliAnalysisManager::GetEntry(Long64_t entry, Int_t getall)
{
// Read one entry of the tree or a whole branch.
+ if (fDebug > 1) {
+ cout << "== AliAnalysisManager::GetEntry()" << endl;
+ }
+ fCurrentEntry = entry;
return fTree ? fTree->GetTree()->GetEntry(entry, getall) : 0;
}
// will be set. It is normaly not necessary to make changes to the
// generated code, but the routine can be extended by the user if needed.
// Init() will be called many times when running with PROOF.
- printf("AliAnalysisManager::Init(%s)\n", tree->GetName());
- if (!fInitOK) {
- cout<<"You have to call InitAnalysis first"<<endl;
- //AliError("You have to call InitAnalysis first");
- return;
- }
if (!tree) return;
+ if (fDebug > 1) {
+ printf("AliAnalysisManager::Init(%s)\n", tree->GetName());
+ }
+ if (!fInitOK) InitAnalysis();
+ if (!fInitOK) return;
fTree = tree;
AliAnalysisDataContainer *top = (AliAnalysisDataContainer*)fInputs->At(0);
+ if (!top) {
+ cout<<"Error: No top input container !" <<endl;
+ return;
+ }
top->SetData(tree);
}
// The Begin() function is called at the start of the query.
// When running with PROOF Begin() is only called on the client.
// The tree argument is deprecated (on PROOF 0 is passed).
- printf("AliAnalysisManager::Begin(%s)\n", tree->GetName());
+ if (fDebug > 1) {
+ cout << "AliAnalysisManager::Begin()" << endl;
+ }
Init(tree);
}
// The SlaveBegin() function is called after the Begin() function.
// When running with PROOF SlaveBegin() is called on each slave server.
// The tree argument is deprecated (on PROOF 0 is passed).
- printf("AliAnalysisManager::SlaveBegin(%s)\n", tree->GetName());
- Init(tree);
+ if (fDebug > 1) {
+ cout << "AliAnalysisManager::SlaveBegin()" << endl;
+ }
+ TIter next(fTasks);
+ AliAnalysisTask *task;
+ // Call CreateOutputObjects for all tasks
+ while ((task=(AliAnalysisTask*)next()))
+ task->CreateOutputObjects();
+ if (fMode == kLocalAnalysis) Init(tree);
}
//______________________________________________________________________________
// user if needed. The return value is currently not used.
if (fTree) {
TFile *curfile = fTree->GetCurrentFile();
- if (curfile) printf("AliAnalysisManager::Notify() file: %s\n", curfile->GetName());
+ if (curfile && fDebug>1) printf("AliAnalysisManager::Notify() file: %s\n", curfile->GetName());
}
return kTRUE;
}
// Assuming that fChain is the pointer to the TChain being processed,
// use fChain->GetTree()->GetEntry(entry).
-// printf("AliAnalysisManager::Process(%lld)\n", entry);
+ if (fDebug > 1) {
+ cout << "AliAnalysisManager::Process()" << endl;
+ }
GetEntry(entry);
ExecAnalysis();
return kTRUE;
}
//______________________________________________________________________________
-void AliAnalysisManager::SlaveTerminate()
+void AliAnalysisManager::PackOutput(TList *target)
{
- // The SlaveTerminate() function is called after all entries or objects
- // have been processed. When running with PROOF SlaveTerminate() is called
- // on each slave server.
-
- printf("AliAnalysisManager::SlaveTerminate()\n");
- if (!fOutput)
- {
- cout<<"ERROR: Output list not initialized."<<endl;
- //AliError("ERROR: Output list not initialized.");
- return;
- }
+ // Pack all output data containers in the output list.
+ if (fDebug > 1) {
+ cout << "AliAnalysisManager::PackOutput()" << endl;
+ }
+ if (!target) {
+ Error("PackOutput", "No target. Aborting.");
+ return;
+ }
+
+ if (fMode == kProofAnalysis) {
+ TIter next(fOutputs);
+ AliAnalysisDataContainer *output;
+ while ((output=(AliAnalysisDataContainer*)next())) {
+ if (fDebug > 1) printf(" Packing container %s\n", output->GetName());
+ if (output->GetData()) target->Add(output);
+// output->SetDataOwned(kFALSE);
+ }
+ }
+ fContainers->Clear();
+ if (fDebug > 1) {
+ printf(" ->output list contains %d containers\n", target->GetSize());
+ }
+}
+
+//______________________________________________________________________________
+void AliAnalysisManager::ReplaceOutputContainers(TList *source)
+{
+// Replace all exising containers with the ones coming in source.
TIter next(fOutputs);
- AliAnalysisDataContainer *output;
- while ((output=(AliAnalysisDataContainer *)next())) {
- output->SetDataOwned(kFALSE);
- fOutput->Add(output->GetData());
+ AliAnalysisDataContainer *cont, *output;
+ while ((cont=(AliAnalysisDataContainer*)next())) {
+ output = (AliAnalysisDataContainer*)source->FindObject(cont->GetName());
+ if (!output) {
+ printf("Error: container %s not found in analysis output !\n", cont->GetName());
+ continue;
+ }
+ if (fDebug > 1) printf("...Replacing output container %s\n", output->GetName());
+ if (cont->GetFileName()) printf(" -> %s\n", output->GetFileName());
+ Int_t ntasks = fTasks->GetEntries();
+ AliAnalysisTask *task;
+ AliAnalysisDataSlot *oslot;
+ for (Int_t i=0; i<ntasks; i++) {
+ task = (AliAnalysisTask*)fTasks->At(i);
+ Int_t nout = task->GetNoutputs();
+ for (Int_t iout=0; iout<nout; iout++) {
+ oslot = task->GetOutputSlot(iout);
+ if (oslot->GetContainer() == cont) oslot->ConnectContainer(output);
+ }
+ }
+// output->GetConsumers()->Delete();
+// if (output->GetProducer()) delete output->GetProducer();
+ }
+}
+
+//______________________________________________________________________________
+void AliAnalysisManager::UnpackOutput(TList *source)
+{
+ // Called by AliAnalysisSelector::Terminate. Output containers should
+ // be in source in the same order as in fOutputs.
+
+ if (!source) {
+ Error("PackOutput", "No target. Aborting.");
+ return;
+ }
+ if (fDebug > 1) {
+ printf("AliAnalysisManager::UnpackOutput(): %d containers\n", source->GetSize());
+ printf(" Source list contains %d containers\n", source->GetSize());
}
+ TCollection *collection = source;
+ if (fMode == kLocalAnalysis) collection = fOutputs;
+ TIter next(collection);
+
+ if (fMode == kProofAnalysis) {
+ ReplaceOutputContainers(source);
+ fOutputs->Clear();
+ }
+ AliAnalysisDataContainer *output;
+ while ((output=(AliAnalysisDataContainer*)next())) {
+ if (fMode == kProofAnalysis) {
+ output->SetDataOwned(kTRUE);
+ fOutputs->Add(output);
+ }
+ if (!output->GetData()) continue;
+ // Check if the output need to be written to a file.
+ const char *filename = output->GetFileName();
+ if (!filename || !strlen(filename)) continue;
+ TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
+ if (file) file->cd();
+ else file = new TFile(filename, "RECREATE");
+ if (file->IsZombie()) continue;
+ // Reparent data to this file
+ TMethodCall callEnv;
+ if (output->GetData()->IsA())
+ callEnv.InitWithPrototype(output->GetData()->IsA(), "SetDirectory", "TDirectory*");
+ if (callEnv.IsValid()) {
+ callEnv.SetParam((Long_t) file);
+ callEnv.Execute(output->GetData());
+ }
+ output->GetData()->Write();
+ }
}
//______________________________________________________________________________
{
// The Terminate() function is the last function to be called during
// a query. It always runs on the client, it can be used to present
- // the results graphically or save the results to file.
- printf("AliAnalysisManager::Terminate()\n");
- AliAnalysisDataContainer *output;
+ // the results graphically.
+ if (fDebug > 1) {
+ cout << "AliAnalysisManager::Terminate()" << endl;
+ }
AliAnalysisTask *task;
- TIter next(fOutputs);
- while ((output=(AliAnalysisDataContainer *)next())) output->WriteData();
- TIter next1(fTasks);
+ TIter next(fTasks);
// Call Terminate() for tasks
- while ((task=(AliAnalysisTask*)next1())) task->Terminate();
+ while ((task=(AliAnalysisTask*)next())) task->Terminate();
}
//______________________________________________________________________________
//______________________________________________________________________________
AliAnalysisDataContainer *AliAnalysisManager::CreateContainer(const char *name,
- TClass *datatype, EAliAnalysisContType type)
+ TClass *datatype, EAliAnalysisContType type, const char *filename)
{
// Create a data container of a certain type. Types can be:
-// kNormalContainer = 0, used to exchange date between tasks
+// kExchangeContainer = 0, used to exchange date between tasks
// kInputContainer = 1, used to store input data
// kOutputContainer = 2, used for posting results
AliAnalysisDataContainer *cont = new AliAnalysisDataContainer(name, datatype);
fInputs->Add(cont);
break;
case kOutputContainer:
+ if (fOutputs->FindObject(name)) printf("CreateContainer: warning: a container named %s existing !\n",name);
fOutputs->Add(cont);
+ if (filename && strlen(filename)) cont->SetFileName(filename);
break;
- case kNormalContainer:
+ case kExchangeContainer:
break;
}
return cont;
// Connect input of an existing task to a data container.
if (!fTasks->FindObject(task)) {
AddTask(task);
- cout<<"Task "<<task->GetName()<<" not registered. Now owned by analysis manager"<<endl;
- //AliInfo(Form("Task %s not registered. Now owned by analysis manager", task->GetName()));
+ Warning("ConnectInput", "Task %s not registered. Now owned by analysis manager", task->GetName());
}
Bool_t connected = task->ConnectInput(islot, cont);
return connected;
// Connect output of an existing task to a data container.
if (!fTasks->FindObject(task)) {
AddTask(task);
- cout<<"Task "<<task->GetName()<<"not registered. Now owned by analysis manager"<<endl;
- //AliInfo(Form("Task %s not registered. Now owned by analysis manager", task->GetName()));
+ Warning("ConnectOutput", "Task %s not registered. Now owned by analysis manager", task->GetName());
}
Bool_t connected = task->ConnectOutput(islot, cont);
return connected;
// and data containers are properly connected
// Check for input/output containers
fInitOK = kFALSE;
-// if (!fInputs->GetEntriesFast()) {
-// AliError("No input container defined. At least one container should store input data");
-// return kFALSE;
-// }
-// if (!fOutputs->GetEntriesFast()) {
-// AliError("No output container defined. At least one container should store output data");
-// return kFALSE;
-// }
// Check for top tasks (depending only on input data containers)
if (!fTasks->First()) {
- cout<<"Analysis has no tasks !"<<endl;
- //AliError("Analysis have no tasks !");
+ Error("InitAnalysis", "Analysis has no tasks !");
return kFALSE;
}
TIter next(fTasks);
istop = kTRUE;
iszombie = kFALSE;
Int_t ninputs = task->GetNinputs();
-// if (!ninputs) {
-// task->SetZombie();
-// fZombies->Add(task);
-// nzombies++;
-// AliWarning(Form("Task %s has no input slots defined ! Declared zombie...",task->GetName()));
-// continue;
-// }
for (i=0; i<ninputs; i++) {
cont = task->GetInputSlot(i)->GetContainer();
if (!cont) {
nzombies++;
iszombie = kTRUE;
}
- cout<<"Input slot "<<i<<" of task "<<task->GetName()<<" has no container connected ! Declared zombie..."<<endl;
- //AliWarning(Form("Input slot %i of task %s has no container connected ! Declared zombie...",i,task->GetName()));
+ Error("InitAnalysis", "Input slot %d of task %s has no container connected ! Declared zombie...",
+ i, task->GetName());
}
if (iszombie) continue;
// Check if cont is an input container
}
}
if (!ntop) {
- cout<<"No top task defined. At least one task should be connected only to input containers"<<endl;
- //AliError("No top task defined. At least one task should be connected only to input containers");
+ Error("InitAnalysis", "No top task defined. At least one task should be connected only to input containers");
return kFALSE;
}
// Check now if there are orphan tasks
while ((task=(AliAnalysisTask*)next())) {
if (!task->IsUsed()) {
norphans++;
- cout<<"Task "<<task->GetName()<<" is orphan"<<endl;
- //AliWarning(Form("Task %s is orphan",task->GetName()));
+ Warning("InitAnalysis", "Task %s is orphan", task->GetName());
}
}
// Check the task hierarchy (no parent task should depend on data provided
for (i=0; i<ntop; i++) {
task = (AliAnalysisTask*)fTopTasks->At(i);
if (task->CheckCircularDeps()) {
- cout<<"Found illegal circular dependencies between following tasks:"<<endl;
- //AliError("Found illegal circular dependencies between following tasks:");
+ Error("InitAnalysis", "Found illegal circular dependencies between following tasks:");
PrintStatus("dep");
return kFALSE;
}
CleanContainers();
}
+//______________________________________________________________________________
+void AliAnalysisManager::StartAnalysis(const char *type, TTree *tree)
+{
+// Start analysis for this manager. Analysis task can be: LOCAL, PROOF or GRID.
+ if (!fInitOK) {
+ Error("StartAnalysis","Analysis manager was not initialized !");
+ return;
+ }
+ if (fDebug>1) {
+ cout << "StartAnalysis: " << GetName() << endl;
+ }
+ TString anaType = type;
+ anaType.ToLower();
+ fMode = kLocalAnalysis;
+ if (tree) {
+ if (anaType.Contains("proof")) fMode = kProofAnalysis;
+ else if (anaType.Contains("grid")) fMode = kGridAnalysis;
+ }
+ if (fMode == kGridAnalysis) {
+ Warning("StartAnalysis", "GRID analysis mode not implemented. Running local.");
+ fMode = kLocalAnalysis;
+ }
+ char line[128];
+ TChain *chain = dynamic_cast<TChain*>(tree);
+ switch (fMode) {
+ case kLocalAnalysis:
+ if (!tree) {
+ ExecAnalysis();
+ return;
+ }
+ // Run tree-based analysis via AliAnalysisSelector
+ gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/AliAnalysisSelector.cxx+");
+ cout << "===== RUNNING LOCAL ANALYSIS " << GetName() << " ON TREE " << tree->GetName() << endl;
+ sprintf(line, "AliAnalysisSelector *selector = new AliAnalysisSelector((AliAnalysisManager*)0x%lx);",(ULong_t)this);
+ gROOT->ProcessLine(line);
+ sprintf(line, "((TTree*)0x%lx)->Process(selector);",(ULong_t)tree);
+ gROOT->ProcessLine(line);
+ break;
+ case kProofAnalysis:
+ if (!gROOT->GetListOfProofs() || !gROOT->GetListOfProofs()->GetEntries()) {
+ printf("StartAnalysis: no PROOF!!!\n");
+ return;
+ }
+ sprintf(line, "gProof->AddInput((TObject*)0x%lx);", (ULong_t)this);
+ gROOT->ProcessLine(line);
+ if (chain) {
+ chain->SetProof();
+ cout << "===== RUNNING PROOF ANALYSIS " << GetName() << " ON CHAIN " << chain->GetName() << endl;
+ chain->Process(gSystem->ExpandPathName("$ALICE_ROOT/ANALYSIS/AliAnalysisSelector.cxx+"));
+ } else {
+ printf("StartAnalysis: no chain\n");
+ return;
+ }
+ break;
+ case kGridAnalysis:
+ Warning("StartAnalysis", "GRID analysis mode not implemented. Running local.");
+ }
+}
+
//______________________________________________________________________________
void AliAnalysisManager::ExecAnalysis(Option_t *option)
{
// Execute analysis.
if (!fInitOK) {
- cout<<"Analysis manager was not initialized !"<<endl;
- //AliError("Analysis manager was not initialized !");
+ Error("ExecAnalysis", "Analysis manager was not initialized !");
return;
}
AliAnalysisTask *task;
// Check if the top tree is active.
if (fTree) {
+ if (fDebug>1) {
+ printf("AliAnalysisManager::ExecAnalysis\n");
+ }
TIter next(fTasks);
// De-activate all tasks
while ((task=(AliAnalysisTask*)next())) task->SetActive(kFALSE);
AliAnalysisDataContainer *cont = (AliAnalysisDataContainer*)fInputs->At(0);
if (!cont) {
- cout<<"Cannot execute analysis in TSelector mode without at least one top container"<<endl;
- //AliError("Cannot execute analysis in TSelector mode without at least one top container");
+ Error("ExecAnalysis","Cannot execute analysis in TSelector mode without at least one top container");
return;
}
cont->SetData(fTree); // This will notify all consumers
TIter next1(cont->GetConsumers());
while ((task=(AliAnalysisTask*)next1())) {
// task->SetActive(kTRUE);
+ if (fDebug >1) {
+ cout << " Executing task " << task->GetName() << endl;
+ }
task->ExecuteTask(option);
}
return;
TIter next2(fTopTasks);
while ((task=(AliAnalysisTask*)next2())) {
task->SetActive(kTRUE);
- printf("executing %s\n", task->GetName());
+ if (fDebug > 1) {
+ cout << " Executing task " << task->GetName() << endl;
+ }
task->ExecuteTask(option);
}
}
// event for all tasks depending only on initial input data.
//==============================================================================
-#ifndef ROOT_TSelector
-#include "TSelector.h"
+#ifndef ROOT_TNamed
+#include <TNamed.h>
#endif
class TClass;
+class TTree;
class AliAnalysisDataContainer;
class AliAnalysisTask;
-class AliAnalysisManager : public TSelector {
+class AliAnalysisManager : public TNamed {
public:
enum EAliAnalysisContType {
- kNormalContainer = 0,
+ kExchangeContainer = 0,
kInputContainer = 1,
kOutputContainer = 2
};
+
+enum EAliAnalysisExecMode {
+ kLocalAnalysis = 0,
+ kProofAnalysis = 1,
+ kGridAnalysis = 2
+};
+
AliAnalysisManager();
+ AliAnalysisManager(const char *name, const char *title="");
virtual ~AliAnalysisManager();
+
+ AliAnalysisManager(const AliAnalysisManager& other);
+ AliAnalysisManager& operator=(const AliAnalysisManager& other);
- // Selector-specific methods
+ void StartAnalysis(const char *type="local", TTree *tree=0);
+
virtual void Init(TTree *tree);
virtual void Begin(TTree *tree);
virtual Bool_t Notify();
virtual Bool_t ProcessCut(Long64_t entry) {return Process(entry);}
virtual Bool_t Process(Long64_t entry);
virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0);
- virtual void SlaveTerminate();
+ void PackOutput(TList *target);
+ void UnpackOutput(TList *source);
virtual void Terminate();
- // Getters
- TTree *GetTree() const {return fTree;}
+ // Getters/Setters
+ static AliAnalysisManager *GetAnalysisManager() {return fgAnalysisManager;}
TObjArray *GetContainers() const {return fContainers;}
+ UInt_t GetDebugLevel() const {return fDebug;}
TObjArray *GetInputs() const {return fInputs;}
TObjArray *GetOutputs() const {return fOutputs;}
TObjArray *GetTasks() const {return fTasks;}
TObjArray *GetTopTasks() const {return fTopTasks;}
+ TTree *GetTree() const {return fTree;}
TObjArray *GetZombieTasks() const {return fZombies;}
-// AliAnalysisInfo *GetStatus() const {return fStatus;}
+ Long64_t GetCurrentEntry() const {return fCurrentEntry;}
+ EAliAnalysisExecMode
+ GetAnalysisType() const {return fMode;}
+
+ void SetAnalysisType(EAliAnalysisExecMode mode) {fMode = mode;}
+ void SetCurrentEntry(Long64_t entry) {fCurrentEntry = entry;}
+ void SetDebugLevel(UInt_t level) {fDebug = level;}
// Container handling
AliAnalysisDataContainer *CreateContainer(const char *name, TClass *datatype,
- EAliAnalysisContType type=kNormalContainer);
+ EAliAnalysisContType type = kExchangeContainer,
+ const char *filename = NULL);
// Including tasks and getting them
void AddTask(AliAnalysisTask *task);
void PrintStatus(Option_t *option="all") const;
protected:
- TTree *fTree; // Input tree in case of TSelector model
- Bool_t fInitOK; // Initialisation done
- TObjArray *fContainers; //-> List of all containers
- TObjArray *fInputs; //-> List of containers with input data
- TObjArray *fOutputs; //-> List of containers with results
- TObjArray *fTasks; //-> List of analysis tasks
- TObjArray *fTopTasks; //-> List of top tasks
- TObjArray *fZombies; //-> List of zombie tasks
-// AliAnalysisInfo *fStatus; // Analysis info object
+ void ReplaceOutputContainers(TList *source);
private:
- AliAnalysisManager(const AliAnalysisManager& other);
- AliAnalysisManager& operator=(const AliAnalysisManager& other);
-
+ TTree *fTree; //! Input tree in case of TSelector model
+ Long64_t fCurrentEntry; //! Current processed entry in the tree
+ EAliAnalysisExecMode fMode; // Execution mode
+ Bool_t fInitOK; // Initialisation done
+ UInt_t fDebug; // Debug level
+ TObjArray *fTasks; // List of analysis tasks
+ TObjArray *fTopTasks; // List of top tasks
+ TObjArray *fZombies; // List of zombie tasks
+ TObjArray *fContainers; // List of all containers
+ TObjArray *fInputs; // List of containers with input data
+ TObjArray *fOutputs; // List of containers with results
+ static AliAnalysisManager *fgAnalysisManager; //! static pointer to object instance
ClassDef(AliAnalysisManager,1) // Analysis manager class
};
#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-// Author: Andrei Gheata, 31/05/2006
-
-//==============================================================================
-// AliAnalysysRLContainer -
-//
-//
-//
-//==============================================================================
-
-#include "AliAnalysisRLContainer.h"
-#include "TTree.h"
-#include "TFile.h"
-
-#include "AliLog.h"
-#include "AliRunLoader.h"
-#include "AliESD.h"
-#include "AliHeader.h"
-#include "AliStack.h"
-#include "AliAnalysisDataContainer.h"
-#include "AliAnalysisDataSlot.h"
-#include "AliAnalysisTask.h"
-
-ClassImp(AliAnalysisRLContainer)
-
-//______________________________________________________________________________
-AliAnalysisRLContainer::AliAnalysisRLContainer()
- :AliAnalysisDataContainer(),
- fRunLoader(NULL),
- fESD(NULL),
- fKineFile(NULL),
- fKinematicsLoaded(kFALSE),
- fHeaderLoaded(kFALSE)
-{
-// Dummy ctor.
-}
-
-//______________________________________________________________________________
-AliAnalysisRLContainer::AliAnalysisRLContainer(const char *name)
- :AliAnalysisDataContainer(name, TTree::Class()),
- fRunLoader(NULL),
- fESD(NULL),
- fKineFile(NULL),
- fKinematicsLoaded(kFALSE),
- fHeaderLoaded(kFALSE)
-{
-// Normal constructor.
-}
-
-//______________________________________________________________________________
-AliAnalysisRLContainer::AliAnalysisRLContainer(const AliAnalysisRLContainer &rlc)
- :AliAnalysisDataContainer(rlc),
- fRunLoader(rlc.fRunLoader),
- fESD(rlc.fESD),
- fKineFile(rlc.fKineFile),
- fKinematicsLoaded(rlc.fKinematicsLoaded),
- fHeaderLoaded(rlc.fHeaderLoaded)
-{
-// Copy constructor.
-}
-
-//______________________________________________________________________________
-AliAnalysisRLContainer::~AliAnalysisRLContainer()
-{
-// Destructor. Deletes data ! (What happens if data is a container ???)
-}
-
-//______________________________________________________________________________
-AliAnalysisRLContainer &AliAnalysisRLContainer::operator=(const AliAnalysisRLContainer &rlc)
-{
-// Assignment.
- if (&rlc != this) {
- AliAnalysisDataContainer::operator=(rlc);
- fRunLoader = rlc.fRunLoader;
- fESD = rlc.fESD;
- fKineFile = rlc.fKineFile;
- fKinematicsLoaded = rlc.fKinematicsLoaded;
- fHeaderLoaded = rlc.fHeaderLoaded;
- }
- return *this;
-}
-
-//______________________________________________________________________________
-Bool_t AliAnalysisRLContainer::SetData(TObject *data, Option_t */*option*/)
-{
-// Data must be a tree here.
- fData = data;
- TTree *tree = (TTree *)data;
- // Set branch address
- tree->SetBranchAddress("ESD", &fESD);
- fDataReady = kTRUE;
- return kTRUE;
-}
-
-//______________________________________________________________________________
-void AliAnalysisRLContainer::GetEntry(Long64_t ientry)
-{
-// If data is ready and derives from TTree or from TBranch, this will get the
-// requested entry in memory if not already loaded.
- if (!fDataReady) return;
- TTree *tree = (TTree*)fData;
- tree->GetTree()->GetEntry(ientry);
- if (fRunLoader) fRunLoader->GetEvent(ientry);
-}
-
-//______________________________________________________________________________
-void AliAnalysisRLContainer::NotifyChange(ENotifyMessage type)
-{
-// Notify container that file has changed.
- AliAnalysisDataContainer::NotifyChange(type);
- if (!type==kFileChange) return;
- DeleteKinematicsFile();
- DeleteRunLoader();
-}
-
-//______________________________________________________________________________
-void AliAnalysisRLContainer::DeleteRunLoader()
-{
-// Deletes the runloader.
- if (fRunLoader) {
- fRunLoader->Delete();
- fRunLoader = 0;
- }
- fKinematicsLoaded = kFALSE;
- fHeaderLoaded = kFALSE;
-}
-
-//______________________________________________________________________________
-void AliAnalysisRLContainer::DeleteKinematicsFile()
-{
-// Closes the kinematics file and deletes the pointer.
- if (fKineFile) {
- fKineFile->Close();
- delete fKineFile;
- fKineFile = 0;
- }
-}
-
-//______________________________________________________________________________
-AliRunLoader* AliAnalysisRLContainer::GetRunLoader()
-{
-// Returns AliRun instance corresponding to current ESD active in fTree
-// Loads galice.root, the file is identified by replacing "AliESDs" to
-// "galice" in the file path of the ESD file. This is a hack, to be changed!
-
- if (!fDataReady) return 0;
- TTree *tree = (TTree*)fData;
- if (!fRunLoader) {
- if (!tree->GetCurrentFile()) return 0;
- TString fileName(tree->GetCurrentFile()->GetName());
- fileName.ReplaceAll("AliESDs", "galice");
- fRunLoader = AliRunLoader::Open(fileName);
- if (!fRunLoader) return 0;
- if (fRunLoader->LoadgAlice() != 0) {
- delete fRunLoader;
- fRunLoader = 0;
- return 0;
- }
- fRunLoader->GetEvent(tree->GetTree()->GetReadEntry());
- }
- return fRunLoader;
-}
-
-//______________________________________________________________________________
-AliHeader* AliAnalysisRLContainer::GetHeader()
-{
-// Returns header retrieved from RunLoader
- AliRunLoader* runLoader = GetRunLoader();
- if (!runLoader) return 0;
- if (!fHeaderLoaded)
- if (runLoader->LoadHeader() != 0) return 0;
- fHeaderLoaded = kTRUE;
- return runLoader->GetHeader();
-}
-
-//______________________________________________________________________________
-TTree* AliAnalysisRLContainer::GetKinematics()
-{
-// Returns kinematics tree corresponding to current ESD active in fTree
-// Loads the kinematics from the kinematics file, the file is identified by replacing "AliESDs" to
-// "Kinematics" in the file path of the ESD file. This is a hack, to be changed!
-
- if (!fDataReady) return 0;
- TTree *tree = (TTree*)fData;
- if (!fKineFile) {
- if (!tree->GetCurrentFile()) return 0;
- TString fileName(tree->GetCurrentFile()->GetName());
- fileName.ReplaceAll("AliESDs", "Kinematics");
-
- AliDebug(AliLog::kInfo, Form("Opening %s", fileName.Data()));
-
- fKineFile = TFile::Open(fileName);
- if (!fKineFile) return 0;
- }
- return dynamic_cast<TTree*> (fKineFile->Get(Form("Event%d/TreeK", tree->GetTree()->GetReadEntry())));
-}
-
-//______________________________________________________________________________
-AliStack* AliAnalysisRLContainer::GetStack()
-{
-// Returns stack retrieved from RunLoader
-
- AliRunLoader* runLoader = GetRunLoader();
- if (!runLoader) return 0;
- if (!fKinematicsLoaded)
- if (runLoader->LoadKinematics() != 0) return 0;
- fKinematicsLoaded = kTRUE;
- return runLoader->Stack();
-}
+++ /dev/null
-#ifndef ALIANALYSISRLCONTAINER_H
-#define ALIANALYSISRLCONTAINER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-// Author: Andrei Gheata, 31/05/2006
-
-//==============================================================================
-// AliAnalysysRLContainer - Special container working with AliRunLoader
-// with trees
-//==============================================================================
-
-#ifndef ALIANALYSISDATQCONTAINER_H
-#include "AliAnalysisDataContainer.h"
-#endif
-
-class TFile;
-class TTree;
-class AliRunLoader;
-class AliHeader;
-class AliStack;
-
-class AliAnalysisRLContainer : public AliAnalysisDataContainer {
-
-public:
- AliAnalysisRLContainer();
- AliAnalysisRLContainer(const char *name);
- AliAnalysisRLContainer(const AliAnalysisRLContainer &rlc);
- virtual ~AliAnalysisRLContainer();
-
- AliAnalysisRLContainer &operator=(const AliAnalysisRLContainer &rlc);
- AliRunLoader *GetRunLoader();
- AliHeader *GetHeader();
- AliStack *GetStack();
- TTree *GetKinematics();
- AliESD *GetESD() const {return fESD;}
- virtual void GetEntry(Long64_t ientry);
- virtual Bool_t SetData(TObject *data, Option_t *option="");
- // Send a notify signal to the container
- virtual void NotifyChange(ENotifyMessage type);
-
-private:
- void DeleteKinematicsFile();
- void DeleteRunLoader();
-
- AliRunLoader* fRunLoader; //! pointer to the RunLoader if galice.root was opened
- AliESD* fESD; //! "ESD" branch in fChain
- TFile* fKineFile; //! pointer to Kinematics.root if the file was opened
- Bool_t fKinematicsLoaded; // determines if the stack is properly loaded (AliRunLoader::LoadKinematics() succeeded), this is needed because the GetStack returnes a invalid stack object when the function failed
- Bool_t fHeaderLoaded; // determines if the header is properly loaded
-
- ClassDef(AliAnalysisRLContainer,1) // Class describing a data container using AliRunLoader
-};
-#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+// Author: Andrei Gheata, 31/05/2006
+
+//==============================================================================
+// AliAnalysisSelector - A transparent selector to be created by
+// AliAnalysisManager to handle analysis.
+//==============================================================================
+
+#include "Riostream.h"
+
+#include "AliAnalysisManager.h"
+#include "AliAnalysisTask.h"
+#include "AliAnalysisDataContainer.h"
+#include "AliAnalysisSelector.h"
+
+ClassImp(AliAnalysisSelector)
+
+//______________________________________________________________________________
+AliAnalysisSelector::AliAnalysisSelector(AliAnalysisManager *mgr)
+ :TSelector(),
+ fInitialized(kFALSE),
+ fAnalysis(mgr)
+{
+// Constructor. Called by AliAnalysisManager which registers itself on the
+// selector running on the master.
+}
+
+//______________________________________________________________________________
+AliAnalysisSelector::~AliAnalysisSelector()
+{
+// Dtor. The analysis manager object is sent in the input list and duplicated
+// on the workers - it needs to be deleted (?)
+// if (fAnalysis) delete fAnalysis;
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::Init(TTree *tree)
+{
+// Called after Begin/SlaveBegin, assumes that fAnalysis is already initialized.
+// Is Init called on workers in case of PROOF.
+ if (!fAnalysis) {
+ Error("Init", "Analysis manager NULL !");
+ return;
+ }
+ if (!tree) {
+ Error("Init", "Input tree is NULL !");
+ return;
+ }
+ fAnalysis->Init(tree);
+ fInitialized = kTRUE;
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::Begin(TTree *)
+{
+// Assembly the input list.
+ RestoreAnalysisManager();
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::SlaveBegin(TTree *tree)
+{
+// Called on each worker. We "unpack" analysis manager here and call InitAnalysis.
+ RestoreAnalysisManager();
+ if (fAnalysis) fAnalysis->SlaveBegin(tree);
+}
+
+//______________________________________________________________________________
+Bool_t AliAnalysisSelector::Process(Long64_t entry)
+{
+// Event loop.
+ if (fAnalysis->GetDebugLevel() >1 ) {
+ printf("AliAnalysisSelector::Process()\n");
+ }
+ fAnalysis->GetEntry(entry); // Not needed anymore in version 2
+ fAnalysis->ExecAnalysis();
+ return kTRUE;
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::RestoreAnalysisManager()
+{
+// Restores analysis manager from the input list.
+ if (!fAnalysis) {
+ TIter next(fInput);
+ TObject *obj;
+ while ((obj=next())) {
+ if (obj->IsA() == AliAnalysisManager::Class()) {
+ fAnalysis = (AliAnalysisManager*)obj;
+ break;
+ }
+ }
+ if (!fAnalysis) {
+ Error("SlaveBegin", "Analysis manager not found in the input list");
+ return;
+ }
+ }
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::SlaveTerminate()
+{
+ // The SlaveTerminate() function is called after all entries or objects
+ // have been processed. When running with PROOF SlaveTerminate() is called
+ // on each slave server.
+ if (fAnalysis->GetDebugLevel() >1 ) {
+ printf("AliAnalysisSelector::SlaveTerminate()\n");
+ }
+ fAnalysis->PackOutput(fOutput);
+}
+
+//______________________________________________________________________________
+void AliAnalysisSelector::Terminate()
+{
+ // The Terminate() function is the last function to be called during
+ // a query. It always runs on the client, it can be used to present
+ // the results graphically or save the results to file.
+ if (!fAnalysis) {
+ Error("Terminate","AliAnalysisSelector::Terminate: No analysisManager!!!");
+ return;
+ }
+ if (fAnalysis->GetDebugLevel() >1 ) {
+ printf("AliAnalysisSelector::Terminate()\n");
+ }
+ fAnalysis->UnpackOutput(fOutput);
+ fAnalysis->Terminate();
+}
--- /dev/null
+#ifndef ALIANALYSISSELECTOR_H
+#define ALIANALYSISSELECTOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+// Author: Andrei Gheata, 31/05/2006
+
+//==============================================================================
+// AliAnalysisSelector - Transparent selector class instantiated by an
+// analysis manager object.
+//==============================================================================
+
+#ifndef ROOT_TSelector
+#include "TSelector.h"
+#endif
+
+class AliAnalysisManager;
+
+class AliAnalysisSelector : public TSelector {
+
+protected:
+ Bool_t fInitialized; // Flag that initialization was done
+ AliAnalysisManager *fAnalysis; // Analysis manager to be processed
+
+private:
+ AliAnalysisSelector(const AliAnalysisSelector&); // not implemented
+ AliAnalysisSelector& operator=(const AliAnalysisSelector&); // not implemented
+ void RestoreAnalysisManager();
+
+public:
+ AliAnalysisSelector() : TSelector(), fInitialized(kFALSE), fAnalysis(NULL) {}
+ AliAnalysisSelector(AliAnalysisManager *mgr);
+ virtual ~AliAnalysisSelector();
+
+ virtual int Version() const {return 1;}
+ virtual void Init(TTree *tree);
+ virtual void Begin(TTree *);
+ virtual void SlaveBegin(TTree *tree);
+ virtual Bool_t Notify() {return kTRUE;}
+ virtual Bool_t Process(Long64_t entry);
+ virtual void SlaveTerminate();
+ virtual void Terminate();
+
+ ClassDef(AliAnalysisSelector,0) //A class for processing jobs using AliAnalysisManager
+};
+
+#endif
// To connect a slot to a data container, the data types declared by both must
// match.
//
-// The method Init will be called once per session at the moment when the data is
-// available at all input slots.
-// The method Init() has to be overloaded by the derived class in order to:
-// 1. Define objects that should be created only once per session (e.g. output
-// histograms)
-// 2. Set the branch address or connect to a branch address in case the input
-// slots are connected to trees.
-//
+// The method ConnectInputData() has to be overloaded by the derived class in order to
+// set the branch address or connect to a branch address in case the input
+// slots are connected to trees.
// Example:
-// MyAnalysisTask::Init(Option_t *)
+// MyAnalysisTask::ConnectInputData(Option_t *)
// {
-// if (!fHist1) fHist1 = new TH1F("h1", ....);
-// if (!fHist2) fHist2 = new TH1F("h2", ....);
-// fESD = GetBranchAddress(islot=0, "ESD");
-// if (!fESD) SetBranchAddress(islot=0, "ESD", &fESD);
+// // One should first check if the branch address was taken by some other task
+// char ** address = (char **)GetBranchAddress(0, "ESD");
+// if (address) {
+// fESD = (AliESD*)(*address);
+// } else {
+// fESD = new AliESD();
+// SetBranchAddress(0, "ESD", &fESD);
+// }
+// }
+//
+// The method CreateOutputObjects() has to be overloaded an will contain the
+// objects that should be created only once per session (e.g. output
+// histograms)
+//
+// void MyAnalysisTask::CreateOutputObjects()
+//{
+ // create histograms
+// fhPt = new TH1F("fhPt","This is the Pt distribution",15,0.1,3.1);
+// fhPt->SetStats(kTRUE);
+// fhPt->GetXaxis()->SetTitle("P_{T} [GeV]");
+// fhPt->GetYaxis()->SetTitle("#frac{dN}{dP_{T}}");
+// fhPt->GetXaxis()->SetTitleColor(1);
+// fhPt->SetMarkerStyle(kFullCircle);
// }
//
// The method Terminate() will be called by the framework once at the end of
-// data processing. Overload this if needed.
+// data processing. Overload this if needed. DO NOT ASSUME that the pointers
+// to histograms defined in CreateOutputObjects() are valid, since this is
+// not true in case of PROOF. Restore the pointer values like:
+//
+//void MyAnalysisTask::Terminate(Option_t *)
+//{
+// fhPt = (TH1F*)GetOutputData(0);
+// ...
+//}
+
//
//==============================================================================
#include <Riostream.h>
-#include <TClass.h>
#include <TDirectory.h>
+#include <TClass.h>
-//#include "AliLog.h"
#include "AliAnalysisTask.h"
#include "AliAnalysisDataSlot.h"
#include "AliAnalysisDataContainer.h"
AliAnalysisTask::~AliAnalysisTask()
{
// Dtor.
+ if (fTasks) fTasks->Clear();
if (fInputs) {fInputs->Delete(); delete fInputs;}
if (fOutputs) {fOutputs->Delete(); delete fOutputs;}
}
for (i=0; i<fNinputs; i++) {
slot = (AliAnalysisDataSlot*)fInputs->At(i);
if (!slot) {
- cout<<"Input slot "<<i<<" of task "<<GetName()<<" not defined !"<<endl;
- //AliError(Form("Input slot %i of task %s not defined !",i,GetName()));
+ Error("AreSlotsConnected", "Input slot %d of task %s not defined !",i,GetName());
return kFALSE;
}
if (!slot->IsConnected()) return kFALSE;
for (i=0; i<fNoutputs; i++) {
slot = (AliAnalysisDataSlot*)fOutputs->At(i);
if (!slot) {
- cout<<"Output slot "<<i<<" of task "<<GetName()<<" not defined !"<<endl;
- //AliError(Form("Output slot %i of task %s not defined !",i,GetName()));
+ Error("AreSlotsConnected", "Output slot %d of task %s not defined !",i,GetName());
return kFALSE;
}
if (!slot->IsConnected()) return kFALSE;
SetActive(kTRUE);
if (fInitialized) return;
TDirectory *cursav = gDirectory;
- Init();
+ ConnectInputData();
if (cursav) cursav->cd();
fInitialized = kTRUE;
}
// Connect an input slot to a data container.
AliAnalysisDataSlot *input = GetInputSlot(islot);
if (!input) {
- cout<<"Input slot "<<islot<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Input slot %i not defined for analysis task %s", islot, GetName()));
+ Error("ConnectInput","Input slot %i not defined for analysis task %s", islot, GetName());
return kFALSE;
}
// Check type matching
if (!input->GetType()->InheritsFrom(cont->GetType())) {
- cout<<"Data type "<<input->GetType()->GetName()<<" for input "<<islot<<" of task "<<GetName()<<" not matching container "<<cont->GetName()<<" of type "<<cont->GetType()->GetName()<<endl;
- //AliError(Form("Data type %s for input %i of task %s not matching container %s of type %s",input->GetType()->GetName(), islot, GetName(), cont->GetName(), cont->GetType()->GetName()));
+ Error("ConnectInput","Data type %s for input %i of task %s not matching container %s of type %s",input->GetType()->GetName(), islot, GetName(), cont->GetName(), cont->GetType()->GetName());
return kFALSE;
}
// Connect the slot to the container as input
// Connect an output slot to a data container.
AliAnalysisDataSlot *output = GetOutputSlot(islot);
if (!output) {
- cout<<"Output slot "<<islot<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Output slot %i not defined for analysis task %s", islot, GetName()));
+ Error("ConnectOutput","Output slot %i not defined for analysis task %s", islot, GetName());
return kFALSE;
}
// Check type matching
if (!output->GetType()->InheritsFrom(cont->GetType())) {
- cout<<"Data type "<<output->GetType()->GetName()<<" for output "<<islot<<" of task "<<GetName()<<" not matching container "<<cont->GetName()<<" of type "<<cont->GetType()->GetName()<<endl;
- //AliError(Form("Data type %s for output %i of task %s not matching container %s of type %s",output->GetType()->GetName(), islot, GetName(), cont->GetName(), cont->GetType()->GetName()));
+ Error("ConnectOutput","Data type %s for output %i of task %s not matching container %s of type %s",output->GetType()->GetName(), islot, GetName(), cont->GetName(), cont->GetType()->GetName());
return kFALSE;
}
// Connect the slot to the container as output
void AliAnalysisTask::DefineOutput(Int_t islot, TClass *type)
{
// Define an output slot and its type.
- if (islot<0) {
- cout<<"Cannot define negative output slot number for task "<<GetName()<<endl;
- //AliError(Form("Cannot define negative output slot number for task %s", GetName()));
- return;
- }
AliAnalysisDataSlot *output = new AliAnalysisDataSlot(type, this);
if (fNoutputs<islot+1) {
fNoutputs = islot+1;
// Retreive type of a given input slot.
AliAnalysisDataSlot *input = GetInputSlot(islot);
if (!input) {
- cout<<"Input slot "<<islot<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Input slot %i not defined for analysis task %s", islot, GetName()));
+ Error("GetInputType","Input slot %d not defined for analysis task %s", islot, GetName());
return NULL;
}
return (input->GetType());
// Retreive type of a given output slot.
AliAnalysisDataSlot *output = GetOutputSlot(islot);
if (!output) {
- cout<<"Output slot "<<islot<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Output slot %i not defined for analysis task %s", islot, GetName()));
+ Error("GetOutputType","Output slot %d not defined for analysis task %s", islot, GetName());
return NULL;
}
return (output->GetType());
// the object has to be statically cast to the appropriate type.
AliAnalysisDataSlot *input = GetInputSlot(islot);
if (!input) {
- cout<<"Input slot "<<islot<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Input slot %i not defined for analysis task %s", islot, GetName()));
+ Error("GetInputData","Input slot %d not defined for analysis task %s", islot, GetName());
return NULL;
}
return (input->GetData());
}
+//______________________________________________________________________________
+TObject *AliAnalysisTask::GetOutputData(Int_t islot) const
+{
+// Retreive output data for a slot. Normally called in UserTask::Terminate to
+// get a valid pointer to data even in case of Proof.
+ AliAnalysisDataSlot *output = GetOutputSlot(islot);
+ if (!output) {
+ Error("GetOutputData","Input slot %d not defined for analysis task %s", islot, GetName());
+ return NULL;
+ }
+ return (output->GetData());
+}
+
//______________________________________________________________________________
char *AliAnalysisTask::GetBranchAddress(Int_t islot, const char *branch) const
{
}
//______________________________________________________________________________
-void AliAnalysisTask::Init(Option_t *)
+void AliAnalysisTask::ConnectInputData(Option_t *)
{
-// Branch address initialization.
+// Overload and connect your branches here.
}
//______________________________________________________________________________
-void AliAnalysisTask::Terminate(Option_t *)
+void AliAnalysisTask::CreateOutputObjects()
{
-// Method called by the framework at the end of data processing.
+// Overload and create your output objects here.
}
//______________________________________________________________________________
-void AliAnalysisTask::OpenFile(Int_t iout, const char *name, Option_t *option) const
+void AliAnalysisTask::Terminate(Option_t *)
{
-// Set data at output iout to be written in the specified file.
- GetOutputSlot(iout)->GetContainer()->OpenFile(name, option);
-}
+// Method called by the framework at the end of data processing.
+}
//______________________________________________________________________________
Bool_t AliAnalysisTask::PostData(Int_t iout, TObject *data, Option_t *option)
fPublishedData = 0;
AliAnalysisDataSlot *output = GetOutputSlot(iout);
if (!output) {
- cout<<"Output slot "<<iout<<" not defined for analysis task "<<GetName()<<endl;
- //AliError(Form("Output slot %i not defined for analysis task %s", iout, GetName()));
+ Error("PostData","Output slot %i not defined for analysis task %s", iout, GetName());
return kFALSE;
}
if (!output->IsConnected()) {
- cout<<"Output slot "<<iout<<" of analysis task "<<GetName()<<" not connected to any data container"<<endl;
- //AliError(Form("Output slot %i of analysis task %s not connected to any data container", iout, GetName()));
+ Error("PostData","Output slot %i of analysis task %s not connected to any data container", iout, GetName());
return kFALSE;
}
if (!fOutputReady) {
kTaskZombie = BIT(15),
kTaskChecked = BIT(16)
};
+
+ protected:
+ Bool_t fReady; // Flag if the task is ready
+ Bool_t fInitialized; // True if Init() was called
+ Int_t fNinputs; // Number of inputs
+ Int_t fNoutputs; // Number of outputs
+ Bool_t *fOutputReady; //[fNoutputs] Flags for output readyness
+ TObject *fPublishedData; // !published data
+ TObjArray *fInputs; // Array of input slots
+ TObjArray *fOutputs; // Array of output slots
+
+ // Define the input/output slots (called by user in the ctor of the derived class)
+ //=== CALL IN THE CONSTRUCTOR OF DERIVED CLASS TO DEFINE INPUTS/OUTPUTS ===
+ void DefineInput(Int_t islot, TClass *type);
+ void DefineOutput(Int_t islot, TClass *type);
+ //=====================================================================
+
+ //=====================================================================
+ // === OVERLOAD THIS TO CONNECT TREE BRANCHES AT INPUT SLOTS. YOU
+ // SHOULD DEFINE HERE ALSO THE OBJECTS TO BE CONNECTED TO YOUR OUTPUTS
+ virtual void ConnectInputData(Option_t *option="");
+ //=====================================================================
+
+ // Post output data (called by Exec() when data is ready)
+ //=== CALL IN EXEC() FOR EACH OUTPUT WHEN READY ===
+ Bool_t PostData(Int_t iout, TObject *data, Option_t *option="");
+ //=====================================================================
+ // === USE THIS FIRST IN YOUR Init() TO CHECH IF A BRANCH IS ALREADY CONNECTED
+ // TO SOME ADDRESS.
+ char *GetBranchAddress(Int_t islot, const char *branch) const;
+ // === CALL THIS AFTERWARDS IN Init() IF THE BRANCH ADDRESS IS NOT YET SET
+ Bool_t SetBranchAddress(Int_t islot, const char *branch, void *address) const;
+ //=====================================================================
+ // === CALL THIS IN CreateOutputObjects IF THE OUTPUT IS TO BE WRITTEN AT OUTPUT IOUT
+// void OpenFile(Int_t iout, const char *name, Option_t *option) const;
+
+public:
AliAnalysisTask();
AliAnalysisTask(const char *name, const char *title);
AliAnalysisTask(const AliAnalysisTask &task);
// Assignment
AliAnalysisTask& operator=(const AliAnalysisTask &task);
+ //=====================================================================
+ // === OVERLOAD THIS AND CREATE YOUR OUTPUT OBJECTS (HISTOGRAMS,DATA) HERE
+ virtual void CreateOutputObjects();
// Conect inputs/outputs to data containers (by AliAnalysisModule)
Bool_t ConnectInput(Int_t islot, AliAnalysisDataContainer *cont);
Bool_t ConnectOutput(Int_t islot, AliAnalysisDataContainer *cont);
TClass *GetOutputType(Int_t islot) const;
// === USE THIS TO RETREIVE INPUT DATA AND STATICALLY CAST IT TO THE DECLARED TYPE
TObject *GetInputData(Int_t islot) const;
+ TObject *GetOutputData(Int_t islot) const;
Bool_t IsOutputReady(Int_t islot) const {return fOutputReady[islot];}
Bool_t IsChecked() const {return TObject::TestBit(kTaskChecked);}
Bool_t IsInitialized() const {return fInitialized;}
// === OVERLOAD THIS IF YOU WANT TO DO SOMETHING WITH THE OUTPUT
virtual void Terminate(Option_t *option="");
//=====================================================================
-
- protected:
- // Define the input/output slots (called by user in the ctor of the derived class)
- //=== CALL IN THE CONSTRUCTOR OF DERIVED CLASS TO DEFINE INPUTS/OUTPUTS ===
- void DefineInput(Int_t islot, TClass *type);
- void DefineOutput(Int_t islot, TClass *type);
- //=====================================================================
-
- //=====================================================================
- // === OVERLOAD THIS TO CONNECT TREE BRANCHES AT INPUT SLOTS. YOU
- // SHOULD DEFINE HERE ALSO THE OBJECTS TO BE CONNECTED TO YOUR OUTPUTS
- virtual void Init(Option_t *option="");
- //=====================================================================
-
- // Post output data (called by Exec() when data is ready)
- //=== CALL IN EXEC() FOR EACH OUTPUT WHEN READY ===
- Bool_t PostData(Int_t iout, TObject *data, Option_t *option="");
- //=====================================================================
-
- // === USE THIS FIRST IN YOUR Init() TO CHECH IF A BRANCH IS ALREADY CONNECTED
- // TO SOME ADDRESS.
- char *GetBranchAddress(Int_t islot, const char *branch) const;
- // === CALL THIS AFTERWARDS IN Init() IF THE BRANCH ADDRESS IS NOT YET SET
- Bool_t SetBranchAddress(Int_t islot, const char *branch, void *address) const;
- //=====================================================================
- // === CALL THIS IN INIT IF THE OUTPUT IS TO BE WRITTEN AT OUTPUT IOUT
- void OpenFile(Int_t iout, const char *name, Option_t *option) const;
-
- Bool_t fReady; // Flag if the task is ready
- Bool_t fInitialized; // True if Init() was called
- Int_t fNinputs; // Number of inputs
- Int_t fNoutputs; // Number of outputs
- Bool_t *fOutputReady; //[fNoutputs] Flags for output readyness
- TObject *fPublishedData; // !published data
- TObjArray *fInputs; // Array of input slots
- TObjArray *fOutputs; // Array of output slots
-
- ClassDef(AliAnalysisTask,2) // Class describing an analysis task
+
+ ClassDef(AliAnalysisTask,1) // Class describing an analysis task
};
#endif
+++ /dev/null
-#ifdef __CINT__
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ class AliAnalysisRLContainer+;
-
-#endif
--- /dev/null
+#ifdef __CINT__
+
+#pragma link off all glols;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class TGliteXmlEventlist+;
+
+#pragma link C++ class AliD0toKpi+;
+#pragma link C++ class AliD0toKpiAnalysis+;
+#pragma link C++ class AliRunAnalysis+;
+#pragma link C++ class AliAnalysis+;
+
+#pragma link C++ class AliAOD+;
+#pragma link C++ class AliEventBuffer+;
+#pragma link C++ class AliVAODParticle+;
+#pragma link C++ class AliAODParticle+;
+#pragma link C++ class AliAODPair+;
+
+#pragma link C++ class AliAODRun+;
+
+#pragma link C++ class AliTrackPoints+;
+#pragma link C++ class AliClusterMap+;
+
+#pragma link C++ class AliReader+;
+#pragma link C++ class AliReaderAOD+;
+#pragma link C++ class AliReaderESD+;
+#pragma link C++ class AliReaderESDTree+;
+#pragma link C++ class AliReaderKineTree+;
+
+#pragma link C++ class AliFlowAnalysis+;
+#pragma link C++ class AliMuonAnalysis+;
+
+#pragma link C++ class AliEventCut+;
+#pragma link C++ class AliEventEmptyCut+;
+#pragma link C++ class AliEventBaseCut+;
+
+#pragma link C++ class AliPrimVertexXCut+;
+#pragma link C++ class AliPrimVertexYCut+;
+#pragma link C++ class AliPrimVertexZCut+;
+#pragma link C++ class AliNChargedCut+;
+
+#pragma link C++ class AliAODParticleCut-;
+#pragma link C++ class AliAODParticleEmptyCut-;
+#pragma link C++ class AliAODParticleBaseCut+;
+
+#pragma link C++ class AliAODMomentumCut+;
+#pragma link C++ class AliAODPtCut+;
+#pragma link C++ class AliAODEnergyCut+;
+#pragma link C++ class AliAODRapidityCut+;
+#pragma link C++ class AliAODPseudoRapidityCut+;
+#pragma link C++ class AliAODPxCut+;
+#pragma link C++ class AliAODPyCut+;
+#pragma link C++ class AliAODPzCut+;
+#pragma link C++ class AliAODPhiCut+;
+#pragma link C++ class AliAODThetaCut+;
+#pragma link C++ class AliAODVxCut+;
+#pragma link C++ class AliAODVyCut+;
+#pragma link C++ class AliAODVzCut+;
+#pragma link C++ class AliAODPIDCut+;
+#pragma link C++ class AliAODLogicalOperCut-;
+#pragma link C++ class AliAODAndCut+;
+#pragma link C++ class AliAODOrCut+;
+
+
+#pragma link C++ class AliAODPairCut-;
+#pragma link C++ class AliAODPairEmptyCut-;
+#pragma link C++ class AliAODPairBaseCut+;
+
+#pragma link C++ class AliAODQInvCut+;
+#pragma link C++ class AliAODKtCut+;
+#pragma link C++ class AliAODKStarCut+;
+#pragma link C++ class AliAODKStarOutCut+;
+#pragma link C++ class AliAODKStarSideCut+;
+#pragma link C++ class AliAODKStarLongCut+;
+#pragma link C++ class AliAODQSideLCMSCut+;
+#pragma link C++ class AliAODQOutLCMSCut+;
+#pragma link C++ class AliAODQLongLCMSCut+;
+#pragma link C++ class AliAODDeltaECut+;
+#pragma link C++ class AliAODDeltaPCut+;
+#pragma link C++ class AliAODDeltaPvectorCut+;
+#pragma link C++ class AliAODDeltaPhiCut+;
+#pragma link C++ class AliAODDeltaThetaCut+;
+#pragma link C++ class AliAODAvSeparationCut+;
+#pragma link C++ class AliAODSeparationCut+;
+#pragma link C++ class AliAODITSSeparationCut+;
+#pragma link C++ class AliAODCluterOverlapCut+;
+#pragma link C++ class AliAODOutSideSameSignCut+;
+#pragma link C++ class AliAODOutSideDiffSignCut+;
+#pragma link C++ class AliAODLogicalOperPairCut-;
+#pragma link C++ class AliAODOrPairCut+;
+#pragma link C++ class AliAODAndPairCut+;
+
+#pragma link C++ class AliAODevent+;
+#pragma link C++ class AliAODv0+;
+#pragma link C++ class AliAODxi+;
+
+#pragma link C++ class AliAnalysisEventCuts+;
+#pragma link C++ class AliAnalysisTrackCuts+;
+
+#endif
+++ /dev/null
-#ifdef __CINT__
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ class AliAnalysisDataContainer+;
-#pragma link C++ class AliAnalysisTask+;
-#pragma link C++ class AliAnalysisDataSlot+;
-#pragma link C++ class AliAnalysisManager+;
-
-#pragma link C++ class AliAnalysisGoodies+;
-
-#endif
include $(ROOTSYS)/test/Makefile.arch
-default-target: libANALYSIS_NEW.so
+default-target: libANALYSIS.so
ALICEINC = -I.
endif
endif
-# for building of ANALYSIS_NEW.par
-ifneq ($(ANALYSIS_NEW_INCLUDE),)
- ALICEINC += -I../$(ANALYSIS_NEW_INCLUDE)
+# for building of ANALYSIS.par
+ifneq ($(ANALYSIS_INCLUDE),)
+ ALICEINC += -I../$(ANALYSIS_INCLUDE)
endif
CXXFLAGS += $(ALICEINC) -g
-PACKAGE = ANALYSIS_NEW
+PACKAGE = ANALYSIS
include lib$(PACKAGE).pkg
-DHDR_ANALYSIS_NEW := $(DHDR)
-HDRS_ANALYSIS_NEW := $(HDRS)
-SRCS_ANALYSIS_NEW := $(SRCS) G__$(PACKAGE).cxx
-OBJS_ANALYSIS_NEW := $(SRCS_ANALYSIS_NEW:.cxx=.o)
+DHDR_ANALYSIS := $(DHDR)
+HDRS_ANALYSIS := $(HDRS)
+SRCS_ANALYSIS := $(SRCS) G__$(PACKAGE).cxx
+OBJS_ANALYSIS := $(SRCS_ANALYSIS:.cxx=.o)
PARFILE = $(PACKAGE).par
-lib$(PACKAGE).so: $(OBJS_ANALYSIS_NEW)
+lib$(PACKAGE).so: $(OBJS_ANALYSIS)
@echo "Linking" $@ ...
@/bin/rm -f $@
ifeq ($(PLATFORM),macosx)
$(CXX) $(CXXFLAGS) $(PACKCXXFLAGS) -c $< -o $@
clean:
- @rm -f $(OBJS_ANALYSIS_NEW) *.so G__$(PACKAGE).* $(PARFILE)
+ @rm -f $(OBJS_ANALYSIS) *.so G__$(PACKAGE).* $(PARFILE)
G__$(PACKAGE).cxx G__$(PACKAGE).h: $(HDRS) $(DHDR)
@echo "Generating dictionary ..."
### CREATE PAR FILE
-$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_ANALYSIS_NEW) $(SRCS_ANALYSIS_NEW) $(DHDR_ANALYSIS_NEW) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
+$(PARFILE): $(patsubst %,$(PACKAGE)/%,$(filter-out G__%, $(HDRS_ANALYSIS) $(SRCS_ANALYSIS) $(DHDR_ANALYSIS) Makefile Makefile.arch lib$(PACKAGE).pkg PROOF-INF))
@echo "Creating archive" $@ ...
@tar cfzh $@ $(PACKAGE)
@rm -rf $(PACKAGE)
--- /dev/null
+void SETUP()
+{
+ // Load the ANALYSIS library
+ gSystem->Load("libANALYSIS");
+
+ // Set the Inlucde paths
+ gSystem->SetIncludePath("-I$ROOTSYS/include -IANALYSIS");
+ gROOT->ProcessLine(".include ANALYSIS");
+
+ // Set our location, so that other packages can find us
+ gSystem->Setenv("ANALYSIS_INCLUDE", "ANALYSIS");
+}
+++ /dev/null
-void SETUP()
-{
- // Load the ANALYSIS_NEW library
- gSystem->Load("libANALYSIS_NEW");
-
- // Set the Inlucde paths
- gSystem->SetIncludePath("-I$ROOTSYS/include -IANALYSIS_NEW");
- gROOT->ProcessLine(".include ANALYSIS_NEW");
-
- // Set our location, so that other packages can find us
- gSystem->Setenv("ANALYSIS_NEW_INCLUDE", "ANALYSIS_NEW");
-}
-SRCS= TGliteXmlEventlist.cxx\
- AliAOD.cxx AliEventBuffer.cxx \
- AliRunAnalysis.cxx AliAnalysis.cxx \
- AliVAODParticle.cxx AliAODParticle.cxx \
- AliAODPair.cxx AliAODRun.cxx \
- AliAODParticleCut.cxx AliAODParticleBaseCut.cxx \
- AliAODPairCut.cxx AliAODPairBaseCut.cxx \
- AliEventCut.cxx AliEventBaseCut.cxx \
- AliReader.cxx AliReaderAOD.cxx AliReaderKineTree.cxx \
- AliReaderESD.cxx AliReaderESDTree.cxx \
- AliTrackPoints.cxx AliClusterMap.cxx \
- AliD0toKpi.cxx AliD0toKpiAnalysis.cxx AliFlowAnalysis.cxx \
- AliMuonAnalysis.cxx AliAODv0.cxx AliAODxi.cxx AliAODevent.cxx \
- AliAnalysisEventCuts.cxx AliAnalysisTrackCuts.cxx
+SRCS = AliAnalysisDataContainer.cxx AliAnalysisDataSlot.cxx \
+ AliAnalysisManager.cxx AliAnalysisTask.cxx AliAnalysisGoodies.cxx
-HDRS= $(SRCS:.cxx=.h)
-DHDR:=ANALYSISLinkDef.h
+HDRS:= $(SRCS:.cxx=.h)
+
+DHDR= ANALYSISLinkDef.h
+
+CHECKALIEN = $(shell root-config --has-alien)
+ifeq (yes,$(CHECKALIEN))
+PACKCXXFLAGS := $(CXXFLAGS) -DWITHALIEN
+endif
+EXPORT:=$(SRCS:.cxx=.h)
-EXPORT:=AliAOD.h AliEventBuffer.h\
- AliVAODParticle.h AliAODParticle.h \
- AliAODPair.h AliAODRun.h \
- AliAODPairCut.h AliAODPairBaseCut.h \
- AliAODParticleCut.h AliAODParticleBaseCut.h \
- AliRunAnalysis.h AliAnalysis.h \
- AliEventCut.h AliEventBaseCut.h \
- AliReader.h AliReaderESD.h \
- AliTrackPoints.h AliClusterMap.h \
- AliFlowAnalysis.h AliReaderESDTree.h \
- AliMuonAnalysis.h AliAODv0.h AliAODxi.h AliAODevent.h \
- AliAnalysisEventCuts.h AliAnalysisTrackCuts.h
-EINCLUDE:= TPC ITS
+++ /dev/null
-SRCS= AliAnalysisRLContainer.cxx
-
-HDRS= $(SRCS:.cxx=.h)
-
-DHDR:=AnalysisExtraLinkDef.h
-
-EXPORT:=$(HDRS)
+++ /dev/null
-SRCS = AliAnalysisDataContainer.cxx AliAnalysisDataSlot.cxx \
- AliAnalysisManager.cxx AliAnalysisTask.cxx AliAnalysisGoodies.cxx
-
-
-HDRS:= $(SRCS:.cxx=.h)
-
-DHDR= AnalysisTaskLinkDef.h
-
-CHECKALIEN = $(shell root-config --has-alien)
-ifeq (yes,$(CHECKALIEN))
-PACKCXXFLAGS := $(CXXFLAGS) -DWITHALIEN
-endif
-EXPORT:=$(SRCS:.cxx=.h)
-
-
--- /dev/null
+SRCS= TGliteXmlEventlist.cxx\
+ AliAOD.cxx AliEventBuffer.cxx \
+ AliRunAnalysis.cxx AliAnalysis.cxx \
+ AliVAODParticle.cxx AliAODParticle.cxx \
+ AliAODPair.cxx AliAODRun.cxx \
+ AliAODParticleCut.cxx AliAODParticleBaseCut.cxx \
+ AliAODPairCut.cxx AliAODPairBaseCut.cxx \
+ AliEventCut.cxx AliEventBaseCut.cxx \
+ AliReader.cxx AliReaderAOD.cxx AliReaderKineTree.cxx \
+ AliReaderESD.cxx AliReaderESDTree.cxx \
+ AliTrackPoints.cxx AliClusterMap.cxx \
+ AliD0toKpi.cxx AliD0toKpiAnalysis.cxx AliFlowAnalysis.cxx \
+ AliMuonAnalysis.cxx AliAODv0.cxx AliAODxi.cxx AliAODevent.cxx \
+ AliAnalysisEventCuts.cxx AliAnalysisTrackCuts.cxx
+
+HDRS= $(SRCS:.cxx=.h)
+
+DHDR:=AnalysisOldLinkDef.h
+
+EXPORT:=AliAOD.h AliEventBuffer.h\
+ AliVAODParticle.h AliAODParticle.h \
+ AliAODPair.h AliAODRun.h \
+ AliAODPairCut.h AliAODPairBaseCut.h \
+ AliAODParticleCut.h AliAODParticleBaseCut.h \
+ AliRunAnalysis.h AliAnalysis.h \
+ AliEventCut.h AliEventBaseCut.h \
+ AliReader.h AliReaderESD.h \
+ AliTrackPoints.h AliClusterMap.h \
+ AliFlowAnalysis.h AliReaderESDTree.h \
+ AliMuonAnalysis.h AliAODv0.h AliAODxi.h AliAODevent.h \
+ AliAnalysisEventCuts.h AliAnalysisTrackCuts.h
+
+EINCLUDE:= TPC ITS
timer.Start();
gSystem->AddIncludePath("-I\"$ALICE_ROOT/include\"");
- gSystem->Load("libANALYSIS_NEW.so");
+ gSystem->Load("libANALYSIS.so");
gROOT->LoadMacro("testEvent.C+");
- generate();
+// generate();
filter_reco();
timer.Stop();
// ##### TO RUN THIS MACRO:
// bash$ aliroot (due to AliInfo, AliError, ...)
-// root[0] gSystem->Load("libANALYSIS_NEW");
+// root[0] gSystem->Load("libANALYSIS");
// IN case you do not have the include path set to AliRoot includes:
// root[1] gSystem->AddIncludePath("-I\"$ALICE_ROOT/include\"");
// root[2] .L testEvent.C+;
#include "TClonesArray.h"
#include "TChain.h"
#include "TH1.h"
+#include "TMath.h"
#include "TCanvas.h"
#include "testEvent.h"
void generate()
{
// Simple event generation
- AliAnalysisManager *mgr = new AliAnalysisManager();
+ AliAnalysisManager *mgr = new AliAnalysisManager("generate");
TaskGenerate *task = new TaskGenerate("gener");
mgr->AddTask(task);
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
- mgr->ExecAnalysis();
+ mgr->StartAnalysis();
}
delete mgr;
}
chain->Add("event08000.root");
chain->Add("event10000.root");
// Create an analysis manager
- AliAnalysisManager *mgr = new AliAnalysisManager();
+ AliAnalysisManager *mgr = new AliAnalysisManager("testEvent");
// Create a filter task and register it
TaskFilter *task1 = new TaskFilter("TaskFilter");
mgr->AddTask(task1);
// Create a reco task and register it
+
TaskRecoPi0 *task2 = new TaskRecoPi0("TaskRecoPi0");
mgr->AddTask(task2);
// Create containers for input/output
AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("output1",
TList::Class(), AliAnalysisManager::kOutputContainer);
AliAnalysisDataContainer *coutput = mgr->CreateContainer("output",
- TH1::Class(), AliAnalysisManager::kOutputContainer);
+ TH1::Class(), AliAnalysisManager::kOutputContainer, "output.root");
// Connect containers to the task input/outputs
mgr->ConnectInput(task1,0,cinput);
mgr->ConnectOutput(task1,0,coutput1);
mgr->ConnectOutput(task1,1,coutput2);
mgr->ConnectInput(task2,0,coutput1);
mgr->ConnectOutput(task2,0,coutput);
+
// Connect input data
- cinput->SetData(chain);
+// cinput->SetData(chain);
// Init analysis and start event loop
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
- chain->Process(mgr);
+ mgr->StartAnalysis("local",chain);
}
-// delete mgr;
+ delete mgr;
}
ClassImp(TaskGenerate)
}
//______________________________________________________________________________
-void TaskFilter::Init(Option_t *)
+void TaskFilter::ConnectInputData(Option_t *)
{
// Initialize branches.
- printf(" Init %s\n", GetName());
- if (!fEvent) {
+ printf(" ConnectInputData of task %s\n", GetName());
+ char ** address = (char **)GetBranchAddress(0, "event");
+ if (address) {
// One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "event");
- if (address) fEvent = (AnaEvent*)(*address);
- if (!fEvent) {
- fEvent = new AnaEvent();
- SetBranchAddress(0, "event", &fEvent);
- }
- // The output tree will be written to gammas.root
- TDirectory *dirsav = gDirectory;
- // Open a file for output #0
- OpenFile(0, "gammas.root", "RECREATE");
+ fEvent = (AnaEvent*)(*address);
+ } else {
+ fEvent = new AnaEvent();
+ SetBranchAddress(0, "event", &fEvent);
+ }
+}
+
+//______________________________________________________________________________
+void TaskFilter::CreateOutputObjects()
+{
+ printf(" CreateOutputObjects of task %s\n", GetName());
+ if (!fList) {
fOutput = new TTree("TGAM", "gammas");
TBranch *branch = fOutput->Branch("event", &fEvent, 18000,1);
branch->SetAutoDelete(kFALSE);
- if (dirsav) dirsav->cd();
- }
- if (!fList) {
fList = new TList();
fHist1 = new TH1I("ntracks", "Number of tracks per event", 100, 0, 1000);
fHist1->SetLineColor(kRed);
}
//______________________________________________________________________________
-void TaskRecoPi0::Init(Option_t *)
+void TaskRecoPi0::ConnectInputData(Option_t *)
{
// Initialize branches.
- printf(" Init %s\n", GetName());
+ printf(" ConnectInputData for task %s\n", GetName());
if (!fEvent) {
// One should first check if the branch address was taken by some other task
char ** address = (char **)GetBranchAddress(0, "event");
fEvent = new AnaEvent();
SetBranchAddress(0, "event", &fEvent);
}
- fGammas = new TObjArray();
- fPions = new TObjArray();
}
+}
+
+//______________________________________________________________________________
+void TaskRecoPi0::CreateOutputObjects()
+{
+ printf(" CreateOutputObjects of task %s\n", GetName());
if (!fHist) {
+ fGammas = new TObjArray();
+ fPions = new TObjArray();
fHist = new TH1F("Pt_pi0", "Pt distribution for pi0's", 100, 0., 10.);
fHist->SetLineColor(kRed);
}
virtual ~TaskGenerate() {}
virtual void Exec(Option_t *option);
- ClassDef(TaskGenerate,0) // Simple generator
+ ClassDef(TaskGenerate,1) // Simple generator
};
// The next task is filtering the input events coming from a chain and having
TH1I *fHist1; // Number of gammas per event
TH1I *fHist2; // Number of gammas per event
public:
+ TaskFilter() : AliAnalysisTask(), fEvent(0), fOutput(0), fList(0), fHist1(0), fHist2(0) {}
TaskFilter(const char *name);
virtual ~TaskFilter() {}
- virtual void Init(Option_t *);
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Exec(Option_t *option);
virtual void Terminate(Option_t *);
- ClassDef(TaskFilter,0) // Event filter
+ ClassDef(TaskFilter,1) // Event filter
};
// This task reconstructs pi0's for gammas coming from the same vertex
TObjArray *fPions; // Array of pi0's
TH1F *fHist; // Pt distrib. of reconstructed pions
public:
+ TaskRecoPi0() : AliAnalysisTask(), fEvent(0), fGammas(0), fPions(0), fHist(0) {}
TaskRecoPi0(const char *name);
virtual ~TaskRecoPi0();
- virtual void Init(Option_t *);
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Exec(Option_t *option);
virtual void Terminate(Option_t *);
- ClassDef(TaskRecoPi0,0) // Pi0 reconstructor
+ ClassDef(TaskRecoPi0,1) // Pi0 reconstructor
};
//______________________________________________________________________________
}
//________________________________________________________________________
-void AliAnalysisTaskPt::Init(Option_t *)
+void AliAnalysisTaskPt::ConnectInputData(Option_t *)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
- // create histograms
+}
+//________________________________________________________________________
+void AliAnalysisTaskPt::CreateOutputObjects()
+{
+ // create histograms
fhPt = new TH1F("fhPt","This is the Pt distribution",15,0.1,3.1);
fhPt->SetStats(kTRUE);
fhPt->GetXaxis()->SetTitle("P_{T} [GeV]");
c1->cd(1)->SetLeftMargin(0.15);
c1->cd(1)->SetBottomMargin(0.15);
c1->cd(1)->SetLogy();
- fhPt->DrawCopy("E");
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhPt = (TH1F*)fOutputContainer->At(0);
+ if (fhPt) fhPt->DrawCopy("E");
c1->Print("TracksPt.eps");
AliAnalysisTaskPt(const char *name);
virtual ~AliAnalysisTaskPt() {}
- virtual void Init(Option_t * opt = "");
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Exec(Option_t * opt = "");
virtual void Terminate(Option_t * opt = "");
}
//______________________________________________________________________________
-void AliEMCALQATask::Init(const Option_t*)
+void AliEMCALQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
- // create histograms
+}
+//______________________________________________________________________________
+void AliEMCALQATask::CreateOutputObjects()
+{
+// create histograms
fhEMCALPos = new TNtuple("EMCALPos" , "Position in EMCAL" , "x:y:z");
fhEMCAL = new TNtuple("EMCAL" , "EMCAL" , "event:digits:clusters:photons");
fhEMCALEnergy = new TH1D("EMCALEnergy" , "EMCALEnergy" , 1000, 0., 10. ) ;
void AliEMCALQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
-
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhEMCALEnergy = (TH1D*)fOutputContainer->At(2);
+ fhEMCALDigits = (TH1I*)fOutputContainer->At(3);
+ fhEMCALRecParticles = (TH1D*)fOutputContainer->At(4);
+ fhEMCALPhotons = (TH1I*)fOutputContainer->At(5);
+ fhEMCALInvariantMass = (TH1D*)fOutputContainer->At(6);
+ fhEMCALDigitsEvent = (TH1I*)fOutputContainer->At(7);
printf("EMCALEnergy Mean : %5.3f , RMS : %5.3f \n", fhEMCALEnergy->GetMean(), fhEMCALEnergy->GetRMS() ) ;
printf("EMCALDigits Mean : %5.3f , RMS : %5.3f \n", fhEMCALDigits->GetMean(), fhEMCALDigits->GetRMS() ) ;
printf("EMCALRecParticles Mean : %5.3f , RMS : %5.3f \n", fhEMCALRecParticles->GetMean(), fhEMCALRecParticles->GetRMS() ) ;
virtual ~AliEMCALQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliFMDQATask::Init(const Option_t*)
+void AliFMDQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliFMDQATask::CreateOutputObjects()
+{
// create histograms
fhFMD1i = new TH1D("FMD1i", "FMD1i", 100, -0.5, 3);
fhFMD2i = new TH1D("FMD2i", "FMD2i", 100, -0.5, 3);
{
// Processing when the event loop is ended
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhFMD1i = (TH1D*)fOutputContainer->At(0);
+ fhFMD2i = (TH1D*)fOutputContainer->At(1);
+ fhFMD2o = (TH1D*)fOutputContainer->At(2);
+ fhFMD3i = (TH1D*)fOutputContainer->At(3);
+ fhFMD3o = (TH1D*)fOutputContainer->At(4);
+
TCanvas * cFMD1 = new TCanvas("cFMD1", "FMD ESD Test", 400, 10, 600, 700);
cFMD1->Divide(3, 2) ;
virtual ~AliFMDQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliHMPIDQATask::Init(const Option_t*)
+void AliHMPIDQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliHMPIDQATask::CreateOutputObjects()
+{
// create histograms
fhHMPIDCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]", 150, 0, 7 ,100, -3, 1);
fhHMPIDSigP = new TH2F("SigP" ,"#sigma_{#theta_c}" , 150, 0, 7 ,100, 0, 1e20);
void AliHMPIDQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhHMPIDCkovP = (TH2F*)fOutputContainer->At(0);
+ fhHMPIDSigP = (TH2F*)fOutputContainer->At(1);
+ fhHMPIDMipXY = (TH2F*)fOutputContainer->At(2);
+ fhHMPIDDifXY = (TH2F*)fOutputContainer->At(3);
+ fhHMPIDProb[0] = (TH1F*)fOutputContainer->At(4);
+ fhHMPIDProb[1] = (TH1F*)fOutputContainer->At(5);
+ fhHMPIDProb[2] = (TH1F*)fOutputContainer->At(6);
+ fhHMPIDProb[3] = (TH1F*)fOutputContainer->At(7);
+ fhHMPIDProb[4] = (TH1F*)fOutputContainer->At(8);
Float_t n = 1.292 ; //mean freon ref idx
TF1 * hHMPIDpPi = new TF1("RiPiTheo", "acos(sqrt(x*x+[0]*[0])/(x*[1]))", 1.2, 7) ;
virtual ~AliHMPIDQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliMUONQATask::Init(const Option_t*)
+void AliMUONQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliMUONQATask::CreateOutputObjects()
+{
// create histograms
fhMUONVertex = new TH1F("hMUONVertex","ITS Vertex" ,100, -25., 25.);
fhMUONMult = new TH1F("hMUONMult" ,"Multiplicity of ESD tracks",10, -0.5, 9.5);
// Processing when the event loop is ended
AliInfo(Form("Terminate %s:", GetName())) ;
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhMUONVertex = (TH1F*)fOutputContainer->At(0);
+ fhMUONMult = (TH1F*)fOutputContainer->At(1);
Int_t eff_match = -1 ;
if (ftracktot)
virtual ~AliMUONQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
//______________________________________________________________________________
-void AliPHOSQATask::Init(const Option_t*)
+void AliPHOSQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliPHOSQATask::CreateOutputObjects()
+{
// create histograms
fhPHOSPos = new TNtuple("PHOSPos" , "Position in PHOS" , "x:y:z");
void AliPHOSQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
-
+
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhPHOSPos = (TNtuple*)fOutputContainer->At(0);
+ fhPHOS = (TNtuple*)fOutputContainer->At(1);
+ fhPHOSEnergy = (TH1D*)fOutputContainer->At(2);
+ fhPHOSDigits = (TH1I*)fOutputContainer->At(3);
+ fhPHOSRecParticles = (TH1D*)fOutputContainer->At(4);
+ fhPHOSPhotons = (TH1I*)fOutputContainer->At(5);
+ fhPHOSInvariantMass = (TH1D*)fOutputContainer->At(6);
+ fhPHOSDigitsEvent = (TH1I*)fOutputContainer->At(7);
+
printf("PHOSEnergy Mean : %5.3f , RMS : %5.3f \n", fhPHOSEnergy->GetMean(), fhPHOSEnergy->GetRMS() ) ;
printf("PHOSDigits Mean : %5.3f , RMS : %5.3f \n", fhPHOSDigits->GetMean(), fhPHOSDigits->GetRMS() ) ;
printf("PHOSRecParticles Mean : %5.3f , RMS : %5.3f \n", fhPHOSRecParticles->GetMean(), fhPHOSRecParticles->GetRMS() ) ;
virtual ~AliPHOSQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliPMDQATask::Init(const Option_t*)
+void AliPMDQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
+}
+
+//________________________________________________________________________
+void AliPMDQATask::CreateOutputObjects()
+{
// create histograms
fhPMDP1 = new TH2F("fhPMDP1","XY of Clusters",100,-100.,100.,100,-100.,100.);
void AliPMDQATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
-
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+
+ fhPMDP1 = (TH2F*)fOutputContainer->At(0);
+ fhPMDC2 = (TH1F*)fOutputContainer->At(1);
+ fhPMDP2 = (TH1F*)fOutputContainer->At(2);
+ fhPMDC3 = (TH1F*)fOutputContainer->At(3);
+ fhPMDP3 = (TH1F*)fOutputContainer->At(4);
+ fhPMDP4 = (TH1F*)fOutputContainer->At(5);
+ fhPMDC5 = (TH1F*)fOutputContainer->At(6);
+ fhPMDP5 = (TH1F*)fOutputContainer->At(7);
+ fhPMDCP0 = (TH2F*)fOutputContainer->At(8);
+ fhPMDCP1 = (TH2F*)fOutputContainer->At(9);
+ fhPMDCP2 = (TH2F*)fOutputContainer->At(10);
+ fhPMDCP3 = (TH2F*)fOutputContainer->At(11);
+ fhPMDCP4 = (TH2F*)fOutputContainer->At(12);
+
+ fhPMDSM1 = (TH2F*)fOutputContainer->At(13);
+ fhPMDSM2 = (TH2F*)fOutputContainer->At(14);
+ fhPMDSM3 = (TH2F*)fOutputContainer->At(15);
+ fhPMDSM4 = (TH2F*)fOutputContainer->At(16);
+ fhPMDSM5 = (TH2F*)fOutputContainer->At(17);
+ fhPMDSM6 = (TH2F*)fOutputContainer->At(18);
+ fhPMDSM7 = (TH2F*)fOutputContainer->At(19);
+ fhPMDSM8 = (TH2F*)fOutputContainer->At(20);
+ fhPMDSM9 = (TH2F*)fOutputContainer->At(21);
+ fhPMDSM10 = (TH2F*)fOutputContainer->At(22);
+ fhPMDSM11 = (TH2F*)fOutputContainer->At(23);
+ fhPMDSM12 = (TH2F*)fOutputContainer->At(24);
+ fhPMDSM13 = (TH2F*)fOutputContainer->At(25);
+ fhPMDSM14 = (TH2F*)fOutputContainer->At(26);
+ fhPMDSM15 = (TH2F*)fOutputContainer->At(27);
+ fhPMDSM16 = (TH2F*)fOutputContainer->At(28);
+ fhPMDSM17 = (TH2F*)fOutputContainer->At(29);
+ fhPMDSM18 = (TH2F*)fOutputContainer->At(30);
+ fhPMDSM19 = (TH2F*)fOutputContainer->At(31);
+ fhPMDSM20 = (TH2F*)fOutputContainer->At(32);
+ fhPMDSM21 = (TH2F*)fOutputContainer->At(33);
+ fhPMDSM22 = (TH2F*)fOutputContainer->At(34);
+ fhPMDSM23 = (TH2F*)fOutputContainer->At(35);
+ fhPMDSM24 = (TH2F*)fOutputContainer->At(36);
+ fhPMDSM = (TH1F*)fOutputContainer->At(37);
+
gStyle->SetOptStat(110000);
gStyle->SetOptFit(1);
virtual ~AliPMDQATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliT0QATask::Init(const Option_t*)
+void AliT0QATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir)
- cdir->cd() ;
-
- // create histograms
+}
+//________________________________________________________________________
+void AliT0QATask::CreateOutputObjects()
+{
+ // create histograms
fhT01 = new TH1F("hRealVertex", "Primary vertex", 100, -20, 20);
fhT02 = new TH1F("hT0start", "T0 start time", 100, 12400, 12600);
fhT03 = new TH1F("hT0vertex", "T0vertex", 100, -20, 20);
void AliT0QATask::Terminate(Option_t *)
{
// Processing when the event loop is ended
-
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhT01 = (TH1F*)fOutputContainer->At(0);
+ fhT02 = (TH1F*)fOutputContainer->At(1);
+ fhT03 = (TH1F*)fOutputContainer->At(2);
+
Float_t mean = fhT02->GetMean();
printf ("mean time T0 ps %f\n", mean) ;
virtual ~AliT0QATask() ;
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
return *this;
}
//______________________________________________________________________________
-void AliTOFQATask::Init(const Option_t*)
+void AliTOFQATask::ConnectInputData(const Option_t*)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD") ;
- if (address)
- fESD = (AliESD *)(*address) ;
- if (!fESD)
- fChain->SetBranchAddress("ESD", &fESD) ;
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
+}
+
+//________________________________________________________________________
+void AliTOFQATask::CreateOutputObjects()
+{
+// Create histograms
BookHistos();
}
+
//______________________________________________________________________________
void AliTOFQATask::Exec(Option_t *)
{
}
//______________________________________________________________________________
void AliTOFQATask::BookHistos()
-{
-
- // The output objects will be written to:
- TDirectory * cdir = gDirectory ;
- // Open a file for output #0
- char outputName[1024] ;
- sprintf(outputName, "%s.root", GetName() ) ;
- OpenFile(0, outputName , "RECREATE") ;
- if (cdir) cdir->cd() ;
-
+{
// Construct histograms:
fhTOFMatch=
// some plots
AliInfo("TOF QA Task: End of events loop");
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ fhTOFMatch = (TH1F*)fOutputContainer->At(0);
+ fhESDeffPhi = (TH1F*)fOutputContainer->At(1);
+ fhESDeffTheta = (TH1F*)fOutputContainer->At(2);
+ fhESDeffMom = (TH1F*)fOutputContainer->At(3);
+ fhTOFeffPhi = (TH1F*)fOutputContainer->At(4);
+ fhTOFeffPhiMT = (TH1F*)fOutputContainer->At(5);
+ fhTOFeffTheta = (TH1F*)fOutputContainer->At(6);
+ fhTOFeffThetaMT = (TH1F*)fOutputContainer->At(7);
+ fhTOFeffMom = (TH1F*)fOutputContainer->At(8);
+ fhTOFeffMomMT = (TH1F*)fOutputContainer->At(9);
+ fhTOFsector = (TH1F*)fOutputContainer->At(10);
+ fhTOFsectorMT = (TH1F*)fOutputContainer->At(11);
+ fhTOFTime = (TH1F*)fOutputContainer->At(12);
+ fhTOFDeltaTime = (TH1F*)fOutputContainer->At(13);
+ fhTOFDeltaTimeMT = (TH1F*)fOutputContainer->At(14);
+ fhTOFIDSpecies = (TH1F*)fOutputContainer->At(15);
+ fhTOFMassVsMom = (TH1F*)fOutputContainer->At(16);
+ fhTOFMass = (TH1F*)fOutputContainer->At(17);
GetEfficiency();
- PostData(0, fOutputContainer);
+// PostData(0, fOutputContainer);
DrawHistos() ;
-
}
AliTOFQATask& operator=(const AliTOFQATask & qatask); // assignment operator
virtual ~AliTOFQATask(); //dtor
virtual void Exec(Option_t * opt = "") ;
- virtual void Init(Option_t * opt = "") ;
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "") ;
private:
}
//______________________________________________________________________________
-void AliTRDQATask::Init(const Option_t *)
+void AliTRDQATask::ConnectInputData(const Option_t *)
{
// Initialisation of branch container and histograms
return ;
}
- if (!fESD) {
- // One should first check if the branch address was taken by some other task
- char ** address = (char **)GetBranchAddress(0, "ESD");
- if (address) {
- fESD = (AliESD *)(*address);
- AliInfo("Old ESD found.");
- }
- if (!fESD) {
- fESD = new AliESD();
- SetBranchAddress(0, "ESD", &fESD);
- if (fESD) AliInfo("ESD connected.");
- }
+ // One should first check if the branch address was taken by some other task
+ char ** address = (char **)GetBranchAddress(0, "ESD");
+ if (address) {
+ fESD = (AliESD*)(*address);
+ } else {
+ fESD = new AliESD();
+ SetBranchAddress(0, "ESD", &fESD);
}
- // The output objects will be written to
- TDirectory * cdir = gDirectory ;
- OpenFile(0, Form("%s.root", GetName()), "RECREATE");
- if (cdir)
- cdir->cd() ;
+}
+//________________________________________________________________________
+void AliTRDQATask::CreateOutputObjects()
+{
// create histograms
-
fNTracks = new TH1D("ntracks", ";number of all tracks", 500, -0.5, 499.5);
fEventSize = new TH1D("evSize", ";event size (MB)", 100, 0, 5);
fOutputContainer = new TObjArray(150);
// register histograms to the container
- TIter next(gDirectory->GetList());
- TObject *obj;
int counter = 0;
- while (obj = next.Next()) {
- if (obj->InheritsFrom("TH1")) fOutputContainer->AddAt(obj, counter++);
+ fOutputContainer->AddAt(fNTracks, counter++);
+ fOutputContainer->AddAt(fEventSize, counter++);
+ fOutputContainer->AddAt(fTrackStatus, counter++);
+ fOutputContainer->AddAt(fKinkIndex, counter++);
+ fOutputContainer->AddAt(fParIn, counter++);
+ fOutputContainer->AddAt(fParOut, counter++);
+ fOutputContainer->AddAt(fXIn, counter++);
+ fOutputContainer->AddAt(fXOut, counter++);
+ fOutputContainer->AddAt(fAlpha[0], counter++);
+ fOutputContainer->AddAt(fAlpha[1], counter++);
+ fOutputContainer->AddAt(fAlpha[2], counter++);
+ fOutputContainer->AddAt(fAlpha[3], counter++);
+
+ fOutputContainer->AddAt(fSectorTRD, counter++);
+ for(int i=0; i<nbits; i++) {
+ fOutputContainer->AddAt(fPt[i], counter++);
+ fOutputContainer->AddAt(fTheta[i], counter++);
+ fOutputContainer->AddAt(fSigmaY[i], counter++);
+ fOutputContainer->AddAt(fChi2[i], counter++);
+ fOutputContainer->AddAt(fPlaneYZ[i], counter++);
+ }
+ fOutputContainer->AddAt(fEffPt[0], counter++);
+ fOutputContainer->AddAt(fEffPt[1], counter++);
+ fOutputContainer->AddAt(fEffPt[2], counter++);
+ fOutputContainer->AddAt(fEffPt[3], counter++);
+
+ fOutputContainer->AddAt(fClustersTRD[0], counter++);
+ fOutputContainer->AddAt(fClustersTRD[1], counter++);
+ fOutputContainer->AddAt(fClustersTRD[2], counter++);
+ fOutputContainer->AddAt(fTime, counter++);
+ fOutputContainer->AddAt(fBudget, counter++);
+ fOutputContainer->AddAt(fQuality, counter++);
+ fOutputContainer->AddAt(fSignal, counter++);
+ fOutputContainer->AddAt(fTrdSigMom, counter++);
+ fOutputContainer->AddAt(fTpcSigMom, counter++);
+ for(int i=0; i<6; i++) {
+ fOutputContainer->AddAt(fTpcPID[i], counter++);
+ fOutputContainer->AddAt(fTpcSigMomPID[i], counter++);
+ fOutputContainer->AddAt(fTrdPID[i], counter++);
+ fOutputContainer->AddAt(fTrdSigMomPID[i], counter++);
}
AliInfo(Form("Number of histograms = %d", counter));
{
// Processing when the event loop is ended
AliInfo("TRD QA module");
+ fOutputContainer = (TObjArray*)GetOutputData(0);
+ int counter = 0;
+ fNTracks = (TH1D*)fOutputContainer->At(counter++);
+ fEventSize = (TH1D*)fOutputContainer->At(counter++);
+ fTrackStatus = (TH1D*)fOutputContainer->At(counter++);
+ fKinkIndex = (TH1D*)fOutputContainer->At(counter++);
+ fParIn = (TH1D*)fOutputContainer->At(counter++);
+ fParOut = (TH1D*)fOutputContainer->At(counter++);
+ fXIn = (TH1D*)fOutputContainer->At(counter++);
+ fXOut = (TH1D*)fOutputContainer->At(counter++);
+ fAlpha[0] = (TH1D*)fOutputContainer->At(counter++);
+ fAlpha[1] = (TH1D*)fOutputContainer->At(counter++);
+ fAlpha[2] = (TH1D*)fOutputContainer->At(counter++);
+ fAlpha[3] = (TH1D*)fOutputContainer->At(counter++);
+
+ fSectorTRD = (TH1D*)fOutputContainer->At(counter++);
+ const int nbits = 6;
+ for(int i=0; i<nbits; i++) {
+ fPt[i] = (TH1D*)fOutputContainer->At(counter++);
+ fTheta[i] = (TH1D*)fOutputContainer->At(counter++);
+ fSigmaY[i] = (TH1D*)fOutputContainer->At(counter++);
+ fChi2[i] = (TH1D*)fOutputContainer->At(counter++);
+ fPlaneYZ[i] = (TH2D*)fOutputContainer->At(counter++);
+ }
+ fEffPt[0] = (TH1D*)fOutputContainer->At(counter++);
+ fEffPt[1] = (TH1D*)fOutputContainer->At(counter++);
+ fEffPt[2] = (TH1D*)fOutputContainer->At(counter++);
+ fEffPt[3] = (TH1D*)fOutputContainer->At(counter++);
+
+ fClustersTRD[0] = (TH1D*)fOutputContainer->At(counter++);
+ fClustersTRD[1] = (TH1D*)fOutputContainer->At(counter++);
+ fClustersTRD[2] = (TH1D*)fOutputContainer->At(counter++);
+ fTime = (TH1D*)fOutputContainer->At(counter++);
+ fBudget = (TH1D*)fOutputContainer->At(counter++);
+ fQuality = (TH1D*)fOutputContainer->At(counter++);
+ fSignal = (TH1D*)fOutputContainer->At(counter++);
+ fTrdSigMom = (TH2D*)fOutputContainer->At(counter++);
+ fTpcSigMom = (TH2D*)fOutputContainer->At(counter++);
+ for(int i=0; i<6; i++) {
+ fTpcPID[i] = (TH1D*)fOutputContainer->At(counter++);
+ fTpcSigMomPID[i] = (TH2D*)fOutputContainer->At(counter++);
+ fTrdPID[i] = (TH1D*)fOutputContainer->At(counter++);
+ fTrdSigMomPID[i] = (TH2D*)fOutputContainer->At(counter++);
+ }
// create efficiency histograms
CalculateEff();
- PostData(0, fOutputContainer);
+// PostData(0, fOutputContainer);
DrawESD() ;
DrawGeoESD() ;
virtual ~AliTRDQATask() {}
virtual void Exec(Option_t * opt = "");
- virtual void Init(Option_t * opt = "");
+ virtual void ConnectInputData(Option_t *);
+ virtual void CreateOutputObjects();
virtual void Terminate(Option_t * opt = "");
private:
{
if (! gIsAnalysisLoaded ) {
LoadLib("ESD") ;
- LoadLib("ANALYSIS_NEW") ;
+ LoadLib("ANALYSIS") ;
printf("Include path = %s\n", gSystem->GetIncludePath()) ;
LoadLib("AnalysisCheck") ;
}
//
gSystem->Load("libEG.so");
gSystem->Load("libGeom.so");
- gSystem->Load("libANALYSIS_NEW.so");
+ gSystem->Load("libANALYSIS.so");
gSystem->Load("libESD.so");
gSystem->Load("libJETAN.so");
//
mgr->ConnectInput (jetana,0,cinput1);
mgr->ConnectOutput(jetana,0,coutput1);
- cinput1->SetData(chain1);
+// cinput1->SetData(chain1);
//
// Run the analysis
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
- chain1->Process(mgr);
+// chain1->Process(mgr);
+ mgr->StartAnalysis("local",chain1);
}
}
InputFile= {"LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/AliAnalysisTaskPt.cxx",
"LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/AliAnalysisTaskPt.h",
"LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/ESD.par",
- "LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/ANALYSIS_NEW.par",
+ "LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/ANALYSIS.par",
"LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/demoBatch.C",
"LF:/alice/cern.ch/user/p/pchrist/Tutorial/BATCH/runAnalysis.C"};
gSystem->ChangeDirectory("../");
}
- gSystem->Load("libANALYSIS_NEW.so");
+ gSystem->Load("libANALYSIS.so");
printf("*** Connect to AliEn ***\n");
TGrid::Connect("alien://");
gSystem->Load("libESD.so");
//_____________________________________________________________//
- //_____________Setting up ANALYSIS_NEW.par_____________________//
+ //_____________Setting up ANALYSIS.par_____________________//
//_____________________________________________________________//
- const char* pararchivename2 = "ANALYSIS_NEW";
+ const char* pararchivename2 = "ANALYSIS";
//////////////////////////////////////////
// Libraries required to load
//////////////////////////////////////////
gSystem->ChangeDirectory("../");
}
- gSystem->Load("libANALYSIS_NEW.so");
+ gSystem->Load("libANALYSIS.so");
printf("*** Connect to AliEn ***\n");
TGrid::Connect("alien://");
gSystem->Load("libESD.so");
//_____________________________________________________________//
- //_____________Setting up ANALYSIS_NEW.par_____________________//
+ //_____________Setting up ANALYSIS.par_____________________//
//_____________________________________________________________//
- const char* pararchivename2 = "ANALYSIS_NEW";
+ const char* pararchivename2 = "ANALYSIS";
//////////////////////////////////////////
// Libraries required to load
//////////////////////////////////////////
gSystem->ChangeDirectory("../");
}
- gSystem->Load("libANALYSIS_NEW.so");
+ gSystem->Load("libANALYSIS.so");
gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");
gROOT->LoadMacro("demoLocal.C");
o) Batch
You can find the executable (that you should store under your $HOME/bin AliEn directory), the jdl, the xml collection, as well as the macro runAnalysis.C. You should also use the AliAnalysisTaskPt.* from the Local directory. The macros will be updated slightly (I'll include the usage of the tags) once the new root version will be deployed in AliEn. Everybody who wants to use these files should change them accordingly!!!
-In order to run the examples you should use the ESD.par as well as the ANALYSIS_NEW.par. You can creat both par files by typing "make ESD.par" and "make ANALYSIS_NEW.par" respectively under $ALICE_ROOT.
+In order to run the examples you should use the ESD.par as well as the ANALYSIS_NEW.par. You can creat both par files by typing "make ESD.par" and "make ANALYSIS.par" respectively under $ALICE_ROOT.
===========================================================
For any questions send mails to: Panos.Christakoglou@cern.ch
ALIROOT/module.mk: ALIROOT/binaliroot.pkg
-ANALYSIS/module.mk: ANALYSIS/libANALYSIS.pkg ANALYSIS/libANALYSIS_NEW.pkg ANALYSIS/libANALYSIS_EXTRA.pkg ANALYSIS/libAliengui.pkg ANALYSIS/binaliengui.pkg
+ANALYSIS/module.mk: ANALYSIS/libANALYSIS.pkg ANALYSIS/libAnalysisOld.pkg ANALYSIS/libAliengui.pkg ANALYSIS/binaliengui.pkg
ACORDE/module.mk: ACORDE/libACORDE.pkg
EMCAL/module.mk: EMCAL/libEMCALbase.pkg EMCAL/libEMCALsim.pkg EMCAL/libEMCALrec.pkg
EPEMGEN/module.mk: EPEMGEN/libEPEMGEN.pkg