]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update of preprocessors.
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Oct 2009 22:31:17 +0000 (22:31 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Oct 2009 22:31:17 +0000 (22:31 +0000)
- AliMUONVSubprocessor::Initialize method now returns a boolean to know whether the init was ok or not (previously the preprocessor could announce Init OK while it was not...)

- Adding the handling of the tracker configuration in the Pedestal subprocessor, creating a new OCDB object = MUON/Calib/Config. This object is around 85 KBytes, and hopefully will change rarely (only when we have to remove part of the detector from the readout for whatever serious reason).

- Allow mchview to plot the new MUON/Calib/Config object.

26 files changed:
MUON/AliMUON2DStoreValidator.cxx
MUON/AliMUON2DStoreValidator.h
MUON/AliMUONCalibrationData.cxx
MUON/AliMUONCalibrationData.h
MUON/AliMUONGMSSubprocessor.cxx
MUON/AliMUONGMSSubprocessor.h
MUON/AliMUONGainSubprocessor.cxx
MUON/AliMUONGainSubprocessor.h
MUON/AliMUONMchViewApplication.cxx
MUON/AliMUONMchViewApplication.h
MUON/AliMUONOccupancySubprocessor.cxx
MUON/AliMUONOccupancySubprocessor.h
MUON/AliMUONPainterDataSourceFrame.cxx
MUON/AliMUONPedestalEventGenerator.cxx
MUON/AliMUONPedestalSubprocessor.cxx
MUON/AliMUONPedestalSubprocessor.h
MUON/AliMUONPreprocessor.cxx
MUON/AliMUONPreprocessor.h
MUON/AliMUONTrackerIO.cxx
MUON/AliMUONTrackerIO.h
MUON/AliMUONTrackerOCDBDataMaker.cxx
MUON/AliMUONTriggerSubprocessor.cxx
MUON/AliMUONTriggerSubprocessor.h
MUON/AliMUONVSubprocessor.cxx
MUON/AliMUONVSubprocessor.h
MUON/TestMUONPreprocessor.C

index de5a02c27283f390ffdabf88a59bd171f5dd60af..dc7c0397459a9a72c6e066ed6c00ecd889418142 100644 (file)
@@ -296,19 +296,22 @@ AliMUON2DStoreValidator::Report(TList& lines, const TObjArray& chambers)
 
 //_____________________________________________________________________________
 TObjArray* 
-AliMUON2DStoreValidator::Validate(const AliMUONVStore& store)
+AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
+                                  AliMUONVStore* config)
 {                                  
   /// Validate the store. Check only the presence of all manus (i.e.
-  /// check nothing about the values themselves)
+  /// check nothing about the values themselves). 
+  /// Absence of manus which are not in the config is considered as normal.
   
   Bool_t (*kCheck)(const AliMUONVCalibParam&,Int_t) = 0x0;
-  return Validate(store,kCheck);
+  return Validate(store,kCheck,config);
 }
 
 //_____________________________________________________________________________
 TObjArray* 
 AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
-                                  Bool_t (*check)(const AliMUONVCalibParam&,Int_t))
+                                  Bool_t (*check)(const AliMUONVCalibParam&,Int_t),
+                                  AliMUONVStore* config)
 {
   /// Validate the store. 
   /// The check method is used to decide if a store content value
@@ -331,7 +334,11 @@ AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
     if (!test)
     {
       // completely missing manu
-      AddMissingManu(detElemId,manuId);
+      if ( !config || ( config && config->FindObject(detElemId,manuId ) ) )
+      {
+        // manu is in the config but not in the store : that's an error
+        AddMissingManu(detElemId,manuId);
+      }
     }
     else
     {
@@ -358,7 +365,8 @@ AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
 //_____________________________________________________________________________
 TObjArray* 
 AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
-                                  Float_t invalidFloatValue)
+                                  Float_t invalidFloatValue,
+                                  AliMUONVStore* config)
 {
   /// Validate the store. 
   /// The invalidFloatValue is used to decide if a store content value
@@ -379,8 +387,11 @@ AliMUON2DStoreValidator::Validate(const AliMUONVStore& store,
       static_cast<AliMUONVCalibParam*>(store.FindObject(detElemId,manuId));
     if (!test)
     {
-      // completely missing manu
-      AddMissingManu(detElemId,manuId);
+      if ( !config || ( config && config->FindObject(detElemId,manuId ) ) )
+      {
+        // completely missing manu
+        AddMissingManu(detElemId,manuId);
+      }
     }
     else
     {
index 4943f79ddfe09d240200e4a30f77d8eb328b4f75..61cf1c55199cb96e3852ff8dd202e645eb2652d9 100644 (file)
@@ -29,12 +29,13 @@ public:
   AliMUON2DStoreValidator();
   virtual ~AliMUON2DStoreValidator();
   
-  TObjArray* Validate(const AliMUONVStore& store, Float_t invalidFloatValue);
+  TObjArray* Validate(const AliMUONVStore& store, Float_t invalidFloatValue, AliMUONVStore* config=0x0);
 
-  TObjArray* Validate(const AliMUONVStore& store);
+  TObjArray* Validate(const AliMUONVStore& store, AliMUONVStore* config=0x0);
   
   TObjArray* Validate(const AliMUONVStore& store, 
-                      Bool_t (*check)(const AliMUONVCalibParam&,Int_t));
+                      Bool_t (*check)(const AliMUONVCalibParam&,Int_t),
+                      AliMUONVStore* config=0x0);
 
   /// Return statuses
   AliMUONVStore* GetStatus() const { return fStatus; }
index d3eb1ec0cb5bf7c77725e876552c89c685b35ab7..ef68fda7f404896773c3213ee70ec9213cc818da 100644 (file)
@@ -75,7 +75,8 @@ fTriggerEfficiency(0x0),
 fCapacitances(0x0),
 fNeighbours(0x0),
 fOccupancyMap(0x0),
-fRejectList(0x0)
+fRejectList(0x0),
+fConfig(0x0)
 {
 /// Default ctor.
 
@@ -100,6 +101,7 @@ fRejectList(0x0)
     TriggerEfficiency();
     Capacitances();
     Neighbours();
+    Config();
   }
 }
 
@@ -245,6 +247,14 @@ AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
 }
 
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
+{
+  /// Create a new config store from the OCDB for a given run
+  return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
+}
+
 
 //_____________________________________________________________________________
 AliMUONRegionalTriggerConfig*
