//_______________________________________________________________________
AliRun::AliRun():
- fRun(0),
+ fRun(-1),
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
//
AliConfig::Instance();//skowron 29 Feb 2002
//ensures that the folder structure is build
+
}
//_______________________________________________________________________
AliRun::AliRun(const AliRun& arun):
TNamed(arun),
- fRun(0),
+ fRun(-1),
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
//_____________________________________________________________________________
AliRun::AliRun(const char *name, const char *title):
TNamed(name,title),
- fRun(0),
+ fRun(-1),
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
{
// Set the loading of geometry from cdb instead of creating it
// A default CDB storage needs to be set before this method is called
- if(AliCDBManager::Instance()->IsDefaultStorageSet()){
+ if(AliCDBManager::Instance()->IsDefaultStorageSet() &&
+ AliCDBManager::Instance()->GetRun() >= 0){
SetRootGeometry();
fGeometryFromCDB = kTRUE;
}else{
//
// Called at the end of the run.
//
-
+
if(fLego)
{
AliDebug(1, "Finish Lego");
Write(0,TObject::kOverwrite);//write AliRun
fRunLoader->Write(0,TObject::kOverwrite);//write RunLoader itself
- // Clean tree information
- AliDebug(1, "fRunLoader->Stack()->FinishRun()");
- fRunLoader->Stack()->FinishRun();
-
- if(fMCApp) fMCApp->FinishRun();
-
+ if(fMCApp) fMCApp->FinishRun();
fRunLoader->Synchronize();
}
printf(" You are running AliRoot version NewIO\n");
printf("%6s","*");
- printf(" The cvs tag for the current program is $Name$\n");
+ printf(" The SVN version for the current program is $Id$\n");
printf("%6s","*");printf("%64s","*\n");
printf("%70s",
// Set Trees branch addresses
TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next())))
+ AliDetector *detector;
+ while((detector = dynamic_cast<AliDetector*>(next())))
{
detector->SetTreeAddress();
}
//_______________________________________________________________________
TGeometry *AliRun::GetGeometry()
{
+
// Create the TNode geometry for the event display
if (!fGeometry) {
BuildSimpleGeometry();
gROOT->LoadMacro(setup);
gInterpreter->ProcessLine(fConfigFunction.Data());
- // Set the run number in the CDB manager as assigned from
- // constructor or from config file
- AliCDBManager::Instance()->SetRun(GetRunNumber());
+ if(AliCDBManager::Instance()->GetRun() >= 0) {
+ SetRunNumber(AliCDBManager::Instance()->GetRun());
+ } else {
+ AliWarning("Run number not initialized!!");
+ }
fRunLoader->CdGAFile();
-
+
AliPDG::AddParticlesToPdgDataBase();
fNdets = fModules->GetLast()+1;
-
TIter next(fModules);
for(Int_t i=0; i<fNdets; ++i)
{
if (!gener) gener = new AliLegoGenerator();
//
// Configure Generator
+
gener->SetRadiusRange(rmin, rmax);
gener->SetZMax(zmax);
gener->SetCoor1Range(nc1, c1min, c1max);
//Run Lego Object
+
if (fRunLoader) fRunLoader->SetNumberOfEventsPerFile(nev);
- //gMC->ProcessRun(nc1*nc2+1);
gMC->ProcessRun(nev);
// End of this run, close files
//
// Return the value of the magnetic field
//
+
Float_t xfloat[3];
for (Int_t i=0; i<3; i++) xfloat[i] = x[i];
if (Field()) {
+
Float_t bfloat[3];
Field()->Field(xfloat,bfloat);
for (Int_t j=0; j<3; j++) b[j] = bfloat[j];
AliError("No mag field defined!");
b[0]=b[1]=b[2]=0.;
}
+
+
}
//
fNdets++;
}
-// added by Alberto Colla
//_____________________________________________________________________________
/*inline*/ Bool_t AliRun::IsFileAccessible(const char* fnam, EAccessMode mode)
{ return !gSystem->AccessPathName(fnam,mode);}