All Data Points protected in case no DP is present!
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Sep 2008 18:15:19 +0000 (18:15 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Sep 2008 18:15:19 +0000 (18:15 +0000)
HMPID/AliHMPIDPreprocessor.cxx

index 799bc1b..8f2a725 100644 (file)
@@ -120,37 +120,47 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
   
   for(Int_t iCh=0;iCh<7;iCh++){                   
     TObjArray *pP =(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWPC.actual.value",iCh,iCh,iCh));
-      Log(Form(" Pressure for module %i data             ---> %3i entries",iCh,pP->GetEntries()));
-    if(pP->GetEntries()) {
-      TIter nextP(pP);    
-      TGraph *pGrP=new TGraph; cnt=0; 
-      while((pVal=(AliDCSValue*)nextP())) pGrP->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //P
-      if( cnt==1) {
-        pGrP->GetPoint(0,xP,yP);
-        new TF1(Form("P%i",iCh),Form("%f",yP),fStartTime,fEndTime);
-      } else {
-        pGrP->Fit(new TF1(Form("P%i",iCh),"[0] + x*[1]",fStartTime,fEndTime),"Q");
-      }
-      delete pGrP;
-    } else {AliWarning(" No Data Points from HMP_MP0-6_GAS_PMWPC.actual.value!");return kFALSE;}
+    if(!pP) {
+      AliWarning(Form(" No Data Points from HMP_MP%1i_GAS_PMWPC.actual.value!",iCh));
+      return kFALSE;
+    } else {
+        Log(Form(" Pressure for module %i data             ---> %3i entries",iCh,pP->GetEntries()));
+      if(pP->GetEntries()) {
+        TIter nextP(pP);    
+        TGraph *pGrP=new TGraph; cnt=0; 
+        while((pVal=(AliDCSValue*)nextP())) pGrP->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //P
+        if( cnt==1) {
+          pGrP->GetPoint(0,xP,yP);
+          new TF1(Form("P%i",iCh),Form("%f",yP),fStartTime,fEndTime);
+        } else {
+          pGrP->Fit(new TF1(Form("P%i",iCh),"[0] + x*[1]",fStartTime,fEndTime),"Q");
+        }
+        delete pGrP;
+      } else {AliWarning(" No Data Points from HMP_MP0-6_GAS_PMWPC.actual.value!");return kFALSE;}
+    }
     
 // evaluate High Voltage
     
     for(Int_t iSec=0;iSec<6;iSec++){
       TObjArray *pHV=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC%i/HMP_MP%i_SEC%i_HV.actual.vMon",iCh,iCh,iCh,iSec,iCh,iSec));
-      Log(Form(" HV for module %i and secto %i data       ---> %3i entries",iCh,iSec,pHV->GetEntries()));
-      if(pHV->GetEntries()) {
-        TIter nextHV(pHV);
-        TGraph *pGrHV=new TGraph; cnt=0;
-        while((pVal=(AliDCSValue*)nextHV())) pGrHV->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //HV
-        if( cnt==1) {
-          pGrHV->GetPoint(0,xP,yP);
-          new TF1(Form("HV%i_%i",iCh,iSec),Form("%f",yP),fStartTime,fEndTime);               
-        } else {
-          pGrHV->Fit(new TF1(Form("HV%i_%i",iCh,iSec),"[0]+x*[1]",fStartTime,fEndTime),"Q");               
-        }
-        delete pGrHV;
-      } else {AliWarning(" No Data Points from HMP_MP0-6_SEC0-5_HV.actual.vMon!");return kFALSE;}
+      if(!pHV) {
+        AliWarning(Form(" No Data Points from HMP_MP%1i_SEC%1i_HV.actual.vMon!",iCh,iSec));
+        return kFALSE;
+      } else {
+        Log(Form(" HV for module %i and secto %i data       ---> %3i entries",iCh,iSec,pHV->GetEntries()));
+        if(pHV->GetEntries()) {
+          TIter nextHV(pHV);
+          TGraph *pGrHV=new TGraph; cnt=0;
+          while((pVal=(AliDCSValue*)nextHV())) pGrHV->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //HV
+          if( cnt==1) {
+            pGrHV->GetPoint(0,xP,yP);
+            new TF1(Form("HV%i_%i",iCh,iSec),Form("%f",yP),fStartTime,fEndTime);               
+          } else {
+            pGrHV->Fit(new TF1(Form("HV%i_%i",iCh,iSec),"[0]+x*[1]",fStartTime,fEndTime),"Q");               
+          }
+          delete pGrHV;
+        } else {AliWarning(" No Data Points from HMP_MP0-6_SEC0-5_HV.actual.vMon!");return kFALSE;}
+      }
      
 // evaluate Qthre
      
@@ -164,35 +174,45 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
       pTin[3*iCh+iRad]  = new TF1(Form("Tin%i%i" ,iCh,iRad),"[0]+[1]*x",fStartTime,fEndTime);
       pTout[3*iCh+iRad] = new TF1(Form("Tout%i%i",iCh,iRad),"[0]+[1]*x",fStartTime,fEndTime);          
       
-      TObjArray *pT1=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad));  
-      Log(Form(" Temperatures for module %i inside data  ---> %3i entries",iCh,pT1->GetEntries()));
-      if(pT1->GetEntries()) {
-        TIter nextT1(pT1);//Tin
-        TGraph *pGrT1=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT1())) pGrT1->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T inlet
-        if(cnt==1) { 
-          pGrT1->GetPoint(0,xP,yP);
-          pTin[3*iCh+iRad]->SetParameter(0,yP);
-          pTin[3*iCh+iRad]->SetParameter(1,0);
-        } else {
-          pGrT1->Fit(pTin[3*iCh+iRad],"Q");
-        }
-        delete pGrT1;
-      } else {AliWarning(" No Data Points from HMP_MP0-6_LIQ_LOOP.actual.sensors.Rad0-2In_Temp!");return kFALSE;}
+      TObjArray *pT1=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad));
+      if(!pT1) {
+        AliWarning(Form(" No Data Points from HMP_MP%1i_LIQ_LOOP.actual.sensors.Rad%1iIn_Temp!",iCh,iRad));
+        return kFALSE;
+      } else {
+        Log(Form(" Temperatures for module %i inside data  ---> %3i entries",iCh,pT1->GetEntries()));
+        if(pT1->GetEntries()) {
+          TIter nextT1(pT1);//Tin
+          TGraph *pGrT1=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT1())) pGrT1->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T inlet
+          if(cnt==1) { 
+            pGrT1->GetPoint(0,xP,yP);
+            pTin[3*iCh+iRad]->SetParameter(0,yP);
+            pTin[3*iCh+iRad]->SetParameter(1,0);
+          } else {
+            pGrT1->Fit(pTin[3*iCh+iRad],"Q");
+          }
+          delete pGrT1;
+        } else {AliWarning(" No Data Points from HMP_MP0-6_LIQ_LOOP.actual.sensors.Rad0-2In_Temp!");return kFALSE;}
+      }
     // T out
       TObjArray *pT2=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp",iCh,iCh,iRad)); 