@@ -429,6 +439,19 @@ AliMUONCalibrationData::Pedestals() const
   return fPedestals;
 }
 
+//_____________________________________________________________________________
+AliMUONVStore*
+AliMUONCalibrationData::Config() const
+{
+  /// Return config
+  
+  if (!fConfig)
+  {
+    fConfig = CreateConfig(fRunNumber);
+  }
+  return fConfig;
+}
+
 //_____________________________________________________________________________
 AliMUONVCalibParam*
 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
@@ -455,6 +478,7 @@ AliMUONCalibrationData::Print(Option_t*) const
   cout << "RunNumber " << RunNumber()
   << " fGains=" << fGains
   << " fPedestals=" << fPedestals
+  << " fConfig=" << fConfig
   << " fHV=" << fHV
   << " fTriggerDCS=" << fTriggerDCS
   << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
@@ -512,6 +536,8 @@ AliMUONCalibrationData::Reset()
 {
 /// Reset all data
 
+  delete fConfig;
+  fConfig = 0x0;
   delete fPedestals;
   fPedestals = 0x0;
   delete fGains;
@@ -615,6 +641,15 @@ AliMUONCalibrationData::Check(Int_t runNumber)
   {
     AliInfoClass("Pedestals read OK");
   }
+
+  if ( ! CreateConfig(runNumber) )
+  {
+    AliErrorClass("Could not read config");
+  }
+  else
+  {
+    AliInfoClass("Config read OK");
+  }
   
   if ( ! CreateRegionalTriggerConfig(runNumber) )
   {
index a8b912390f3f91739061f950cde393fba74b4a18..5541af3ac986c4ee332fab2acd6e0f3eb680a30f 100644 (file)
@@ -70,6 +70,9 @@ public:
   /// Create a pedestal store (which must be deleted) from OCDB for the given run
   static AliMUONVStore* CreatePedestals(Int_t runNumber, Int_t* startOfValidity=0);
 
+  /// Create a configuration store (which must be deleted) from OCDB for the given run
+  static AliMUONVStore* CreateConfig(Int_t runNumber, Int_t* startOfValidity=0);
+
   /// Create a regional trigger mask store (which must be deleted) for a given run
   static AliMUONRegionalTriggerConfig* CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity=0);
 
@@ -105,6 +108,9 @@ public:
   /// Get the pedestal store
   AliMUONVStore* Pedestals() const;
 
+  /// Get the config store
+  AliMUONVStore* Config() const;
+  
   /// Get the occupancy map store
   AliMUONVStore* OccupancyMap() const;
 
@@ -166,8 +172,10 @@ private:
 
   static AliMUONVStore* fBypassPedestals;
   static AliMUONVStore* fBypassGains;
-    
-  ClassDef(AliMUONCalibrationData,12) // Storage for all MUON calibration data.
+  
+  mutable AliMUONVStore* fConfig; //!< configuration of the tracker
+  
+  ClassDef(AliMUONCalibrationData,13) // Storage for all MUON calibration data.
 };
 
 #endif
index 0ac04540f2c0fe91c71112ac7d438a2d0e0279ab..d0d5e3bc65a933ccfadc46fe0c1ee63f4398ccd0 100644 (file)
@@ -69,7 +69,7 @@ AliMUONGMSSubprocessor::~AliMUONGMSSubprocessor()
 
 
 //______________________________________________________________________________
-void  AliMUONGMSSubprocessor::Initialize(Int_t /*run*/, 
+Bool_t  AliMUONGMSSubprocessor::Initialize(Int_t /*run*/, 
                                          UInt_t /*startTime*/, UInt_t /*endTime*/)
 {
 /// Instantiate geometry transformer
@@ -78,6 +78,7 @@ void  AliMUONGMSSubprocessor::Initialize(Int_t /*run*/,
     fTransformer = new AliMUONGeometryTransformer();
     fTransformer->CreateModules();
   }  
+  return kTRUE;
 }                                           
 
 //______________________________________________________________________________
index fcf544cbbd14a77603784d4db9a5c87db78cac57..143c04858e09109e75c0d1f0b14ea6900b3df7d2 100644 (file)
@@ -29,7 +29,7 @@ class AliMUONGMSSubprocessor : public AliMUONVSubprocessor
     virtual ~AliMUONGMSSubprocessor();
 
     // methods
-    virtual void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+    virtual Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
     virtual UInt_t Process(TMap* /*dcsAliasMap*/);
 
   private:
index bfdea997636ef4bac5f2d05484752e84f1cc68de..ed95018c53e15a50c0aab508d11c906a8c3cb43d 100644 (file)
@@ -75,7 +75,7 @@ AliMUONGainSubprocessor::~AliMUONGainSubprocessor()
 }
 
 //_____________________________________________________________________________
-void 
+Bool_t 
 AliMUONGainSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
 {
   /// When starting a new run, reads in the Gains ASCII files.
@@ -113,6 +113,8 @@ AliMUONGainSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
     }
   }
   
+  delete sources;
+
   if ( fSkip ) 
   {
     delete fGains;
@@ -124,9 +126,10 @@ AliMUONGainSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
     Master()->Log("Failed to read any Gains");
     delete fGains;
     fGains = 0x0;
+    return kFALSE;
   }
   
