本文整理汇总了C++中AliCDBManager::SetRun方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBManager::SetRun方法的具体用法?C++ AliCDBManager::SetRun怎么用?C++ AliCDBManager::SetRun使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliCDBManager
的用法示例。
在下文中一共展示了AliCDBManager::SetRun方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeMUONRecoParamArray
//-----------------------------------------------------------------------
void MakeMUONRecoParamArray(Int_t startRun = 0,
Int_t endRun = AliCDBRunRange::Infinity(),
const char* settings="ppIdeal")
{
/// set the reconstruction parameters and store them in the OCDB ($ALICE_ROOT/OCDB/MUON/Calib/RecoParam/).
///
/// - make a CDB entry for the run range [startRun, endRun]
///
/// for the possible values of settings, please see AliMUONRecoParam::Create
// init CDB
AliCDBManager* man = AliCDBManager::Instance();
if (!man->IsDefaultStorageSet())
{
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
}
man->SetRun(startRun);
TObjArray* recoParams = AliMUONRecoParam::Create(settings);
if (recoParams)
{
// save RecoParam in CDB
AliMUONCDB::WriteToCDB(recoParams, "MUON/Calib/RecoParam", startRun, endRun,
"reconstruction parameters for MUON", "L. Aphecetche and P. Pillot");
}
delete recoParams;
}
示例2: OCDBDefault
void OCDBDefault(Int_t mode)
{
Int_t run = atoi(gSystem->Getenv("CONFIG_RUN"));
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("raw://");
if(gSystem->Getenv("CONFIG_OCDBTIMESTAMP"))
{
TString t = gSystem->Getenv("CONFIG_OCDBTIMESTAMP");
TObjArray* list =t.Tokenize("_");
UInt_t tU[6];
for(Int_t i=0; i<list->GetEntries(); i++)
{
TString st = ((TObjString*)list->At(i))->GetString();
tU[i] =(UInt_t)atoi(st.Data());
}
man->SetMaxDate(TTimeStamp(tU[0], tU[1], tU[2], tU[3], tU[4], tU[5]));
printf("*** Setting custom OCDB time stamp %s ***\n", t.Data());
}
man->SetRun(run);
// set detector specific paths
DefaultSpecificStorage(man, mode);
}
示例3: MakeFMDZeroMisAlignment
void MakeFMDZeroMisAlignment()
{
// Create TClonesArray of zero-misalignment objects for FMD
//
const char* macroname = "MakeFMDZeroMisAlignment.C";
// Activate CDB storage and load geometry from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
TString storage = gSystem->Getenv("STORAGE");
TString output = "FMDfullMisalignment.root";
if(toCdb) output = storage;
gSystem->Load("libFMDutil");
AliFMDAlignFaker::GetGeometry(toCdb, storage);
AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
"geometry.root",
output.Data());
faker->SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
faker->SetSensorRotation(0., 0., 0., 0., 0., 0.);
faker->SetHalfDisplacement(0., 0., 0., 0., 0., 0.);
faker->SetHalfRotation(0., 0., 0., 0., 0., 0.);
faker->Exec();
delete faker;
}
示例4: PatchCDB
void PatchCDB(const char* runlist, const char* runlist1400, const char* srcOCDBPath="alien://folder=/alice/data/2016/OCDB", const char* destOCDBPath="alien://folder=/alice/cern.ch/user/l/laphecet/OCDBCH3L")
{
// function to patch the OCDB MUON/Calib/HV for the swap of CH3L Q2S1 and Q2S2
// runlist = full list of runs where Chamber03Left/Quad2Sect1 has an HV problem (trips, too low, plus the 1400 V
// below)
// runlist1400 = list of runs where Chamber03Left/Quad2Sect1 was struggling at 1400 V
// for the runs in runlist1400, the HV will be forced to zero for that sector
// note that Chamber03Left/Quad2Sect1 = Chamber02Left/Quad1Sect0 in DCS alias world
AliAnalysisTriggerScalers ts(runlist,srcOCDBPath);
std::vector<int> vrunlist = ts.GetRunList();
AliAnalysisTriggerScalers ts1400(runlist1400,srcOCDBPath);
std::vector<int> vrunlist1400 = ts1400.GetRunList();
AliCDBManager* man = AliCDBManager::Instance();
TObjString sector2("MchHvLvLeft/Chamber02Left/Quad1Sect0.actual.vMon");
TObjString sector1("MchHvLvLeft/Chamber02Left/Quad1Sect1.actual.vMon");
for ( auto r : vrunlist )
{
man->SetDefaultStorage(srcOCDBPath);
man->SetRun(r);
std::cout << "Run " << r << std::endl;
AliCDBEntry* entry = man->Get("MUON/Calib/HV");
TMap* hvmap = static_cast<TMap*>(entry->GetObject()->Clone());
TPair* p1 = hvmap->RemoveEntry(§or2);
if ( std::find(vrunlist1400.begin(),vrunlist1400.end(),r) != vrunlist1400.end() )
{
TObjArray* a1 = static_cast<TObjArray*>(p1->Value());
AliDCSValue* first = static_cast<AliDCSValue*>(a1->First());
AliDCSValue* last = static_cast<AliDCSValue*>(a1->Last());
a1->Delete();
a1->Add(new AliDCSValue(0.0f,first->GetTimeStamp()));
a1->Add(new AliDCSValue(0.0f,last->GetTimeStamp()));
}
TPair* p2 = hvmap->RemoveEntry(§or1);
hvmap->Add(new TObjString(sector2),p2->Value());
hvmap->Add(new TObjString(sector1),p1->Value());
delete p1->Key();
delete p2->Key();
man->SetDefaultStorage(destOCDBPath);
hvmap->SetUniqueID( hvmap->GetUniqueID() | ( 1 << 9 ) );
AliMUONCDB::WriteToCDB(hvmap,"MUON/Calib/HV",r,r,"Patched for CH3L Quad2Sect1 vs 0 swapping","L. Aphecetche");
man->ClearCache();
}
}
示例5: initGeom
void initGeom()
{
// Macro replacing the gAlice->Init() to initialize the geometry
// Suggested by Raffaele Grosso <[email protected]>
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetRun(0);
gROOT->LoadMacro("Config.C");
gInterpreter->ProcessLine(gAlice->GetConfigFunction());
gAlice->GetMCApp()->Init();
}
示例6:
AliTOFTriggerMask *
ReadCDBEntryTriggerMask(Int_t run, const Char_t *defaultStorage = "raw://", const Char_t *specificStorage = NULL)
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(defaultStorage);
if (specificStorage)
cdb->SetSpecificStorage("TRIGGER/TOF/TriggerMask", specificStorage);
cdb->SetRun(run);
AliCDBEntry *cdbe = cdb->Get("TRIGGER/TOF/TriggerMask");
AliTOFTriggerMask *triggerMaskObj = (AliTOFTriggerMask *)cdbe->GetObject();
return triggerMaskObj;
}
示例7: AliTRDCheckPedestal
//__________________________________________________________
void AliTRDCheckPedestal(const Int_t runNr){
// Establish grid connection
if(!TGrid::Connect("alien://")){printf("F-No grid connection\n");return;}
// Set the storage to the OCDB of this runNr. It will be like
// alien://folder=/alice/data/2016/OCDB
AliCDBManager *man = AliCDBManager::Instance();
man->SetDefaultStorageFromRun(runNr);
// We derive the reference storage from it
const AliCDBStorage *stor = man->GetDefaultStorage();
TString folder = stor->GetBaseFolder();
folder.ReplaceAll("OCDB","Reference");
man->SetDefaultStorage(Form("alien://folder=%s",folder.Data()));
// Set the run number
man->SetRun(runNr);
// We abuse the folder name to derive the year
TString yearString(folder);
yearString.ReplaceAll("/alice/data/","");
yearString.ReplaceAll("/Reference/","");
const Int_t year = yearString.Atoi();
printf("W-Experimental: Derived year %d from storage folder\n",year);
// The reference data is stored per Local Data Concentrator
std::vector<Int_t> LDCvec = GetLDCVector(year);
// Loop over LDCs
for(std::vector<Int_t>::iterator LDCit = LDCvec.begin();LDCit!=LDCvec.end();LDCit++){
const TString padstatus = Form("TRD/DAQData/PadStatus%d",*LDCit);
AliCDBEntry *entry = AliCDBManager::Instance()->Get(padstatus.Data());
AliTRDCalibPadStatus *calpadstatus = dynamic_cast<AliTRDCalibPadStatus *>(entry->GetObject());
if(!calpadstatus){printf("E-Can not find %s in %s \n",padstatus.Data(),folder.Data());continue;}
//Create the noise pad with the RMS values of each channel
AliTRDCalPad *noisePad = calpadstatus->CreateCalPad();
// LDC -> SM mapping
std::vector<Int_t> SMvec = GetSMVector(year,*LDCit);
for(std::vector<Int_t>::iterator SMit=SMvec.begin();SMit!=SMvec.end();SMit++){
const TString padstatussm = Form("PadNoise-LDC%d-SM%02d",*LDCit,*SMit);
TCanvas *cpadstatusm = new TCanvas(padstatussm.Data(),padstatussm.Data(),50,50,600,800);
cpadstatusm->Divide(3,2);
// Draw each layer (or here plane)
const Float_t zRange[2]={0.,0.2};
for(Int_t iLayer = 0;iLayer<6;iLayer++){
cpadstatusm->cd(iLayer+1);
noisePad->MakeHisto2DSmPl(*SMit,iLayer,0,0,zRange[0],zRange[1],-1)->Draw("colz");
}
cpadstatusm->SaveAs(Form("%s.pdf",cpadstatusm->GetName()));
} // Loop over SMs of this LDC
} // End of loop over LDCs
} // End of void AliTRDcheckPedestal
示例8: makeSDigit
void makeSDigit(Int_t run=117048,
const char *fname="/alice/data/2010/LHC10b/000117048/raw/10000117048041.30.root")
{
AliSimulation sim;
//AliLog::SetGlobalDebugLevel(1);
AliLog::SetModuleDebugLevel("STEER",1);
AliCDBManager *cdbm = AliCDBManager::Instance();
cdbm->SetRun(run);
cdbm->SetDefaultStorage("local://$ALIROOT_OCDB_ROOT/OCDB");
//cdbm->SetDefaultStorage("raw://");
cdbm->SetSpecificStorage("GRP/GRP/Data",Form("local://%s","$ALICE_ROOT/test/rawmerge"));
sim.SetMakeSDigits("ITS TPC");
sim.SetNumberOfEvents(10000);
sim.ConvertRaw2SDigits(fname);
return;
}
示例9:
/** Display hits
@ingroup FMD_script
*/
void
PatternRaw(const char* file="raw.root")
{
// AliLog::SetModuleDebugLevel("FMD", 8);
AliCDBManager* cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
AliFMDParameters::Instance()->Init();
gSystem->Load("libFMDutil");
AliFMDPattern* d = new AliFMDPattern;
d->AddLoad(AliFMDInput::kRaw);
d->SetRawFile(file);
d->SetName("raw");
d->SetTitle("Raw");
// d->AddLoad(AliFMDInput::kKinematics);
d->Run();
}
示例10: sim
void sim(Int_t embrun)
{
AliSimulation sim;
if (embrun == 4) {
AliCDBManager *cdbm = AliCDBManager::Instance();
cdbm->SetRun(atoi(gSystem->Getenv("DC_RUN")));
cdbm->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdbm->SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));
sim.SetMakeSDigits("ITS TPC TRD TOF VZERO");
sim.ConvertRaw2SDigits("raw.root","AliESDs.root");
return;
}
if (embrun == 2) {
sim.SetRunGeneration(kFALSE);
sim.SetMakeSDigits("");
sim.SetMakeDigitsFromHits("");
}
else {
sim.SetRunGeneration(kTRUE);
sim.SetMakeSDigits("ITS TPC TRD TOF VZERO");
}
sim.SetRunSimulation(kTRUE);
sim.SetMakeDigits("ITS TPC TRD TOF VZERO");
sim.SetWriteRawData("ITS TPC TRD TOF VZERO","raw.root",kTRUE);
if (embrun == 1)
sim.MergeWith("../BackgroundSDigits/galice.root",1);
sim.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
sim.SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));
sim.SetRunQA(":") ;
AliQA::SetQARefStorage("local://$ALICE_ROOT/OCDB") ;
for (Int_t det = 0 ; det < AliQA::kNDET ; det++) {
sim.SetQACycles(det, 1) ;
}
// sim.SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-15-Release/Full/");
// sim.SetRunHLT("");
// sim.SetQA(kFALSE);
sim.Run(1);
}
示例11: Init
void Init()
{
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetRun(0);
// MC application initialization
TString configFileName = "$ALICE_ROOT/macros/g4Config.C";
gROOT->LoadMacro(configFileName.Data());
gInterpreter->ProcessLine(gAlice->GetConfigFunction());
gAlice->GetMCApp()->Init();
((TGeant4*)gMC)->ProcessGeantCommand("/mcDet/printMedia");
cout << endl
<< "Only MonteCarlo initialization has been performed. " << endl
<< "To run simulation you have to re-run aliroot and choose Run in g4menu." << endl;
}
示例12: trd_qaRec
void trd_qaRec()
{
gSystem->Load("libANALYSIS");
gSystem->Load("libTender");
gSystem->Load("libPWGPP");
if(!TFile::Open("TRD.DebugInfoGen.root")){
printf("No debug file for InfoGen task.\n");
return;
}
TTree *t = (TTree*)gFile->Get("trackInfo");
AliTRDtrackInfo *fTrackInfo = 0x0;
t->SetBranchAddress("TrackInfo.", &fTrackInfo);
gROOT->cd();
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
AliEveEventManager::Instance()->AssertGeometry();
AliEveEventManager::AssertMagField();
AliTRDReconstructor *reco = new AliTRDReconstructor();
reco->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
AliEveTRDTrackList *tracks = new AliEveTRDTrackList("TRD QA Tracks");
AliTRDtrackV1 *fTrack = 0x0, *track = 0x0;
for (Int_t it=0; it<t->GetEntries(); it++){
if(!t->GetEntry(it)) continue;
if(!fTrackInfo) continue;
if(!(fTrack = fTrackInfo->GetTrack())) continue;
track = new AliTRDtrackV1(*fTrack);
track->SetOwner();
track->SetReconstructor(reco);
tracks->AddElement(new AliEveTRDTrack(track));
printf("Trk[%3d] ESD[%d] Ncls[%d]\n", it, fTrackInfo->GetESDinfo()->GetId(), fTrack->GetNumberOfClusters());
if(it>= 100) break;
}
gEve->AddElement(tracks);
gEve->Redraw3D();
}
示例13: AliTRDreadRaw2Clusters
void AliTRDreadRaw2Clusters(const char *fname = "raw.root", const char *fnameGeom = "./geometry.root")
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
TFile *fGeometryFile = TFile::Open(fnameGeom);
TGeoManager *fGeoManager = 0;
if (fGeometryFile)
{
fGeoManager = (TGeoManager *)fGeometryFile->Get("Geometry");
}
if (fGeoManager == 0)
{
cout << "Geo Manager init failed." << endl;
}
AliTRDdigitsManager manR;
manR.CreateArrays();
AliRawReaderRoot reader(fname, 0);
reader.Select("TRD");
Int_t ievent = 0;
while (reader.NextEvent())
{
TTree *treeR = new TTree(sdir, "TRD clusters");
AliTRDclusterizer clusterizer("TRDclusterizer", "TRDclusterizer");
clusterizer.OpenOutput(treeR);
Int_t ir = clusterizer.Raw2ClustersChamber(&reader);
cout << "Clusterizer returned " << ir << endl;
// do something witht he clusters...
ievent++;
}
}
示例14: recTracking
void recTracking(Int_t type, const char *filename="data.root")
{
/// Set path to calibration data
AliCDBManager * man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetRun(0);
man->SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/user/m/mivanov/public/Calib");
//
// Set reconstruction parameters
//
AliLog::SetClassDebugLevel("AliTPCclusterer",2);
AliTPCRecoParam * tpcRecoParam = 0;
if (type==0) tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE);
if (type>0) tpcRecoParam = AliTPCRecoParam::GetLaserTestParam(kTRUE);
AliTPCReconstructor::SetRecoParam(tpcRecoParam);
AliTPCReconstructor::SetStreamLevel(1);
//
//
//
AliReconstruction rec;
rec.SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/user/m/mivanov/public/Calib");
rec.SetLoadAlignData("");
rec.SetWriteESDfriend(kTRUE);
rec.SetInput(filename);
rec.SetEquipmentIdMap("EquipmentIdMap.data");
//rec.SetRunReconstruction("TPC");
rec.SetOption("TPC","PedestalSubtraction");
rec.SetRunLocalReconstruction("");
rec.SetRunTracking("TPC");
rec.SetFillESD("TPC");
rec.SetFillTriggerESD(kFALSE);
rec.SetRunVertexFinder(kFALSE);
rec.SetWriteAlignmentData(kTRUE);
rec.Run(0);
}
示例15: MakeGeometry
void MakeGeometry()
{
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetRun(1);
// MC application initialization
TString configFileName = "$ALICE_ROOT/macros/g4ConfigGeometry.C";
gROOT->LoadMacro(configFileName.Data());
gInterpreter->ProcessLine(gAlice->GetConfigFunction());
gAlice->GetMCApp()->Init();
// Generate geometry file
//
gGeoManager->Export("geometry.root");
cout << endl
<< "Geometry file geometry.root has been generated." << endl
<< "You have to re-run aliroot and choose Run in g4menu." << endl;
exit(0);
}