]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes to allow running the reconstruction with the "TryRecover"
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 May 2010 15:19:01 +0000 (15:19 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 May 2010 15:19:01 +0000 (15:19 +0000)
feature of the raw data decoder turned ON (via RecoParam). Will be
needed for processing half of the May 2010 B=0 data.

Small change in TrackerQADataMakerRec so the EventSize plot works
online as well.

MUON/AliMUONDigitMaker.cxx
MUON/AliMUONDigitMaker.h
MUON/AliMUONRecoParam.cxx
MUON/AliMUONRecoParam.h
MUON/AliMUONReconstructor.cxx
MUON/AliMUONTrackerDataMaker.cxx
MUON/AliMUONTrackerDataMaker.h
MUON/AliMUONTrackerQAChecker.cxx
MUON/AliMUONTrackerQADataMakerRec.cxx
MUON/AliMUONTrackerQADataMakerRec.h
MUON/MakeMUONRecoParamArray.C

index 06e62f8bd32b9b55061d4f6b9ab12a5f8eed882a..05bb6e6ce4f96e3455c1437f76a56666cbbcf6e3 100644 (file)
@@ -83,8 +83,7 @@ fRawStreamTracker(new AliMUONRawStreamTrackerHP),
 fRawStreamTrigger(new AliMUONRawStreamTriggerHP),
 fDigitStore(0x0),
 fTriggerStore(0x0),
 fRawStreamTrigger(new AliMUONRawStreamTriggerHP),
 fDigitStore(0x0),
 fTriggerStore(0x0),
-fLogger(new AliMUONLogger(10000))
-{
+fLogger(new AliMUONLogger(10000)){
   /// ctor 
   
   if  ( !a || !b ) AliFatal("no longer supported");
   /// ctor 
   
   if  ( !a || !b ) AliFatal("no longer supported");
@@ -489,3 +488,12 @@ AliMUONDigitMaker::TriggerToDigitsStore(const AliMUONVTriggerStore& triggerStore
   }
   return kTRUE;
 }
   }
   return kTRUE;
 }
+
+//______________________________________________________________________________
+void 
+AliMUONDigitMaker::SetTryRecover(Bool_t flag) 
+{
+  /// Instruct the decoder to try to recover corrupted raw data.
+  /// Only use for specific cases for which you know it will work...
+  fRawStreamTracker->TryRecover(flag);
+}
index 0341a74f12583cb36dea5707b2763e9839a51e4a..a7a2e57d8ab35b7cc73d9c71d3c021ab83987f6f 100644 (file)
@@ -71,6 +71,8 @@ class AliMUONDigitMaker : public TObject
 
   void Print(Option_t* opt="") const;
 
 
   void Print(Option_t* opt="") const;
 
+  void SetTryRecover(Bool_t flag);
+
 private:
     
   /// Not implemented
 private:
     
   /// Not implemented
index b9c9fbeb28ee49a5b0c2ea8ce611066d8134529f..1f75b8424f4db8f07cee032d081ede08f447304c 100644 (file)
@@ -31,6 +31,9 @@
 #include "AliRecoParam.h"
 #include "AliLog.h"
 
 #include "AliRecoParam.h"
 #include "AliLog.h"
 
+#include "AliCDBManager.h"
+#include "AliCDBEntry.h"
+
 #include <Riostream.h>
 
 ClassImp(AliMUONRecoParam)
 #include <Riostream.h>
 
 ClassImp(AliMUONRecoParam)
@@ -79,7 +82,8 @@ AliMUONRecoParam::AliMUONRecoParam()
   fClusterChargeCut(2.0),
   fEventSizeSoftLimit(35.0),
   fEventSizeHardLimit(45.0),
   fClusterChargeCut(2.0),
   fEventSizeSoftLimit(35.0),
   fEventSizeHardLimit(45.0),
-  fTokenLostLimit(0.0)
+  fTokenLostLimit(0.0),
+  fTryRecover(kFALSE)
 {  
   /// Constructor
   
 {  
   /// Constructor
   
@@ -521,6 +525,12 @@ void AliMUONRecoParam::Print(Option_t *option) const
                ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
   cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
   
                ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
   cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
   
+  if (TryRecover())
+  {
+    cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
+    cout << "!!! WILL TRY TO RECOVER CORRUPTED RAW DATA !!!" << endl;
+    cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;    
+  }
   cout<<"\t-----------------------------------------------------"<<endl<<endl;
   
 }
   cout<<"\t-----------------------------------------------------"<<endl<<endl;
   
 }
@@ -575,5 +585,161 @@ AliMUONRecoParam::SetDefaultLimits()
   SetEventSizeLimits(35.0,45.0);
   
   SetTokenLostLimit(0.0);
   SetEventSizeLimits(35.0,45.0);
   
   SetTokenLostLimit(0.0);
