/*
$Log$
+Revision 1.56 2001/02/14 15:45:20 hristov
+Algorithmic way of getting entry index in fParticleMap. Protection of fParticleFileMap (I.Hrivnacova)
+
Revision 1.55 2001/02/12 15:52:54 buncic
Removed OpenBaseFile().
fTreeE->Write(0,TObject::kOverwrite);
// Write AliRun info and all detectors parameters
- Write();
+ Write(0,TObject::kOverwrite);
// Clean tree information
if (fTreeK) {
//_____________________________________________________________________________
void AliRun::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size, char *file)
{
+ //
+ // Makes branch in given tree and diverts them to a separate file
+ //
if (GetDebug()>1)
printf("* MakeBranch * Making Branch %s \n",name);
//_____________________________________________________________________________
void AliRun::MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address, Int_t size, Int_t splitlevel, char *file)
{
+ //
+ // Makes branch in given tree and diverts them to a separate file
+ //
TDirectory *cwd = gDirectory;
TBranch *branch = tree->Branch(name,classname,address,size,splitlevel);
if (GetDebug()>1)
TIter next(fModules);
AliModule *detector;
while((detector = (AliModule*)next())) {
- if (oH || oR) detector->MakeBranch(option,file);
+ if (oH) detector->MakeBranch(option,file);
}
}
// Create the Root Tree with one branch per detector
+ MakeTree("ESD");
+
if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
- MakeTree("E");
MakeTree("K","Kine.root");
MakeTree("H","Hits.root");
- MakeTree("R","Reco.root");
} else {
- MakeTree("EKHR");
+ MakeTree("KH");
}
gMC->ProcessRun(nevent);
if(nevent>0) FinishRun();
}
+//_____________________________________________________________________________
+void AliRun::RunReco(const char *detector)
+{
+ //
+ // Main function to be called to reconstruct Alice event
+ //
+
+ MakeTree("R");
+ Digits2Reco(detector);
+}
+
//_____________________________________________________________________________
void AliRun::Hits2Digits(const char *selected)
{
+ // Convert Hits to sumable digits
+ //
Hits2SDigits(selected);
SDigits2Digits(selected);
}
+
//_____________________________________________________________________________
-void AliRun::Hits2SDigits(const char *selected)
+void AliRun::Tree2Tree(Option_t *option, const char *selected)
{
//
- // Main function to be called to convert hits to digits.
-
- gAlice->GetEvent(0);
-
- TObjArray *detectors = gAlice->Detectors();
-
- TIter next(detectors);
-
- AliDetector *detector;
+ // Function to transform the content of
+ //
+ // - TreeH to TreeS (option "S")
+ // - TreeS to TreeD (option "D")
+ // - TreeD to TreeR (option "R")
+ //
+ // If multiple options are specified ("SDR"), transformation will be done in sequence for
+ // selected detector and for all detectors if none is selected (detector string
+ // can contain blank separated list of detector names).
- TDirectory *cwd = gDirectory;
- MakeTree("S");
+ char *oS = strstr(option,"S");
+ char *oD = strstr(option,"D");
+ char *oR = strstr(option,"R");
- while((detector = (AliDetector*)next())) {
- if (selected) {
- if (strcmp(detector->GetName(),selected)) continue;
- }
- if (detector->IsActive()){
- if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
- if (GetDebug()>0)
- cout << "Processing " << detector->GetName() << "..." << endl;
- char * outFile = new char[strlen (detector->GetName())+18];
- sprintf(outFile,"SDigits.%s.root",detector->GetName());
- detector->MakeBranch("S",outFile);
- delete outFile;
- } else {
- detector->MakeBranch("S");
- }
- cwd->cd();
- detector->Hits2SDigits();
- }
- }
-}
-
-//_____________________________________________________________________________
-
-void AliRun::SDigits2Digits(const char *selected)
-{
- //
- // Main function to be called to convert hits to digits.
-
gAlice->GetEvent(0);
TObjArray *detectors = gAlice->Detectors();
TIter next(detectors);
- AliDetector *detector;
+ AliDetector *detector = 0;
TDirectory *cwd = gDirectory;
- MakeTree("D");
+ char outFile[32];
while((detector = (AliDetector*)next())) {
- if (selected) {
+ if (selected)
if (strcmp(detector->GetName(),selected)) continue;
- }
if (detector->IsActive()){
- if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
- if (GetDebug()>0)
+ if (GetDebug()>0)
cout << "Processing " << detector->GetName() << "..." << endl;
- char * outFile = new char[strlen (detector->GetName())+16];
- sprintf(outFile,"Digits.%s.root",detector->GetName());
- detector->MakeBranch("D",outFile);
- delete outFile;
+ if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
+ if (oS) {
+ sprintf(outFile,"SDigits.%s.root",detector->GetName());
+ detector->MakeBranch("S",outFile);
+ }
+ if (oD) {
+ sprintf(outFile,"Digits.%s.root",detector->GetName());
+ detector->MakeBranch("D",outFile);
+ }
+ if (oR) {
+ sprintf(outFile,"Reco.%s.root",detector->GetName());
+ detector->MakeBranch("R",outFile);
+ }
} else {
- detector->MakeBranch("D");
- }
- cwd->cd();
- detector->SDigits2Digits();
+ detector->MakeBranch(option);
+ }
+
+ cwd->cd();
+
+ if (oS)
+ detector->Hits2SDigits();
+ if (oD)
+ detector->SDigits2Digits();
+ if (oR)
+ detector->Digits2Reco();
+
+ cwd->cd();
+
}
}
}
+
//_____________________________________________________________________________
void AliRun::RunLego(const char *setup, Int_t nc1, Float_t c1min,
Float_t c1max,Int_t nc2,Float_t c2min,Float_t c2max,
Float_t &tof);
Int_t GetNtrack() const {return fNtrack;}
virtual Int_t GetPrimary(Int_t track) const;
- virtual void Hits2Digits(const char *detector=0);
- virtual void Hits2SDigits(const char *detector=0);
- virtual void SDigits2Digits(const char *detector=0);
+ virtual void Hits2Digits(const char *detector=0);
+ virtual void Hits2SDigits(const char *detector=0) {Tree2Tree("S",detector);}
+ virtual void SDigits2Digits(const char *detector=0) {Tree2Tree("D",detector);}
+ virtual void Digits2Reco(const char *detector=0) {Tree2Tree("R",detector);}
+ virtual void Tree2Tree(Option_t *option, const char *detector=0);
virtual void InitMC(const char *setup="Config.C");
virtual void Init(const char *setup="Config.C") {InitMC(setup);}
Bool_t IsFolder() const {return kTRUE;}
Int_t nc2=60,Float_t c2min=0,Float_t c2max=360,Float_t rmin=0,
Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL);
virtual Bool_t IsLegoRun() const {return (fLego!=0);}
+ virtual void RunReco(const char *detector=0);
virtual void SetCurrentTrack(Int_t track);
virtual void SetDebug(const Int_t level=1) {fDebug = level;}
virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}