// $Id$
#include <cstdlib>
+#include <iostream>
#include "AliMUONTrackerIO.h"
/// \class AliMUONTrackerIO
///
/// \author Laurent Aphecetche, Subatech
+using std::ostringstream;
+using std::istringstream;
+using std::cout;
+using std::endl;
/// \cond CLASSIMP
ClassImp(AliMUONTrackerIO)
/// \endcond
if ( ! AliMpDDLStore::Instance(kFALSE) )
{
AliErrorClass("Mapping not loaded. Cannot work");
- return 0;
+ return kNoMapping;
}
char line[1024];
sin >> busPatchId >> manuId >> sumn >> numberOfEvents;
+ if ( busPatchId == -1 && manuId == -1 && sumn == 0 && numberOfEvents == 0 )
+ {
+ /// DA could not produce information (because run failed somehow).
+ /// That's OK, but let the world know about it
+ return kNoInfoFile;
+ }
+
Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(busPatchId);
AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
if ( sline.Contains("DUMMY") )
{
AliDebugClass(1,"Got a dummy file here");
+ delete [] runs;
+ delete [] dac;
return kDummyFile;
}
if ( sline.Contains("* Run") )
runNumber = s.Atoi();
AliDebugClass(1,Form("runNumber is %d",runNumber));
}
+ delete a;
}
if ( sline.Contains("DAC values") )
{
{
if ( nDAC < 100 )
{
+ delete[] runs;
+ delete[] dac;
runs = new Int_t[nDAC];
dac = new Int_t[nDAC];
// skip two lines
{
AliErrorClass(Form("Something went wrong, as I get too big nDAC = %d",nDAC));
nDAC = 0;
+ delete [] runs;
+ delete [] dac;
return kFormatError;
}
}
}
continue;
}
+
+ if (!param) continue;
+
Int_t channel;
Float_t capaValue;
Float_t injectionGain;
//_____________________________________________________________________________
Int_t
-AliMUONTrackerIO::ReadConfig(const char* filename, AliMUONVStore& confStore, Bool_t& changed)
+AliMUONTrackerIO::ReadConfig(const char* filename, AliMUONVStore& confStore)
{
/// 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));
in.close();
- return DecodeConfig(stream.str().c_str(),confStore,changed);
+ return DecodeConfig(stream.str().c_str(),confStore);
}
//_____________________________________________________________________________
Int_t
-AliMUONTrackerIO::DecodeConfig(const char* data, AliMUONVStore& confStore, Bool_t& changed)
+AliMUONTrackerIO::DecodeConfig(const char* data, AliMUONVStore& confStore)
{
/// 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;
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);