+  
+  fTryRecover = kFALSE;
+}
+
+
+//-----------------------------------------------------------------------
+TObjArray* 
+AliMUONRecoParam::Create(const char* settings)
+{
+  /// Create pre-defined recoparam array, according to settings.
+  /// settings is case-insensitive.
+  ///
+  /// Currently defined are :
+  ///
+  /// "cosmics" :
+  ///      Cosmic (default)
+  ///      Calibration
+  /// "ppideal"
+  ///      LowFlux (default)
+  ///      Calibration
+  /// "ppreal"
+  ///      LowFlux (modified to reconstruct real p-p data)
+  ///      Calibration
+  /// "pprealsim"
+  ///      LowFlux (modified to reconstruct realistic p-p simulation)
+  ///      Calibration
+  
+  AliMUONRecoParam* param(0x0);
+  
+  AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult;
+  
+  TString stype(settings);
+  stype.ToLower();
+  
+  if ( stype == "cosmics" )
+  {
+    // set parameters for cosmic runs
+    param = AliMUONRecoParam::GetCosmicParam();
+    defaultParam = AliRecoParam::kCosmic;
+  }
+  else if ( stype == "ppideal" ) 
+  {
+    // set default lowFlux parameters
+    param = AliMUONRecoParam::GetLowFluxParam();
+  }
+  else if ( stype == "ppreal" || stype == "pprealsim" || "pprealnofield" ) 
+  {      
+    // common parameters for p-p data and realistic p-p simu
+    param = AliMUONRecoParam::GetLowFluxParam();
+    param->SaveFullClusterInESD(kTRUE, 100.);
+    for (Int_t iCh=0; iCh<10; iCh++) 
+    {
+      param->SetDefaultNonBendingReso(iCh,0.4);
+      param->SetDefaultBendingReso(iCh,0.4);
+    }
+    param->SetSigmaCutForTracking(7.);
+    param->SetStripCutForTrigger(1.5);
+    param->SetSigmaCutForTrigger(6.);
+    param->ImproveTracks(kTRUE, 6.);
+    param->SetPedMeanLimits(20, 700);
+    param->SetManuOccupancyLimits(-1.,0.01);
+    param->SetBuspatchOccupancyLimits(-1.,0.01);  
+    param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
+    
+    // specific parameters for p-p data or realistic p-p simu
+    if ( stype == "ppreal" || stype == "pprealnofield" )
+    {
+      param->SetPadGoodnessMask(0x400BE80);
+    }
+    else
+    {
+      param->SetPadGoodnessMask(0x8080);      
+    }
+    
+    if ( stype == "pprealnofield" )
+    {
+      param->TryRecover(kTRUE);
+    }
+  }
+  else
+  {
+    AliErrorClass("Unknown settings !");
+    return 0x0;
+  }
+
+  TObjArray* recoParams = new TObjArray;
+
+  recoParams->AddLast(param);
+  
+  // set (dummy) parameters for calibration runs
+  param = AliMUONRecoParam::GetCalibrationParam();
+  recoParams->AddLast(param);
+  
+  // set parameters for Pb-Pb runs
+  // param = AliMUONRecoParam::GetHighFluxParam();
+  // recoParams.AddLast(param);
+  
+  // identify default parameters (exit if identification failed)
+  Bool_t defaultIsSet = kFALSE;
+  TIter next(recoParams);
+  while ( (param = static_cast<AliMUONRecoParam*>(next())) ) 
+  {
+    if (param->GetEventSpecie() == defaultParam) 
+    {
+      param->SetAsDefault();
+      defaultIsSet = kTRUE;
+    }
+    param->Print("FULL");
+  }
+  
+  if (!defaultIsSet) 
+  {
+    AliErrorClass("The default reconstruction parameters are not set! Exiting...");
+    return 0x0;
+  }  
+  
+  return recoParams;
 }
 
 }
 
