#include <TSystem.h>
#include <TVirtualMC.h>
#include <TVirtualMCApplication.h>
+#include <TDatime.h>
#include "AliAlignObj.h"
#include "AliCDBEntry.h"
fLoadAlObjsListOfDets("ALL"),
fMakeSDigits("ALL"),
fMakeDigits("ALL"),
- fMakeTrigger(""),
+ fTriggerConfig(""),
fMakeDigitsFromHits(""),
fWriteRawData(""),
fRawDataFileName(""),
fRunQA(kTRUE),
fEventSpecie(AliRecoParam::kDefault),
fWriteQAExpertData(kTRUE),
+ fGeometryFile(),
fRunHLT("default"),
fpHLT(NULL),
fWriteGRPEntry(kTRUE)
}
// Export ideal geometry
- if(!gAlice->IsRootGeometry()) AliGeomManager::GetGeometry()->Export("geometry.root");
+ if(!IsGeometryFromFile()) AliGeomManager::GetGeometry()->Export("geometry.root");
// Load alignment data from CDB and apply to geometry through AliGeomManager
if(fLoadAlignFromCDB){
// run the generation, simulation and digitization
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliSysInfo::AddStamp("Start_Run");
// Load run number and seed from environmental vars
// digits -> trigger
- if (!RunTrigger(fMakeTrigger,fMakeDigits)) {
+ if (!RunTrigger(fTriggerConfig,fMakeDigits)) {
if (fStopOnError) return kFALSE;
}
// run the generation and simulation
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// initialize CDB storage and run number from external environment
// (either CDB manager or AliSimulation setters)
AliPDG::AddParticlesToPdgDataBase();
- gAlice->GetMCApp()->Init();
-
gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
+ gAlice->GetMCApp()->Init();
+
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
{
// run the trigger
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// initialize CDB storage from external environment
// (either CDB manager or AliSimulation setters),
TString trconfiguration = config;
if (trconfiguration.IsNull()) {
- if (strcmp(gAlice->GetTriggerDescriptor(),"")) {
- trconfiguration = gAlice->GetTriggerDescriptor();
+ if(!fTriggerConfig.IsNull()) {
+ trconfiguration = fTriggerConfig;
}
else
AliWarning("No trigger descriptor is specified. Loading the one that is in the CDB.");
{
// run the generation and simulation
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// initialize CDB storage and run number from external environment
// (either CDB manager or AliSimulation setters)
AliPDG::AddParticlesToPdgDataBase();
- gAlice->GetMCApp()->Init();
- AliSysInfo::AddStamp("RunSimulation_InitMCApp");
-
gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
AliSysInfo::AddStamp("RunSimulation_GetField");
+ gAlice->GetMCApp()->Init();
+ AliSysInfo::AddStamp("RunSimulation_InitMCApp");
+
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
AliRunLoader::Instance()->MakeTree("E");
AliSysInfo::AddStamp("RunSimulation_InitLoaders");
//___________________________________________________________________________________________
- // Get the trigger descriptor string
- // Either from AliSimulation or from
- // gAlice
- if (fMakeTrigger.IsNull()) {
- if (strcmp(gAlice->GetTriggerDescriptor(),""))
- fMakeTrigger = gAlice->GetTriggerDescriptor();
- }
- else
- gAlice->SetTriggerDescriptor(fMakeTrigger.Data());
AliSysInfo::AddStamp("RunSimulation_TriggerDescriptor");
// Set run number in CDBManager
{
// run the digitization and produce summable digits
static Int_t eventNr=0;
- AliCodeTimerAuto("") ;
+ AliCodeTimerAuto("",0) ;
// initialize CDB storage, run number, set CDB lock
InitCDB();
{
// run the digitization and produce digits from sdigits
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// initialize CDB storage, run number, set CDB lock
InitCDB();
{
// run the digitization and produce digits from hits
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
// initialize CDB storage, run number, set CDB lock
InitCDB();
// 'selrawdata' flag can be used to enable writing of detectors raw data
// accoring to the trigger cluster.
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliSysInfo::AddStamp("WriteRawData_Start");
TString detStr = detectors;
{
// convert the digits to raw data DDL files
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliRunLoader* runLoader = LoadRun("READ");
if (!runLoader) return kFALSE;
// The second argument is not empty when the user decides to write
// the detectors raw data according to the trigger cluster.
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
char* path = gSystem->Which(gSystem->Getenv("PATH"), "dateStream");
if (!path) {
AliPDG::AddParticlesToPdgDataBase();
- gAlice->GetMCApp()->Init();
-
gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
+ gAlice->GetMCApp()->Init();
+
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
AliRunLoader::Instance()->MakeTree("E");
}
Int_t colon = detAndAction.Index(":") ;
fQADetectors = detAndAction(0, colon) ;
- if (fQADetectors.Contains("ALL") )
- fQADetectors = Form("%s %s", fMakeDigits.Data(), fMakeDigitsFromHits.Data()) ;
- fQATasks = detAndAction(colon+1, detAndAction.Sizeof() ) ;
+ if (fQADetectors.Contains("ALL") ){
+ TString tmp = Form("%s %s", fMakeDigits.Data(), fMakeDigitsFromHits.Data()) ;
+ Int_t minus = fQADetectors.Last('-') ;
+ TString toKeep = Form("%s %s", fMakeDigits.Data(), fMakeDigitsFromHits.Data()) ;
+ TString toRemove("") ;
+ while (minus >= 0) {
+ toRemove = fQADetectors(minus+1, fQADetectors.Length()) ;
+ toRemove = toRemove.Strip() ;
+ toKeep.ReplaceAll(toRemove, "") ;
+ fQADetectors.ReplaceAll(Form("-%s", toRemove.Data()), "") ;
+ minus = fQADetectors.Last('-') ;
+ }
+ fQADetectors = toKeep ;
+ }
+ fQATasks = detAndAction(colon+1, detAndAction.Sizeof() ) ;
if (fQATasks.Contains("ALL") ) {
fQATasks = Form("%d %d %d", AliQAv1::kHITS, AliQAv1::kSDIGITS, AliQAv1::kDIGITS) ;
} else {
grpObj->SetRunType("PHYSICS");
grpObj->SetTimeStart(0);
- grpObj->SetTimeEnd(9999);
+ TDatime curtime;
+ grpObj->SetTimeStart(0);
+ grpObj->SetTimeEnd(curtime.Convert());
+ grpObj->SetBeamEnergyIsSqrtSHalfGeV(); // new format of GRP: store sqrt(s)/2 in GeV
const AliGenerator *gen = gAlice->GetMCApp()->Generator();
if (gen) {
- grpObj->SetBeamEnergy(gen->GetEnergyCMS()/0.120);
+ grpObj->SetBeamEnergy(gen->GetEnergyCMS()/2);
TString projectile;
Int_t a,z;
gen->GetProjectile(projectile,a,z);
}
}
// CTP
- if (!fMakeTrigger.IsNull() || strcmp(gAlice->GetTriggerDescriptor(),""))
+ if (!fTriggerConfig.IsNull())
detectorPattern |= (1 << AliDAQ::DetectorID("TRG"));
// HLT
grpObj->SetDetectorMask((Int_t)detectorPattern);
grpObj->SetLHCPeriod("LHC08c");
grpObj->SetLHCState("STABLE_BEAMS");
- grpObj->SetLHCLuminosity(0,(AliGRPObject::Stats)0);
- grpObj->SetBeamIntensity(0,(AliGRPObject::Stats)0);
//
AliMagF *field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
Float_t solenoidField = field ? TMath::Abs(field->SolenoidField()) : 0;