//
// 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
//
////////////////////////////////////////////////////////////////////////
AliRunLoader* Init(TString fileName);
AliTRDdigitizer *InitTRDdigitizer();
-void AliCopy(TFile *inputFile, TFile *outputFile);
// global variables
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) {
}
// TPC
- AliTPC *TPC;
+ AliTPC *TPC = NULL;
if (iTPC) {
TPC = (AliTPC*)gAlice->GetDetector("TPC");
if (!TPC) {
}
// TRD
- AliTRDdigitizer *sdTRD;
+ AliTRDdigitizer *sdTRD = NULL;
if (iTRD) {
sdTRD = InitTRDdigitizer();
}
// PHOS
- AliPHOSSDigitizer *sdPHOS;
+ AliPHOSSDigitizer *sdPHOS = NULL;
if (iPHOS) {
sdPHOS = new AliPHOSSDigitizer(fileName.Data());
}
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();
if (loader)
{
loader->LoadHits("read");
- loader->LoadSDigits("update");
+ loader->LoadSDigits("recreate");
+ TPC->SetTreeAddress();
TPC->SetActiveSectors(1);
TPC->Hits2SDigits2(iEvent);
loader->UnloadHits();
if (loader)
{
loader->LoadHits("read");
- loader->LoadSDigits("update");
+ loader->LoadSDigits("recreate");
sdTRD->MakeDigits();
sdTRD->WriteDigits();
loader->UnloadHits();
timer.Print();
delete rl;
+ return 0;
}
sdTRD->SetParameter(TRDparam);
sdTRD->InitDetector();
- if (!sdTRD->MakeBranch()) {
- cerr<<"Problems with TRD digitizer initialization."<<endl;
- }
return sdTRD;
}
-////////////////////////////////////////////////////////////////////////
-/*void AliCopy(TFile *inputFile, TFile *outputFile) {
-// copy some objects
-
-// copy gAlice
- if (gDEBUG) cout<<"Copy gAlice: ";
- outputFile->cd();
- gAlice->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
- TTree *treeE = gAlice->TreeE();
- if (!treeE) {
- cerr<<"No TreeE found "<<endl;
- return;
- }
-
-// copy TreeE
- if (gDEBUG) cout<<"Copy TreeE: ";
- AliHeader *header = new AliHeader();
- treeE->SetBranchAddress("Header", &header);
- treeE->SetBranchStatus("*",1);
- TTree *treeENew = treeE->CloneTree();
- treeENew->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
-// copy AliceGeom
- if (gDEBUG) cout<<"Copy AliceGeom: ";
- TGeometry *AliceGeom = static_cast<TGeometry*>(inputFile->Get("AliceGeom"));
- if (!AliceGeom) {
- cerr<<"AliceGeom was not found in the input file "<<endl;
- return;
- }
- AliceGeom->Write();
- if (gDEBUG) cout<<"done"<<endl;
-
-}
-*/
#include "AliPDG.h"
#include "TPDGCode.h"
#include "TDatabasePDG.h"
+#include "AliRunLoader.h"
+#include "AliRun.h"
+#include "AliMagF.h"
ClassImp(AliKalmanTrack)
//
// Default constructor
//
- if (fgConvConst==0)
- Fatal("AliKalmanTrack()","The magnetic field has not been set !\n");
+ if (fgConvConst==0) {
+ Warning("AliKalmanTrack()", "The magnetic field has not been set!");
+ SetConvConst();
+ }
fStartTimeIntegral = kFALSE;
fIntegratedLength = 0;
//
// Copy constructor
//
- if (fgConvConst==0)
- Fatal("AliKalmanTrack(const AliKalmanTrack&)",
- "The magnetic field has not been set !\n");
+ if (fgConvConst==0) {
+ Warning("AliKalmanTrack(const AliKalmanTrack&)",
+ "The magnetic field has not been set!");
+ SetConvConst();
+ }
fStartTimeIntegral = t.fStartTimeIntegral;
fIntegratedLength = t.fIntegratedLength;
fIntegratedTime[i] = t.fIntegratedTime[i];
}
+
+//_______________________________________________________________________
+void AliKalmanTrack::SetConvConst()
+{
+ ::Info("SetConvConst()", "tryinig to get the magnetic field from the AliRun object...");
+ AliRunLoader* loader = AliRunLoader::GetRunLoader();
+ if (!loader) ::Fatal("SetConvConst()", "No run loader found");
+ if (!loader->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
{
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
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;
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
--- /dev/null
+////////////////////////////////////////////////////////////////////////
+//
+// 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;
+}
+
///////////////////////////////////////////////////////////////////////////////
//
-// 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;
}
* See cxx source for full Copyright notice */
#include <TObject.h>
-#ifdef __CINT__
-class fstream;
-#else
-#include <Riostream.h>
-#endif
+
struct AliMiniHeader {
UInt_t fSize;
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
};
}
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;i<nInputStreams;i++) {
+ for (i=0;i<nInputStreams;i++) {
new(lInputStreams[i]) AliStream(fgkBaseInFolderName+(Long_t)i,"READ");
}
}
{
fOutRunLoader->SetEventNumber(eventsCreated-1);
}
+ static_cast<AliStream*>(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();
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");
}
/**************************************************************************/
+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
/******************************************/
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
//
// 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
//
////////////////////////////////////////////////////////////////////////
#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 "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
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);
delete manager;
}
-
-////////////////////////////////////////////////////////////////////////
-void AliCopyN(TString inputFileName, TString outputFileName) {
-// copy some objects
-
-}
-////////////////////////////////////////////////////////////////////////
{
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;
}