+//______________________________________________________________________________
+void 
+AliMUONRecoParam::Show(Int_t runNumber, const char* ocdb)
+{
+  /// Show what we have in the designated OCDB for that run, as far as RecoParams are concerned
+  
+  AliCDBManager::Instance()->SetDefaultStorage(ocdb);
+  AliCDBManager::Instance()->SetRun(runNumber);
+  
+  AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
+  
+  if (!entry) return;
+  
+  TObject* o = entry->GetObject();
+  
+  if ( o->IsA() == TObjArray::Class() ) 
+  {
+    TObjArray* array = static_cast<TObjArray*>(o);
+    for ( Int_t i = 0; i <= array->GetLast(); ++i ) 
+    {
+      AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
+      cout << Form("array[%d]=%s %s %s",i,
+                   p ? p->ClassName() : "",
+                   p ? AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(p->GetEventSpecie())) :"",
+                   p ? ( p->IsDefault() ? "default" : "") : "" ) << endl;
+    }
+    cout << "=========== dumps below ====== " << endl;
+    
+    for ( Int_t i = 0; i <= array->GetLast(); ++i ) 
+    {
+      AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
+      if ( p ) p->Print("");
+    }
+  }
+  else
+  {
+    o->Print();
+  }
+}
index 964240680b8ced94241d3cf38f3d365da0142f5f..6218d72c0ea7ffa2e2c8ba04300d9a0915f0217d 100644 (file)
@@ -319,9 +319,21 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   /// Get the percentage of token lost error we allow
   virtual Double_t TokenLostLimit() const { return fTokenLostLimit; }
 
   /// Get the percentage of token lost error we allow
   virtual Double_t TokenLostLimit() const { return fTokenLostLimit; }
 
-  /// Set the percentage of token lost error we allo
+  /// Set the percentage of token lost error we allow
   virtual void SetTokenLostLimit(Double_t limit) { fTokenLostLimit = limit; }
 
   virtual void SetTokenLostLimit(Double_t limit) { fTokenLostLimit = limit; }
 
+  /// Whether or not we try to recover corrupted raw data
+  virtual Bool_t TryRecover() const { return fTryRecover; }
+
+  /// Set the try recover corrupted raw data (use kTRUE only if you know what you are doing. Should be left to kFALSE by default)
+  virtual void TryRecover(Bool_t flag) { fTryRecover = flag; }
+
+  /// Create object ready to be put in OCDB
+  static TObjArray* Create(const char* settings);
+  
+  /// Show what is the OCDB for that run
+  static void Show(Int_t runNumber, const char* ocdbPath="raw://");
+  
 private:
   
   void SetDefaultLimits();
 private:
   
   void SetDefaultLimits();
@@ -424,13 +436,15 @@ private:
   
   Double32_t fTokenLostLimit; ///< limit on the fraction of token lost error per event we allow
   
   
   Double32_t fTokenLostLimit; ///< limit on the fraction of token lost error per event we allow
   
+  Bool_t     fTryRecover; ///< try to recover corrupted raw data
+  
   // functions
   void SetLowFluxParam();
   void SetHighFluxParam();
   void SetCosmicParam();
   void SetCalibrationParam();
   
   // functions
   void SetLowFluxParam();
   void SetHighFluxParam();
   void SetCosmicParam();
   void SetCalibrationParam();
   
-  ClassDef(AliMUONRecoParam,167) // MUON reco parameters
+  ClassDef(AliMUONRecoParam,168) // MUON reco parameters
   // we're at 167 not because we had that many versions, but because at some point (version 15->16)
   // 166 was committed by error, and we did not to go reverse afterwards...
 };
   // we're at 167 not because we had that many versions, but because at some point (version 15->16)
   // 166 was committed by error, and we did not to go reverse afterwards...
 };
index 1acf4b07b96ded65589ed1788a94ee8b4269c807..05ef314825a7b0647e770960008ced1042fca69e 100644 (file)
@@ -280,6 +280,14 @@ AliMUONReconstructor::CreateDigitMaker() const
     {
       fDigitMaker->SetMakeTriggerDigits(kTRUE);
     }
     {
       fDigitMaker->SetMakeTriggerDigits(kTRUE);
     }
+  if ( GetRecoParam()->TryRecover() )
+  {
+    fDigitMaker->SetTryRecover(kTRUE);
+  }
+  else
+  {
+    fDigitMaker->SetTryRecover(kFALSE);    
+  }
 }
 
 //_____________________________________________________________________________
 }
 
 //_____________________________________________________________________________
