fScanInfo->SetRouterNr(val);
fInfoModified=kTRUE;
}
+void AliITSOnlineSPDscan::SetHalfStaveScanned(UInt_t val, Bool_t b) {
+ // set half stave scanned
+ fScanInfo->SetHalfStaveScanned(val,b);
+ fInfoModified=kTRUE;
+}
+void AliITSOnlineSPDscan::SetDataFormat(UInt_t val) {
+ // set data format (0=normal 1=histogram)
+ fScanInfo->SetDataFormat(val);
+ fInfoModified=kTRUE;
+}
void AliITSOnlineSPDscan::SetTriggers(UInt_t nsi, UInt_t val) {
// set nr of triggers
SwitchToStep(nsi);
UInt_t AliITSOnlineSPDscan::GetRouterNr() const {
return fScanInfo->GetRouterNr();
}
+Bool_t AliITSOnlineSPDscan::GetHalfStaveScanned(UInt_t val) const {
+ return fScanInfo->GetHalfStaveScanned(val);
+}
+UInt_t AliITSOnlineSPDscan::GetDataFormat() const {
+ return fScanInfo->GetDataFormat();
+}
UInt_t AliITSOnlineSPDscan::GetTriggers(UInt_t nsi) const {
return fScanInfo->GetTriggers(nsi);
}
void SetType(UInt_t val);
void SetRunNr(UInt_t val);
void SetRouterNr(UInt_t val);
+ void SetHalfStaveScanned(UInt_t val, Bool_t b);
+ void SetDataFormat(UInt_t val);
void SetTriggers(UInt_t nsi, UInt_t val);
void SetChipPresent(UInt_t hs, UInt_t chipi, Bool_t val);
void SetRowStart(UInt_t val);
UInt_t GetType() const;
UInt_t GetRunNr() const;
UInt_t GetRouterNr() const;
+ Bool_t GetHalfStaveScanned(UInt_t val) const;
+ UInt_t GetDataFormat() const;
UInt_t GetTriggers(UInt_t nsi) const;
Bool_t GetChipPresent(UInt_t hs, UInt_t chipi) const;
UInt_t GetRowStart() const;
fRouterNr=999;
fRowStart=0;
fRowEnd=255;
+ for (Int_t hs=0; hs<6; hs++) {
+ fHalfStaveScanned[hs]=kFALSE;
+ }
for (Int_t i=0; i<10; i++) {
fChipPresent[i]=kTRUE;
}
fTriggers.AddAt(0, fNSteps-1);
return fNSteps-1;
}
-
void AliITSOnlineSPDscanInfo::IncrementTriggers(UInt_t nsi) {
// increment the nr of triggers for step nsi
if (nsi<fNSteps) {
fTriggers.AddAt(val,nsi);
}
}
-
UInt_t AliITSOnlineSPDscanInfo::GetTriggers(UInt_t nsi) const {
// get the nr of triggers for step nsi
if (nsi<fNSteps) return fTriggers.At(nsi);
else return 0;
}
+void AliITSOnlineSPDscanInfo::SetHalfStaveScanned(UInt_t val, Bool_t b) {
+ // set half stave scanned
+ if (val<6) {
+ fHalfStaveScanned[val]=b;
+ }
+}
+Bool_t AliITSOnlineSPDscanInfo::GetHalfStaveScanned(UInt_t val) {
+ // set half stave scanned
+ if (val<6) {
+ return fHalfStaveScanned[val];
+ }
+ else {
+ printf("hs requested is out of range (hs=%d)\n",val);
+ return kFALSE;
+ }
+}
void SetType(UInt_t val) {fType=val;}
void SetRunNr(UInt_t val) {fRunNr=val;}
void SetRouterNr(UInt_t val) {fRouterNr=val;}
+ void SetHalfStaveScanned(UInt_t val, Bool_t b);
+ void SetDataFormat(UInt_t val) {fDataFormat=val;}
void SetTriggers(UInt_t nsi, UInt_t val);
- void SetChipPresent(UInt_t hs, UInt_t chipi, Bool_t val)
- {fChipPresent[hs*10+chipi]=val;}
+ void SetChipPresent(UInt_t hs, UInt_t chipi, Bool_t val) {fChipPresent[hs*10+chipi]=val;}
void SetRowStart(UInt_t val){fRowStart=val;}
void SetRowEnd(UInt_t val){fRowEnd=val;}
void SetDacStart(UInt_t val){fDacStart=val;}
UInt_t GetType() const {return fType;}
UInt_t GetRunNr() const {return fRunNr;}
UInt_t GetRouterNr() const {return fRouterNr;}
+ Bool_t GetHalfStaveScanned(UInt_t val);
+ UInt_t GetDataFormat() const {return fDataFormat;}
UInt_t GetTriggers(UInt_t nsi) const ;
Bool_t GetChipPresent(UInt_t hs, UInt_t chipi) const {return fChipPresent[hs*10+chipi];}
UInt_t GetRowStart() const {return fRowStart;}
UInt_t GetDacStep() const {return fDacStep;}
protected:
- UInt_t fType; // type of calibration scan
- UInt_t fRunNr; // run nr
- UInt_t fRouterNr; // router nr
- UInt_t fNSteps; // nr of s-curve steps
- TArrayI fTriggers; // number of triggers for the different steps of the scan
- Bool_t fChipPresent[60]; // which chips are present
- UInt_t fRowStart; // row start
- UInt_t fRowEnd; // row end
- UInt_t fDacStep; // dac step
- UInt_t fDacStart; // dac start
- UInt_t fDacEnd; // dac end
+ UInt_t fType; // type of calibration scan
+ UInt_t fDataFormat; // data format (normal or histogram)
+ UInt_t fRunNr; // run nr
+ UInt_t fRouterNr; // router nr
+ Bool_t fHalfStaveScanned[6]; // half stave scanned
+ UInt_t fNSteps; // nr of s-curve steps
+ TArrayI fTriggers; // number of triggers for the different steps of the scan
+ Bool_t fChipPresent[60]; // which chips are present
+ UInt_t fRowStart; // row start
+ UInt_t fRowEnd; // row end
+ UInt_t fDacStep; // dac step
+ UInt_t fDacStart; // dac start
+ UInt_t fDacEnd; // dac end
ClassDef(AliITSOnlineSPDscanInfo,1)
};
// Do the actual preprocessing
- // *** REFERENCE DATA ***
+ // *** CHECK RUN TYPE ***
+
+ TString runType = GetRunType();
+ if(runType != "SPD_STANDALONE_CALIBRATION") {
+ Log("Nothing to do");
+ return 0;
+ }
-// OLD algorithm (commented out)!!!
-// ***********************************************************
-// // Store the container files as reference data (one for each equipment)
-// for (UInt_t eq=0; eq<20; eq++) {
-// Char_t id[20];
-// sprintf(id,"SPDref%d",eq);
-// TList* list = GetFileSources(kDAQ,id); // (the id is actually unique, so always 1 file)
-// if (list) {
-// TObjString* fileNameEntry = (TObjString*) list->First();
-// Char_t* fileName = (Char_t*) GetFile(kDAQ, id, fileNameEntry->GetString().Data());
-// AliITSOnlineSPDscan *scan = new AliITSOnlineSPDscan((Char_t*)fileName);
-// TObjArray* arr = scan->GetAsTObjArray();
-// Char_t refCAT[10];
-// sprintf(refCAT,"Ref%d",eq);
-// StoreReferenceData("SHUTTLE", refCAT, arr, &metaData, 0, 0);
-// }
-// }
-// ***********************************************************
+
+ // *** REFERENCE DATA ***
// Store the container files as reference data (one file for each equipment)
for (UInt_t eq=0; eq<20; eq++) {
// *** NOISY DATA ***
-// OLD algorithm (commented out)!!!
-// ***********************************************************
-// // Read old calibration
-// AliCDBEntry* cdbEntry = GetFromOCDB("Calib", "SPDNoisy");
-// TObjArray* spdEntry;
-// if(cdbEntry) {
-// spdEntry = (TObjArray*)cdbEntry->GetObject();
-// if(!spdEntry) return 0;
-// }
-// else {
-// Log(Form("Old calibration not found in database. A fresh one will be created."));
-// // Create fresh calibration
-// spdEntry = new TObjArray(240);
-// for(Int_t module=0;module<240;module++){
-// AliITSCalibrationSPD* cal = new AliITSCalibrationSPD();
-// spdEntry->Add(cal);
-// }
-// spdEntry->SetOwner(kTRUE);
-// }
-// ***********************************************************
-
// Read old calibration
- AliCDBEntry* cdbEntry = GetFromOCDB("Calib", "SPDNoisy");
+ AliCDBEntry* cdbEntry = GetFromOCDB("Calib", "CalibSPD");
TObjArray* spdEntry;
if(cdbEntry) {
spdEntry = (TObjArray*)cdbEntry->GetObject();
metaData.SetBeamPeriod(0);
metaData.SetResponsible("Henrik Tydesjo");
metaData.SetComment("Preprocessor test for SPD.");
- if (!Store("Calib", "SPDNoisy", spdEntry, &metaData, 0, kTRUE)) {
+ if (!Store("Calib", "CalibSPD", spdEntry, &metaData, 0, kTRUE)) {
return 1;
}
// delete spdEntry;