}
// Processing data to go to AliLHCData object
-
- TMap* lhcMap = (TMap*)lhcReader.ReadLHCDP(fileName.Data());
- if (lhcMap) {
- Log(Form("LHCData map entries = %d",lhcMap->GetEntries()));
-
- AliLHCData* dt = new AliLHCData(lhcMap,timeStart,timeEnd);
-
- // storing AliLHCData in OCDB
- if (dt){
- AliCDBMetaData md;
- md.SetResponsible("Ruben Shahoyan");
- md.SetComment("LHC data from the GRP preprocessor.");
-
- Bool_t result = kTRUE;
- result = Store("GRP", "LHCData", dt, &md);
- delete dt;
- if (result) return 0;
- else return 3;
- }
- else return 4;
- delete lhcMap;
- }
- else {
- AliError("Cannot read correctly LHCData file");
- return 2;
+ AliLHCData* dt = new AliLHCData(fileName.Data(),timeStart,timeEnd);
+ // storing AliLHCData in OCDB
+ if (dt){
+ AliInfo(Form("Filled %d records to AliLHCData object",dt->GetData().GetEntriesFast()));
+ AliCDBMetaData md;
+ md.SetResponsible("Ruben Shahoyan");
+ md.SetComment("LHC data from the GRP preprocessor.");
+ Bool_t result = kTRUE;
+ result = Store("GRP", "LHCData", dt, &md);
+ delete dt;
+ if (result) return 0;
+ else return 3;
}
}
Element GetValue(Int_t i=0) const;
Element* GetValues() const {return (Element*)fArray;}
Double_t GetTimeStamp() const {return fTimeStamp;}
- Char_t* GetTimeAsString() const {return TimeAsString(fTimeStamp);}
+ Char_t* GetTimeAsString(Bool_t utc=kTRUE) const {return TimeAsString(fTimeStamp,utc);}
//
void SetProcessed1(Bool_t v=kTRUE) {SetBit(kProcessed1,v);}
void SetLastSpecial(Bool_t v=kTRUE) {SetBit(kLastSpecial,v);}
virtual void Clear(const Option_t *opt="");
virtual void Print(const Option_t *opt="") const;
//
- static Char_t* TimeAsString(double t);
+ static Char_t* TimeAsString(double t,Bool_t utc=kTRUE);
//
protected:
//
//__________________________________________________________________________
template<class Element>
-Char_t* AliLHCDipValT<Element>::TimeAsString(double t)
+Char_t* AliLHCDipValT<Element>::TimeAsString(double t, Bool_t utc)
{
+ // time as string in UTC or local format
time_t tt = (time_t) t;
- char* st = ctime(&tt);
+ char* st = utc ? asctime(gmtime(&tt)) : ctime(&tt);
*(strchr(st,'\n')) = 0;
return st;
}
TString str = opt;
str.ToLower();
if (str.Contains("raw")) printf("%.1f ",GetTimeStamp());
- else printf("[%s] ",GetTimeAsString());
+ else printf("[%s] ",GetTimeAsString(!str.Contains("loc")));
//
TString tp = typeid(fArray).name();
if ( tp==typeid(Char_t*).name() ) printf(": %s\n",(Char_t*)fArray);
if (sz>1) printf("\n");
Bool_t eolOK = kFALSE;
for (int i=0;i<sz;i++) {
- if (tp == typeid(Int_t*).name() || tp == typeid(UInt_t*).name() ) printf(" %6d |" ,(Int_t)fArray[i]);
+ if (tp == typeid(Int_t*).name() || tp == typeid(UInt_t*).name() ) {
+ if (!str.Contains("bit")) printf(" %6d |" ,(Int_t)fArray[i]);
+ else {
+ printf(" ");
+ int val = (int)fArray[i];
+ for (int j=sizeof(int)*8;j--;) printf("%d",(val>>j)&0x1);
+ printf(" |");
+ }
+
+ }
else if (tp == typeid(Double_t*).name() || tp == typeid(Float_t*).name()) printf(" %+.3e |",(Float_t)fArray[i]);
else printf(" ");
eolOK = kFALSE;
//
// reading the file with the inputs
//
-
+ gSystem->ExpandPathName(filename);
if( gSystem->AccessPathName( filename.Data() ) ) {
AliError(Form( "file (%s) not found", filename.Data() ) );
return NULL;
}
TObjArray* tokens = strLine.Tokenize("\t");
Int_t ntokens = tokens->GetEntriesFast();
+ //
+ if ( strLine.Contains("LHC_ENTRIES ") ) {
+ // RS: special treatment for "LHC_ENTRIES N" record, which is space (and not tab) separated)
+ delete tokens;
+ tokens = strLine.Tokenize(" ");
+ ntokens = tokens->GetEntriesFast();
+ }
+ //
AliDebug(3,Form("Number of tokens = %d",ntokens));
if (ntokens == 2 && !(((TObjString*)tokens->At(0))->String()).CompareTo("LHC_ENTRIES")){
lhcEntries = (((TObjString*)tokens->At(1))->String()).Atoi();
// reading the file with the inputs for the selected alias
// returning the TObjArray containing the information only for the current alias
//
-
+ gSystem->ExpandPathName(filename);
if( gSystem->AccessPathName( filename.Data() ) ) {
AliError(Form( "file (%s) not found", filename.Data() ) );
return NULL;