@@ -567,11 +575,9 @@ AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore,
                                 TTree& clustersTree) const
 {
   /// Write the trigger and cluster information into TreeR
                                 TTree& clustersTree) const
 {
   /// Write the trigger and cluster information into TreeR
-  
+
   AliCodeTimerAuto("",0)
 
   AliCodeTimerAuto("",0)
 
-  AliDebug(1,"");
-  
   Bool_t ok(kFALSE);
   Bool_t alone(kTRUE); // is trigger the only info in TreeR ?
   
   Bool_t ok(kFALSE);
   Bool_t alone(kTRUE); // is trigger the only info in TreeR ?
   
index fa78ec0e2ede600f8f1714b8ae2d3852a1e544aa..d61a34ec0adbae4109a43e0c257ee420ae615b89 100644 (file)
@@ -67,7 +67,10 @@ fIsEventByEvent(kFALSE),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
-fNumberOfGoodPhysicsEvents(0)
+fNumberOfGoodPhysicsEvents(0),
+fTryRecover(kFALSE),
+fFirstEvent(-1),
+fLastEvent(-1)
 {
 /// Root IO ctor
 }
 {
 /// Root IO ctor
 }
@@ -99,7 +102,10 @@ fIsEventByEvent(kFALSE),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
-fNumberOfGoodPhysicsEvents(0)
+fNumberOfGoodPhysicsEvents(0),
+fTryRecover(kFALSE),
+fFirstEvent(-1),
+fLastEvent(-1)
 {
   /// Ctor in which this object will NOT be the owner of the reader
   /// and can NOT apply rewind to it, nor use Next on it. 
 {
   /// Ctor in which this object will NOT be the owner of the reader
   /// and can NOT apply rewind to it, nor use Next on it. 
@@ -133,7 +139,10 @@ fIsEventByEvent(kFALSE),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
-fNumberOfGoodPhysicsEvents(0)
+fNumberOfGoodPhysicsEvents(0),
+fTryRecover(kFALSE),
+fFirstEvent(-1),
+fLastEvent(-1)
 {
   /// Ctor in which we take the ownership of the rawReader, so we can rewind
   /// and advance it as we wish
 {
   /// Ctor in which we take the ownership of the rawReader, so we can rewind
   /// and advance it as we wish
@@ -168,7 +177,10 @@ fIsEventByEvent(kFALSE),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
 fLogger(0x0),
 fLastEventWasEmpty(kFALSE),
 fNumberOfPhysicsEvents(0),
-fNumberOfGoodPhysicsEvents(0)
+fNumberOfGoodPhysicsEvents(0),
+fTryRecover(kFALSE),
+fFirstEvent(-1),
+fLastEvent(-1)
 {
   /// Ctor from raw data reader
   if (fRawReader) 
 {
   /// Ctor from raw data reader
   if (fRawReader) 
@@ -322,7 +334,32 @@ AliMUONTrackerDataMaker::NextEvent()
   
   if ( !IsRunning() ) return kTRUE;
   
   
   if ( !IsRunning() ) return kTRUE;
   
-  Bool_t ok = fRawReader->NextEvent();
+  Bool_t ok(kTRUE);
+  
+  if ( fLastEvent >= fFirstEvent && fLastEvent > 0 ) // do we have an event range to consider ?
+  {
+    // skip up to first event
+    
+    while ( (fNumberOfEvents-1) < fFirstEvent && ( ok = fRawReader->NextEvent() ) ) 
+    {
+      ++fNumberOfEvents; 
+    }
+    
+    if ( ok && (fNumberOfEvents-1) <= fLastEvent ) 
+    {
+      ok = fRawReader->NextEvent();
+    }
+    else
+    {
+      fNumberOfEvents=fLastEvent+1;
+      return kFALSE;
+    }
+  }
+  else
+  {
+    // no event range, just proceed...
+    ok = fRawReader->NextEvent();
+  }
   
   if (!ok) 
   {
   
   if (!ok) 
   {
@@ -367,6 +404,15 @@ Bool_t AliMUONTrackerDataMaker::ProcessEvent()
   stream.DisableWarnings();
   stream.DisableRawReaderErrorLogger();
   stream.DisableMUONErrorLogger();
   stream.DisableWarnings();
   stream.DisableRawReaderErrorLogger();
   stream.DisableMUONErrorLogger();
+
+  if ( fTryRecover ) 
+  {
+    stream.TryRecover(kTRUE);
+  }
+  else
+  {
+    stream.TryRecover(kFALSE);
+  }
   
   if (fLogger)
   {
   
   if (fLogger)
   {
index a5577486e2552cf2292728ec38ed30f973fbe770..30b95c183e04818540ba57b5a8e3464e61d87cb0 100644 (file)
@@ -112,6 +112,12 @@ public:
   /// Whether last decoded event was empty
   Bool_t LastEventWasEmpty() const { return fLastEventWasEmpty; }
   
   /// Whether last decoded event was empty
   Bool_t LastEventWasEmpty() const { return fLastEventWasEmpty; }
   
+  /// Whether or not we should try to recover corrupted raw data
+  void SetTryRecover(Bool_t flag) { fTryRecover = flag; }
+  
+  /// Set the event range to consider
+  void SetEventRange(Int_t first, Int_t last) { fFirstEvent=first; fLastEvent=last; }
+
 private:
   /// not implemented
   AliMUONTrackerDataMaker(const AliMUONTrackerDataMaker& rhs);
 private:
   /// not implemented
   AliMUONTrackerDataMaker(const AliMUONTrackerDataMaker& rhs);
@@ -144,8 +150,11 @@ private:
   Bool_t fLastEventWasEmpty; ///< whether last decoded event was empty
   Int_t fNumberOfPhysicsEvents; ///< number of physics events seen
   Int_t fNumberOfGoodPhysicsEvents; ///< number of errors with no (fatal) readout error
   Bool_t fLastEventWasEmpty; ///< whether last decoded event was empty
   Int_t fNumberOfPhysicsEvents; ///< number of physics events seen
   Int_t fNumberOfGoodPhysicsEvents; ///< number of errors with no (fatal) readout error
-  
-  ClassDef(AliMUONTrackerDataMaker,4) // Producer of AliMUONVTrackerData from raw
+  Bool_t fTryRecover; ///< whether we should try to recover corrupted raw data
+  Int_t fFirstEvent; ///< first event to consider
+  Int_t fLastEvent; ///< last event to consider
+
+  ClassDef(AliMUONTrackerDataMaker,5) // Producer of AliMUONVTrackerData from raw
 };
 
 #endif
 };
 
 #endif
index 6263ee9b2d70d5534265eac0c5d74b46d490cc07..c4a73fec337052d91e0d3546d2350c06807fc7b8 100644 (file)
@@ -416,8 +416,6 @@ AliMUONTrackerQAChecker::BeautifyOccupancyHistograms(TH1& hddl,
     }
   }
   
     }
   }
   
-  hbp.GetListOfFunctions()->Delete();
-  hddl.GetListOfFunctions()->Delete();
   hddl.SetStats(kFALSE);
   hbp.SetXTitle("Absolute Bus Patch Id");
   hbp.SetYTitle("Occupancy (percent)");
   hddl.SetStats(kFALSE);
   hbp.SetXTitle("Absolute Bus Patch Id");
   hbp.SetYTitle("Occupancy (percent)");
@@ -591,10 +589,7 @@ AliMUONTrackerQAChecker::BeautifyReadoutHistograms(TH1& hrostatus,
   /// Normalize and put some text on the readout error histogram
   /// Note in particular the treatment of tokenlost errors !
   
   /// Normalize and put some text on the readout error histogram
   /// Note in particular the treatment of tokenlost errors !
   
-  hrostatus.GetListOfFunctions()->Delete();
-  hrostatusnorm.GetListOfFunctions()->Delete();
   hrostatusnorm.Reset();
   hrostatusnorm.Reset();
-  hrostatusnorm.SetFillStyle(0);
   
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
   
   
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
   
@@ -657,8 +652,6 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
 
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
 
 
   AliMUONVQAChecker::ECheckCode rv(AliMUONVQAChecker::kInfo);
 
-  heventsizeperevent.GetListOfFunctions()->Delete();
   heventsizeperevent.Reset();
 
   TObjArray messages;
   heventsizeperevent.Reset();
 
   TObjArray messages;
@@ -670,8 +663,7 @@ AliMUONTrackerQAChecker::BeautifyEventsizeHistograms(TH1& heventsize,
   }
   else
   {
   }
   else
   {
-    heventsizeperevent.Add(&heventsize);
-    heventsizeperevent.Scale(1.0/neventsseen/1024.0);
+    heventsizeperevent.Add(&heventsize,1.0/neventsseen/1024.0);
     heventsizeperevent.SetMinimum(0);
     
     Double_t totalEventSizePerEvent = heventsizeperevent.Integral();
     heventsizeperevent.SetMinimum(0);
     
     Double_t totalEventSizePerEvent = heventsizeperevent.Integral();
index 03e77e8d88de7b44b293279d7b4f795a4b7c9b8f..7a98807fb85fcad108f63b3759a4972c7ecd2c72 100644 (file)
 #include "AliMpDetElement.h"
 #include "AliMpManuIterator.h"
 #include "AliQAv1.h"
 #include "AliMpDetElement.h"
 #include "AliMpManuIterator.h"
 #include "AliQAv1.h"
-#include "AliRawEquipment.h"
-#include "AliRawEquipmentHeader.h"
-#include "AliRawEventHeaderBase.h"
 #include "AliRawReader.h"
 #include "AliRawReader.h"
-#include "AliRawVEvent.h"
+#include "AliRawEventHeaderBase.h"
 #include <Riostream.h>
 #include <TH1F.h> 
 #include <TH1I.h> 
 #include <Riostream.h>
 #include <TH1F.h> 
 #include <TH1I.h> 
@@ -719,7 +716,8 @@ void AliMUONTrackerQADataMakerRec::FillReadoutStatus(AliMUONLogger& log, AliMUON
   
   Double_t nbuspatches = fBusPatchConfig->GetEntries();
   
   
   Double_t nbuspatches = fBusPatchConfig->GetEntries();
   
-  hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig,nofBusPatchesNotInConfig*nevents/nbuspatches);
+  Int_t bin = hrostatus->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig);
+  hrostatus->SetBinContent(bin,nofBusPatchesNotInConfig*nevents/nbuspatches);
   
   Double_t nofBusPatchesNotInData(0);
   
   
   Double_t nofBusPatchesNotInData(0);
   
@@ -731,57 +729,37 @@ void AliMUONTrackerQADataMakerRec::FillReadoutStatus(AliMUONLogger& log, AliMUON
     if ( !data->HasBusPatch(bp->GetId()) ) ++nofBusPatchesNotInData;
   }
   
     if ( !data->HasBusPatch(bp->GetId()) ) ++nofBusPatchesNotInData;
   }
   
-  hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream,nofBusPatchesNotInData*nevents/nbuspatches);
+  bin = hrostatus->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream);
+  hrostatus->SetBinContent(bin,nofBusPatchesNotInData*nevents/nbuspatches);
 }
 
 //____________________________________________________________________________ 
 }
 
 //____________________________________________________________________________ 
-void AliMUONTrackerQADataMakerRec::FillEventSize(const AliRawVEvent* cevent)
+void AliMUONTrackerQADataMakerRec::FillEventSize(AliRawReader* rawReader)
 {
   /// Fill event size histogram(s)
   
 {
   /// Fill event size histogram(s)
   
-  if (!cevent)
-  {
-    AliError("Got a null cevent...");
-    return;
-  }
-  
-  AliRawVEvent* event = const_cast<AliRawVEvent*>(cevent); // not good, but the Get*Event() methods are not const...
-  
   TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
 
   TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsSeen);
   
   TH1* hDDLEventSize = GetRawsData(AliMUONQAIndices::kTrackerDDLEventSize);
   
   TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
 
   TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsSeen);
   
   TH1* hDDLEventSize = GetRawsData(AliMUONQAIndices::kTrackerDDLEventSize);
   
-  Double_t eventSize = 0;
-  
   hnevents->Fill(0.0);
   
   hnevents->Fill(0.0);
   
-  for ( int i = 0; i < event->GetNSubEvents(); ++i ) 
+  Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
+  
+  for ( int i = 0; i < AliDAQ::NumberOfDdls("MUONTRK"); ++i )
   {
   {
-    AliRawVEvent* sub = event->GetSubEvent(i);
-    
-    for ( int j = 0; j < sub->GetNEquipments(); ++j ) 
+    rawReader->Reset();
+    rawReader->Select("MUONTRK",i,i);
+    if (rawReader->ReadHeader() )
     {
     {
-      AliRawVEquipment* eq = sub->GetEquipment(j);
-      
-      AliRawEquipmentHeader* equipmentHeader = eq->GetEquipmentHeader();
-      
-      UInt_t uid = equipmentHeader->GetId();
-      
-      int index;
-      
-      TString det(AliDAQ::DetectorNameFromDdlID(uid,index));
-      
-      if (det=="MUONTRK")     
-      {
-        UInt_t ddlsize = equipmentHeader->GetEquipmentSize();
-        hDDLEventSize->Fill(uid,ddlsize);
-        hddlevents->Fill(uid);
-        eventSize += ddlsize;
-      }
-    }
-  }  
+      UInt_t ddlsize = rawReader->GetEquipmentSize();
+      hDDLEventSize->Fill(i+offset,ddlsize);
+      hddlevents->Fill(i+offset);
+    }      
+  }
+  rawReader->Reset();
 }
 
 //____________________________________________________________________________ 
 }
 
 //____________________________________________________________________________ 
