fInitRunNumberCalled(kFALSE),
fSetRunNumberFromDataCalled(kFALSE),
fEmbeddingFlag(kFALSE),
+ fQADetectors("ALL"),
+ fQATasks("ALL"),
fRunQA(kTRUE),
fRunHLT("default")
{
fInitRunNumberCalled(sim.fInitRunNumberCalled),
fSetRunNumberFromDataCalled(sim.fSetRunNumberFromDataCalled),
fEmbeddingFlag(sim.fEmbeddingFlag),
- fRunQA(kTRUE),
+ fQADetectors(sim.fQADetectors),
+ fQATasks(sim.fQATasks),
+ fRunQA(sim.fRunQA),
fRunHLT(sim.fRunHLT)
{
// copy constructor
if (!AliGeomManager::GetGeometry()) {
// Initialize the geometry manager
AliGeomManager::LoadGeometry("geometry.root");
+
+// // Check that the consistency of symbolic names for the activated subdetectors
+// // in the geometry loaded by AliGeomManager
+// AliRunLoader* runLoader = LoadRun("READ");
+// if (!runLoader) return kFALSE;
+//
+// TString detsToBeChecked = "";
+// TObjArray* detArray = runLoader->GetAliRun()->Detectors();
+// for (Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++) {
+// AliModule* det = (AliModule*) detArray->At(iDet);
+// if (!det || !det->IsActive()) continue;
+// detsToBeChecked += det->GetName();
+// detsToBeChecked += " ";
+// } // end loop over detectors
+// if(!AliGeomManager::CheckSymNamesLUT(detsToBeChecked.Data()))
+ if(!AliGeomManager::CheckSymNamesLUT("ALL"))
+ AliFatalClass("Current loaded geometry differs in the definition of symbolic names!");
+
if (!AliGeomManager::GetGeometry()) if (fStopOnError) return kFALSE;
// Misalign geometry
if(!MisalignGeometry()) if (fStopOnError) return kFALSE;
// Misalign geometry
#if ROOT_VERSION_CODE < 331527
AliGeomManager::SetGeometry(gGeoManager);
+
+ // Check that the consistency of symbolic names for the activated subdetectors
+ // in the geometry loaded by AliGeomManager
+ TString detsToBeChecked = "";
+ TObjArray* detArray = runLoader->GetAliRun()->Detectors();
+ for (Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++) {
+ AliModule* det = (AliModule*) detArray->At(iDet);
+ if (!det || !det->IsActive()) continue;
+ detsToBeChecked += det->GetName();
+ detsToBeChecked += " ";
+ } // end loop over detectors
+ if(!AliGeomManager::CheckSymNamesLUT(detsToBeChecked.Data()))
+ AliFatalClass("Current loaded geometry differs in the definition of symbolic names!");
MisalignGeometry(runLoader);
#endif
}
// init the HLT simulation
- if (fRunHLT.CompareTo("default")==0) fRunHLT="";
+ TString options;
+ if (fRunHLT.CompareTo("default")!=0) options=fRunHLT;
+ if (!IsSelected("HLT", fWriteRawData)) {
+ options+=" writerawfiles=";
+ } else {
+ options+=" writerawfiles=HLT";
+ }
AliHLTSimulationInit_t fctInit=(AliHLTSimulationInit_t)(gSystem->DynFindSymbol(ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_INIT));
- if (fctInit==NULL || (iResult=(fctInit(pHLT, pRunLoader, fRunHLT.Data())))<0) {
+ if (fctInit==NULL || (iResult=(fctInit(pHLT, pRunLoader, options.Data())))<0) {
AliError(Form("can not init HLT simulation: error %d (init %p)", iResult, fctInit));
} else {
// run the HLT simulation
AliQADataMakerSteer qas ;
qas.SetRunLoader(gAlice->GetRunLoader()) ;
- Bool_t rv = qas.Run("ALL", AliQA::kHITS) ;
-// qas.Reset() ;
- rv *= qas.Run(fMakeSDigits.Data(), AliQA::kSDIGITS) ;
+ TString detectorsw("") ;
+ Bool_t rv = kTRUE ;
+ if (fQATasks.Contains(Form("%d", AliQA::kHITS)))
+ detectorsw = qas.Run(fQADetectors.Data(), AliQA::kHITS) ;
// qas.Reset() ;
- rv *= qas.Run(fMakeDigits.Data(), AliQA::kDIGITS) ;
+ if (fQATasks.Contains(Form("%d", AliQA::kSDIGITS)))
+ detectorsw += qas.Run(fQADetectors.Data(), AliQA::kSDIGITS) ;
// qas.Reset() ;
- rv *= qas.Run(fMakeDigitsFromHits.Data(), AliQA::kDIGITS) ;
+ if (fQATasks.Contains(Form("%d", AliQA::kDIGITS)))
+ detectorsw += qas.Run(fQADetectors.Data(), AliQA::kDIGITS) ;
+ if ( detectorsw.IsNull() )
+ rv = kFALSE ;
return rv ;
}
+//_____________________________________________________________________________
+Bool_t AliSimulation::SetRunQA(TString detAndAction)
+{
+ // Allows to run QA for a selected set of detectors
+ // and a selected set of tasks among HITS, SDIGITS and DIGITS
+ // all selected detectors run the same selected tasks
+
+ if (!detAndAction.Contains(":")) {
+ AliError( Form("%s is a wrong syntax, use \"DetectorList:ActionList\" \n", detAndAction.Data()) ) ;
+ fRunQA = kFALSE ;
+ return kFALSE ;
+ }
+ 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 (fQATasks.Contains("ALL") ) {
+ fQATasks = Form("%d %d %d", AliQA::kHITS, AliQA::kSDIGITS, AliQA::kDIGITS) ;
+ } else {
+ fQATasks.ToUpper() ;
+ TString tempo("") ;
+ if ( fQATasks.Contains("HIT") )
+ tempo = Form("%d ", AliQA::kHITS) ;
+ if ( fQATasks.Contains("SDIGIT") )
+ tempo += Form("%d ", AliQA::kSDIGITS) ;
+ if ( fQATasks.Contains("DIGIT") )
+ tempo += Form("%d ", AliQA::kDIGITS) ;
+ fQATasks = tempo ;
+ if (fQATasks.IsNull()) {
+ AliInfo("No QA requested\n") ;
+ fRunQA = kFALSE ;
+ return kTRUE ;
+ }
+ }
+ TString tempo(fQATasks) ;
+ tempo.ReplaceAll(Form("%d", AliQA::kHITS), AliQA::GetTaskName(AliQA::kHITS)) ;
+ tempo.ReplaceAll(Form("%d", AliQA::kSDIGITS), AliQA::GetTaskName(AliQA::kSDIGITS)) ;
+ tempo.ReplaceAll(Form("%d", AliQA::kDIGITS), AliQA::GetTaskName(AliQA::kDIGITS)) ;
+ AliInfo( Form("QA will be done on \"%s\" for \"%s\"\n", fQADetectors.Data(), tempo.Data()) ) ;
+ fRunQA = kTRUE ;
+ return kTRUE;
+}
+
//_____________________________________________________________________________
void AliSimulation::ProcessEnvironmentVars()
{
AliInfo(Form("Run number = %d", fRun));
}
+
+