-      Log(Form(" Temperatures for module %i outside data ---> %3i entries",iCh,pT2->GetEntries()));
-      if(pT2->GetEntries()) {
-        TIter nextT2(pT2);//Tout      
-        TGraph *pGrT2=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT2())) pGrT2->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T outlet 
-        if(cnt==1) { 
-          pGrT2->GetPoint(0,xP,yP);
-          pTout[3*iCh+iRad]->SetParameter(0,yP);
-          pTout[3*iCh+iRad]->SetParameter(1,0);
-        } else {
-          pGrT2->Fit(pTout[3*iCh+iRad],"Q");
-        }
-        delete pGrT2;
-      } else {AliWarning(" No Data Points from HMP_MP0-6_LIQ_LOOP.actual.sensors.Rad0-2Out_Temp!");return kFALSE;}
+      if(!pT2) {
+        AliWarning(Form(" No Data Points from HMP_MP%1i_LIQ_LOOP.actual.sensors.Rad%1iOut_Temp!",iCh,iRad));
+        return kFALSE;
+      } else {
+        Log(Form(" Temperatures for module %i outside data ---> %3i entries",iCh,pT2->GetEntries()));
+        if(pT2->GetEntries()) {
+          TIter nextT2(pT2);//Tout      
+          TGraph *pGrT2=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT2())) pGrT2->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T outlet 
+          if(cnt==1) { 
+            pGrT2->GetPoint(0,xP,yP);
+            pTout[3*iCh+iRad]->SetParameter(0,yP);
+            pTout[3*iCh+iRad]->SetParameter(1,0);
+          } else {
+            pGrT2->Fit(pTout[3*iCh+iRad],"Q");
+          }
+          delete pGrT2;
+        } else {AliWarning(" No Data Points from HMP_MP0-6_LIQ_LOOP.actual.sensors.Rad0-2Out_Temp!");return kFALSE;}
+      }
        
 // evaluate Mean Refractive Index