TObject(),
ftagresult(0x0),
fTagDirName(),
- fChain(0x0)
+ fChain(0x0),
+ fAnalysisType()
{
//Default constructor for a AliTagAnalysis
}
//___________________________________________________________________________
+AliTagAnalysis::AliTagAnalysis(const char* type):
+ TObject(),
+ ftagresult(0x0),
+ fTagDirName(),
+ fChain(0x0),
+ fAnalysisType(type)
+{
+ //constructor for a AliTagAnalysis
+}
+
+//___________________________________________________________________________
AliTagAnalysis::~AliTagAnalysis() {
//Default destructor for a AliTagAnalysis
}
TString fTagFilename;
if (! fChain) fChain = new TChain("T");
-
- const char * tagPattern = "tag.root";
+ const char * tagPattern = 0x0;
+ if(fAnalysisType == "ESD") tagPattern = "ESD.tag.root";
+ else if(fAnalysisType == "AOD") tagPattern = "AOD.tag.root";
+ else AliFatal("Only ESD and AOD type is implemented!!!");
+
// Open the working directory
void * dirp = gSystem->OpenDirectory(fTagDirName);
const char * name = 0x0;
//and returns a TChain along with the associated TEventList
AliInfo(Form("Querying the tags........"));
- TString fAliceFile = "esdTree";
+ TString fAliceFile;
+ if(fAnalysisType == "ESD") fAliceFile = "esdTree";
+ else if(fAnalysisType == "AOD") fAliceFile = "aodTree";
+ else AliFatal("Only ESD and AOD type is implemented!!!");
//ESD file chain
TChain *fESDchain = new TChain(fAliceFile.Data());
//and returns a TChain along with the associated TEventList
AliInfo(Form("Querying the tags........"));
- TString fAliceFile = "esdTree";
+ TString fAliceFile;
+ if(fAnalysisType == "ESD") fAliceFile = "esdTree";
+ else if(fAnalysisType == "AOD") fAliceFile = "aodTree";
+ else AliFatal("Only ESD and AOD type is implemented!!!");
//ESD file chain
TChain *fESDchain = new TChain(fAliceFile.Data());
// improvements are committed
TString fsystem = system;
Int_t iAccepted = 0;
- //ESD file chain
- TChain *fESDchain = new TChain("esdTree");
+
+ TChain *fAnalysisChain = new TChain();
+ if(fAnalysisType == "ESD") fAnalysisChain->SetName("esdTree");
+ else if(fAnalysisType == "AOD") fAnalysisChain->SetName("aodTree");
+ else AliFatal("Only ESD and AOD type is implemented!!!");
+
//Event list
TEventList *fEventList = new TEventList();
AliXMLCollection *collection = AliXMLCollection::Open(wn);
collection->Reset();
while (collection->Next()) {
AliInfo(Form("Adding: %s",collection->GetTURL("")));
- fESDchain->Add(collection->GetTURL(""));
+ fAnalysisChain->Add(collection->GetTURL(""));
TEntryList *list = (TEntryList *)collection->GetEventList("");
for(Int_t i = 0; i < list->GetN(); i++) fEventList->Enter(iAccepted+list->GetEntry(i));
else if(fsystem == "PbPb") iAccepted += 1;
}
- fESDchain->SetEventList(fEventList);
+ fAnalysisChain->SetEventList(fEventList);
AliInfo(Form("Number of selected events: %d",fEventList->GetN()));
- return fESDchain;
+ return fAnalysisChain;
}
//___________________________________________________________________________
TString fAliceFile = treename;
Int_t iAccepted = 0;
TChain *fAnalysisChain = new TChain();
- if(fAliceFile == "esdTree") {
- //ESD file chain
- fAnalysisChain->SetName("esdTree");
- } else if(fAliceFile == "aodTree") {
- //AOD file chain
- fAnalysisChain->SetName("aodTree");
- AliFatal("AOD case not yet implemented!!!");
- }
+ if(fAliceFile == "esdTree") fAnalysisChain->SetName("esdTree");
+ else if(fAliceFile == "aodTree") fAnalysisChain->SetName("aodTree");
else AliFatal("Inconsistent tree name - use esdTree or aodTree!");
+
//Event list
TEntryList *fGlobalList = new TEntryList();
AliXMLCollection *collection = AliXMLCollection::Open(collectionname);