-  delete sources;
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
index b144fdea53d8f3b594e6b7de8e91578537f78640..d6bb61ae270a3d7783df7297e59797533cabf030 100644 (file)
@@ -29,7 +29,7 @@ public:
   AliMUONGainSubprocessor(AliMUONPreprocessor* master);
   virtual ~AliMUONGainSubprocessor();
   
-  void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   UInt_t Process(TMap* dcsAliasMap);
   
 private:
index e7678a091f420b5f8ff2ac265811be604b09b631..fdf57a7ffb85cf89e6f3053be653bda480e0595c 100644 (file)
@@ -414,14 +414,18 @@ AliMUONMchViewApplication::ReleaseNotes()
   
   TGTextView* rn = new TGTextView(t);
 
+  rn->AddLine("1.01");
+  rn->AddLine("");
+  rn->AddLine("Added the configuration as a possible OCDB data source");
+  rn->AddLine("");
+  
   rn->AddLine("1.00");
   rn->AddLine("");
   rn->AddLine("Added the Status and StatusMap as a possible OCDB data source");
   rn->AddLine("");
   rn->AddLine("Added one (computed) dimension to the Gains data source = 1/a1/0.2 (mV/fC)");
   rn->AddLine("");
-  
-  
+    
   rn->AddLine("0.99a");
   rn->AddLine("");
   rn->AddLine("Added the --de and --chamber options");
index 937653971f15072fe83d2d3b454fc69f8fdb6780..8b1260a613630c2fdafea2e245ef568b524707be 100644 (file)
@@ -30,7 +30,7 @@ public:
   void HandleMenu(Int_t i);
 
   /// Return the version number of the mchview application
-  static const char* Version() { return "1.00"; }
+  static const char* Version() { return "1.01"; }
   
   /// Return the SVN revision  and version number of the mchview application
   static const char* FullVersion() { return Form("mchview Version %s ($Id$)",Version()); }
index 5ff5afbb60a66ebbf649eda11bf25fc5e96317cf..cd4bc3a1d1fc95578acd123ff27a8784b9364055 100644 (file)
@@ -58,7 +58,7 @@ AliMUONOccupancySubprocessor::~AliMUONOccupancySubprocessor()
 }
 
 //_____________________________________________________________________________
-void 
+Bool_t 
 AliMUONOccupancySubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
 {
   /// When starting a new run, reads in the occupancy ASCII files.
@@ -87,13 +87,16 @@ AliMUONOccupancySubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t end
     }
   }
   
+  delete sources;
+
   if (!n)
   {
     Master()->Log("Failed to read any occupancy");
     delete fOccupancyMap;
     fOccupancyMap = 0;
+    return kFALSE;
   }
-  delete sources;
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
index c58276dd765091645e2bab722c831ddd1f47f56b..6e107fe55958e225a3efa440618dd46d5894f523 100644 (file)
@@ -24,7 +24,7 @@ public:
   AliMUONOccupancySubprocessor(AliMUONPreprocessor* master);
   virtual ~AliMUONOccupancySubprocessor();
   
-  void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   UInt_t Process(TMap* dcsAliasMap);
   void Print(Option_t* opt="") const;
 
index e5e306d7dc4b3e918921e60687f0df36a18f99f4..d48913bf33941835affcdecbff944ccde2632626 100644 (file)
@@ -181,6 +181,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
   fOCDBTypes->AddEntry("Occupancy",4);
   fOCDBTypes->AddEntry("StatusMap",5);
   fOCDBTypes->AddEntry("Status",6);
+  fOCDBTypes->AddEntry("Config",7);
   fOCDBTypes->Select(0);
   fOCDBTypes->Resize(100,20);
     
index b07d17ee9121c3689b6aba7e3a8665409f696db2..c3e2d73ab55884187bdff26a7bd54075b7415c5b 100644 (file)
@@ -152,7 +152,7 @@ AliMUONPedestalEventGenerator::ConvertRawFilesToDate()
   
   const Int_t kIDet = AliDAQ::DetectorID("MUONTRK");
   
-  const Int_t kNLDCs = TMath::CeilNint(AliDAQ::NumberOfLdcs(kIDet));
+  const Int_t kNLDCs = 5;//TMath::CeilNint(AliDAQ::NumberOfLdcs(kIDet));
   
   char* path = gSystem->Which(gSystem->Getenv("PATH"), "dateStream");
   if (!path) 
@@ -174,7 +174,7 @@ AliMUONPedestalEventGenerator::ConvertRawFilesToDate()
     char command[256];
     // Note the option -s. It is used in order to avoid
     // the generation of SOR/EOR events.
-    sprintf(command, "dateStream -s -D -o %s.LDC%d -# %d -C", 
+    sprintf(command, "dateStream -c -D -o %s.LDC%d -# %d -C", 
             fDateFileName.Data(), iFile, runLoader->GetNumberOfEvents());
     pipe[iFile] = gSystem->OpenPipe(command, "w");
   }
