]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliSimulation.cxx
increased classdef version for added fDebug
[u/mrichter/AliRoot.git] / STEER / AliSimulation.cxx
index 02f3bb9fef47acf6a4efc6810b370dd5688b3985..5e90849687a9bd5cedd83e621ef2edd7d2185859 100644 (file)
@@ -601,7 +601,7 @@ Bool_t AliSimulation::Run(Int_t nEvents)
 // run the generation, simulation and digitization
 
  
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
   AliSysInfo::AddStamp("Start_Run");
   
   // Load run number and seed from environmental vars
@@ -794,7 +794,7 @@ Bool_t AliSimulation::RunLego(const char *setup, Int_t nc1, Float_t c1min,
 
 // run the generation and simulation
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
 
   // initialize CDB storage and run number from external environment
   // (either CDB manager or AliSimulation setters)
@@ -892,7 +892,7 @@ Bool_t AliSimulation::RunTrigger(const char* config, const char* detectors)
 {
   // run the trigger
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
 
   // initialize CDB storage from external environment
   // (either CDB manager or AliSimulation setters),
@@ -955,7 +955,7 @@ Bool_t AliSimulation::RunSimulation(Int_t nEvents)
 {
 // run the generation and simulation
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
 
   // initialize CDB storage and run number from external environment
   // (either CDB manager or AliSimulation setters)
@@ -1148,7 +1148,7 @@ Bool_t AliSimulation::RunSDigitization(const char* detectors)
 {
 // run the digitization and produce summable digits
   static Int_t eventNr=0;
-  AliCodeTimerAuto("") ;
+  AliCodeTimerAuto("",0) ;
 
   // initialize CDB storage, run number, set CDB lock
   InitCDB();
@@ -1190,7 +1190,7 @@ Bool_t AliSimulation::RunDigitization(const char* detectors,
 {
 // run the digitization and produce digits from sdigits
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
 
   // initialize CDB storage, run number, set CDB lock
   InitCDB();
@@ -1256,7 +1256,7 @@ Bool_t AliSimulation::RunHitsDigitization(const char* detectors)
 {
 // run the digitization and produce digits from hits
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
 
   // initialize CDB storage, run number, set CDB lock
   InitCDB();
@@ -1303,7 +1303,7 @@ Bool_t AliSimulation::WriteRawData(const char* detectors,
 // '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;
@@ -1379,7 +1379,7 @@ Bool_t AliSimulation::WriteRawFiles(const char* detectors)
 {
 // convert the digits to raw data DDL files
 
-  AliCodeTimerAuto("")
+  AliCodeTimerAuto("",0)
   
   AliRunLoader* runLoader = LoadRun("READ");
   if (!runLoader) return kFALSE;
@@ -1440,7 +1440,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName,
 // 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) {
@@ -1959,8 +1959,7 @@ Bool_t AliSimulation::CreateHLT()
     return kFALSE;
   }
   if (fctVersion()!= ALIHLTSIMULATION_LIBRARY_VERSION) {
-    AliError(Form("%s version does not match: compiled for version %d, loaded %d", ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_LIBRARY_VERSION, fctVersion()));
-    return kFALSE;
+    AliWarning(Form("%s version does not match: compiled for version %d, loaded %d", ALIHLTSIMULATION_LIBRARY, ALIHLTSIMULATION_LIBRARY_VERSION, fctVersion()));
   }
 
   // print compile info
@@ -2117,9 +2116,21 @@ Bool_t AliSimulation::SetRunQA(TString detAndAction)
        }
        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 {
@@ -2209,7 +2220,7 @@ void AliSimulation::WriteGRPEntry()
 
   const AliGenerator *gen = gAlice->GetMCApp()->Generator();
   if (gen) {
-    grpObj->SetBeamEnergy(gen->GetEnergyCMS());
+    grpObj->SetBeamEnergy(gen->GetEnergyCMS()/0.120);
     TString projectile;
     Int_t a,z;
     gen->GetProjectile(projectile,a,z);
@@ -2263,27 +2274,24 @@ void AliSimulation::WriteGRPEntry()
   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;
-  Float_t factor =        field ? field->Factor() : 0;
-  Float_t l3current = TMath::Abs(factor)*solenoidField*30000./5.;
-  grpObj->SetL3Current(l3current,(AliGRPObject::Stats)0);
-  
-  if (factor > 0) {
-    grpObj->SetL3Polarity(0);
-    grpObj->SetDipolePolarity(0);
-  }
-  else {
-    grpObj->SetL3Polarity(1);
-    grpObj->SetDipolePolarity(1);
-  }
-
-  if (TMath::Abs(factor) != 0)
-    grpObj->SetDipoleCurrent(6000,(AliGRPObject::Stats)0);
-  else 
-    grpObj->SetDipoleCurrent(0,(AliGRPObject::Stats)0);
 
+  Float_t factorSol     = field ? field->GetFactorSol() : 0;
+  Float_t currentSol    = TMath::Abs(factorSol)>1E-6 ? 
+    TMath::Nint(TMath::Abs(solenoidField/factorSol))/5.*30000.*TMath::Abs(factorSol) : 0;
+  //
+  Float_t factorDip     = field ? field->GetFactorDip() : 0;
+  Float_t currentDip    = 6000.*TMath::Abs(factorDip);
+  //
+  grpObj->SetL3Current(currentSol,(AliGRPObject::Stats)0);
+  grpObj->SetDipoleCurrent(currentDip,(AliGRPObject::Stats)0);  
+  grpObj->SetL3Polarity(factorSol>0 ? 0:1);  
+  grpObj->SetDipolePolarity(factorDip>0 ? 0:1);
+  grpObj->SetUniformBMap(field->IsUniform());            // for special MC with k5kGUniform map
+  grpObj->SetPolarityConventionLHC();                    // LHC convention +/+ current -> -/- field main components
+  //
   grpObj->SetCavernTemperature(0,(AliGRPObject::Stats)0);
   
   //grpMap->Add(new TObjString("fCavernPressure"),new TObjString("0")); ---> not inserted in simulation with the new object, since it is now an AliDCSSensor