示例#1
0
TMap* CreateDCSAliasMap()
{
  // Creates a DCS structure
  // The structure is the following:
  //   TMap (key --> value)
  //     <DCSAlias> --> <valueList>
  //     <DCSAlias> is a string
  //     <valueList> is a TObjArray of AliDCSValue
  //     An AliDCSValue consists of timestamp and a value in form of a AliSimpleValue

  // In this example 6 aliases exists: DCSAlias1 ... DCSAlias6
  // Each contains 1000 values randomly generated by TRandom::Gaus + 5*nAlias

  TMap* aliasMap = new TMap;
  aliasMap->SetOwner(1);
  TRandom random;

	FILE *fp = fopen("./DCSValues.txt","r");

	char name[50];
	Float_t val;
	while(!(EOF == fscanf(fp,"%s %f",name,&val))){
		TObjArray* valueSet = new TObjArray;
		valueSet->SetOwner(1);

		TString aliasName=name;
		
		//printf("alias: %s\t\t",aliasName.Data());

		int timeStamp=10;
		
		
		if(aliasName.Contains("HV")) {
			for(int i=0;i<200;i++){
				dcsVal = new AliDCSValue((Float_t) (val+random.Gaus(0,val*0.1)), timeStamp+10*i);
				valueSet->Add(dcsVal);
			}
		} else {
			for(int i=0;i<2;i++){
				AliDCSValue* dcsVal = new AliDCSValue((UInt_t) (val), timeStamp+10*i);
				valueSet->Add(dcsVal);
			}
		}
		
		aliasMap->Add(new TObjString(aliasName), valueSet);

	}
	fclose(fp);
  return aliasMap;
}
示例#2
0
void MakeCDBSnapshot()
{
    //TMap *specMap = new TMap(10);
    TMap *specMap = new TMap(30);
    specMap->SetName("mapOfSpecificStorages");
    specMap->SetOwner(1);
    specMap->Add(new TObjString("ITS/Align/Data"), new TObjString("alien://folder=/alice/simulation/2008/v4-15-Release/Residual"));

    specMap->Add(new TObjString("MUON/Align/Data"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("MUON/Calib/Gains"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    //      MTR
    specMap->Add(new TObjString("MUON/Calib/GlobalTriggerCrateConfig"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Full"));
    specMap->Add(new TObjString("MUON/Calib/LocalTriggerBoardMasks"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Full"));
    specMap->Add(new TObjString("MUON/Calib/RegionalTriggerConfig"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Full"));
    specMap->Add(new TObjString("MUON/Calib/TriggerEfficiency"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Full"));
    // TPC (23 total) 
    specMap->Add(new TObjString("TPC/Calib/PadGainFactor"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/TimeGain"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/GainFactorDedx"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/PadTime0"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Distortion"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/PadNoise"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/PadNoise"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Pedestals"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Temperature"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Parameters"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/ClusterParam"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/AltroConfig"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Pulser"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Pulser"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/CE"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Mapping"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Correction"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Align/Data"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Goofie"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/TimeDrift"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/Raw"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/QA"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/"));
    specMap->Add(new TObjString("TPC/Calib/HighVoltage"), new TObjString("alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/")); 


    MakeSnapshot(139517,"alien://folder=/alice/data/2010/OCDB",specMap,"cdbSnapshot.root");

}