From 8de978942f115630e5e289b29aedb2edf7c551c5 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 23 Jul 2003 07:12:26 +0000 Subject: [PATCH] Shortcut methods in AliRunLoader. AliHits2SDigits.C and AliSDigits2Digits.C adapted to NewIO. New macro AliMerge.C for merging. AliRawReader is now an abstract base class. AliKalmanTrack gets the magnetic field conversion constant from the AliRun object, if it was not yet set (T.Kuhr) --- STEER/AliHits2SDigits.C | 76 +++++----------------- STEER/AliKalmanTrack.cxx | 40 ++++++++++-- STEER/AliKalmanTrack.h | 2 + STEER/AliMerge.C | 73 ++++++++++++++++++++++ STEER/AliRawReader.cxx | 128 ++++++++++++++++---------------------- STEER/AliRawReader.h | 45 ++++++++------ STEER/AliRunDigitizer.cxx | 14 ++--- STEER/AliRunLoader.cxx | 93 +++++++++++++++++++++++++++ STEER/AliRunLoader.h | 7 +++ STEER/AliSDigits2Digits.C | 32 +++------- STEER/AliStream.cxx | 2 +- 11 files changed, 317 insertions(+), 195 deletions(-) create mode 100644 STEER/AliMerge.C diff --git a/STEER/AliHits2SDigits.C b/STEER/AliHits2SDigits.C index 0740bb8713b..fd52832a684 100644 --- a/STEER/AliHits2SDigits.C +++ b/STEER/AliHits2SDigits.C @@ -8,19 +8,17 @@ // // description: // creates sdigits for several detectors -// stores sdigits in separate file (or in the source file -// with hits). Stores gAlice object and copies TE to the -// file with sdigits // // input: -// TString fileNameSDigits ... output file with sdigits -// TString fileNameHits ... input file with hits +// TString fileName ... galice input file // Int_t nEvents ... how many events to proceed // Int_t firstEvent ... first event number // Int_t ITS, TPC, ... many flags for diff. detectors // // History: // +// 21.07.03 - changes for NewIO +// // 04.04.02 - first version // //////////////////////////////////////////////////////////////////////// @@ -49,7 +47,6 @@ AliRunLoader* Init(TString fileName); AliTRDdigitizer *InitTRDdigitizer(); -void AliCopy(TFile *inputFile, TFile *outputFile); // global variables @@ -58,23 +55,18 @@ Bool_t gSameFiles = kFALSE; Int_t gDEBUG = 1; -Int_t AliHits2SDigits(TString fileName="rfio:galice.root", +Int_t AliHits2SDigits(TString fileName="galice.root", Int_t nEvents = 1, Int_t firstEvent = 0, Int_t iITS = 0, - Int_t iTPC = 0, Int_t iTRD = 0,Int_t iPHOS = 0, - Int_t iCopy = 1) + Int_t iTPC = 0, Int_t iTRD = 0,Int_t iPHOS = 0) { // // Initialization // AliRunLoader* rl = Init(fileName); if (!rl) return 1; - if (iCopy) { -// AliCopy(gFileHits,fileSDigits); -// gFileHits->cd(); - } // ITS - AliITS *ITS; + AliITS *ITS = NULL; if (iITS) { ITS = (AliITS*) gAlice->GetModule("ITS"); if (!ITS) { @@ -87,7 +79,7 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", } // TPC - AliTPC *TPC; + AliTPC *TPC = NULL; if (iTPC) { TPC = (AliTPC*)gAlice->GetDetector("TPC"); if (!TPC) { @@ -97,14 +89,14 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", } // TRD - AliTRDdigitizer *sdTRD; + AliTRDdigitizer *sdTRD = NULL; if (iTRD) { sdTRD = InitTRDdigitizer(); } // PHOS - AliPHOSSDigitizer *sdPHOS; + AliPHOSSDigitizer *sdPHOS = NULL; if (iPHOS) { sdPHOS = new AliPHOSSDigitizer(fileName.Data()); } @@ -127,7 +119,9 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", if (loader) { loader->LoadHits("read"); - loader->LoadSDigits("update"); + loader->LoadSDigits("recreate"); + if(!loader->TreeS()) loader->MakeTree("S"); + ITS->MakeBranch("S"); ITS->SetTreeAddress(); ITS->Hits2SDigits(); loader->UnloadHits(); @@ -144,8 +138,9 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", if (loader) { loader->LoadHits("read"); - loader->LoadSDigits("update"); + loader->LoadSDigits("recreate"); + TPC->SetTreeAddress(); TPC->SetActiveSectors(1); TPC->Hits2SDigits2(iEvent); loader->UnloadHits(); @@ -162,7 +157,7 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", if (loader) { loader->LoadHits("read"); - loader->LoadSDigits("update"); + loader->LoadSDigits("recreate"); sdTRD->MakeDigits(); sdTRD->WriteDigits(); loader->UnloadHits(); @@ -186,6 +181,7 @@ Int_t AliHits2SDigits(TString fileName="rfio:galice.root", timer.Print(); delete rl; + return 0; } @@ -217,45 +213,5 @@ AliTRDdigitizer *InitTRDdigitizer() { sdTRD->SetParameter(TRDparam); sdTRD->InitDetector(); - if (!sdTRD->MakeBranch()) { - cerr<<"Problems with TRD digitizer initialization."<cd(); - gAlice->Write(); - if (gDEBUG) cout<<"done"<TreeE(); - if (!treeE) { - cerr<<"No TreeE found "<SetBranchAddress("Header", &header); - treeE->SetBranchStatus("*",1); - TTree *treeENew = treeE->CloneTree(); - treeENew->Write(); - if (gDEBUG) cout<<"done"<(inputFile->Get("AliceGeom")); - if (!AliceGeom) { - cerr<<"AliceGeom was not found in the input file "<Write(); - if (gDEBUG) cout<<"done"<GetAliRun()) loader->LoadgAlice(); + AliRun* alirun = loader->GetAliRun(); + if (!alirun) ::Fatal("SetConvConst()", "No AliRun object found"); + + Double_t field = alirun->Field()->SolenoidField(); + SetConvConst(1000/0.299792458/field); + ::Info("SetConvConst()", "Magnetic field set to %f kGauss\n", field); +} + //_______________________________________________________________________ Double_t AliKalmanTrack::GetX() const { @@ -174,6 +197,13 @@ Double_t AliKalmanTrack::SigmaTheta() const return TMath::Sqrt(TMath::Abs(cov[5])) / (1. + par[3]*par[3]); } //_______________________________________________________________________ +Double_t AliKalmanTrack::Eta() const +{ +// return global eta of track + + return -TMath::Log(TMath::Tan(Theta()/2.)); +} +//_______________________________________________________________________ Double_t AliKalmanTrack::Px() const { // return x component of track momentum diff --git a/STEER/AliKalmanTrack.h b/STEER/AliKalmanTrack.h index 9bb3d110679..f58cf1225eb 100644 --- a/STEER/AliKalmanTrack.h +++ b/STEER/AliKalmanTrack.h @@ -72,6 +72,7 @@ public: virtual Double_t SigmaPhi() const; virtual Double_t Theta() const; virtual Double_t SigmaTheta() const; + virtual Double_t Eta() const; virtual Double_t Px() const; virtual Double_t Py() const; virtual Double_t Pz() const; @@ -85,6 +86,7 @@ public: virtual Int_t Update(const AliCluster*, Double_t /*chi2*/, UInt_t) {return 0;} static void SetConvConst(Double_t cc) {fgConvConst=cc;} + static void SetConvConst(); Double_t GetConvConst() const {return fgConvConst;} static void SetMagneticField(Double_t f) {// f - Magnetic field in T diff --git a/STEER/AliMerge.C b/STEER/AliMerge.C new file mode 100644 index 00000000000..4941f09037d --- /dev/null +++ b/STEER/AliMerge.C @@ -0,0 +1,73 @@ +//////////////////////////////////////////////////////////////////////// +// +// name: AliMerge +// date: 21.07.2003 +// last update: 21.07.2003 +// author: Thomas Kuhr +// version: 1.0 +// +// description: +// merges sdigits from a signal and a background event +// to digits for several detectors +// (for advanced features like more input streams see +// AliRunDigitizer.cxx) +// +// input: +// const char* fileNameSignal : galice file of the signal event +// const char* fileNameBkgrd : galice file of the background event +// Int_t nEvents : how many events to process (<0 means all) +// Int_t signalPerBkgrd : number of signal events merged with +// the same background event +// Int_t ITS, TPC, ... : flags for diff. detectors +// +// History: +// +// 21.07.03 - first version +// +//////////////////////////////////////////////////////////////////////// + +#if !defined(__CINT__) || defined(__MAKECINT__) +#include "STEER/AliRun.h" +#include "STEER/AliRunDigitizer.h" +#include "ITS/AliITSDigitizer.h" +#include "ITS/AliITSFDigitizer.h" +#include "TPC/AliTPCDigitizer.h" +#include "TRD/AliTRDdigitizer.h" +#include "PHOS/AliPHOSDigitizer.h" +#include "MUON/AliMUONDigitizer.h" +#include "RICH/AliRICHDigitizer.h" +#include "TStopwatch.h" +#endif + +Bool_t AliMerge(const char* fileNameSignal = "signal/galice.root", + const char* fileNameBkgrd = "bkgrd/galice.root", + Int_t nEvents = -1, Int_t signalPerBkgrd = 1, + Int_t iITS = 0, Int_t iTPC = 0, Int_t iTRD = 0, + Int_t iPHOS = 0, Int_t iMUON = 0, Int_t iRICH = 0) +{ + if (gAlice) delete gAlice; + gAlice = NULL; + + AliRunDigitizer* manager = new AliRunDigitizer(2, signalPerBkgrd); + manager->SetInputStream(0, fileNameSignal); + manager->SetInputStream(1, fileNameBkgrd); + if (nEvents >= 0) manager->SetNrOfEventsToWrite(nEvents); + + if (iITS == 1) new AliITSDigitizer(manager); + if (iITS == 2) new AliITSFDigitizer(manager); + if (iTPC) new AliTPCDigitizer(manager); + if (iTRD) new AliTRDdigitizer(manager); + if (iPHOS) new AliPHOSDigitizer(manager); + if (iMUON) new AliMUONDigitizer(manager); + if (iRICH) new AliRICHDigitizer(manager); + + TStopwatch timer; + timer.Start(); + manager->Exec("deb all"); + timer.Stop(); + timer.Print(); + + delete manager; + return kTRUE; +} + diff --git a/STEER/AliRawReader.cxx b/STEER/AliRawReader.cxx index 2e2a76be1a5..609cd284c98 100644 --- a/STEER/AliRawReader.cxx +++ b/STEER/AliRawReader.cxx @@ -15,143 +15,119 @@ /////////////////////////////////////////////////////////////////////////////// // -// This is the base class for reading a raw data file and providing +// This is the base class for reading raw data and providing // information about digits // /////////////////////////////////////////////////////////////////////////////// #include "AliRawReader.h" + ClassImp(AliRawReader) -AliRawReader::AliRawReader(const char* fileName, Bool_t addNumber) +AliRawReader::AliRawReader() { -// create an object to read digits from the given input file(s) -// if addNumber is true, a number starting at 1 is appended to the file name - - fFileName = fileName; - if (!addNumber) { - fFileNumber = -1; -#ifndef __DECCXX - fStream = new fstream(fileName, ios::binary|ios::in); -#else - fStream = new fstream(fileName, ios::in); -#endif - } else { - fFileNumber = 0; - fStream = NULL; - OpenNextFile(); - } + fMiniHeader = NULL; fCount = 0; + + fSelectDetectorID = -1; + fSelectMinDDLID = -1; + fSelectMaxDDLID = -1; } -AliRawReader::~AliRawReader() + +void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID) { -// close the input file - - if (fStream) { -#if defined(__HP_aCC) || defined(__DECCXX) - if (fStream->rdbuf()->is_open()) fStream->close(); -#else - if (fStream->is_open()) fStream->close(); -#endif - delete fStream; - } -} +// read only data of the detector with the given ID and in the given +// range of DDLs (minDDLID <= DDLID < maxDDLID). +// no selection is applied if a value < 0 is used. + fSelectDetectorID = detectorID; + fSelectMinDDLID = minDDLID; + fSelectMaxDDLID = maxDDLID; +} -Bool_t AliRawReader::OpenNextFile() +Bool_t AliRawReader::IsSelected() { - if (fStream) { -#if defined(__HP_aCC) || defined(__DECCXX) - if (fStream->rdbuf()->is_open()) fStream->close(); -#else - if (fStream->is_open()) fStream->close(); -#endif - delete fStream; - fStream = NULL; +// apply the selection (if any) + + if (fSelectDetectorID >= 0) { + if (fMiniHeader->fDetectorID != fSelectDetectorID) return kFALSE; + if ((fSelectMinDDLID >= 0) && (fMiniHeader->fDDLID < fSelectMinDDLID)) + return kFALSE; + if ((fSelectMaxDDLID >= 0) && (fMiniHeader->fDDLID >= fSelectMaxDDLID)) + return kFALSE; } - if (fFileNumber < 0) return kFALSE; - - fFileNumber++; - char fileName[256]; - sprintf(fileName, "%s%d", fFileName, fFileNumber); -#ifndef __DECCXX - fStream = new fstream(fileName, ios::binary|ios::in); -#else - fStream = new fstream(fileName, ios::in); -#endif -#if defined(__HP_aCC) || defined(__DECCXX) - return (fStream->rdbuf()->is_open()); -#else - return (fStream->is_open()); -#endif + return kTRUE; } -Bool_t AliRawReader::ReadMiniHeader() +Bool_t AliRawReader::CheckMiniHeader() { -// read a mini header at the current stream position -// returns kFALSE if the mini header could not be read +// check the magic number of the mini header - if (!fStream) return kFALSE; - while (!fStream->read((char*) &fMiniHeader, sizeof(fMiniHeader))) { - if (!OpenNextFile()) return kFALSE; + if ((fMiniHeader->fMagicWord[2] != 0x12) || + (fMiniHeader->fMagicWord[1] != 0x34) || + (fMiniHeader->fMagicWord[0] != 0x56)) { + Error("CheckMiniHeader", "wrong magic word!"); + return kFALSE; } - if ((fMiniHeader.fMagicWord[2] != 0x12) || - (fMiniHeader.fMagicWord[1] != 0x34) || - (fMiniHeader.fMagicWord[0] != 0x56)) - Error("ReadMiniHeader", "wrong magic word!"); - fCount = fMiniHeader.fSize; return kTRUE; } Bool_t AliRawReader::ReadNextInt(UInt_t& data) { -// reads the next 4 bytes at the current stream position -// returns kFALSE if the data not be read +// reads the next 4 bytes at the current position +// returns kFALSE if the data could not be read while (fCount == 0) { if (!ReadMiniHeader()) return kFALSE; } - if (!fStream->read((char*) &data, sizeof(data))) { + if (fCount < (Int_t) sizeof(data)) { + Error("ReadNextInt", + "too few data left (%d bytes) to read an UInt_t!", fCount); + return kFALSE; + } + if (!ReadNext((UChar_t*) &data, sizeof(data))) { Error("ReadNextInt", "could not read data!"); return kFALSE; } - fCount -= sizeof(data); return kTRUE; } Bool_t AliRawReader::ReadNextShort(UShort_t& data) { -// reads the next 2 bytes at the current stream position -// returns kFALSE if the data not be read +// reads the next 2 bytes at the current position +// returns kFALSE if the data could not be read while (fCount == 0) { if (!ReadMiniHeader()) return kFALSE; } - if (!fStream->read((char*) &data, sizeof(data))) { + if (fCount < (Int_t) sizeof(data)) { + Error("ReadNextShort", + "too few data left (%d bytes) to read an UShort_t!", fCount); + return kFALSE; + } + if (!ReadNext((UChar_t*) &data, sizeof(data))) { Error("ReadNextShort", "could not read data!"); return kFALSE; } - fCount -= sizeof(data); return kTRUE; } Bool_t AliRawReader::ReadNextChar(UChar_t& data) { // reads the next 1 byte at the current stream position -// returns kFALSE if the data not be read +// returns kFALSE if the data could not be read while (fCount == 0) { if (!ReadMiniHeader()) return kFALSE; } - if (!fStream->read((char*) &data, sizeof(data))) { + if (!ReadNext((UChar_t*) &data, sizeof(data))) { Error("ReadNextChar", "could not read data!"); return kFALSE; } - fCount -= sizeof(data); return kTRUE; } diff --git a/STEER/AliRawReader.h b/STEER/AliRawReader.h index 020fb9dba8d..cbbe2f51600 100644 --- a/STEER/AliRawReader.h +++ b/STEER/AliRawReader.h @@ -4,11 +4,7 @@ * See cxx source for full Copyright notice */ #include -#ifdef __CINT__ -class fstream; -#else -#include -#endif + struct AliMiniHeader { UInt_t fSize; @@ -21,29 +17,38 @@ struct AliMiniHeader { class AliRawReader: public TObject { public : - AliRawReader(const char* fileName, Bool_t addNumber = kTRUE); - virtual ~AliRawReader(); + AliRawReader(); + + void Select(Int_t detectorID, + Int_t minDDLID = -1, Int_t maxDDLID = -1); - inline Int_t GetDetectorID() const {return fMiniHeader.fDetectorID;}; - inline Int_t GetDDLID() const {return fMiniHeader.fDDLID;}; - inline Int_t GetVersion() const {return fMiniHeader.fVersion;}; - inline Bool_t IsCompressed() const {return fMiniHeader.fCompressionFlag != 0;}; + inline Int_t GetDataSize() const {return fMiniHeader->fSize;}; + inline Int_t GetDetectorID() const {return fMiniHeader->fDetectorID;}; + inline Int_t GetDDLID() const {return fMiniHeader->fDDLID;}; + inline Int_t GetVersion() const {return fMiniHeader->fVersion;}; + inline Bool_t IsCompressed() const {return fMiniHeader->fCompressionFlag != 0;}; - Bool_t ReadNextInt(UInt_t& data); - Bool_t ReadNextShort(UShort_t& data); - Bool_t ReadNextChar(UChar_t& data); + virtual Bool_t ReadMiniHeader() = 0; + virtual Bool_t ReadNextData(UChar_t*& data) = 0; + virtual Bool_t ReadNextInt(UInt_t& data); + virtual Bool_t ReadNextShort(UShort_t& data); + virtual Bool_t ReadNextChar(UChar_t& data); + + virtual Bool_t Reset() = 0; protected : - Bool_t OpenNextFile(); + Bool_t IsSelected(); - Bool_t ReadMiniHeader(); + Bool_t CheckMiniHeader(); + virtual Bool_t ReadNext(UChar_t* data, Int_t size) = 0; - const char* fFileName; // name of input files - Int_t fFileNumber; // number of current input file - fstream* fStream; // stream of raw digits - AliMiniHeader fMiniHeader; // current mini header + AliMiniHeader* fMiniHeader; // current mini header Int_t fCount; // counter of bytes to be read for current DDL + Int_t fSelectDetectorID; // id of selected detector (<0 = no selection) + Int_t fSelectMinDDLID; // minimal index of selected DDLs (<0 = no selection) + Int_t fSelectMaxDDLID; // maximal index of selected DDLs (<0 = no selection) + ClassDef(AliRawReader, 0) // base class for reading raw digits }; diff --git a/STEER/AliRunDigitizer.cxx b/STEER/AliRunDigitizer.cxx index dd56e37c1fe..46e66985777 100644 --- a/STEER/AliRunDigitizer.cxx +++ b/STEER/AliRunDigitizer.cxx @@ -177,13 +177,8 @@ AliRunDigitizer::AliRunDigitizer(Int_t nInputStreams, Int_t sperb): } TClonesArray &lInputStreams = *fInputStreams; - -// the first Input is open RW to be output as well - new(lInputStreams[0]) AliStream(fgkBaseInFolderName + "0","UPDATE"); - //fOutputStream = (AliStream*)lInputStreams.At(0);//redirects output to first input - - for (i=1;iSetEventNumber(eventsCreated-1); } + static_cast(fInputStreams->At(0))->ImportgAlice(); // use gAlice of the first input stream ExecuteTasks(option);// loop over all registered digitizers and let them do the work FinishEvent(); CleanTasks(); @@ -457,8 +453,10 @@ void AliRunDigitizer::FinishGlobal() Error("FinishGlobal","Can not get RunLoader from Output Stream folder"); return; } - GetOutRunLoader()->CdGAFile(); - this->Write(0,TObject::kOverwrite); + TFile* file = TFile::Open(fOutputDirName + "/digitizer.root", "recreate"); + this->Write(); + file->Close(); + delete file; if (fOutRunLoader) { fOutRunLoader->WriteHeader("OVERWRITE"); diff --git a/STEER/AliRunLoader.cxx b/STEER/AliRunLoader.cxx index c3e7f732dca..63b83597669 100644 --- a/STEER/AliRunLoader.cxx +++ b/STEER/AliRunLoader.cxx @@ -1204,6 +1204,99 @@ AliRunLoader* AliRunLoader::GetRunLoader(const char* eventfoldername) } /**************************************************************************/ +AliLoader* AliRunLoader::GetDetectorLoader(const char* detname) +{ +//get the loader of the detector with the given name from the global +//run loader object + AliRunLoader* runLoader = GetRunLoader(); + if (!runLoader) { + cerr << "AliRunLoader::GetDetectorLoader: no run loader found\n"; + return NULL; + } + char loadername[256]; + sprintf(loadername, "%sLoader", detname); + AliLoader* loader = runLoader->GetLoader(loadername); + if (!loader) { + runLoader->Error("GetDetectorLoader", "no loader for %s found", detname); + return NULL; + } + return loader; +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeH(const char* detname, Bool_t maketree) +{ +//get the tree with hits of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeH() && maketree) loader->MakeTree("H"); + return loader->TreeH(); +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeS(const char* detname, Bool_t maketree) +{ +//get the tree with summable digits of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeS() && maketree) loader->MakeTree("S"); + return loader->TreeS(); +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeD(const char* detname, Bool_t maketree) +{ +//get the tree with digits of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeD() && maketree) loader->MakeTree("D"); + return loader->TreeD(); +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeR(const char* detname, Bool_t maketree) +{ +//get the tree with clusters of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeR() && maketree) loader->MakeTree("R"); + return loader->TreeR(); +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeT(const char* detname, Bool_t maketree) +{ +//get the tree with tracks of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeT() && maketree) loader->MakeTree("T"); + return loader->TreeT(); +} + +/**************************************************************************/ + +TTree* AliRunLoader::GetTreeP(const char* detname, Bool_t maketree) +{ +//get the tree with particles of the detector with the given name +//if maketree is true and the tree does not exist, the tree is created + AliLoader* loader = GetDetectorLoader(detname); + if (!loader) return NULL; + if (!loader->TreeP() && maketree) loader->MakeTree("P"); + return loader->TreeP(); +} + +/**************************************************************************/ + void AliRunLoader::CdGAFile() { //sets gDirectory to galice file diff --git a/STEER/AliRunLoader.h b/STEER/AliRunLoader.h index e34bc73de68..ea1634a5e39 100644 --- a/STEER/AliRunLoader.h +++ b/STEER/AliRunLoader.h @@ -198,6 +198,13 @@ class AliRunLoader: public TNamed /******************************************/ static AliRunLoader* GetRunLoader(const char* eventfoldername); static AliRunLoader* GetRunLoader(){return fgRunLoader;} + static AliLoader* GetDetectorLoader(const char* detname); + static TTree* GetTreeH(const char* detname, Bool_t maketree); + static TTree* GetTreeS(const char* detname, Bool_t maketree); + static TTree* GetTreeD(const char* detname, Bool_t maketree); + static TTree* GetTreeR(const char* detname, Bool_t maketree); + static TTree* GetTreeT(const char* detname, Bool_t maketree); + static TTree* GetTreeP(const char* detname, Bool_t maketree); // static AliRunDigitizer* GetRunDigitizer(); // Tasks are supposed to be singletons, that is why following methods are static diff --git a/STEER/AliSDigits2Digits.C b/STEER/AliSDigits2Digits.C index 82c27adb45a..37adc0ce84f 100644 --- a/STEER/AliSDigits2Digits.C +++ b/STEER/AliSDigits2Digits.C @@ -8,18 +8,16 @@ // // description: // creates digits from sdigits for several detectors -// stores sdigits in separate file (or in the source file -// with sdigits). Stores gAlice object and copies TE to the -// file with digits // // input: -// TString fileNameSDigits ... input file with sdigits -// TString fileNameDigits ... output file with digits +// TString input ... galice input file // Int_t nEvents ... how many events to process // Int_t ITS, TPC, ... many flags for diff. detectors // // History: // +// 21.07.03 - changes for NewIO +// // 04.04.02 - first version // //////////////////////////////////////////////////////////////////////// @@ -29,6 +27,7 @@ #include "STEER/AliRun.h" #include "STEER/AliRunDigitizer.h" #include "ITS/AliITSDigitizer.h" +#include "ITS/AliITSFDigitizer.h" #include "TPC/AliTPCDigitizer.h" #include "TRD/AliTRDdigitizer.h" #include "PHOS/AliPHOSDigitizer.h" @@ -37,15 +36,10 @@ #include "TStopwatch.h" #endif -#include "AliHits2SDigits.C" - -void AliCopyN(TString inputFile, TString outputFile); - -Int_t AliSDigits2Digits(TString output="out/galice.root", - TString input="wrk/galice.root", - Int_t nEvents = 1, Int_t iITS = 0, Int_t iTPC = 1, +Int_t AliSDigits2Digits(TString input="galice.root", + Int_t nEvents = 1, Int_t iITS = 0, Int_t iTPC = 0, Int_t iTRD = 0, Int_t iPHOS = 0, Int_t iMUON = 0, - Int_t iRICH = 0, Int_t iCopy = 0) + Int_t iRICH = 0) { // delete the current gAlice object, the one from input file // will be used @@ -57,12 +51,7 @@ Int_t AliSDigits2Digits(TString output="out/galice.root", AliRunDigitizer * manager = new AliRunDigitizer(1,1); manager->SetDebug(1000); manager->SetInputStream(0,input); - if (iCopy) - { -// AliCopyN(fileNameSDigits,fileNameDigits); - } - manager->SetOutputFile(output); manager->SetNrOfEventsToWrite(nEvents); if (iITS == 1) AliITSDigitizer *dITS = new AliITSDigitizer(manager); if (iITS == 2) AliITSFDigitizer *dITS = new AliITSFDigitizer(manager); @@ -79,10 +68,3 @@ Int_t AliSDigits2Digits(TString output="out/galice.root", delete manager; } - -//////////////////////////////////////////////////////////////////////// -void AliCopyN(TString inputFileName, TString outputFileName) { -// copy some objects - -} -//////////////////////////////////////////////////////////////////////// diff --git a/STEER/AliStream.cxx b/STEER/AliStream.cxx index b350e817a22..36e58aab4f0 100644 --- a/STEER/AliStream.cxx +++ b/STEER/AliStream.cxx @@ -109,7 +109,7 @@ Bool_t AliStream::NextEventInStream() { if (!OpenNextFile()) return kFALSE; } - Info("NextEventInStream","Trying to get event ",fLastEventSerialNr+1); + Info("NextEventInStream","Trying to get event %d",fLastEventSerialNr+1); currentloader->GetEvent(++fLastEventSerialNr); return kTRUE; } -- 2.43.5