index ccc7a545268f02c459ffcbd5e7bdcef9037b8e2c..056168890f5378b61f084d660aec26957cc01e60 100644 (file)
@@ -55,7 +55,9 @@ AliMUONPedestalSubprocessor::AliMUONPedestalSubprocessor(AliMUONPreprocessor* ma
 : AliMUONVSubprocessor(master,
                        "Pedestals",
                        "Upload MUON Tracker pedestals to OCDB"),
-fPedestals(0x0)
+fPedestals(0x0),
+fConfig(0x0),
+fConfigChanged(kFALSE)
 {
   /// default ctor
 }
@@ -65,10 +67,11 @@ AliMUONPedestalSubprocessor::~AliMUONPedestalSubprocessor()
 {
   /// dtor
   delete fPedestals;
+  delete fConfig;
 }
 
 //_____________________________________________________________________________
-void 
+Bool_t 
 AliMUONPedestalSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
 {
   /// When starting a new run, reads in the pedestals ASCII files.
@@ -79,6 +82,9 @@ AliMUONPedestalSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endT
   delete fPedestals;
   fPedestals = new AliMUON2DMap(kTRUE);
   
+  delete fConfig;
+  fConfig = new AliMUON2DMap(kTRUE);
+  
   Master()->Log(Form("Reading pedestal files for Run %d startTime %ld endTime %ld",
                      run,startTime,endTime));
   
@@ -86,24 +92,64 @@ AliMUONPedestalSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endT
   TIter next(sources);
   TObjString* o(0x0);
   Int_t n(0);
+  Int_t npedFiles(0);
   
   while ( ( o = static_cast<TObjString*>(next()) ) )
   {
     TString fileName(Master()->GetFile(kSystem,kId,o->GetName()));
-    Int_t ok = ReadFile(fileName.Data());
+    Int_t ok = ReadPedestalFile(fileName.Data());
     if (ok>0)
     {
       n += ok;
+      ++npedFiles;
     }
   }
+
+  delete sources;
   
   if (!n)
   {
     Master()->Log("Failed to read any pedestals");
     delete fPedestals;
     fPedestals = 0;
+    delete fConfig;
+    fConfig = 0;
+    return kFALSE;
+  }
+  
+  const char* kIdConf = "CONFIG";
+
+  sources = Master()->GetFileSources(kSystem,kIdConf);
+  TIter nextConf(sources);
+  Int_t nconf(0);
+  Int_t nconfFiles(0);
+  
+  fConfigChanged = kFALSE;
+  
+  while ( ( o = static_cast<TObjString*>(nextConf()) ) )
+  {
+    TString fileName(Master()->GetFile(kSystem,kIdConf,o->GetName()));
+    Int_t ok = ReadConfigFile(fileName.Data());
+    if (ok>0)
+    {
+      nconf += ok;
+      ++nconfFiles;
+    }
   }
+  
   delete sources;
+  
+  if ( npedFiles != nconfFiles )
+  {
+    Master()->Log(Form("ERROR : Number of config files (%d) different from number of pedestal files (%d)",nconfFiles,npedFiles));
+    delete fPedestals;
+    fPedestals = 0;
+    delete fConfig;
+    fConfig = 0;
+    return kFALSE;
+  }
+  
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
@@ -112,9 +158,9 @@ AliMUONPedestalSubprocessor::Process(TMap* /*dcsAliasMap*/)
 {
   /// Store the pedestals into the CDB
   
-  if (!fPedestals) 
+  if (!fPedestals || !fConfig
   {
-    // this is the only reason to fail for the moment : getting no pedestal
+    // this is the only reason to fail for the moment : getting no pedestal or no config
     // at all.
     return 1;
   }
@@ -123,7 +169,7 @@ AliMUONPedestalSubprocessor::Process(TMap* /*dcsAliasMap*/)
 
   Master()->Log("Validating");
 
-  TObjArray* chambers = validator.Validate(*fPedestals);
+  TObjArray* chambers = validator.Validate(*fPedestals,fConfig);
   
   if (chambers)
   {
@@ -143,7 +189,11 @@ AliMUONPedestalSubprocessor::Process(TMap* /*dcsAliasMap*/)
     }
   }
   
-  Master()->Log("Storing pedestals");
+  Master()->Log("Storing pedestals...");
+  if ( fConfigChanged ) 
+  {
+    Master()->Log("...and configuration, as it has changed");
+  }
   
   AliCDBMetaData metaData;
        metaData.SetBeamPeriod(0);
@@ -154,13 +204,16 @@ AliMUONPedestalSubprocessor::Process(TMap* /*dcsAliasMap*/)
   
   Bool_t validToInfinity = kTRUE;
        Bool_t result = Master()->Store("Calib", "Pedestals", fPedestals, &metaData, 0, validToInfinity);
-  
+  if ( fConfigChanged ) 
+  {
+    result = result && Master()->Store("Calib", "Config", fConfig, &metaData, 0, validToInfinity);
+  }
   return ( result != kTRUE ); // return 0 if everything is ok.  
 }
 
 //_____________________________________________________________________________
 Int_t
-AliMUONPedestalSubprocessor::ReadFile(const char* filename)
+AliMUONPedestalSubprocessor::ReadPedestalFile(const char* filename)
 {
   /// Read the pedestals from an ASCII file.                                  \n
   /// Format of that file is one line per channel :                           \n
@@ -187,6 +240,34 @@ AliMUONPedestalSubprocessor::ReadFile(const char* filename)
   return n;
 }
 
+//_____________________________________________________________________________
+Int_t
+AliMUONPedestalSubprocessor::ReadConfigFile(const char* filename)
+{
+  /// Read the configuration from an ASCII file.                              
+  /// Format of that file is one line per manu :                              
+  /// BUS_PATCH MANU_ADDR
+  /// And the first line contains "unchanged" if the configuration is the same
+  /// as before.
+  /// Return kFALSE if reading was not successfull.                           
+  ///
+  
+  TString sFilename(gSystem->ExpandPathName(filename));
+  
+  Master()->Log(Form("Reading %s",sFilename.Data()));
+  
+  Int_t n = AliMUONTrackerIO::ReadConfig(sFilename.Data(),*fConfig,fConfigChanged);
+  
+  switch (n)
+  {
+    case -1:
+      Master()->Log(Form("Could not open %s",sFilename.Data()));
+      break;
+  }
+  
+  return n;
+}
+
 
 //_____________________________________________________________________________
 void
@@ -194,4 +275,6 @@ AliMUONPedestalSubprocessor::Print(Option_t* opt) const
 {
   /// ouput to screen
   if (fPedestals) fPedestals->Print("",opt);
+  if (fConfig) fConfig->Print("",opt);
 }
+
index 699d341804c9a9808bc10c8c9e738a19bf05fd4e..cc231eb5d7c469a5465a8dac104d009d698ab621 100644 (file)
@@ -25,7 +25,7 @@ public:
   AliMUONPedestalSubprocessor(AliMUONPreprocessor* master);
   virtual ~AliMUONPedestalSubprocessor();
   
-  void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   UInt_t Process(TMap* dcsAliasMap);
   void Print(Option_t* opt="") const;
   
@@ -35,12 +35,15 @@ private:
   /// Not implemented
   AliMUONPedestalSubprocessor& operator=(const AliMUONPedestalSubprocessor&);
   
-  Int_t ReadFile(const char* filename);
+  Int_t ReadPedestalFile(const char* filename);
+  Int_t ReadConfigFile(const char* filename);
 
 private:
   AliMUONVStore* fPedestals; //!< Pedestals for the MUON TRK
+  AliMUONVStore* fConfig; //!< Configuration (i.e. list of (buspatch,manu)) for the MUON TRK
+  Bool_t fConfigChanged; //!< flag to trigger the saving of the configuration
   
-  ClassDef(AliMUONPedestalSubprocessor,1) // A shuttle preprocessor for MUON TRK pedestals
+  ClassDef(AliMUONPedestalSubprocessor,2) // A shuttle preprocessor for MUON TRK pedestals
 };
 
 #endif
index 2488db2a5e9ec2e37dc905777c13b4afa5cfda38..9265a1cc873e2adb57cd2ff6aebb267bef6c9533 100644 (file)
@@ -120,13 +120,17 @@ AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
     }
   }
   
