]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliITSOnlineSPDscan and AliITSOnlineSPDscanInfo: Changes in calibration header format...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Apr 2007 13:12:04 +0000 (13:12 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Apr 2007 13:12:04 +0000 (13:12 +0000)
ITS/AliITSOnlineSPDscan.cxx
ITS/AliITSOnlineSPDscan.h
ITS/AliITSOnlineSPDscanInfo.cxx
ITS/AliITSOnlineSPDscanInfo.h
ITS/AliITSPreprocessorSPD.cxx

index da191f0eb6928a51a173e800ddd4d70d0f6e1bb0..ecb2c66f7d3e183893e70e04dc771c5658176a78 100644 (file)
@@ -409,6 +409,16 @@ void AliITSOnlineSPDscan::SetRouterNr(UInt_t val) {
   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);
@@ -466,6 +476,12 @@ UInt_t AliITSOnlineSPDscan::GetRunNr() const {
 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);
 }
index 088b715cb10cd5b9720e02853e4dcafbd2398cea..3f025917dce90972496fa35c21ad65622b5ad2e4 100644 (file)
@@ -34,6 +34,8 @@ class AliITSOnlineSPDscan {
   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);
@@ -54,6 +56,8 @@ class AliITSOnlineSPDscan {
   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;
index 5ac3dc4dbddb7826e8c059722fcc6fef1d0e1dfe..6d1abf99b0367ddb2527ec890b28395e9c88b7c6 100644 (file)
@@ -37,6 +37,9 @@ void AliITSOnlineSPDscanInfo::ClearThis() {
   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;
   }
@@ -49,7 +52,6 @@ UInt_t AliITSOnlineSPDscanInfo::AddScanStep() {
   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) {
@@ -62,9 +64,24 @@ void AliITSOnlineSPDscanInfo::SetTriggers(UInt_t nsi, UInt_t val) {
     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;
+  }
+}
index 1c3c97a6b50b2ec669f94ab78038587e356ba025..b2dce57d2405b5b21a8360c6a46d0c303e531247 100644 (file)
@@ -24,9 +24,10 @@ class AliITSOnlineSPDscanInfo :  public TObject {
   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;}
@@ -40,6 +41,8 @@ class AliITSOnlineSPDscanInfo :  public TObject {
   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;}
@@ -49,17 +52,19 @@ class AliITSOnlineSPDscanInfo :  public TObject {
   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)
     };
index c6e6c89c6ae64bb036be65a288a5839bd3031b20..c1bec5c2e6ae11913803cc920429af760a14a8c0 100644 (file)
@@ -51,26 +51,16 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/)
   // 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++) {
@@ -93,29 +83,8 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/)
 
   // *** 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();
@@ -168,7 +137,7 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/)
     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;