ofstream outfile;
outfile.open(target);
- while ((obj = iter->Next()))
- outfile << obj->GetTitle() << endl;
+ while ((obj = iter->Next())) {
+ TString fileName(obj->GetTitle());
+
+ fileName.Remove(fileName.Length()-13);
+
+ cout << fileName.Data() << endl;
+ outfile << fileName.Data() << endl;
+ }
outfile.close();
ChainToTextFile(chain, target);
}
+
+
+
+TChain* CreateRawChain(const char* aDataDir, Int_t aRuns = 20) {
+
+ TChain* chain = new TChain("RAW");
+
+ // ########################################################
+ // get the data dir
+ Char_t execDir[256];
+ sprintf(execDir,gSystem->pwd());
+ TSystemDirectory* baseDir = new TSystemDirectory(".",aDataDir);
+ TList* fileList = baseDir->GetListOfFiles();
+ Int_t nFiles = fileList->GetEntries();
+ // go back to the dir where this script is executed
+ gSystem->cd(execDir);
+
+ // ########################################################
+ // loop over files
+ Int_t counter = 0;
+ for (Int_t r=0; r<nFiles; r++) {
+
+ if (counter>aRuns)
+ break;
+
+ TSystemFile* presentFile = (TSystemFile*)fileList->At(r);
+ if (!presentFile || presentFile->IsDirectory())
+ continue;
+
+ if (!(TString(presentFile->GetName()).Contains(".root")))
+ continue;
+
+ counter++;
+
+ //cout << Form("%s/%s",aDataDir,presentFile->GetName()) << endl;
+
+ chain->AddFile(Form("%s/%s",aDataDir,presentFile->GetName()));
+ }
+
+
+
+}
#pragma link C++ class AlidNdEtaSystematicsSelector+;
#pragma link C++ class AliTestESDtrackCutsSelector+;
#pragma link C++ class AliROCESDAnalysisSelector+;
+#pragma link C++ class AliROCRawAnalysisSelector+;
#endif
Int_t detector = cluster->GetDetector();
- if (detector < 0 || detector >= kTPCSectors)
- {
- AliDebug(AliLog::kDebug, Form("We found a cluster from invalid sector %d", detector));
- continue;
+ if (detector < 0 || detector >= kTPCSectors) {
+ AliDebug(AliLog::kDebug, Form("We found a cluster from invalid sector %d", detector));
+ continue;
}
-
+
// TODO: find a clever way to handle the time
// if (fESD->GetTimeStamp()<1160000000)
// continue;
if (!fClusterHistograms[detector])
{
- fClusterHistograms[detector] = new AliTPCClusterHistograms(detector),"",fESD->GetTimeStamp(),fESD->GetTimeStamp()+7*60*60);
+ fClusterHistograms[detector] = new AliTPCClusterHistograms(detector,"",fESD->GetTimeStamp(),fESD->GetTimeStamp()+7*60*60);
}
fClusterHistograms[detector]->FillCluster(cluster, fESD->GetTimeStamp());
--- /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$ */
+
+
+#include "AliROCRawAnalysisSelector.h"
+
+#include <AliLog.h>
+
+#include <TFile.h>
+#include <TTree.h>
+#include <TCanvas.h>
+
+
+ClassImp(AliROCRawAnalysisSelector)
+
+AliROCRawAnalysisSelector::AliROCRawAnalysisSelector() :
+ AliSelector()
+{
+ //
+ // Constructor. Initialization of pointers
+ //
+
+ // for (Int_t i=0; i<kTPCSectors; i++)
+ // fClusterHistograms[i] = 0;
+}
+
+AliROCRawAnalysisSelector::~AliROCRawAnalysisSelector()
+{
+ //
+ // Destructor
+ //
+}
+
+void AliROCRawAnalysisSelector::SlaveBegin(TTree* tree)
+{
+ //
+
+ AliSelector::SlaveBegin(tree);
+}
+
+void AliROCRawAnalysisSelector::Init(TTree *tree)
+{
+ // The Init() function is called when the selector needs to initialize
+ // a new tree or chain. Typically here the branch addresses of the tree
+ // 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.
+
+ AliSelector::Init(tree);
+
+ // Set branch address
+ //if (tree)
+ // tree->SetBranchAddress("rawevent", &fRawEvent);
+
+}
+
+Bool_t AliROCRawAnalysisSelector::Process(Long64_t entry)
+{
+ //
+ // Implement your analysis here. Do not forget to call the parent class Process by
+ // if (AliSelector::Process(entry) == kFALSE)
+ // return kFALSE;
+ //
+
+ if (AliSelector::Process(entry) == kFALSE)
+ return kFALSE;
+
+
+
+ return kTRUE;
+}
+
+void AliROCRawAnalysisSelector::SlaveTerminate()
+{
+ //
+
+ //for (Int_t i=0; i<kTPCSectors; i++)
+ // if (fClusterHistograms[i])
+ // fOutput->Add(fClusterHistograms[i]);
+}
+
+void AliROCRawAnalysisSelector::Terminate()
+{
+ // TODO read from output list for PROOF
+
+ TFile* file = TFile::Open("rocRaw.root", "RECREATE");
+
+ // for (Int_t i=0; i<kTPCSectors; i++)
+ // if (fClusterHistograms[i])
+ // fClusterHistograms[i]->SaveHistograms();
+
+ file->Close();
+}
--- /dev/null
+/* $Id$ */
+
+#ifndef AliROCRawAnalysisSelector_H
+#define AliROCRawAnalysisSelector_H
+
+#include "AliSelector.h"
+
+
+//
+// TODO explain this
+//
+
+class AliROCRawAnalysisSelector : public AliSelector {
+ public:
+
+ AliROCRawAnalysisSelector();
+ virtual ~AliROCRawAnalysisSelector();
+
+ virtual void SlaveBegin(TTree* tree);
+ virtual void Init(TTree *tree);
+ virtual Bool_t Process(Long64_t entry);
+ virtual void SlaveTerminate();
+ virtual void Terminate();
+
+ protected:
+
+
+
+ private:
+ AliROCRawAnalysisSelector(const AliROCRawAnalysisSelector&);
+ AliROCRawAnalysisSelector& operator=(const AliROCRawAnalysisSelector&);
+
+ ClassDef(AliROCRawAnalysisSelector, 0);
+};
+
+#endif
--- /dev/null
+/* $Id$ */
+
+//
+//
+//
+
+#include "../CreateESDChain.C"
+#include "../PWG0Helper.C"
+
+void runROCESDAnalysis(Char_t* dataDir, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE,
+ const char* option = "", const char* proofServer = "jgrosseo@lxb6046")
+{
+ if (aProof)
+ connectProof(proofServer);
+
+ TString libraries("libEG;libGeom;libPWG0base");
+ TString packages;
+
+ if (!prepareQuery(libraries, packages, 2))
+ return;
+
+ TChain* chain = CreateRawChain(dataDir, nRuns);
+
+ TList inputList;
+
+ TString selectorName = "AliROCESDAnalysisSelector";
+ AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
+
+ if (aDebug != kFALSE)
+ {
+ AliLog::SetClassDebugLevel(selectorName, AliLog::kDebug);
+ selectorName += ".cxx+g";
+ }
+ else
+ selectorName += ".cxx+";
+
+ Int_t result = executeQuery(chain, &inputList, selectorName, option);
+}
dNdEta/AliMultiplicityMCSelector.h \
dNdEta/AlidNdEtaSystematicsSelector.h \
esdTrackCuts/AliTestESDtrackCutsSelector.h \
- TPC/AliROCESDAnalysisSelector.h
+ TPC/AliROCESDAnalysisSelector.h \
+ TPC/AliROCRawAnalysisSelector.h
SRCS = $(HDRS:.h=.cxx)