+  Int_t nok(0);
+
   if (IsValid())
   {
     // loop over subtasks and initialize them
     for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
     {
-      Subprocessor(i)->Initialize(run,startTime,endTime);
+      Bool_t ok = Subprocessor(i)->Initialize(run,startTime,endTime);
+      if (ok) ++nok;
     }
+    if (nok !=  fSubprocessors->GetLast()+1) fIsValid = kFALSE;
   }
   Log(Form("Initialize was %s",( IsValid() ? "fine" : "NOT OK")));
 }
index 1d3247eef05fc536b4bc665d99acbc9ad8774368..95e33b93ff914717ecf2353066aec0dc7e7048ec 100644 (file)
@@ -65,6 +65,9 @@ public:
   /// Whether we should do something or not
   Bool_t IsApplicable() { return fIsApplicable; }
   
+  TString GetLogBookParam(const char* parname)
+  { return TString(AliPreprocessor::GetRunParameter(parname)); }
+  
 protected:
   AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle);
   virtual ~AliMUONPreprocessor();
index 6e766d9fa977c50f076a805dd63ae6b64ead2193..c14047ad8434675034a3102beb7844ad1ae5a3d8 100644 (file)
 ClassImp(AliMUONTrackerIO)
 /// \endcond
 
+#include "AliDCSValue.h"
 #include "AliLog.h"
 #include "AliMUONCalibParamND.h"
 #include "AliMUONCalibParamNF.h"
 #include "AliMUONVStore.h"
 #include "AliMpConstants.h"
 #include "AliMpDDLStore.h"
+#include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
 #include <Riostream.h>
 #include <TClass.h>
@@ -205,6 +207,14 @@ AliMUONTrackerIO::DecodePedestals(TString data, AliMUONVStore& pedStore)
     std::istringstream sin(line);
     sin >> busPatchID >> manuID >> manuChannel >> pedMean >> pedSigma;
     Int_t detElemID = AliMpDDLStore::Instance()->GetDEfromBus(busPatchID);
+    
+    if ( !AliMpDEManager::IsValidDetElemId(detElemID) )
+    {
+      AliErrorClass(Form("Got an invalid DE = %d from busPatchId=%d manuId=%d",
+                         detElemID,busPatchID,manuID));
+      continue;
+    }
+    
     AliDebugClass(3,Form("BUSPATCH %3d DETELEMID %4d MANU %3d CH %3d MEAN %7.2f SIGMA %7.2f",
                     busPatchID,detElemID,manuID,manuChannel,pedMean,pedSigma));
                    
@@ -343,6 +353,14 @@ AliMUONTrackerIO::DecodeGains(TString data, AliMUONVStore& gainStore,
            &a0,&a1,&thres,&qual); 
     AliDebugClass(3,Form("line=%s",line));
     Int_t detElemID = AliMpDDLStore::Instance()->GetDEfromBus(busPatchID);
+    
+    if ( !AliMpDEManager::IsValidDetElemId(detElemID) )
+    {
+      AliErrorClass(Form("Got an invalid DE = %d from busPatchId=%d manuId=%d",
+                         detElemID,busPatchID,manuID));
+      continue;
+    }
+    
     AliDebugClass(3,Form("BUSPATCH %3d DETELEMID %4d MANU %3d CH %3d A0 %7.2f "
                     "A1 %e THRES %5d QUAL %x",
                     busPatchID,detElemID,manuID,manuChannel,a0,a1,thres,qual));
@@ -433,3 +451,118 @@ AliMUONTrackerIO::ReadCapacitances(const char* file, AliMUONVStore& capaStore)
   
   return ngenerated;
 }
