]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the ShowConfig function
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 Jun 2010 01:01:07 +0000 (01:01 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 Jun 2010 01:01:07 +0000 (01:01 +0000)
MUON/AliMUONCDB.cxx
MUON/AliMUONCDB.h

index 54e97ca9a08586db3da717eac9e9df85c6df0b01..b710d5dc3d5202428f8b9f445dad2ff47258321c 100644 (file)
@@ -1423,3 +1423,72 @@ AliMUONCDB::WriteTracker(Bool_t defaultValues, Int_t startRun, Int_t endRun)
   WriteConfig(startRun,endRun);
 }
 
+//_____________________________________________________________________________
+void 
+AliMUONCDB::ShowConfig()
+{  
+  /// Dumps the current tracker configuration, i.e. number and identity of missing buspatches
+  if (!AliMUONCDB::CheckOCDB()) return;
+  
+  AliMUONCDB::LoadMapping();
+  
+  if (!AliMUONCDB::CheckMapping()) return;
+  
+  AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/Config");
+  
+  if (!e) return ;
+  
+  AliMUONVStore* config = static_cast<AliMUONVStore*>(e->GetObject());
+  
+  TIter nextManu(config->CreateIterator());
+  AliMUONVCalibParam* param;
+  
+  AliMpExMap buspatches;
+  
+  while ( ( param = static_cast<AliMUONVCalibParam*>(nextManu()) ) )
+  {
+    Int_t detElemId = param->ID0();
+    Int_t manuId = param->ID1();
+    Int_t busPatchId = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
+    if ( buspatches.GetValue(busPatchId) == 0x0 ) 
+    {      
+      buspatches.Add(busPatchId,new TObjString(Form("BP%04d",busPatchId)));
+    }
+  }
+
+  TArrayI removed(buspatches.GetSize());
+
+  TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
+  AliMpBusPatch* bp;
+  Int_t n(0);
+  Int_t nok(0);
+  Int_t nremoved(0);
+  
+  while ( ( bp = static_cast<AliMpBusPatch*>(next())))
+  {
+    if ( buspatches.GetValue(bp->GetId()) )
+    {
+      ++nok;
+    }
+    else
+    {
+      removed.SetAt(bp->GetId(),nremoved++);
+    }
+    ++n;
+  }
+  
+  cout << Form("n=%d nok=%d nremoved=%d",n,nok,nremoved) << endl;
+  
+  Int_t* indices = new Int_t[nremoved];
+  
+  TMath::Sort(nremoved,removed.GetArray(),indices,kFALSE);
+  
+  for ( Int_t i = 0; i < nremoved; ++i ) 
+  {
+    Int_t busPatchId = removed[indices[i]];
+    bp = AliMpDDLStore::Instance()->GetBusPatch(busPatchId);
+    bp->Print();
+  }
+  
+  delete[] indices;  
+}
index 9f89395f4ab854090f4d4fc0d4f43717a02e76ee..aaa2c41d12b8e5572e1dfa2e30d366772ba123ee 100644 (file)
@@ -57,6 +57,8 @@ namespace AliMUONCDB
   
   void Plot(const AliMUONVStore& store, const char* name, Int_t nbins=512);
 
+  void ShowConfig();
+  
   void WriteToCDB(const char* calibpath, TObject* object,
                   Int_t startRun, Int_t endRun, Bool_t defaultValues);
   void WriteToCDB(const char* calibpath, TObject* object,