// //
// AliTRDCalibChamberStatus: to determine which half chambers are off //
// Produce a AliTRDCalChamberStatus calibration object //
-// Check with the AliTRDCalDCSFEE info //
+// Check with the AliTRDCalDCSFEEv2 info //
// //
// //
// Authors: //
#include "AliTRDSignalIndex.h"
#include "AliTRDpadPlane.h"
#include "./Cal/AliTRDCalChamberStatus.h"
-#include "./Cal/AliTRDCalDCS.h"
-#include "./Cal/AliTRDCalDCSFEE.h"
+#include "./Cal/AliTRDCalDCSv2.h"
+#include "./Cal/AliTRDCalDCSFEEv2.h"
#include "AliTRDrawStream.h"
}
//_____________________________________________________________________
-void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCS *calDCS) /*FOLD00*/
+void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCSv2 *calDCS) /*FOLD00*/
{
//
- // Correct the AliTRDCalChamberStatus according to the AliTRDCalDCS
+ // Correct the AliTRDCalChamberStatus according to the AliTRDCalDCSv2
// Using globale state of the HalfChamberMerger (HCM)
//
for(Int_t det = 0; det < 540; det++) {
- AliTRDCalDCSFEE* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
+ AliTRDCalDCSFEEv2* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
if(!calDCSFEEEOR) continue;
}
//_____________________________________________________________________
-TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, Int_t sm, Int_t pl) /*FOLD00*/
+TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl) /*FOLD00*/
{
//
// Plot globale state of the HalfChamberMerger (HCM)
for (Int_t k = 0; k < nstack; k++){
Int_t det = offsetsmpl+k*6;
Int_t stac = AliTRDgeometry::GetStack(det);
- AliTRDCalDCSFEE* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
+ AliTRDCalDCSFEEv2* calDCSFEEEOR = calDCS->GetCalDCSFEEObj(det);
if(!calDCSFEEEOR) { continue;}
for (Int_t icol=0; icol<ncols; icol++){
Int_t nrows = 16;
}
//_____________________________________________________________________________
-TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCS *calDCS, Int_t sm, const Char_t *name)
+TCanvas* AliTRDCalibChamberStatus::PlotHistos2DSmEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, const Char_t *name)
{
//
// Make 2D graph
class AliTRDCalChamberStatus;
class AliRawReader;
-class AliTRDCalDCS;
+class AliTRDCalDCSv2;
struct eventHeaderStruct;
void Init();
void AnalyseHisto();
- void CheckEORStatus(AliTRDCalDCS *calDCS);
+ void CheckEORStatus(AliTRDCalDCSv2 *calDCS);
void Add(AliTRDCalibChamberStatus *calibChamberStatus);
// Plot
TH2D *PlotSparseI(Int_t sm, Int_t side); // Plot fStatus for sm
- TH2F *MakeHisto2DSmPlEORStatus(AliTRDCalDCS *calDCS, Int_t sm, Int_t pl);
- TCanvas *PlotHistos2DSmEORStatus(AliTRDCalDCS *calDCS,Int_t sm, const Char_t *name);
+ TH2F *MakeHisto2DSmPlEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl);
+ TCanvas *PlotHistos2DSmEORStatus(AliTRDCalDCSv2 *calDCS,Int_t sm, const Char_t *name);
// Debug
void SetDebugLevel(Short_t level) { fDebugLevel = level; }
#include "AliTRDCalChamberStatus.h"
#include "AliTRDCalSingleChamberStatus.h"
#include "AliTRDCalPadStatus.h"
-#include "AliTRDCalDCS.h"
-#include "AliTRDCalDCSFEE.h"
+#include "AliTRDCalDCSv2.h"
+#include "AliTRDCalDCSFEEv2.h"
#include "AliTRDcalibDB.h"
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
dcsArray = (TObjArray*)entry->GetObject();
}
}
- AliTRDCalDCS *dcsSOR = 0;
- AliTRDCalDCS *dcsEOR = 0;
+ AliTRDCalDCSv2 *dcsSOR = 0;
+ AliTRDCalDCSv2 *dcsEOR = 0;
if(getDCS && dcsArray) {
- dcsSOR = (AliTRDCalDCS*)dcsArray->At(0);
- dcsEOR = (AliTRDCalDCS*)dcsArray->At(1);
+ dcsSOR = (AliTRDCalDCSv2*)dcsArray->At(0);
+ dcsEOR = (AliTRDCalDCSv2*)dcsArray->At(1);
}
// Alignment information
} // end if(getCalibs)
// get the dcs information
- AliTRDCalDCSFEE *dcsfeeSOR = 0;
- AliTRDCalDCSFEE *dcsfeeEOR = 0;
+ AliTRDCalDCSFEEv2 *dcsfeeSOR = 0;
+ AliTRDCalDCSFEEv2 *dcsfeeEOR = 0;
if(getDCS) {
if(dcsSOR) dcsfeeSOR = dcsSOR->GetCalDCSFEEObj(chamberNo);
if(dcsEOR) dcsfeeEOR = dcsEOR->GetCalDCSFEEObj(chamberNo);
#include "AliTRDCalibChamberStatus.h"
#include "Cal/AliTRDCalPad.h"
#include "Cal/AliTRDCalPadStatus.h"
-#include "Cal/AliTRDCalDCS.h"
+#include "Cal/AliTRDCalDCSv2.h"
#include "Cal/AliTRDCalSingleChamberStatus.h"
#include "Cal/AliTRDCalChamberStatus.h"
#include "Cal/AliTRDCalROC.h"
if(calPed) {
//calPed->AnalyseHisto(); // check number of events, create calHalfChamberStatus (done on DAQ)
if(fCalDCSObjEOR) {
- calPed->CheckEORStatus((AliTRDCalDCS *)fCalDCSObjEOR);
+ calPed->CheckEORStatus((AliTRDCalDCSv2 *)fCalDCSObjEOR);
}
calHalfChamberStatus=(AliTRDCalChamberStatus *)calPed->GetCalChamberStatus();
}
// get the calibration object storing the data from the handler
if (fileExistS) {
if(fCalDCSObjSOR) delete fCalDCSObjSOR;
- fCalDCSObjSOR = (AliTRDCalDCS *) saxHandlerS.GetCalDCSObj()->Clone();
+ fCalDCSObjSOR = (AliTRDCalDCSv2 *) saxHandlerS.GetCalDCSObj()->Clone();
fCalDCSObjSOR->EvaluateGlobalParameters();
fCalDCSObjSOR->SetRunType(GetRunType());
fCalDCSObjSOR->SetStartTime(GetStartTimeDCSQuery());
if (fileExistE) {
if(fCalDCSObjEOR) delete fCalDCSObjEOR;
- fCalDCSObjEOR = (AliTRDCalDCS *) saxHandlerE.GetCalDCSObj()->Clone();
+ fCalDCSObjEOR = (AliTRDCalDCSv2 *) saxHandlerE.GetCalDCSObj()->Clone();
fCalDCSObjEOR->EvaluateGlobalParameters();
fCalDCSObjEOR->SetRunType(GetRunType());
fCalDCSObjEOR->SetStartTime(GetStartTimeDCSQuery());
AliCDBMetaData metaData1;
metaData1.SetBeamPeriod(0);
metaData1.SetResponsible("Frederick Kramer");
- metaData1.SetComment("DCS configuration data in two AliTRDCalDCS objects in one TObjArray (0:SOR, 1:EOR).");
+ metaData1.SetComment("DCS configuration data in two AliTRDCalDCSv2 objects in one TObjArray (0:SOR, 1:EOR).");
if (!Store("Calib", "DCS", calObjArray, &metaData1, 0, kTRUE)) {
Log("problems while storing DCS config data object");
return 16;
#include "AliPreprocessor.h"
class TMap;
-class AliTRDCalDCS;
+class AliTRDCalDCSv2;
class AliTRDCalROC;
class AliTRDCalSingleChamberStatus;
private:
- AliTRDCalDCS* fCalDCSObjSOR; //
- AliTRDCalDCS* fCalDCSObjEOR; //
+ AliTRDCalDCSv2* fCalDCSObjSOR; //
+ AliTRDCalDCSv2* fCalDCSObjEOR; //
Bool_t fVdriftHLT; // HLT Vdrift
UInt_t ProcessDCSConfigData(); // process DCS configuration
#include <TObjArray.h>\r
#include "AliTRDSaxHandler.h"\r
#include "AliTRDgeometry.h"\r
-#include "Cal/AliTRDCalDCS.h"\r
-#include "Cal/AliTRDCalDCSFEE.h"\r
+#include "Cal/AliTRDCalDCSv2.h"\r
+#include "Cal/AliTRDCalDCSFEEv2.h"\r
#include "Cal/AliTRDCalDCSGTU.h"\r
\r
ClassImp(AliTRDSaxHandler)\r
,fDCSFEEObj(0)\r
,fDCSPTRObj(0)\r
,fDCSGTUObj(0)\r
- ,fCalDCSObj(new AliTRDCalDCS())\r
+ ,fCalDCSObj(new AliTRDCalDCSv2())\r
,fLevel1Tag(-2)\r
,fLevel2Tag(-2)\r
,fInsideBoardInfo(false)\r
}\r
\r
//_____________________________________________________________________________\r
-AliTRDCalDCS* AliTRDSaxHandler::GetCalDCSObj()\r
+AliTRDCalDCSv2* AliTRDSaxHandler::GetCalDCSObj()\r
{\r
// put the arrays in the global calibration object and return this\r
fCalDCSObj->SetFEEArr(fFEEArr);\r
// if there is a new DCS element put it in the correct array\r
if (CompareString(tagName, "DCS")) {\r
if (fSystem == kInsideFEE) {\r
- fDCSFEEObj = new AliTRDCalDCSFEE(name,dcsTitle);\r
+ fDCSFEEObj = new AliTRDCalDCSFEEv2();\r
fDCSFEEObj->SetDCSid(dcsId);\r
}\r
if (fSystem == kInsidePTR) {\r
#include "Cal/AliTRDCalDCSGTUTmu.h"
class TObjArray;
-class AliTRDCalDCS;
-class AliTRDCalDCSFEE;
+class AliTRDCalDCSv2;
+class AliTRDCalDCSFEEv2;
class AliTRDCalDCSPTR;
class AliTRDCalDCSGTU;
virtual ~AliTRDSaxHandler();
AliTRDSaxHandler &operator=(const AliTRDSaxHandler &sh);
- TObjArray* GetDCSFEEDataArray() const { return fFEEArr; }
- TObjArray* GetDCSPTRDataArray() const { return fPTRArr; }
- AliTRDCalDCS* GetCalDCSObj(); // to be called by the preprocessor
+ TObjArray* GetDCSFEEDataArray() const { return fFEEArr; }
+ TObjArray* GetDCSPTRDataArray() const { return fPTRArr; }
+ AliTRDCalDCSv2* GetCalDCSObj(); // to be called by the preprocessor
- Int_t GetHandlerStatus() const { return fHandlerStatus; }
+ Int_t GetHandlerStatus() const { return fHandlerStatus; }
// functions for all possible events
- void OnStartDocument() const;
- void OnEndDocument() const;
- void OnStartElement(const char *name, const TList *attributes);
- void OnEndElement(const char *name);
- void OnCharacters(const char *name);
- void OnComment(const char *name) const;
- void OnWarning(const char *name);
- void OnError(const char *name);
- void OnFatalError(const char *name);
- void OnCdataBlock(const char *name, Int_t len) const;
+ void OnStartDocument() const;
+ void OnEndDocument() const;
+ void OnStartElement(const char *name, const TList *attributes);
+ void OnEndElement(const char *name);
+ void OnCharacters(const char *name);
+ void OnComment(const char *name) const;
+ void OnWarning(const char *name);
+ void OnError(const char *name);
+ void OnFatalError(const char *name);
+ void OnCdataBlock(const char *name, Int_t len) const;
private:
- bool CompareString(TString str, const char *str2);
-
- Int_t fHandlerStatus; // 0: everything OK, >0: error
- Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon)
- Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon)
- TObjArray* fFEEArr; // array of AliTRDCalDCSFEE objects
- TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects
-// TObjArray* fGTUArr; // array of AliTRDCalDCSGTU objects
- Int_t fSystem; // current system (FEE/PTR/GTU) (while parsing)
- Int_t fInsideRstate; // if we are inside rstate (while parsing)
- Int_t fCurrentSM; // current supermodule (while parsing)
- Int_t fCurrentStack; // current stack (while parsing)
- Int_t fCurrentROB; // current ROB (while parsing)
- Int_t fCurrentMCM; // current MCM (while parsing)
- Int_t fCurrentADC; // current ADC (while parsing)
- TString fContent; // content of the xml element (text)
- AliTRDCalDCSFEE* fDCSFEEObj; // the calib object for one FEE DCS board
- AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board
- AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board
- AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all info
- Int_t fLevel1Tag; // 1st level in XML (while parsing)
- Int_t fLevel2Tag; // 2nd level in XML (while parsing)
- Bool_t fInsideBoardInfo; // if we are inside BoardInfo (while parsing)
+ bool CompareString(TString str, const char *str2);
+
+ Int_t fHandlerStatus; // 0: everything OK, >0: error
+ Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon)
+ Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon)
+ TObjArray* fFEEArr; // array of AliTRDCalDCSFEEv2 objects
+ TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects
+ // TObjArray* fGTUArr; // array of AliTRDCalDCSGTU objects
+ Int_t fSystem; // current system (FEE/PTR/GTU) (while parsing)
+ Int_t fInsideRstate; // if we are inside rstate (while parsing)
+ Int_t fCurrentSM; // current supermodule (while parsing)
+ Int_t fCurrentStack; // current stack (while parsing)
+ Int_t fCurrentROB; // current ROB (while parsing)
+ Int_t fCurrentMCM; // current MCM (while parsing)
+ Int_t fCurrentADC; // current ADC (while parsing)
+ TString fContent; // content of the xml element (text)
+ AliTRDCalDCSFEEv2* fDCSFEEObj; // the calib object for one FEE DCS board
+ AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board
+ AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board
+ AliTRDCalDCSv2* fCalDCSObj; // the complete calib obj containing all info
+ Int_t fLevel1Tag; // 1st level in XML (while parsing)
+ Int_t fLevel2Tag; // 2nd level in XML (while parsing)
+ Bool_t fInsideBoardInfo; // if we are inside BoardInfo (while parsing)
AliTRDCalDCSGTUTmu* fTmu; // GTU calibration data: pattern generator
AliTRDCalDCSGTUCtpOpc* fCtpOpc; // GTU calibration data: OPC
AliTRDCalDCSGTUSegment* fSegment; // GTU calibration data: SMU tracklets/tracks/triggers
AliTRDCalDCSGTUBoardInfo* fBoardInfo; // GTU calibration data: hard-/software and type
-
- ClassDef(AliTRDSaxHandler,2); // The XML file handler for the preprocessor
+ ClassDef(AliTRDSaxHandler,3); // The XML file handler for the preprocessor
};
#endif
#include "Cal/AliTRDCalPad.h"
#include "Cal/AliTRDCalDet.h"
#include "Cal/AliTRDCalDCS.h"
+#include "Cal/AliTRDCalDCSv2.h"
#include "Cal/AliTRDCalPID.h"
#include "Cal/AliTRDCalMonitoring.h"
#include "Cal/AliTRDCalChamberStatus.h"
//
// Caches the entry <id> with cdb path <cdbPath>
//
-
+
if (!fCDBCache[id]) {
fCDBEntries[id] = GetCDBEntry(cdbPath);
if (fCDBEntries[id]) {
fCDBCache[id] = fCDBEntries[id]->GetObject();
}
- }
-
+ }
+
return fCDBCache[id];
-
}
//_____________________________________________________________________________
Int_t nUndef = -1; // default value - has not been set!
Int_t nTbSor = nUndef;
Int_t nTbEor = nUndef;
+ Int_t calver = 0; // Check CalDCS version
const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
-
if (!dcsArr) {
AliError("No DCS object found!");
return nUndef;
}
- const AliTRDCalDCS *calDCSsor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(0));
- const AliTRDCalDCS *calDCSeor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1));
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
- if (!calDCSsor) {
- // the SOR file is mandatory
- AliError("NO SOR AliTRDCalDCS object found in CDB file!");
- return nUndef;
+ if (calver == 1) {
+ // DCS object
+ const AliTRDCalDCS *calDCSsor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(0));
+ const AliTRDCalDCS *calDCSeor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1));
+ if (!calDCSsor) {
+ // the SOR file is mandatory
+ AliError("NO SOR AliTRDCalDCS object found in CDB file!");
+ return nUndef;
+ }
+ if (!calDCSeor) {
+ // this can happen if the run is shorter than a couple of seconds.
+ AliWarning("NO EOR AliTRDCalDCS object found in CDB file.");
}
- if (!calDCSeor) {
- // this can happen if the run is shorter than a couple of seconds.
- AliWarning("NO EOR AliTRDCalDCS object found in CDB file.");
+ // get the numbers
+ nTbSor = calDCSsor->GetGlobalNumberOfTimeBins();
+ if (calDCSeor) nTbEor = calDCSeor->GetGlobalNumberOfTimeBins();
+
+ } else if (calver == 2) {
+ // DCSv2 object
+ const AliTRDCalDCSv2 *calDCSsorv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(0));
+ const AliTRDCalDCSv2 *calDCSeorv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(1));
+ if (!calDCSsorv2) {
+ // the SOR file is mandatory
+ AliError("NO SOR AliTRDCalDCSv2 object found in CDB file!");
+ return nUndef;
+ }
+ if (!calDCSeorv2) {
+ // this can happen if the run is shorter than a couple of seconds.
+ AliWarning("NO EOR AliTRDCalDCSv2 object found in CDB file.");
}
- // get the numbers
- nTbSor = calDCSsor->GetGlobalNumberOfTimeBins();
- if (calDCSeor) nTbEor = calDCSeor->GetGlobalNumberOfTimeBins();
+ // get the numbers
+ nTbSor = calDCSsorv2->GetGlobalNumberOfTimeBins();
+ if (calDCSeorv2) nTbEor = calDCSeorv2->GetGlobalNumberOfTimeBins();
+
+ } else AliError("NO DCS/DCSv2 OCDB entry found!");
// if they're the same return the value
// -2 means mixed, -1: no data, >= 0: good number of time bins
AliWarning("Inconsistent number of time bins found!");
return nMixed;
}
-
+
// one is undefined, the other ok -> return that one
if (nTbSor == nUndef) return nTbEor;
if (nTbEor == nUndef) return nTbSor;
filterType = "";
return;
}
- const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1)); // Take EOR
-
- if(!calDCS){
- filterType = "";
- return;
- }
- filterType = calDCS->GetGlobalFilterType();
+
+ Int_t esor = 0; // Take SOR
+ Int_t calver = 0; // Check CalDCS version
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
+
+ if (calver == 1) {
+ // DCS object
+ const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(esor));
+ if(!calDCS){
+ filterType = "";
+ return;
+ }
+ filterType = calDCS->GetGlobalFilterType();
+ } else if (calver == 2) {
+ // DCSv2 object
+ const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
+ if(!calDCSv2){
+ filterType = "";
+ return;
+ }
+ filterType = calDCSv2->GetGlobalFilterType();
+ } else AliError("NO DCS/DCSv2 OCDB entry found!");
+
}
//_____________________________________________________________________________
//
// Get Configuration from the DCS
//
+
const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
if(!dcsArr){
config = "";
return;
}
- const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1)); // Take EOR
-
- if(!calDCS){
- config = "";
- return;
- }
- config = calDCS->GetGlobalConfigName();
+
+ Int_t esor = 0; // Take SOR
+ Int_t calver = 0; // Check CalDCS version
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
+ if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
+
+ if (calver == 1) {
+ // DCS object
+ const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(esor));
+ if(!calDCS){
+ config = "";
+ return;
+ }
+ config = calDCS->GetGlobalConfigName();
+ } else if (calver == 2) {
+ // DCSv2 object
+ const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
+ if(!calDCSv2){
+ config = "";
+ return;
+ }
+ config = calDCSv2->GetGlobalConfigName();
+ } else AliError("NO DCS/DCSv2 OCDB entry found!");
+
}
//_____________________________________________________________________________
protected:
// For caching see also implentation of GetCachedCDBObject in the .cxx file
- enum { kCDBCacheSize = 20 }; // Number of cached objects
enum { kIDVdriftPad = 0
, kIDVdriftChamber
, kIDT0Pad
, kIDMonitoringData
, kIDChamberStatus
, kIDPadStatus
- , kIDDCS }; // IDs of cached objects
+ , kIDDCS
+ , kCDBCacheSize }; // IDs of cached objects
const TObject *GetCachedCDBObject(Int_t id);