From: richterm Date: Mon, 15 Feb 2010 08:15:27 +0000 (+0000) Subject: maintenace of the extract-ddlraw macro X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=0c40965760fb3522ba84f2c86a8b31c2362a2642;p=u%2Fmrichter%2FAliRoot.git maintenace of the extract-ddlraw macro - new parameter added to specify max number of events - connect to Grid if input is a remote file - use one single publisher for all links - skipping of CTP initialization in the HLTReconstructor in order to avoid CDB access --- diff --git a/HLT/exa/extract-ddlraw.C b/HLT/exa/extract-ddlraw.C index 66f9d5ed403..b56aa14e8f1 100644 --- a/HLT/exa/extract-ddlraw.C +++ b/HLT/exa/extract-ddlraw.C @@ -26,7 +26,7 @@ * @author Matthias.Richter@ift.uib.no * @ingroup alihlt_tutorial */ -void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) +void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno, int nofEvents=-1) { ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// @@ -44,11 +44,17 @@ void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) return; } + TString strfile=input; + if (strfile.Contains("://") && !strfile.Contains("local://")) { + TGrid::Connect("alien"); + } + AliRawReader* pRawReader=AliRawReader::Create(input); if (!pRawReader) { cout << "can not open RawReader for file " << input << endl; return; } + if (!pRawReader->NextEvent()) { cerr << "no events available" << endl; return; @@ -72,7 +78,7 @@ void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) // in a loop // 2. all in one publisher // can be easily switched with the following - bool bAllInOne=false; + bool bAllInOne=true; TString writerInput; TString arg; @@ -112,7 +118,7 @@ void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) // // the reconstructor setup AliHLTReconstructor hltRec; - hltRec.SetOption("libAliHLTUtil.so loglevel=0x7c chains=sink1"); + hltRec.SetOption("libAliHLTUtil.so loglevel=0x7c chains=sink1 ignore-hltout ignore-ctp"); if (hltRec.Init()<0) { cerr << "initialization of reconstructor failed" << endl; return; @@ -130,7 +136,8 @@ void extract_ddlraw(const char* input, int iMinDDLno, int iMaxDDLno) Int_t event=0; UChar_t* pData=NULL; pRawReader->RewindEvents(); - while (pRawReader->NextEvent()) { + while (pRawReader->NextEvent() && + (nofEvents<0 || event