@@ -983,6 +961,15 @@ void AliMUONTrackerQADataMakerRec::InitDigits()
   
   AliCodeTimerAuto("",0);
 
   
   AliCodeTimerAuto("",0);
 
+  if ( GetRecoParam()->TryRecover() )
+  {
+    fDigitMaker->SetTryRecover(kTRUE);
+  }
+  else
+  {
+    fDigitMaker->SetTryRecover(kFALSE);    
+  }
+  
   TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
   
   /// Book histograms that are common to Raws and Digits
   TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
   
   /// Book histograms that are common to Raws and Digits
@@ -1346,8 +1333,8 @@ void AliMUONTrackerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   {
     dm->ProcessEvent();
     
   {
     dm->ProcessEvent();
     
-    FillEventSize(rawReader->GetEvent());
-    
+    FillEventSize(rawReader);
+        
     if ( dm->LastEventWasEmpty() )
     {
       TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
     if ( dm->LastEventWasEmpty() )
     {
       TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
@@ -1586,6 +1573,8 @@ AliMUONTrackerQADataMakerRec::ResetDetectorRaws(TObjArray* list)
   /// Reset those histograms that must be reset (and only those), plus
   /// the trackerdata itself.
   
   /// Reset those histograms that must be reset (and only those), plus
   /// the trackerdata itself.
   
+  AliInfo("");
+  
   TIter next(list);
   TObject* o;
   while ( ( o = next() ) )
   TIter next(list);
   TObject* o;
   while ( ( o = next() ) )
@@ -1595,18 +1584,30 @@ AliMUONTrackerQADataMakerRec::ResetDetectorRaws(TObjArray* list)
     {
       TString hn(h->GetName());
       
     {
       TString hn(h->GetName());
       
-      if ( hn.Contains("Tracker") )
+      if ( !hn.Contains("TrackerBusPatchConfig") )
       {
       {
-        if ( !hn.Contains("hTrackerBusPatchNofPads") && 
-            !hn.Contains("hTrackerBusPatchConfig" ) )
+        AliInfo(Form("Resetting %s",hn.Data()));
+
+        if ( hn.Contains("DDLMeanEventSize") )
         {
         {
-          AliDebug(1,Form("Resetting %s",hn.Data()));
-          h->Reset();                  
-        }
+          h->Print();
+          h->GetListOfFunctions()->ls();
+          cout << ">>>>>" << endl;
+        }          
+
+        h->Reset();
+        
+        if ( hn.Contains("DDLMeanEventSize") )
+        {
+          h->Print();
+          h->GetListOfFunctions()->ls();
+          cout << "<<<<<<" << endl;
+        }          
       }
       else
       {
       }
       else
       {
-        AliDebug(1,Form("Will not reset histogram %s",hn.Data()));
+        //        AliDebug(1,Form("Will not reset histogram %s",hn.Data()));
+        AliInfo(Form("Will not reset histogram %s",hn.Data()));          
       }
     }
     else
       }
     }
     else
@@ -1635,6 +1636,7 @@ TObjArray* AliMUONTrackerQADataMakerRec::GetArray(TObjArray*& array, Bool_t crea
     if ( create ) 
     {
       array = new TObjArray(AliRecoParam::kNSpecies);
     if ( create ) 
     {
       array = new TObjArray(AliRecoParam::kNSpecies);
+      array->SetOwner(kTRUE);
     }
   }
   
     }
   }
   
@@ -1699,7 +1701,6 @@ AliMUONTrackerQADataMakerRec::TrackerCalData(Int_t specieIndex, Bool_t create)
   
   if (array)
   {
   
   if (array)
   {
-    array->SetOwner(kFALSE); // as the tracker data will be attached to fQADigitsList which will become the owner
     o = array->At(specieIndex);
     if (!o && create)
     {
     o = array->At(specieIndex);
     if (!o && create)
     {
@@ -1722,7 +1723,6 @@ AliMUONTrackerQADataMakerRec::TrackerRecData(Int_t specieIndex, Bool_t create)
   
   if (array)
   {
   
   if (array)
   {
-    array->SetOwner(kFALSE); // as the tracker data will be attached to fQARecPointsList which will become the owner
     o = array->At(specieIndex);
     if (!o && create)
     {
     o = array->At(specieIndex);
     if (!o && create)
     {
@@ -1745,7 +1745,6 @@ AliMUONTrackerQADataMakerRec::MappingCheckRecPoints(Int_t specieIndex, Bool_t cr
   
   if (array)
   {
   
   if (array)
   {
-    array->SetOwner(kTRUE);
     o = array->At(specieIndex);
     if (!o && create)
     {
     o = array->At(specieIndex);
     if (!o && create)
     {
index 4a18908d44e2d045bb8ab9eeade2003eeca41e05..06e531f7e87c82faaf7e242cf449b1cac4cf4b66 100644 (file)
@@ -25,7 +25,6 @@ class AliMUONCalibrationData;
 class AliMUONQAMappingCheck;
 class AliMUONLogger;
 class AliMUONQADataMakerRec;
 class AliMUONQAMappingCheck;
 class AliMUONLogger;
 class AliMUONQADataMakerRec;
-class AliRawVEvent;
 
 class AliMUONTrackerQADataMakerRec: public AliMUONVQADataMakerRec {
 
 
 class AliMUONTrackerQADataMakerRec: public AliMUONVQADataMakerRec {
 
@@ -60,7 +59,7 @@ private:
 
   void FillReadoutStatus(AliMUONLogger& log, AliMUONVTrackerData* data);
   
 
   void FillReadoutStatus(AliMUONLogger& log, AliMUONVTrackerData* data);
   
-  void FillEventSize(const AliRawVEvent* event);
+  void FillEventSize(AliRawReader* rawReader);
   
   void InitCommon();
 
   
   void InitCommon();
 
index b8cfd70e04fd102f8b8434830bb01e9d3b9c3803..20b1d63252530f6ae322c5fce062f95c5e94762e 100644 (file)
 #if !defined(__CINT__) || defined(__MAKECINT__)
 
 #include "AliMUONRecoParam.h"
 #if !defined(__CINT__) || defined(__MAKECINT__)
 
 #include "AliMUONRecoParam.h"
-#include "AliMUONCDB.h"
-
 #include "AliCDBManager.h"
 #include "AliCDBManager.h"
-#include "AliRecoParam.h"
-
-#include <TObjArray.h>
-#include <TIterator.h>
+#include "AliMUONCDB.h"
 
 #include <Riostream.h>
 
 #endif
 
 
 
 #include <Riostream.h>
 
 #endif
 
 
-
 //-----------------------------------------------------------------------
 //-----------------------------------------------------------------------
-void MakeMUONRecoParamArray(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity(),
-                           Int_t settingsForCosmicRun = kFALSE)
+void MakeMUONRecoParamArray(Int_t startRun = 0, 
+                            Int_t endRun = AliCDBRunRange::Infinity(),
+                            const char* settings="ppIdeal")
 {
   /// set the reconstruction parameters and store them in the OCDB ($ALICE_ROOT/OCDB/MUON/Calib/RecoParam/).
 {
   /// set the reconstruction parameters and store them in the OCDB ($ALICE_ROOT/OCDB/MUON/Calib/RecoParam/).
+  ///
   /// - make a CDB entry for the run range [startRun, endRun]
   /// - make a CDB entry for the run range [startRun, endRun]
-  /// - the choice between two possible configurations:
-  ///   -  settingsForCosmicRun = kFALSE (default), i.e.
-  ///      LowFlux (default)
-  ///      Calibration
-  ///   - settingsForCosmicRun = kTRUE, i.e.
-  ///      Cosmic (default)
-  ///      Calibration
+  ///
+  /// for the possible values of settings, please see AliMUONRecoParam::Create
   
   // init CDB
   AliCDBManager* man = AliCDBManager::Instance();
   
   // init CDB
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
-  man->SetRun(startRun);
   
   
-  // set RecoParams
-  AliMUONRecoParam *param;
-  TObjArray recoParams;
-
-  AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult;
-
-  if(!settingsForCosmicRun) {
-    // set parameters for p-p runs
-    param = AliMUONRecoParam::GetLowFluxParam();
-    recoParams.AddLast(param);
-  }
-  else {
-    // set parameters for cosmic runs
-    param = AliMUONRecoParam::GetCosmicParam();
-    recoParams.AddLast(param);
-    defaultParam = AliRecoParam::kCosmic;
-  }
-
-  // set (dummy) parameters for calibration runs
-  param = AliMUONRecoParam::GetCalibrationParam();
-  recoParams.AddLast(param);
-
-  // set parameters for Pb-Pb runs
-  // param = AliMUONRecoParam::GetHighFluxParam();
-  // recoParams.AddLast(param);
-
-  // identify default parameters (exit if identification failed)
-  Bool_t defaultIsSet = kFALSE;
-  TIter next(recoParams.MakeIterator());
-  while ( (param = static_cast<AliMUONRecoParam*>(next())) ) {
-    if (param->GetEventSpecie() == defaultParam) {
-      param->SetAsDefault();
-      defaultIsSet = kTRUE;
-    }
-    param->Print("FULL");
-  }
-  if (!defaultIsSet) {
-    cout<<"The default reconstruction parameters are not set! Exiting..."<<endl;
-    return;
+  if (!man->IsDefaultStorageSet()) 
+  {
+    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");    
   }
   
   }
   
-  // save RecoParam in CDB
-  AliMUONCDB::WriteToCDB(&recoParams, "MUON/Calib/RecoParam", startRun, endRun, "reconstruction parameters for MUON", "Philippe Pillot");
+  man->SetRun(startRun);
+  
+  TObjArray* recoParams = AliMUONRecoParam::Create(settings);
+  
+  if (recoParams)
+  {
+    // save RecoParam in CDB
+    AliMUONCDB::WriteToCDB(recoParams, "MUON/Calib/RecoParam", startRun, endRun, 
+                           "reconstruction parameters for MUON", "MakeMUONRecoParamArray $Id$");
+  }
   
   
+  delete recoParams;
 }
 
 }