+
+//_____________________________________________________________________________
+Int_t 
+AliMUONTrackerIO::ReadConfig(const char* filename, AliMUONVStore& confStore, Bool_t& changed)
+{
+  /// Read config file (produced by the MUONTRKda.exe program for instance)
+  /// and append the read values into the given VStore
+  /// To be used when the input is a file (for instance when reading data 
+  /// from the OCDB).
+  /// changed must be set to kFALSE before calling this method for the first time
+  /// (then the subsequent calls must not set it !)
+  ///
+  
+  TString sFilename(gSystem->ExpandPathName(filename));
+  
+  std::ifstream in(sFilename.Data());
+  if (!in.good()) 
+  {
+    return kCannotOpenFile;
+  }
+  
+  TString datastring;
+  ostringstream stream;
+  char line[1024];
+  while ( in.getline(line,1024) )
+       stream << line << "\n";
+  datastring = TString(stream.str().c_str());
+  
+  in.close();
+  
+  return DecodeConfig(datastring,confStore,changed);
+}
+
+//_____________________________________________________________________________
+Int_t 
+AliMUONTrackerIO::DecodeConfig(TString data, AliMUONVStore& confStore, Bool_t& changed)
+{
+  /// Read config data (produced by the MUONTRKda.exe program for instance)
+  /// and append the read values into the given VStore
+  /// To be used when the input is a TString (for instance when getting data 
+  /// from AMORE DB).
+  /// changed must be set to kFALSE before calling this method for the first time
+  /// (then the subsequent calls must not set it !)
+
+  char line[1024];
+  Int_t busPatchID, manuID;
+  Int_t n(0);
+  istringstream in(data.Data());
+  
+  while ( in.getline(line,1024) )
+  {
+    AliDebugClass(3,Form("line=%s",line));
+    if ( line[0] == '#' ) 
+    {
+      TString sline(line);
+      sline.ToUpper();
+      if (sline.Contains("CHANGED") && !sline.Contains("UNCHANGED")) changed = kTRUE;
+      continue;
+    }
+    std::istringstream sin(line);
+    sin >> busPatchID >> manuID;
+
+    Int_t detElemID = AliMpDDLStore::Instance()->GetDEfromBus(busPatchID);
+
+    if ( !AliMpDEManager::IsValidDetElemId(detElemID) )
+    {
+      AliErrorClass(Form("Got an invalid DE = %d from busPatchId=%d manuId=%d",
+                         detElemID,busPatchID,manuID));
+      continue;
+    }
+    
+    AliMUONVCalibParam* conf = 
+    static_cast<AliMUONVCalibParam*>(confStore.FindObject(detElemID,manuID));
+    if (!conf) 
+    {
+      conf = new AliMUONCalibParamNF(1,1,detElemID,manuID,1);
+      confStore.Add(conf);
+    }
+    ++n;
+  }
+  
+  return n;
+}
+
+//_____________________________________________________________________________
+Int_t 
+AliMUONTrackerIO::WriteConfig(ofstream& out, AliMUONVStore& confStore)
+{
+  /// Write the conf store as an ASCII file
+  /// Note that we are converting (back) the detElemId into a busPatchId
+  /// Return the number of lines written
+  
+  if ( !AliMpDDLStore::Instance() ) 
+  {
+    cout << "ERROR: mapping not loaded. Cannot work" << endl;
+    return 0;
+  }
+  
+  TIter next(confStore.CreateIterator());
+  AliMUONVCalibParam* param;
+  Int_t n(0);
+  
+  while ( (param=static_cast<AliMUONVCalibParam*>(next())) )
+  {
+    Int_t detElemId = param->ID0();
+    Int_t manuId = param->ID1();
+    
+    Int_t busPatchId = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
+    ++n;
+    
+    out << busPatchId << " " << manuId << endl;
+  }
+  return n;
+}
+
index 510b7ca1f669c3cece26a373d2372e263a0d6449..ee61b0d93424ab7d272dc817e58454c813251fc7 100644 (file)
@@ -25,6 +25,10 @@ public:
   AliMUONTrackerIO();
   virtual ~AliMUONTrackerIO();
 
+  static Int_t ReadConfig(const char* filename, AliMUONVStore& confStore, Bool_t& changed);
+  static Int_t DecodeConfig(TString data, AliMUONVStore& confStore, Bool_t& changed);
+  static Int_t WriteConfig(ofstream& out, AliMUONVStore& confStore);
+  
   static Int_t ReadPedestals(const char* filename, AliMUONVStore& pedStore);
   static Int_t DecodePedestals(TString data, AliMUONVStore& pedStore);
   
index a93e4cfd4acbdcaf268aa32e4e068a57c85df41d..a4432609b1f530217243ed85cb53c91a8f44659d 100644 (file)
@@ -78,6 +78,13 @@ AliMUONTrackerOCDBDataMaker::AliMUONTrackerOCDBDataMaker(const char* ocdbPath,
                store = AliMUONCalibrationData::CreatePedestals(runNumber,&startOfValidity);
                fData = CreateDataPedestals(startOfValidity);
        }
+  else if ( stype == "CONFIG" ) 
+  {
+    store = AliMUONCalibrationData::CreateConfig(runNumber,&startOfValidity);
+    fData = new AliMUONTrackerData(Form("CONFIG%d",startOfValidity),"Configuration",1);
+    fData->SetDimensionName(0,"there");
+    fData->DisableChannelLevel();
+  }
        else if ( stype == "OCCUPANCY" )
        {
                store = AliMUONCalibrationData::CreateOccupancyMap(runNumber,&startOfValidity);
index 57b904049626c7bce7c33b0cb501a59ad683f6d8..bea01143d26e214e171d04fec2e3143b191ca61b 100644 (file)
@@ -84,7 +84,7 @@ AliMUONTriggerSubprocessor::GetFileName(const char* fid) const
 }
 
 //_____________________________________________________________________________
