#include <TList.h>
#include <TMap.h>
#include <TObjString.h>
+#include <TObjArray.h>
#include <TGraph.h>
+#include <TString.h>
#include <float.h>
#include <AliTriggerConfiguration.h>
#include <AliCTPTimeParams.h>
-const Double_t kFitFraction = 0.7; // Fraction of DCS sensor fits required
+const Double_t kFitFraction = -1.; // Fraction of DCS sensor fits required
ClassImp(AliGRPPreprocessor)
"CavernTemperature",
"CavernAtmosPressure",
"SurfaceAtmosPressure",
- "CavernAtmosPressure2",
+ "CavernAtmosPressure2"
};
const char* AliGRPPreprocessor::fgkDCSDataPointsHallProbes[AliGRPPreprocessor::fgknDCSDPHallProbes] = {
"Dipole_Outside_H1",
"Dipole_Outside_H2",
"Dipole_Outside_H3",
- "Dipole_Outside_Temperature",
+ "Dipole_Outside_Temperature"
};
const Short_t kSensors = 48; // start index position of sensor in DCS DPs
//_______________________________________________________________
AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle):
- AliPreprocessor("GRP",shuttle), fPressure(0), fmaxFloat(0), fminFloat(0),fmaxDouble(0), fminDouble(0), fmaxInt(0), fminInt(0), fmaxUInt(0), fminUInt(0),fdaqStartEndTimeOk(kTRUE)
+ AliPreprocessor("GRP",shuttle), fPressure(0), fmaxFloat(0), fminFloat(0),fmaxDouble(0), fminDouble(0), fmaxInt(0), fminInt(0), fmaxUInt(0), fminUInt(0),fdaqStartEndTimeOk(kTRUE),ffailedDPs(new TObjArray(fgknDCSDP))
{
// constructor - shuttle must be instantiated!
AliInfo(Form("Max allowed unsigned integer = %u",(Int_t)fmaxUInt));
AliInfo(Form("Min allowed unsigned integer = %u",(Int_t)fminUInt));
+ ffailedDPs->SetOwner(kTRUE);
}
//_______________________________________________________________
//destructor
delete fPressure;
+ delete ffailedDPs;
+
}
//_______________________________________________________________
AliInfo(Form("Pressure Entries: %d",array->GetEntries()));
fPressure = new AliDCSSensorArray(GetStartTimeDCSQuery(), GetEndTimeDCSQuery(), array);
+
+ for (Int_t iDP=0; iDP < fgknDCSDP; iDP++){
+ TObjString* dp = new TObjString(fgkDCSDataPoints[iDP]);
+ ffailedDPs->AddAt(dp,iDP);
+ }
+
}
//_______________________________________________________________
Int_t entries = ProcessDcsDPs( valueMap, grpobj );
Log(Form("entries found = %d (should be %d)",entries, fgknDCSDP-4));
if (fdaqStartEndTimeOk){
- if( entries < fgknDCSDP-4 ) { // FIXME (!= ) LHState, LHCLuminosity, BeamIntensity, LH3_BSF4_H3 are not working yet...
+ if( entries < fgknDCSDP-4 ) { // FIXME (!= ) LHState, LHCLuminosity, BeamIntensity, L3_BSF4_H3 are not working yet...
Log(Form("Problem with the DCS data points!!! Only %d/%d entries found",entries,fgknDCSDP-4));
+ Log(Form("The DPs giving problems were:"));
+ for (Int_t iDP = 0; iDP < fgknDCSDP; iDP++){
+ TObjString *dpString = (TObjString*)ffailedDPs->At(iDP);
+ if (dpString){
+ TString name = dpString->String();
+ if (name != "LHCState" && name != "LHCLuminosity" && name != "BeamIntensity" && name != "L3_BSF4_H3"){
+ Log(Form("******** %s ******** not present, but foreseen --> causing an ERROR",name.Data()));
+ }
+ else {
+ Log(Form(" %s is not present, but was not generating any error since it is not ready in DCS - check the other DPs in this list!",name.Data()));
+ }
+ }
+ }
error |= 8;
}
else Log(Form("DCS data points, successful!"));
nEnvEntries = ProcessEnvDPs(valueMap, grpObj);
nHallProbesEntries = ProcessHPDPs(valueMap, grpObj);
grpObj->SetPolarityConventionLHC(); // after the dipole cables swap we comply with LHC convention
+ Log(Form("nLHCEntries = %d, L3Entries = %d, nDipoleEntries =%d, nEnvEntries = %d, nHallProbesEntries = %d", nLHCEntries, nL3Entries, nDipoleEntries, nEnvEntries, nHallProbesEntries));
entries = nLHCEntries + nL3Entries + nDipoleEntries + nEnvEntries + nHallProbesEntries;
return entries;
// L3 info
Int_t nL3Entries = 0;
+
TObjArray *array = 0x0;
Int_t indexDP = -1;
Bool_t isZero = kTRUE; // flag to monitor L3Current. If set to true, the magnet is OFF, and the polarity can change
floatDCS = 0x0;
}
}
- if (!outOfRange) nL3Entries++;
+ if (!outOfRange) {
+ nL3Entries++;
+ ffailedDPs->RemoveAt(indexDP);
+ }
}
if (array) array = 0x0;
if (change == kFALSE){
grpObj->SetL3Polarity(charDCS);
AliInfo(Form("%s set to %d",fgkDCSDataPoints[indexDP],(Int_t)(grpObj->GetL3Polarity())));
+ ffailedDPs->RemoveAt(indexDP);
nL3Entries++;
}
else if (isZero){
AliInfo(Form("%s set to invalid, but magnet was OFF (according to the current), DP not considered wrong",fgkDCSDataPoints[indexDP]));
+ ffailedDPs->RemoveAt(indexDP);
nL3Entries++;
}
else {
floatDCS = 0x0;
}
}
- if (!outOfRange) nDipoleEntries++;
+ if (!outOfRange) {
+ nDipoleEntries++;
+ ffailedDPs->RemoveAt(indexDP);
+ }
}
if (array) array = 0x0;
if (!change){
grpObj->SetDipolePolarity(charDCS);
AliInfo(Form("%s set to %d",fgkDCSDataPoints[indexDP],(Int_t)(grpObj->GetDipolePolarity())));
+ ffailedDPs->RemoveAt(indexDP);
nDipoleEntries++;
}
else if (isZero){
AliInfo(Form("%s set to invalid, but magnet was OFF (according to the current), DP not considered wrong",fgkDCSDataPoints[indexDP]));
+ ffailedDPs->RemoveAt(indexDP);
nDipoleEntries++;
}
else{
floatDCS = 0x0;
}
}
- if (!outOfRange) nEnvEntries++;
+ if (!outOfRange) {
+ ffailedDPs->RemoveAt(indexDP);
+ nEnvEntries++;
+ }
}
if (array) array = 0x0;
AliDCSSensorArray *dcsSensorArray = GetPressureMap(valueMap);
//dcsSensorArray->Print();
if( fPressure->NumFits()<kNumSensors ) {
- Log(Form("Problem with the pressure sensor values! Not all the %d pressure sensors have been fit",kNumSensors));
+ Log(Form("Check 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("Fit for Sensor %s found",fgkDCSDataPoints[indexDP]));
- grpObj->SetCavernAtmosPressure(sensorCavernP2);
- nEnvEntries++;
- }
- //if (sensorP2) delete sensorP2;
- else {
- Log(Form("ERROR Sensor Fit for %s not found ", fgkDCSDataPoints[indexDP] ));
- }
- AliInfo(Form("==========SurfaceAtmosPressure==========="));
- indexDP = kSurfaceAtmosPressure;
- AliDCSSensor* sensorP2 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
- AliDebug(2,Form("sensorP2 = %p", sensorP2));
- if( sensorP2->GetFit() ) {
- Log(Form("Fit for Sendor %s found",fgkDCSDataPoints[indexDP]));
- grpObj->SetSurfaceAtmosPressure(sensorP2);
- nEnvEntries++;
- }
- //if (sensorP2) delete sensorP2;
+ Log(Form("Number of fits performed = %d",fPressure->NumFits()));
+
+ AliInfo(Form("==========CavernAtmosPressure==========="));
+ indexDP = kCavernAtmosPressure;
+ AliDCSSensor* sensorCavernP2 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
+ TGraph* graph = sensorCavernP2->GetGraph();
+ AliDebug(3,Form("index = %d",indexDP));
+ AliDebug(3,Form("name = %s",fgkDCSDataPoints[indexDP]));
+ AliDebug(2,Form("graph = %p",graph));
+ AliDebug(3,Form("sensorCavernP2 = %p", sensorCavernP2));
+ if(sensorCavernP2->GetFit() || graph) {
+ if (sensorCavernP2->GetFit()){
+ Log(Form("Fit for sensor %s found",fgkDCSDataPoints[indexDP]));
+ }
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;
+ Log(Form("Fit for sensor %s not found, but the graph is there - NOT going into error",fgkDCSDataPoints[indexDP]));
+ }
+ grpObj->SetCavernAtmosPressure(sensorCavernP2);
+ ffailedDPs->RemoveAt(indexDP);
+ nEnvEntries++;
+ }
+ //if (sensorP2) delete sensorP2;
+ else {
+ Log(Form("ERROR!!! Neither graph nor fit found for sensor %s - this will not increase the number of found DCS DPs and will cause an error", fgkDCSDataPoints[indexDP] ));
+ }
+
+ AliInfo(Form("==========SurfaceAtmosPressure==========="));
+ indexDP = kSurfaceAtmosPressure;
+ AliDCSSensor* sensorP2 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
+ graph = sensorP2->GetGraph();
+ AliDebug(3,Form("index = %d",indexDP));
+ AliDebug(3,Form("name = %s",fgkDCSDataPoints[indexDP]));
+ AliDebug(2,Form("graph = %p",graph));
+ AliDebug(3,Form("sensorP2 = %p", sensorP2));
+ if(sensorP2->GetFit() || graph) {
+ if (sensorP2->GetFit()){
+ Log(Form("Fit for sensor %s found",fgkDCSDataPoints[indexDP]));
+ }
else {
- Log(Form("ERROR Sensor Fit for %s not found ", fgkDCSDataPoints[indexDP] ));
+ Log(Form("Fit for sensor %s not found, but the graph is there - NOT going into error",fgkDCSDataPoints[indexDP]));
}
-
+ grpObj->SetSurfaceAtmosPressure(sensorP2);
+ ffailedDPs->RemoveAt(indexDP);
+ nEnvEntries++;
+ }
+ //if (sensorP2) delete sensorP2;
+ else {
+ Log(Form("ERROR!!! Neither graph nor fit found for sensor %s - this will not increase the number of found DCS DPs and will cause an error", fgkDCSDataPoints[indexDP] ));
}
+ AliInfo(Form("==========CavernAtmosPressure2==========="));
+ indexDP = kCavernAtmosPressure2;
+ AliDCSSensor* sensorCavernP22 = dcsSensorArray->GetSensor(fgkDCSDataPoints[indexDP]);
+ graph = sensorCavernP22->GetGraph();
+ AliDebug(3,Form("index = %d",indexDP));
+ AliDebug(3,Form("name = %s",fgkDCSDataPoints[indexDP]));
+ AliDebug(2,Form("graph = %p",graph));
+ AliDebug(3,Form("sensorCavernP2_2 = %p", sensorCavernP22));
+ if(sensorCavernP22->GetFit() || graph) {
+ if (sensorCavernP22->GetFit()){
+ Log(Form("Fit for sensor %s found",fgkDCSDataPoints[indexDP]));
+ }
+ else {
+ Log(Form("Fit for sensor %s not found, but the graph is there - NOT going into error",fgkDCSDataPoints[indexDP]));
+ }
+ grpObj->SetCavernAtmosPressure2(sensorCavernP22);
+ ffailedDPs->RemoveAt(indexDP);
+ nEnvEntries++;
+ }
+ //if (sensorP2) delete sensorP2;
+ else {
+ Log(Form("ERROR!!! Neither graph nor fit found for sensor %s - this will not increase the number of found DCS DPs and will cause an error", fgkDCSDataPoints[indexDP] ));
+ }
+
+
return nEnvEntries;
}
//_______________________________________________________________
floatDCS = 0x0;
}
}
- if (!outOfRange) nHPEntries++;
+ if (!outOfRange) {
+ ffailedDPs->RemoveAt(indexDP + 7); // 7 = shift in the complete list of DPs to get to the Hall Probes
+ nHPEntries++;
+ }
}
}
grpObj->SetLHCState(AliGRPObject::GetInvalidString());
}
}
+ ffailedDPs->RemoveAt(indexDP);
nLHCEntries++;
}
floatDCS = 0x0;
}
}
- if (!outOfRange) nLHCEntries++;
+ if (!outOfRange) {
+ ffailedDPs->RemoveAt(indexDP);
+ nLHCEntries++;
+ }
}
if (array) array = 0x0;
floatDCS = 0x0;
}
}
- if (!outOfRange) nLHCEntries++;
+ if (!outOfRange) {
+ nLHCEntries++;
+ ffailedDPs->RemoveAt(indexDP);
+ }
}
return nLHCEntries;
TMap *map = fPressure->ExtractDCS(dcsAliasMap);
if (map) {
+ AliDebug(2,Form("Map has %d entries",map->GetEntries()));
fPressure->MakeSplineFit(map);
Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors();
if (fitFraction > kFitFraction ) {