Disabling TOF (all) and TPC (Gain calibration) if B=0
authorzampolli <chiara.zampolli@cern.ch>
Tue, 9 Sep 2014 08:59:46 +0000 (10:59 +0200)
committerzampolli <chiara.zampolli@cern.ch>
Tue, 9 Sep 2014 08:59:46 +0000 (10:59 +0200)
PWGPP/CalibMacros/CPass0/makeOCDB.C
PWGPP/CalibMacros/CPass1/makeOCDB.C

index c225d32..520aba0 100644 (file)
@@ -66,6 +66,18 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
     AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Correction","local://");
   }
 
+  // Magnetic field
+  AliMagF* fld = TGeoGlobalMagField::Instance()->GetField();
+  Double_t bz = fld->SolenoidField();
+  Bool_t isMagFieldON = kTRUE;
+  if (TMath::Abs(bz)>0) {
+    printf("Mag field is %f --> ON\n", bz);
+  }
+  else {
+    isMagFieldON = kFALSE;
+    printf("Mag field is %f --> OFF\n", bz);
+  }
+
   // TPC part
   AliTPCPreprocessorOffline *procesTPC = 0;
   if (detStr.Contains("TPC")){
@@ -79,7 +91,7 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
 
     // Make timegain calibration
     //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage);
-    procesTPC->CalibTimeGain("CalibObjects.root", runNumber,runNumber,targetStorage);
+    if (isMagFieldON) procesTPC->CalibTimeGain("CalibObjects.root", runNumber,runNumber,targetStorage);
     
     // Make vdrift calibration
     //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage);
@@ -91,7 +103,10 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
   if (detStr.Contains("TOF") && detStr.Contains("TPC")){
     procesTOF = new AliTOFAnalysisTaskCalibPass0;
     Printf("\n******* Calibrating TOF *******");
-    procesTOF->ProcessOutput("CalibObjects.root", targetStorage);
+    if (isMagFieldON) procesTOF->ProcessOutput("CalibObjects.root", targetStorage);
+    else {
+      printf("Not calibrating TOF in case of mag field OFF\n");
+    }
   }
 
   // T0 part
index 6205c9d..6586661 100644 (file)
@@ -66,6 +66,18 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
     AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Correction","local://");
   }
 
+  // Magnetic field
+  AliMagF* fld = TGeoGlobalMagField::Instance()->GetField();
+  Double_t bz = fld->SolenoidField();
+  Bool_t isMagFieldON = kTRUE;
+  if (TMath::Abs(bz)>0) {
+    printf("Mag field is %f --> ON\n", bz);
+  }
+  else {
+    isMagFieldON = kFALSE;
+    printf("Mag field is %f --> OFF\n", bz);
+  }
+
   // TPC part
   AliTPCPreprocessorOffline *procesTPC = 0;
   if (detStr.Contains("TPC")){
@@ -77,7 +89,7 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
     //procesTPC->SetMinTracksVdrift(100000);
     //procesTPC->SwitchOnValidation();
     // Make timegain calibration
-    //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetStorage);
+    //if (isMagFieldON) proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetStorage);
     // Make vdrift calibration
     //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),targetStorage);
   }
@@ -87,7 +99,10 @@ void makeOCDB(Int_t runNumber, TString  targetOCDBstorage="", TString sourceOCDB
   if (detStr.Contains("TOF") && detStr.Contains("TPC")){
     procesTOF = new AliTOFAnalysisTaskCalibPass0;
     Printf("\n******* Calibrating TOF *******");
-    procesTOF->ProcessOutput("CalibObjects.root", targetStorage);
+    if (isMagFieldON) procesTOF->ProcessOutput("CalibObjects.root", targetStorage);
+    else {
+      printf("Not calibrating TOF in case of mag field OFF\n");
+    }
   }
 
   // T0 part