#include "AliMUONDigitCalibrator.h"
#include "AliMUONPadStatusMaker.h"
#include "AliMUONPadStatusMapMaker.h"
+#include "AliMUONRejectList.h"
#include "AliMUONTrackerData.h"
#include "AliMUONTrackerIO.h"
#include "AliMpArrayI.h"
#include "Riostream.h"
#include "TString.h"
#include <sstream>
+#include "TSystem.h"
+
+//_____________________________________________________________________________
+AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker():
+AliMUONVTrackerDataMaker(),
+fData(0x0),
+fSource(""),
+fIsOwnerOfData(kTRUE)
+{
+ /// default ctor to be able to stream
+}
//_____________________________________________________________________________
AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(Int_t runNumber, const char* ocdbPath, const char* type):
AliMUONVTrackerDataMaker(),
fData(0x0),
-fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type))
+fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type)),
+fIsOwnerOfData(kTRUE)
{
/// ctor from OCDB
AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);
- Int_t startOfValidity;
- AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
- AliInfo(Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
- runNumber,ocdbPath,type,startOfValidity,store));
- if ( store )
+ TString stype(type);
+ stype.ToUpper();
+
+ if ( stype == "REJECTLIST" )
{
- fData = CreateData(type,*store,startOfValidity);
- }
+
+ Int_t startOfValidity(0);
+
+ AliMUONRejectList* rl = AliMUONCalibrationData::CreateRejectList(runNumber,&startOfValidity);
- delete store;
+ if (rl)
+ {
+ fData = new AliMUONTrackerData(Form("RL%d",startOfValidity),"RejectList",*rl);
+ }
+
+ delete rl;
+ }
+ else
+ {
+ Int_t startOfValidity;
+ AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
+ AliDebug(1,Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
+ runNumber,ocdbPath,type,startOfValidity,store));
+ if ( store )
+ {
+ fData = CreateData(type,*store,startOfValidity);
+ }
+ // we do not delete the store, as it's supposedly part of the OCDB cache...
+ }
AliCDBManager::Instance()->SetDefaultStorage(storage);
}
AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(const char* filename, const char* type):
AliMUONVTrackerDataMaker(),
fData(0x0),
-fSource(Form("%s-%s",filename,type))
+fSource(Form("%s-%s",filename,type)),
+fIsOwnerOfData(kTRUE)
{
/// ctor from an ASCII file
AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(const char* data, const char* type, Bool_t) :
AliMUONVTrackerDataMaker(),
fData(0x0),
-fSource(Form("direct-%s",type))
+fSource(Form("direct-%s",type)),
+fIsOwnerOfData(kTRUE)
+
{
/// ctor from a string containing the ASCII data
/// the last parameter is there just to distinguish this ctor from the previous one
AliMUONTrackerConditionDataMaker::~AliMUONTrackerConditionDataMaker()
{
/// dtor
- delete fData;
+ if ( fIsOwnerOfData ) delete fData;
}
Int_t hvIndex = hvNamer.DCSIndexFromDCSAlias(name.Data());
- if ( hvIndex >= 0 )
+ Int_t detElemId = hvNamer.DetElemIdFromDCSAlias(name.Data());
+
+ if ( hvIndex >= 0 && detElemId < 0 )
{
// skip switches
continue;
}
-
- Int_t detElemId = hvNamer.DetElemIdFromDCSAlias(name.Data());
if ( !AliMpDEManager::IsValidDetElemId(detElemId) )
{
detElemId,name.Data()));
continue;
}
-
+
Int_t nPCBs = hvNamer.NumberOfPCBs(detElemId);
- Int_t nindex = nPCBs ? nPCBs : 1;
+ Int_t indexMin = nPCBs ? 0 : hvIndex;
+ Int_t indexMax = nPCBs ? nPCBs : hvIndex+1;
AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
- for ( int i = 0 ; i < nindex; ++i )
+ for ( int i = indexMin ; i < indexMax; ++i )
{
Float_t switchValue(1.0);
AliDCSValue* v;
Float_t hvValue(0);
Int_t n(0);
+ Int_t noff(0);
+
while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
{
hvValue += v->GetFloat();
+ if ( v->GetFloat() < AliMpDCSNamer::TrackerHVOFF() ) ++noff;
++n;
}
hvValue *= switchValue;
if ( n ) hvValue /= n;
+
+ if (noff>0 && noff<n)
+ {
+ // that's a trip
+ hvValue = -1.0;
+ }
Int_t nofChannels(AliMpConstants::ManuNofChannels());
else
{
tmp = new AliMUON2DMap(kTRUE);
- Bool_t changed(kFALSE);
- AliMUONTrackerIO::DecodeConfig(source,*tmp,changed);
+ AliMUONTrackerIO::DecodeConfig(source,*tmp);
}
if ( tmp )
{
if ( ocdb )
{
store = AliMUONCalibrationData::CreateOccupancyMap(runNumber,&startOfValidity);
+ if (store) store = static_cast<AliMUONVStore*>(store->Clone());
}
else
{