-void 
+Bool_t 
 AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
 {
   /// When starting a new run, reads in the trigger online files.
@@ -114,7 +114,7 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
   {
     Master()->Log("FATAL ERROR : DA does not seem to have been run !!!");
     Master()->Invalidate();
-    return;
+    return kFALSE;
   }
   
   // OK. We have an exportedFiles.dat file at hand.
@@ -130,7 +130,7 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
   
   if ((globalFile+regionalFile+localFile+lutFile) == 0) {
     Master()->Log("No file(s) to be processed for this run. Exiting.");
-    return;
+    return kTRUE;
   }
   
   delete fRegionalConfig; fRegionalConfig = 0x0;
@@ -151,7 +151,7 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
   {
     Master()->Log("Could not read some input file(s). Aborting");
     Master()->Invalidate();
-    return;
+    return kFALSE;
   }
   
   if ( regionalFile ) fRegionalConfig = new AliMUONRegionalTriggerConfig();
@@ -192,6 +192,7 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi
       fLUT = 0x0;
     }
   }
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
index 5a12de2c29d5c1d327dac808a9a616bba89f3dc2..8450f2be7462858034b64e64565f5117cb23a2c8 100644 (file)
@@ -29,7 +29,7 @@ public:
   AliMUONTriggerSubprocessor(AliMUONPreprocessor* master);
   virtual ~AliMUONTriggerSubprocessor();
   
-  void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   UInt_t Process(TMap* dcsAliasMap);
   
 private:
index 9391585ff5f3f1f77c78d5fa9475e244af58e0b4..8cf3c40d53d9b85bdedb89229f3a30c9d77c4953 100644 (file)
@@ -52,14 +52,15 @@ AliMUONVSubprocessor::~AliMUONVSubprocessor()
 }
 
 //_____________________________________________________________________________
-void
+Bool_t
 AliMUONVSubprocessor::Initialize(Int_t /*run*/, 
                                  UInt_t startTime, 
                                  UInt_t endTime)
 {
   /// optional
-  fStartTime = startTime;
-  fEndTime = endTime;
+  fStartTime = startTime; // time_created
+  fEndTime = endTime; // time_completed
+  return kTRUE;
 }
 
 //_____________________________________________________________________________
index 094bc74253bf70d88c88001dbc1b16b343c2ee95..fb61f426428532d6b007fdb3d27e5a5d7abd2067 100644 (file)
@@ -27,7 +27,7 @@ public:
                        const char* name="", const char* title="");
   virtual ~AliMUONVSubprocessor();
   
-  virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  virtual Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   
   /// Process this sub-task
   virtual UInt_t Process(TMap* dcsAliasMap) = 0;
index 682398304e3957b3d6ee508ea2cf434a29a02fd0..be2de3132a2d449c19753a69b8fcb87507e3505d 100644 (file)
 /// the rootlogon.C there) before compiling this macro :
 /// <pre>
 /// gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
-/// gSystem->Load("$ALICE_ROOT/MUON/libMUONshuttle");
+/// gSystem->Load("libMUONshuttle");
 /// </pre>
+/// Last line above assume you have $ALICE_ROOT/MUON/lib/tgt_[arch] (where
+/// libMUONshuttle is located) in your LD_LIBRARY_PATH
 ///
 /// Having $ALICE_ROOT/SHUTTLE/TestShuttle directory in your LD_LIBRARY_PATH
 /// (or DYLD_LIBRARY_PATH on Mac OS X) won't hurt either...
 ///    LDC1.ped
 ///    LDC2.ped
 ///    LDC3.ped
+///    LDC4.conf
+/// CONFIG/
+///    LDC0.conf
+///    LDC1.conf
+///    LDC2.conf
+///    LDC3.conf
+///    LDC4.conf
 /// TRIGGER/
 ///    ExportedFiles.dat (mandatory)
 ///    MtgGlobalCrate-1.dat
 
 #include "AliLog.h"
 
+#include "AliMpBusPatch.h"
 #include "AliMpExMap.h"
 #include "AliMpHelper.h"
+#include "AliMpDDLStore.h"
 #include "AliMpDCSNamer.h"
 #include "AliMpCDB.h"
 
 #include "TRandom.h"
 #endif
 
+//______________________________________________________________________________
 void TestMUONPreprocessor(Int_t runNumber=80, 
                           const char* runType="CALIBRATION",
                           const char* sourceDirectory="/afs/cern.ch/user/l/laphecet/public")
