Introducing new DP CavernAtmosPressure2.
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 00:46:03 +0000 (00:46 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 00:46:03 +0000 (00:46 +0000)
AliGRPObject modified according, increasing the ClassDef to be
able to read old object.

GRP/TestGRPPreprocessor.C
STEER/AliGRPObject.cxx
STEER/AliGRPObject.h
STEER/AliGRPPreprocessor.cxx
STEER/AliGRPPreprocessor.h

index bbdd148..a42d719 100644 (file)
@@ -161,7 +161,7 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
   // <valueList> is a TObjArray of AliDCSValue
   // An AliDCSValue consists of timestamp and a value in form of a AliSimpleValue
   
-  const Int_t fgknDCSDP = 50;
+  const Int_t fgknDCSDP = 51;
   const char* fgkDCSDataPoints[AliGRPPreprocessor::fgknDCSDP] = {
                    "LHCState",              // missing in DCS
                    "L3Polarity",
@@ -212,7 +212,8 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
                   "Dipole_Outside_Temperature",
                    "CavernTemperature",
                    "CavernAtmosPressure",
-                   "SurfaceAtmosPressure"
+                   "SurfaceAtmosPressure",
+                   "CavernAtmosPressure2",
                  };
 
   TMap* aliasMap;
@@ -294,6 +295,7 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
       dcsVal = new AliDCSValue((Float_t) (timeStamp+1+10*nAlias), timeStampValue[timeStamp]);
       valueSet->Add(dcsVal);
     }
+    cout << " simulating " << fgkDCSDataPoints[nAlias] << endl;
     aliasMap->Add( new TObjString( fgkDCSDataPoints[nAlias]), valueSet );
   }
 
index bbcd70e..c529ea7 100644 (file)
@@ -103,8 +103,8 @@ AliGRPObject::AliGRPObject():
        fL3Current(new Float_t[fPoints]),\r
        fDipoleCurrent(new Float_t[fPoints]),\r
        fCavernTemperature(new Float_t[fPoints]),\r
-       //fCavernAtmosPressure(new Float_t[fPoints]),\r
        fCavernAtmosPressure(0x0),\r
+       fCavernAtmosPressure2(0x0),\r
        fSurfaceAtmosPressure(0x0),\r
        fHallProbes(0x0)\r
 {\r
@@ -127,7 +127,6 @@ AliGRPObject::AliGRPObject():
                fL3Current[i] = fgkInvalidFloat;\r
                fDipoleCurrent[i] = fgkInvalidFloat;\r
                fCavernTemperature[i] = fgkInvalidFloat;\r
-               //              fCavernAtmosPressure[i] = fgkInvalidFloat;\r
        }\r
 }\r
 \r
@@ -156,6 +155,7 @@ AliGRPObject::AliGRPObject(const AliGRPObject &obj):
        fDipoleCurrent(new Float_t[fPoints]),\r
        fCavernTemperature(new Float_t[fPoints]),\r
        fCavernAtmosPressure(obj.fCavernAtmosPressure),\r
+       fCavernAtmosPressure2(obj.fCavernAtmosPressure2),\r
        fSurfaceAtmosPressure(obj.fSurfaceAtmosPressure),\r
        fHallProbes(0x0)\r
 \r
@@ -202,6 +202,7 @@ AliGRPObject& AliGRPObject:: operator=(const AliGRPObject & obj)
        this->fL3Polarity = obj.GetL3Polarity();\r
        this->fDipolePolarity = obj.GetDipolePolarity();\r
        this->fCavernAtmosPressure = obj.GetCavernAtmosPressure();\r
+       this->fCavernAtmosPressure2 = obj.GetCavernAtmosPressure2();\r
        this->fSurfaceAtmosPressure = obj.GetSurfaceAtmosPressure();\r
        this->fPoints = obj.GetPoints();\r
        this->fDimension = obj.GetDimension();\r
