/// \file MUONOfflineShift.C
/// \brief Macro to be used to check raw data during MUON offline shifts.
///
+/// You NEED an access to the Grid to run this macro.
+///
/// Basic usage is :
///
-/// MUONOfflineShift("path_to_raw_file","basename of output file")
+/// MUONOfflineShift("path_to_raw_file","basename of output file"); > log
+///
+/// (the redirection to an output log file is recommended as the output from
+/// this macro might be quite long...)
///
/// This will read the raw data and process it several times, varying what's done :
/// only decoding, decoding + zero-suppression, etc... (TBE)
///
/// - basename.log, containing (for the moment) the occupancy numbers of the various detection elements
///
+/// Unless you really know what you're doing, please use this macro together with
+/// the grid OCDB (i.e. don't set it to a local OCDB). There are now a lot of things
+/// that are grabbed from the OCDB that are run dependent...
+///
/// \author Laurent Aphecetche
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "AliCDBManager.h"
#include "AliCodeTimer.h"
-#include "AliMUONPainterRegistry.h"
-#include "AliMUONTrackerCalibratedDataMaker.h"
-#include "AliMUONTrackerRawDataMaker.h"
+#include "AliMUONCDB.h"
+#include "AliMUONPainterDataRegistry.h"
+#include "AliMUONRecoParam.h"
+#include "AliMUONTrackerDataMaker.h"
#include "AliMUONVTrackerData.h"
#include "AliMpCDB.h"
#include "AliMpConstants.h"
#include "AliMpDEIterator.h"
#include "AliRawReader.h"
-#include "AliRawReaderDate.h"
-#include "AliRawReaderRoot.h"
#include <Riostream.h>
#include <TFile.h>
#include <TGrid.h>
#endif
//______________________________________________________________________________
-Int_t DataMakerReading(AliRawReader* rawReader,
+Int_t DataMakerReading(const char* input,
TStopwatch& timer,
const char* cdbPath="",
const char* calibMode="",
/// - GAINCONSTANTCAPA : zero-suppression + gain, but with a single capa value for all channels
/// - GAIN : zero-suppression + gain w/ individual capacitance per channel.
- rawReader->RewindEvents();
+ TString fileName(gSystem->ExpandPathName(input));
+
+ AliRawReader* rawReader = AliRawReader::Create(fileName.Data());
+
+ if (!rawReader) return 0;
AliMUONVTrackerDataMaker* dm(0x0);
+ AliMUONRecoParam* recoParam = AliMUONCDB::LoadRecoParam();
+ if (!recoParam) return 0;
+
if ( strlen(cdbPath) > 0 )
{
- dm = new AliMUONTrackerCalibratedDataMaker(rawReader,cdbPath,calibMode,histogram,xmin,xmax);
+ dm = new AliMUONTrackerDataMaker(recoParam,rawReader,cdbPath,calibMode,histogram,xmin,xmax);
}
else
{
- dm = new AliMUONTrackerRawDataMaker(rawReader,kTRUE);
+ dm = new AliMUONTrackerDataMaker(rawReader,histogram);
}
- AliMUONPainterRegistry::Instance()->Register(dm);
+ AliMUONPainterDataRegistry::Instance()->Register(dm);
timer.Start(kTRUE);
Int_t n(0);
timer.Stop();
- delete dm;
-
return n;
}
const Int_t occIndex = 2;
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
Int_t nofDataSources = reg->NumberOfDataSources();
}
//______________________________________________________________________________
-void MUONOfflineShift(const char* input, const char* outputBase,
- const char* ocdbPath="alien://folder=/alice/data/2008/LHC08a/OCDB")
+void MUONOfflineShift(const char* input="alien:///alice/data/2009/LHC09a/000067495/raw/09000067495031.10.root",
+ const char* outputBase="67495031.10",
+ const char* ocdbPath="alien://folder=/alice/data/2009/OCDB")
{
/// Entry point of the macro.
- /// Example of syntax for an input file (from alien)
- ///
- /// alien::///alice/data/2007/LHC07w/000014493/raw/07000014493001.10.root
- ///
- /// and for an OCDB path :
- ///
- /// alien://folder=/alice/data/2007/LHC07w/OCDB
- ///
- TGrid::Connect("alien://");
-
AliCodeTimer::Instance()->Reset();
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliMpCDB::LoadDDLStore();
+ TGrid::Connect("alien://");
- TString fileName(gSystem->ExpandPathName(input));
+ AliRawReader* rawReader = AliRawReader::Create(input);
- AliRawReader* rawReader(0x0);
+ rawReader->NextEvent();
- // check extention to choose the rawdata file format
- if (fileName.EndsWith(".root"))
- {
- rawReader = new AliRawReaderRoot(fileName);
- }
- else if (!fileName.IsNull())
- {
- rawReader = new AliRawReaderDate(fileName); // DATE file
- }
+ Int_t runNumber = rawReader->GetRunNumber();
+
+ delete rawReader;
- if (!rawReader) return;
+ AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);
+ AliCDBManager::Instance()->SetRun(runNumber);
+
+ if (!AliMUONCDB::LoadMapping()) return;
+ TStopwatch timer1;
TStopwatch timer2;
TStopwatch timer3;
+ TStopwatch timer4;
+ TStopwatch timer5;
- Int_t n2 = DataMakerReading(rawReader,timer2);
-
- Int_t n3 = DataMakerReading(rawReader,timer3,ocdbPath);
-
- Print("DataMakerReading(RAW)",timer2,n2);
-
- Print("DataMakerReading(CAL)",timer3,n3);
+ Int_t n1 = DataMakerReading(input,timer1,"","",kTRUE,0,0);
+
+ Int_t n2 = DataMakerReading(input,timer2,ocdbPath,"NOGAIN");
+
+ Int_t n3 = DataMakerReading(input,timer3,ocdbPath,"GAINCONSTANTCAPA");
+
+ Int_t n4 = DataMakerReading(input,timer4,ocdbPath,"GAIN");
+
+ Int_t n5 = DataMakerReading(input,timer5,ocdbPath,"INJECTIONGAIN");
+
+ Print("DataMakerReading(HRAW)",timer1,n1);
+ Print("DataMakerReading(HCALZ)",timer2,n2);
+ Print("DataMakerReading(HCALG)",timer3,n3);
+ Print("DataMakerReading(HCALC)",timer4,n4);
+ Print("DataMakerReading(HCALE)",timer5,n5);
- AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+ AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
TFile f(gSystem->ExpandPathName(Form("%s.root",outputBase)),"RECREATE");
ofstream out(gSystem->ExpandPathName(Form("%s.log",outputBase)));
f.Close();
+ AliCodeTimer::Instance()->Print();
+
}