@@ -139,6 +151,9 @@ void TestMUONPreprocessor(Int_t runNumber=80,
 
   // create AliTestShuttle instance
   // The parameters are run, startTime, endTime
+  
+  gSystem->Load("libTestShuttle.so");
+
   AliTestShuttle* shuttle = new AliTestShuttle(runNumber, 0, 1);
   
   const char* inputCDB = "local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB";
@@ -153,6 +168,8 @@ void TestMUONPreprocessor(Int_t runNumber=80,
   if ( rt.Contains("PHYSICS") )
   {
     // Create DCS aliases
+    UInt_t startTime, endTime;
+    
     TMap* dcsAliasMap = CreateDCSAliasMap(inputCDB, runNumber);
 
     if ( dcsAliasMap ) 
@@ -181,7 +198,14 @@ void TestMUONPreprocessor(Int_t runNumber=80,
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1",Form("%s/PEDESTALS/LDC1.ped",sourceDirectory));
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2",Form("%s/PEDESTALS/LDC2.ped",sourceDirectory));
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3",Form("%s/PEDESTALS/LDC3.ped",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC4",Form("%s/PEDESTALS/LDC4.ped",sourceDirectory));
 
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","CONFIG","LDC0",Form("%s/CONFIG/LDC0.conf",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","CONFIG","LDC1",Form("%s/CONFIG/LDC1.conf",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","CONFIG","LDC2",Form("%s/CONFIG/LDC2.conf",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","CONFIG","LDC3",Form("%s/CONFIG/LDC3.conf",sourceDirectory));
+  shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","CONFIG","LDC4",Form("%s/CONFIG/LDC4.conf",sourceDirectory));
+  
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0",Form("%s/GAINS/LDC0.gain",sourceDirectory));
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC1",Form("%s/GAINS/LDC1.gain",sourceDirectory));
   shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC2",Form("%s/GAINS/LDC2.gain",sourceDirectory));
@@ -215,6 +239,70 @@ void TestMUONPreprocessor(Int_t runNumber=80,
   shuttle->Process();
 }
 
+//______________________________________________________________________________
+void GenerateConfig()
+{
+  /// Generate "fake" configuration files for the tracker. One per LDC.
+  
+  Bool_t undefStorage(kFALSE);
+  
+  AliCDBManager* man = AliCDBManager::Instance();
+  if (!man->IsDefaultStorageSet())
+  {
+    undefStorage = kTRUE;
+    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    man->SetRun(0);
+  }
+  
+  // Load mapping
+  Bool_t ok = AliMpCDB::LoadDDLStore();
+  
+  if (undefStorage)
+  {
+    man->UnsetDefaultStorage();
+  }
+  
+  if (!ok)
+  {
+    AliErrorGeneral("GenerateConfig","Could not load DDLStore from OCDB");
+    return;
+  }
+  
+  ofstream* files[5];
+  for ( Int_t i = 0; i < 5; ++i ) 
+  {
+    files[i]=0;
+  }
+  
+  TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
+  AliMpBusPatch* bp;
+  
+  while ( ( bp = static_cast<AliMpBusPatch*>(next()) ) )
+  {
+    Int_t ddl = bp->GetDdlId();
+    
+    Int_t ldc = ddl/4;
+    
+    if (!files[ldc])
+    {
+      files[ldc] = new ofstream(Form("LDC%d.conf",ldc));
+      *(files[ldc]) << "# changed" << endl;
+    }
+
+    for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu ) 
+    {
+      *(files[ldc]) << bp->GetId() << " " << bp->GetManuId(imanu) << endl;
+    }        
+  }
+  
+  for ( Int_t i = 0; i < 5; ++i ) 
+  {
+    if ( files[i] ) files[i]->close();
+    delete files[i];
+  }
+}
+
+//______________________________________________________________________________
 TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
 {
   /// Creates a DCS structure for MUON Tracker HV and Trigger DCS and Currents
@@ -272,54 +360,52 @@ TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
       TString& aliasName = alias->String();
       if ( aliasName.Contains("sw") && sDetName.Contains("TRACKER")) 
       {
-       // HV Switch (St345 only)
-       TObjArray* valueSet = new TObjArray;
-       valueSet->SetOwner(kTRUE);
-       Bool_t bvalue = kTRUE;
-//      Float_t r = random.Uniform();
-//      if ( r < 0.007 ) value = kFALSE;      
-//      if ( aliasName.Contains("DE513sw2") ) value = kFALSE;
-      
-       for ( UInt_t timeStamp = 0; timeStamp < 60*3; timeStamp += 60 )
-       {
-         AliDCSValue* dcsValue = new AliDCSValue(bvalue,timeStamp);
-         valueSet->Add(dcsValue);
-       }
-       aliasMap->Add(new TObjString(*alias),valueSet);
+        // HV Switch (St345 only)
+        TObjArray* valueSet = new TObjArray;
+        valueSet->SetOwner(kTRUE);
+        Bool_t bvalue = kTRUE;
+        //      Float_t r = random.Uniform();
+        //      if ( r < 0.007 ) value = kFALSE;      
+        //      if ( aliasName.Contains("DE513sw2") ) value = kFALSE;
+        
+        for ( UInt_t timeStamp = 0; timeStamp < 60*3; timeStamp += 60 )
+        {
+          AliDCSValue* dcsValue = new AliDCSValue(bvalue,timeStamp);
+          valueSet->Add(dcsValue);
+        }
+        aliasMap->Add(new TObjString(*alias),valueSet);
       }
       else
       {
-       TObjArray* valueSet = new TObjArray;
-       valueSet->SetOwner(kTRUE);
-       for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
-       {
-         Float_t value = 0;
-         if(sDetName.Contains("TRACKER")){
-           value = random.Gaus(1750,62.5);
-           if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
-         }
-         else if(aliasName.Contains("iMon")){
-           value = random.Gaus(2.,0.4);
-         }
-         else {
-           value = random.Gaus(8000.,16.);
-         }
-       
-         AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
-         valueSet->Add(dcsValue);
-       }
-       if ( aliasName == "MchHvLvLeft/Chamber04Left/Slat06.actual.vMon" ) continue;
-       if ( aliasName == "MTR_INSIDE_MT22_RPC3_HV.vEff" ) continue;
-       if ( aliasName == "MTR_OUTSIDE_MT21_RPC4_HV.actual.iMon" ) continue;
-       aliasMap->Add(new TObjString(*alias),valueSet);
+        TObjArray* valueSet = new TObjArray;
+        valueSet->SetOwner(kTRUE);
+        for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
+        {
+          Float_t value = 0;
+          if(sDetName.Contains("TRACKER")){
+            value = random.Gaus(1750,62.5);
+            if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
+          }
+          else if(aliasName.Contains("iMon")){
+            value = random.Gaus(2.,0.4);
+          }
+          else {
+            value = random.Gaus(8000.,16.);
+          }
+          
+          AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
+          valueSet->Add(dcsValue);
+        }
+        if ( aliasName == "MchHvLvLeft/Chamber04Left/Slat06.actual.vMon" ) continue;
+        if ( aliasName == "MTR_INSIDE_MT22_RPC3_HV.vEff" ) continue;
+        if ( aliasName == "MTR_OUTSIDE_MT21_RPC4_HV.actual.iMon" ) continue;
+        aliasMap->Add(new TObjString(*alias),valueSet);
       }
     } // loop on aliases
-
+    
     delete aliases;
   } // loop on detectors (tracker and trigger)
   
-
-    
   AliMpCDB::UnloadAll();
   
   return aliasMap;