@@ -256,6 +257,10 @@ AliGRPObject::~AliGRPObject() {
                delete fCavernAtmosPressure;\r
                fCavernAtmosPressure = 0x0;\r
        }\r
+       if (fCavernAtmosPressure2){\r
+               delete fCavernAtmosPressure2;\r
+               fCavernAtmosPressure2 = 0x0;\r
+       }\r
        if (fSurfaceAtmosPressure){\r
                delete fSurfaceAtmosPressure;\r
                fSurfaceAtmosPressure = 0x0;\r
index 8e79c12..263e107 100644 (file)
@@ -73,6 +73,7 @@ class AliGRPObject : public TObject {
        Float_t*  GetCavernTemperature() const {return fCavernTemperature;}\r
        Float_t   GetCavernTemperature(Stats stat) const {return fCavernTemperature[stat];}\r
        AliDCSSensor*   GetCavernAtmosPressure() const {return fCavernAtmosPressure;}\r
+       AliDCSSensor*   GetCavernAtmosPressure2() const {return fCavernAtmosPressure2;}\r
        AliDCSSensor*   GetSurfaceAtmosPressure() const {return fSurfaceAtmosPressure;}\r
 \r
        Float_t*  GetHallProbesArray(DP_HallProbes hp) const;\r
@@ -120,6 +121,7 @@ class AliGRPObject : public TObject {
        }\r
        void SetCavernTemperature(Float_t cavernTemperature, Stats stat)  {fCavernTemperature[stat] = cavernTemperature;}\r
        void SetCavernAtmosPressure(AliDCSSensor* const cavernAtmosPressure)  {fCavernAtmosPressure = cavernAtmosPressure;}\r
+       void SetCavernAtmosPressure2(AliDCSSensor* const cavernAtmosPressure)  {fCavernAtmosPressure2 = cavernAtmosPressure;}\r
        void SetSurfaceAtmosPressure(AliDCSSensor* const surfacePressure)  {fSurfaceAtmosPressure = surfacePressure;}\r
 \r
        void SetHallProbes(DP_HallProbes hp, Float_t hall_probe, Stats stat)  {fHallProbes[hp*fPoints+stat] = hall_probe;}\r
@@ -181,6 +183,7 @@ class AliGRPObject : public TObject {
        Float_t*  fCavernTemperature;     // [fPoints]\r
                                           // CavernTemperature entry from DCS DB\r
        AliDCSSensor*  fCavernAtmosPressure;    // CavernAtmosPressure entry from DCS DB\r
+       AliDCSSensor*  fCavernAtmosPressure2;    // CavernAtmosPressure2 entry from DCS DB\r
        AliDCSSensor*  fSurfaceAtmosPressure;   // SurfaceAtmosPressure entry from DCS DB\r
 \r
        // Hall Probes\r
@@ -188,7 +191,7 @@ class AliGRPObject : public TObject {
        Float_t* fHallProbes;       //[fDimension] \r
                                    // array containg the values for the Hall Probes\r
 \r
-       ClassDef(AliGRPObject,2)\r
+       ClassDef(AliGRPObject,3)\r
 \r
 };\r
 \r
index bc76219..1dc3adc 100644 (file)
@@ -66,7 +66,7 @@ ClassImp(AliGRPPreprocessor)
 
   const Int_t AliGRPPreprocessor::fgknDAQLbPar = 8; // num parameters in the logbook for PHYSICS runs, when beamType from DAQ logbook == NULL
   const Int_t AliGRPPreprocessor::fgknDAQLbParReduced = 7; // num parameters in the logbook for the other cases
-  const Int_t AliGRPPreprocessor::fgknDCSDP = 50;   // number of dcs dps
+  const Int_t AliGRPPreprocessor::fgknDCSDP = 51;   // number of dcs dps
   const Int_t AliGRPPreprocessor::fgknDCSDPHallProbes = 40;   // number of dcs dps
   const char* AliGRPPreprocessor::fgkDCSDataPoints[AliGRPPreprocessor::fgknDCSDP] = {
                    "LHCState",              // missing in DCS
@@ -118,7 +118,8 @@ ClassImp(AliGRPPreprocessor)
                   "Dipole_Outside_Temperature",
                    "CavernTemperature",
                    "CavernAtmosPressure",
-                   "SurfaceAtmosPressure"
+                   "SurfaceAtmosPressure",
+                   "CavernAtmosPressure2",
                  };
 
   const char* AliGRPPreprocessor::fgkDCSDataPointsHallProbes[AliGRPPreprocessor::fgknDCSDPHallProbes] = {
@@ -165,7 +166,8 @@ ClassImp(AliGRPPreprocessor)
                  };
                  
   const Short_t kSensors = 48; // start index position of sensor in DCS DPs
-  const Short_t kNumSensors = 2; // Number of sensors in DCS DPs
+  const Short_t kNumSensors = 3; // Number of sensors in DCS DPs (CavernAtmosPressure, SurfaceAtmosPressure, CavernAtmosPressure2)
+
 
   const char* AliGRPPreprocessor::fgkLHCState[20] = {
                    "P", "PREPARE",
@@ -247,21 +249,21 @@ AliGRPPreprocessor::~AliGRPPreprocessor()
 
 void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
 {
-  // Initialize preprocessor
-
-  AliPreprocessor::Initialize(run, startTime, endTime);
-
-  AliInfo("Initialization of the GRP preprocessor.");
-  AliInfo(Form("Start Time DCS = %d",GetStartTimeDCSQuery()));
-  AliInfo(Form("End Time DCS = %d",GetEndTimeDCSQuery()));
-  TClonesArray * array = new TClonesArray("AliDCSSensor",kNumSensors); 
-  for(Int_t j = 0; j < kNumSensors; j++) {
-    AliDCSSensor * sens = new ((*array)[j])AliDCSSensor;
-    sens->SetStringID(fgkDCSDataPoints[j+kSensors]);
-  }
-  AliInfo(Form("Pressure Entries: %d",array->GetEntries()));
+       // Initialize preprocessor
 
-  fPressure = new AliDCSSensorArray(GetStartTimeDCSQuery(), GetEndTimeDCSQuery(), array);
+       AliPreprocessor::Initialize(run, startTime, endTime);
+       
+       AliInfo("Initialization of the GRP preprocessor.");
+       AliInfo(Form("Start Time DCS = %d",GetStartTimeDCSQuery()));
+       AliInfo(Form("End Time DCS = %d",GetEndTimeDCSQuery()));
+       TClonesArray * array = new TClonesArray("AliDCSSensor",kNumSensors); 
+       for(Int_t j = 0; j < kNumSensors; j++) {
+               AliDCSSensor * sens = new ((*array)[j])AliDCSSensor;
+               sens->SetStringID(fgkDCSDataPoints[j+kSensors]);
+       }
+       AliInfo(Form("Pressure Entries: %d",array->GetEntries()));
+       
+       fPressure = new AliDCSSensorArray(GetStartTimeDCSQuery(), GetEndTimeDCSQuery(), array);
 }
 
 //_______________________________________________________________
@@ -963,19 +965,20 @@ Int_t AliGRPPreprocessor::ProcessEnvDPs(TMap* valueMap, AliGRPObject* grpObj)
 
        if (array) array = 0x0;
 
-       AliInfo(Form("==========AtmosPressures (Cavern + Surface)==========="));
+       AliInfo(Form("========== AtmosPressures (Cavern + Surface + Cavern2) ==========="));
        AliDCSSensorArray *dcsSensorArray = GetPressureMap(valueMap);
-       dcsSensorArray->Print();
-       if( fPressure->NumFits()==0 ) {
-               Log("Problem with the pressure sensor values!!!");
+       //dcsSensorArray->Print();
+       if( fPressure->NumFits()<kNumSensors ) {
+               Log(Form("Problem with the pressure sensor values! Not all the %d pressure sensors have been fit",kNumSensors));
        } 
        else {
+               Log(Form("Number of fits performed = %d",fPressure->NumFits()));
                AliInfo(Form("==========CavernAtmosPressure==========="));
                indexDP = kCavernAtmosPressure;
                AliDCSSensor* sensorCavernP2 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
                AliDebug(2,Form("sensorCavernP2 = %p", sensorCavernP2));
                if( sensorCavernP2->GetFit() ) {
-                       Log(Form("<%s> for run %d: Sensor Fit found",fgkDCSDataPoints[indexDP], fRun));
+                       Log(Form("Fit for Sensor %s found",fgkDCSDataPoints[indexDP]));
                        grpObj->SetCavernAtmosPressure(sensorCavernP2);
                        nEnvEntries++;
                } 
@@ -988,7 +991,7 @@ Int_t AliGRPPreprocessor::ProcessEnvDPs(TMap* valueMap, AliGRPObject* grpObj)
                AliDCSSensor* sensorP2 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
                AliDebug(2,Form("sensorP2 = %p", sensorP2));
                if( sensorP2->GetFit() ) {
-                       Log(Form("<%s> for run %d: Sensor Fit found",fgkDCSDataPoints[indexDP], fRun));
+                       Log(Form("Fit for Sendor %s found",fgkDCSDataPoints[indexDP]));
                        grpObj->SetSurfaceAtmosPressure(sensorP2);
                        nEnvEntries++;
                } 
@@ -996,6 +999,19 @@ Int_t AliGRPPreprocessor::ProcessEnvDPs(TMap* valueMap, AliGRPObject* grpObj)
                else {
                        Log(Form("ERROR Sensor Fit for %s not found ", fgkDCSDataPoints[indexDP] ));
                }
+               AliInfo(Form("==========CavernAtmosPressure2==========="));
+               indexDP = kCavernAtmosPressure2;
+               AliDCSSensor* sensorCavernP22 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
+               AliDebug(2,Form("sensorCavernP2_2 = %p", sensorCavernP22));
+               if( sensorCavernP22->GetFit() ) {
+                       Log(Form("Fit for Sensor %s found",fgkDCSDataPoints[indexDP]));
+                       grpObj->SetCavernAtmosPressure2(sensorCavernP22);
+                       nEnvEntries++;
+               } 
+               //if (sensorP2) delete sensorP2;
+               else {
+                       Log(Form("ERROR Sensor Fit for %s not found ", fgkDCSDataPoints[indexDP] ));
+               }
                
        }
 
@@ -1875,7 +1891,7 @@ AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap)
                fPressure->MakeSplineFit(map);
                Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); 
                if (fitFraction > kFitFraction ) {
-                       AliInfo(Form("Pressure values extracted, %d fits performed.", fPressure->NumFits()));
+                       AliInfo(Form("Pressure values extracted, %d fits performed for %d sensors.", fPressure->NumFits(),fPressure->NumSensors()));
                } else { 
                        AliInfo("Too few pressure maps fitted!!!");
                }
index f133e82..a09f7dc 100644 (file)
@@ -44,7 +44,8 @@ class AliGRPPreprocessor: public AliPreprocessor {
                 kL3bkf8H1, kL3bkf8H2, kL3bkf8H3, kL3bkf8Temperature,
                 kDipoleInsideH1, kDipoleInsideH2, kDipoleInsideH3, kDipoleInsideTemperature,
                 kDipoleOutsideH1, kDipoleOutsideH2, kDipoleOutsideH3, kDipoleOutsideTemperature,
-                 kCavernTemperature, kCavernAtmosPressure, kSurfaceAtmosPressure};
+                 kCavernTemperature, kCavernAtmosPressure, kSurfaceAtmosPressure, 
+                kCavernAtmosPressure2};
 
        enum DPHallProbes { 
                 khpL3bsf17H1= 0 , khpL3bsf17H2, khpL3bsf17H3, khpL3bsf17Temperature,