Changes to configure the TRD calib task when SDD/SSD are not available (Raphaelle...
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Aug 2012 06:46:02 +0000 (06:46 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Aug 2012 06:46:02 +0000 (06:46 +0000)
PWGPP/CalibMacros/CPass1/AddTaskTRDCalib.C

index 9e07885..f83080f 100644 (file)
@@ -22,6 +22,14 @@ AliAnalysisTask  *AddTaskTRDCalib(Int_t runNumber)
     return NULL;
   }
 
+  // check the presence of the detectors
+  AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data");
+  AliGRPObject* grpData = dynamic_cast<AliGRPObject*>(entry->GetObject()); 
+  if (!grpData) {printf("Failed to get GRP data for run",runNumber); return;}
+  Int_t activeDetectors = grpData->GetDetectorMask(); 
+  TString detStr = AliDAQ::ListOfTriggeredDetectors(activeDetectors);
+
+
   ////////////////////////////////////////////
   // Number of timebins
   ///////////////////////////////////////////
@@ -33,6 +41,7 @@ AliAnalysisTask  *AddTaskTRDCalib(Int_t runNumber)
   /////////////////////////////////////////////
   Int_t versiongain, subversiongain, versionvdrift, subversionvdrift;
 
+
   /////////////////////////
   // The TRD calib Task
   /////////////////////////
@@ -76,6 +85,9 @@ AliAnalysisTask  *AddTaskTRDCalib(Int_t runNumber)
   calibTask->SetMinNbOfContributors(1);
   calibTask->SetMaxCluster(100.0);
   calibTask->SetNbMaxCluster(2);
+
+  if ( detStr.Contains("ITSSPD") && (!detStr.Contains("ITSSDD") || !detStr.Contains("ITSSSD"))) calibTask->SetUseSPDVertex();
+
   //calibTask->SetLimitChargeIntegration(kTRUE);