本文整理汇总了C++中AliCDBManager::SetSpecificStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBManager::SetSpecificStorage方法的具体用法?C++ AliCDBManager::SetSpecificStorage怎么用?C++ AliCDBManager::SetSpecificStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliCDBManager
的用法示例。
在下文中一共展示了AliCDBManager::SetSpecificStorage方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rec
void rec() {
// AliLog::SetGlobalDebugLevel(10);
AliCDBManager * man = AliCDBManager::Instance();
man->SetDefaultStorage("alien://Folder=/alice/simulation/2008/v4-10-Release/Residual/");
man->SetSpecificStorage("EMCAL/*","local://DB");
AliReconstruction reco;
AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
AliTracker::SetFieldMap(field,kTRUE);
reco.SetUniformFieldTracking(kFALSE);
reco.SetWriteESDfriend();
reco.SetWriteAlignmentData();
AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam();
AliTPCReconstructor::SetRecoParam(tpcRecoParam);
AliTPCReconstructor::SetStreamLevel(0);
reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON T0 VZERO FMD PMD ZDC");
//reco.SetInput("raw.root") ;
//AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();
// recEmc->SetSubtractPedestals(kFALSE);
// AliPHOSReconstructor::SetRecoParamEmc(recEmc);
reco.SetRunQA(kFALSE) ;
TStopwatch timer;
timer.Start();
reco.Run();
timer.Stop();
timer.Print();
}
示例2: runReconstruction
void runReconstruction(int seed, const char* input, const char* recoptions, bool rawocdb)
{
AliCDBManager* man = AliCDBManager::Instance();
if ( rawocdb )
{
cout << "**** WILL USE RAW OCDB" << endl;
man->SetDefaultStorage("raw://"); //alien://folder=/alice/data/2011/OCDB?cacheFold=/Users/laurent/OCDBcache");
man->SetSpecificStorage("ITS/Calib/RecoParam","alien://folder=/alice/cern.ch/user/p/ppillot/OCDB_PbPbSim");
}
else
{
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));
}
gRandom->SetSeed(seed);
AliReconstruction* MuonRec = new AliReconstruction("galice.root");
MuonRec->SetInput(gSystem->ExpandPathName(input));
MuonRec->SetRunReconstruction("MUON ITS");
MuonRec->SetFillESD("HLT");
MuonRec->SetOption("HLT", "libAliHLTMUON.so");
MuonRec->SetNumberOfEventsPerFile(10000);
MuonRec->SetOption("MUON",recoptions);
MuonRec->SetRunQA("MUON:ALL");
MuonRec->SetQAWriteExpert(AliQAv1::kMUON);
MuonRec->SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
MuonRec->SetWriteESDfriend(kFALSE);
MuonRec->SetCleanESD(kFALSE);
MuonRec->SetStopOnError(kFALSE);
// uncomment the following lines if you want to set custom RecoParam
// instead of getting them from the OCDB
// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
// muonRecoParam->SaveFullClusterInESD(kTRUE,100.);
// MuonRec->SetRecoParam("MUON",muonRecoParam);
MuonRec->Run();
delete MuonRec;
//gObjectTable->Print();
}
示例3:
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;
}
示例4: 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;
}
示例5: 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);
}
示例6: recqa
void recqa()
{
const char * kYear = "08" ;
gEnv->SetValue("Root.Stacktrace","no");
gEnv->SetValue("Root.Stacktrace","no");
AliCDBManager * man = AliCDBManager::Instance();
//man->SetDefaultStorage("alien://Folder=/alice/data/2008/LHC08d/OCDB/") ;
man->SetDefaultStorage("local://$ALIROOT_OCDB_ROOT/OCDB");
man.SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd()));
TString detectors("ITS TPC TRD TOF PHOS HMPID EMCAL/*MUON*/ FMD ZDC PMD T0 VZERO");
//AliQA::SetQARefStorage(Form("%s%s/", AliQA::GetQARefDefaultStorage(), kYear)) ;
AliQA::SetQARefStorage("local://$ALIROOT_OCDB_ROOT/OCDB") ;
//AliQA::SetQARefDataDirName(AliQA::kMONTECARLO) ; //RUN_TYPE
AliQADataMamanager qas("rec") ;
qas.Run(detectors.Data(), AliQA::kRECPOINTS);
}
示例7: 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);
}
示例8: AliTRDplotNoiseBaseline
//void PlotNoiseBaseline(Int_t run, Int_t sm, Int_t det, const char * pathdatabase="local:///d/alice12/bailhache/TestShuttle/database/", const char * pathreferencefile="local:///d/alice12/bailhache/TestShuttle/reference")
//void PlotNoiseBaseline(Int_t run=34529, Int_t sm=0, Int_t det=0, const char * pathdatabase="alien://Folder=/alice/data/2008/LHC08b/OCDB/", const char * pathreferencedatabase="alien://Folder=/alice/data/2008/LHC08b/Reference/")
//void PlotNoiseBaseline(Int_t run=1, Int_t sm=0, Int_t det=0, const char * pathdatabase="local:///d/alice12/bailhache/AliAnalysisTask/v4-13-Head/SHUTTLE/TestShuttle/TestCDB/", const char * pathreferencedatabase="local:///d/alice12/bailhache/AliAnalysisTask/v4-13-Head/SHUTTLE/TestShuttle/TestReference/")
void AliTRDplotNoiseBaseline(Int_t run=34529, Int_t sm=0, Int_t det=0, const char * pathdatabase="alien://Folder=/alice/data/2008/LHC08b/OCDB/", const char * pathreferencedatabase="alien://Folder=/alice/data/2008/LHC08b/Reference/")
{
//TGrid::Connect("alien://",0,0,"t");
AliCDBManager *CDB = AliCDBManager::Instance();
CDB->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
CDB->SetSpecificStorage("TRD/Calib/PadNoise",pathdatabase);
CDB->SetSpecificStorage("TRD/Calib/DetNoise",pathdatabase);
CDB->SetSpecificStorage("TRD/Calib/PadStatus",pathdatabase);
CDB->SetRun(run);
AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
//const AliTRDCalDet *u = cal->GetNoiseDet();
AliTRDCalDet *u = new AliTRDCalDet("u","u");
for(Int_t k = 0; k < 540; k++){
u->SetValue(k,10.0);
}
//Style
//************************
gStyle->SetPalette(1);
gStyle->SetOptStat(1111);
gStyle->SetPadBorderMode(0);
gStyle->SetCanvasColor(10);
gStyle->SetPadLeftMargin(0.13);
gStyle->SetPadRightMargin(0.13);
//Build the Cal Pad
//********************************
Int_t smi = sm*30;
AliTRDCalPad *ki = new AliTRDCalPad("testnoise","testnoise");
for(Int_t k = 0; k < 540; k++){
ki->SetCalROC(k,(AliTRDCalROC *) cal->GetNoiseROC(k));
}
// padstatus 2D
Int_t smn = (Int_t) det/30;
if((smn==0) || (smn==1) || (smn==2) || (smn==9) || (smn==10) || (smn==11)) smn = 1;
if((smn==3) || (smn==4) || (smn==5) || (smn==12) || (smn==13) || (smn==14)) smn = 2;
if((smn==6) || (smn==7) || (smn==8) || (smn==15) || (smn==16) || (smn==17)) smn = 3;
TString name("TRD/DAQData/PadStatus");
name += smn;
//name += 3;
AliCDBEntry *entrypadstatus = AliCDBManager::Instance()->Get("TRD/Calib/PadStatus",run);
if(!entrypadstatus) return;
AliTRDCalPadStatus *lo = (AliTRDCalPadStatus *)entrypadstatus->GetObject();
AliCDBEntry *entryo = AliCDBManager::Instance()->GetStorage(pathreferencedatabase)->Get(name, run);
if(!entryo) return;
AliTRDCalibPadStatus *calpad = (AliTRDCalibPadStatus *) entryo->GetObject();
if(!calpad) return;
// Plot
//***********
// noise 2D
TCanvas *cnoise = new TCanvas((const char*)"noise1",(const char*)"noise1",50,50,600,800);
cnoise->Divide(3,2);
cnoise->cd(1);
((TH2F *)ki->MakeHisto2DSmPl(sm,0,u,0,0.0,3.5,-1))->Draw("colz");
cnoise->cd(2);
((TH2F *)ki->MakeHisto2DSmPl(sm,1,u,0,0.0,3.5,-1))->Draw("colz");
cnoise->cd(3);
((TH2F *)ki->MakeHisto2DSmPl(sm,2,u,0,0.0,3.5,-1))->Draw("colz");
cnoise->cd(4);
((TH2F *)ki->MakeHisto2DSmPl(sm,3,u,0,0.0,3.5,-1))->Draw("colz");
cnoise->cd(5);
((TH2F *)ki->MakeHisto2DSmPl(sm,4,u,0,0.0,3.5,-1))->Draw("colz");
cnoise->cd(6);
((TH2F *)ki->MakeHisto2DSmPl(sm,5,u,0,0.0,3.5,-1))->Draw("colz");
// Pad Status
TCanvas *cpadstatus = new TCanvas((const char*)"padstatus",(const char*)"padstatus",50,50,600,800);
cpadstatus->Divide(3,2);
cpadstatus->cd(1);
((TH2F *)lo->MakeHisto2DSmPl(sm,0))->Draw("colz");
cpadstatus->cd(2);
((TH2F *)lo->MakeHisto2DSmPl(sm,1))->Draw("colz");
cpadstatus->cd(3);
((TH2F *)lo->MakeHisto2DSmPl(sm,2))->Draw("colz");
cpadstatus->cd(4);
((TH2F *)lo->MakeHisto2DSmPl(sm,3))->Draw("colz");
cpadstatus->cd(5);
((TH2F *)lo->MakeHisto2DSmPl(sm,4))->Draw("colz");
cpadstatus->cd(6);
((TH2F *)lo->MakeHisto2DSmPl(sm,5))->Draw("colz");
// reference data
TCanvas *cpoui = new TCanvas((const char*)"cpoui",(const char*)"cpoui",50,50,600,800);
//.........这里部分代码省略.........
示例9: HLTT0Test
// ----------------------------------------------------------------------------
void HLTT0Test(const Char_t *filename, const Char_t *cdbURI,
Int_t minEvent=-1, Int_t maxEvent=-1) {
printf (" ============================================= \n\n");
printf (" TEST T0 RECONSTRUCTION \n\n");
printf (" ============================================= \n");
if(!gSystem->AccessPathName("galice.root")){
cerr << "AliReconstruction on raw data requires to delete galice.root, ";
cerr << "or run at different place." << endl;
cerr << "!!! DO NOT DELETE the galice.root of your simulation, ";
cerr << "but create a subfolder !!!!" << endl;
return;
}
TGrid::Connect("alien");
if (gSystem->AccessPathName(filename)) {
cerr << "can not find file " << filename << endl;
return;
}
// -- connect to the GRID if we use a file or OCDB from the GRID
TString struri=cdbURI;
TString strfile=filename;
if (struri.BeginsWith("raw://") ||
strfile.Contains("://") && !strfile.Contains("local://")) {
TGrid::Connect("alien");
}
// -- Set the CDB storage location
AliCDBManager * man = AliCDBManager::Instance();
man->SetDefaultStorage(cdbURI);
if (struri.BeginsWith("local://")) {
// set specific storage for GRP entry
// search in the working directory and one level above, the latter
// follows the standard simulation setup like e.g. in test/ppbench
if (!gSystem->AccessPathName("GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
} else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
} else {
cerr << "can not find a GRP entry, please run the macro in the folder" << endl;
cerr << "of a simulated data sample, or specify a GRID OCDB" << endl;
HLTT0Test();
return;
}
}
//////////////////////////////////////////////////////////////////////////////////////
//
// Reconstruction settings
AliReconstruction rec;
if (minEvent>=0 || maxEvent>minEvent) {
if (minEvent<0) minEvent=0;
if (maxEvent<minEvent) maxEvent=minEvent;
rec.SetEventRange(minEvent,maxEvent);
}
rec.SetRunReconstruction("HLT");
rec.SetLoadAlignFromCDB(kFALSE);
rec.SetWriteESDfriend(kFALSE);
// due to bug ...
// StopOnError needs to be disabled
rec.SetStopOnError(kFALSE);
rec.SetRunVertexFinder(kFALSE);
rec.SetInput(filename);
// QA options
rec.SetRunQA(":") ;
//rec.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;
//////////////////////////////////////////////////////////////////////////////////////
//
// setup the HLT system
AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
/*
// define a data publisher configuration for T0 raw data
AliHLTConfiguration publisher("RAW-Publisher",
"AliRawReaderPublisher",
"",
"-equipmentid 3584 "
"-datatype 'DDL_RAW ' 'VZRO' "
"-dataspec 0x01"
);
// define configuration of the T0Reconstruction component
AliHLTConfiguration vzeroReco("T0-Reconstruction",
"T0Reconstruction",
"RAW-Publisher",
""
);
// define configuration of the GlobalEsdConverter component
AliHLTConfiguration esdConverter("GLOBAL-ESD-Converter",
"GlobalEsdConverter",
"T0-Reconstruction",
""
//.........这里部分代码省略.........
示例10: trackhisto
//.........这里部分代码省略.........
for(int part=iMinPart; part<=iMaxPart; part++){
TString arg, publisher, cf;
// raw data publisher components
int ddlno=768;
if (part>1) ddlno+=72+4*slice+(part-2);
else ddlno+=2*slice+part;
arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x -verbose", ddlno, slice, slice, part, part);
publisher.Form("DP_%02d_%d", slice, part);
AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
// cluster finder components
cf.Form("CF_%02d_%d", slice, part);
AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(), "");
if (trackerInput.Length()>0) trackerInput+=" ";
trackerInput+=cf;
}
TString tracker, converted_tracklet;
// tracker components
tracker.Form("TR_%02d", slice);
converted_tracklet.Form("CONVTR_%02d", slice);
AliHLTConfiguration trackerconf(tracker.Data(), "TPCCATracker", trackerInput.Data(), "");
AliHLTConfiguration convertedconf(converted_tracklet.Data(), "TPCCATrackerOutputConverter", tracker.Data(), "");
if (tracklets.Length()>0) tracklets+=" ";
tracklets+=converted_tracklet;
}
TString histoInput;
if(bTracklets==kTRUE){
if(histoInput.Length()>0)
histoInput+=" ";
histoInput+=tracklets;
AliHLTConfiguration tracklethiconf("tracklethi", "TPCTrackHisto", histoInput.Data(), "");
AliHLTConfiguration trackletrwfconf("trackletrfw", "ROOTFileWriter", "tracklethi", "-datafile TrackletHisto -concatenate-events -overwrite");
}
else {
if(histoInput.Length()>0)
histoInput+=" ";
histoInput+="TPC-clusters";
histoInput+=" ";
histoInput+="TPC-globalmerger";
AliHLTConfiguration trhiconf("trhi", "TPCTrackHisto", histoInput.Data(), "");
AliHLTConfiguration rwfconf("rfw", "ROOTFileWriter", "trhi", "-datafile TrackHisto -concatenate-events -overwrite");
}
AliReconstruction rec;
rec.SetRunQA(":");
rec.SetInput(filename);
// connect to the GRID if we use a file or OCDB from the GRID
TString struri = cdbURI;
TString strfile = filename;
if(struri.BeginsWith("raw://") || strfile.Contains("://") && !strfile.Contains("local://")){
TGrid::Connect("alien");
}
AliCDBManager *man = AliCDBManager::Instance();
man->SetDefaultStorage(cdbURI);
if(struri.BeginsWith("local://")) {
// set specific storage for GRP entry
// search in the working directory and one level above, the latter
// follows the standard simulation setup like e.g. in test/ppbench
if(!gSystem->AccessPathName("GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
}
else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
}
}
if(minEvent>=0 || maxEvent>minEvent){
if(minEvent<0) minEvent=0;
if(maxEvent<minEvent) maxEvent=minEvent;
rec.SetEventRange(minEvent,maxEvent);
}
rec.SetRunVertexFinder(kFALSE);
rec.SetRunReconstruction("HLT");
if(bTracklets==kTRUE){
rec.SetOption("HLT", "loglevel=0x7c chains=trackletrfw");
}
else {
rec.SetOption("HLT", "loglevel=0x7c chains=rfw");
}
rec.Run();
}
示例11: sampleRawAnalysis
/**
* @file sampleRawAnalysis.C
* @brief Example macro to run the AliHLTSampleRawAnalysisComponent in
* AliReconstruction.
*
* The component subscribes to DDL raw data published by the
* AliHLTRawReaderPublisherComponent. The macros requires a raw data file
* and a corresponding GRP entry.
*
* <pre>
* Usage: aliroot -b -q -l \
* sampleRawAnalysis.C'("rawfile", "cdb", minEvent, maxEvent)'
*
* Examples:
* sampleRawAnalysis.C'("raw.root", minEvent, MaxEvent)'
* sampleRawAnalysis.C'("./", minEvent, MaxEvent)'
* sampleRawAnalysis.C'("alien:///alice/data/2010/.../raw/....root")'
*
* Defaults
* cdb="local://$ALICE_ROOT/OCDB" -> take local OCDB from distribution
* minEvent=-1 -> no lower event selection
* maxEvent=-1 -> no upper event selection
*
* </pre>
*
* The input file can be a local raw.root file but also a file from the
* GRID. The separate DDL files generated in simulation can be accessed
* using AliRawReaderFile by speficying "directory/".
*
* Since the macro runs AliReconstruction the OCDB needs to be set up, in
* particular the GRP entry. If testing with a local OCDB you have to
* simulate some events and run the macro in the folder of the simulation.
* Also HLT components configure from objects in the OCDB.
*
* Note: You need a valid GRID token, if you want to access files directly
* from the Grid, use 'alien-token-init' of your alien installation.
*
* @author [email protected]t.uib.no
* @ingroup alihlt_tutorial
*/
void sampleRawAnalysis(const char *filename,
const char *cdbURI,
int minEvent=-1,
int maxEvent=-1)
{
if(!gSystem->AccessPathName("galice.root")){
cerr << "AliReconstruction on raw data requires to delete galice.root, or run at different place." << endl;
cerr << "!!! DO NOT DELETE the galice.root of your simulation, but create a subfolder !!!!" << endl;
return;
}
if (gSystem->AccessPathName(filename)) {
cerr << "can not find file " << filename << endl;
return;
}
// connect to the GRID if we use a file or OCDB from the GRID
TString struri=cdbURI;
TString strfile=filename;
if (struri.BeginsWith("raw://") ||
strfile.Contains("://") && !strfile.Contains("local://")) {
TGrid::Connect("alien");
}
// Set the CDB storage location
AliCDBManager * man = AliCDBManager::Instance();
man->SetDefaultStorage(cdbURI);
if (struri.BeginsWith("local://")) {
// set specific storage for GRP entry
// search in the working directory and one level above, the latter
// follows the standard simulation setup like e.g. in test/ppbench
if (!gSystem->AccessPathName("GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
} else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
} else {
cerr << "can not find a GRP entry, please run the macro in the folder" << endl;
cerr << "of a simulated data sample, or specify a GRID OCDB" << endl;
sampleRawAnalysis();
return;
}
}
//////////////////////////////////////////////////////////////////////////////////////
//
// Reconstruction settings
AliReconstruction rec;
if (minEvent>=0 || maxEvent>minEvent) {
if (minEvent<0) minEvent=0;
if (maxEvent<minEvent) maxEvent=minEvent;
rec.SetEventRange(minEvent,maxEvent);
}
rec.SetRunReconstruction("HLT");
rec.SetLoadAlignFromCDB(kFALSE);
rec.SetWriteESDfriend(kFALSE);
// due to bug ...
// StopOnError needs to be disabled
rec.SetStopOnError(kFALSE);
rec.SetRunVertexFinder(kFALSE);
//.........这里部分代码省略.........
示例12: compClusHitsMod2
void compClusHitsMod2(int nev=-1)
{
const int kSplit=0x1<<22;
const int kSplCheck=0x1<<23;
//
gSystem->Load("libITSUpgradeBase");
gSystem->Load("libITSUpgradeSim");
gSystem->Load("libITSUpgradeRec");
gROOT->SetStyle("Plain");
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));
man->SetSpecificStorage("ITS/Align/Data",
Form("local://%s",gSystem->pwd()));
man->SetSpecificStorage("ITS/Calib/RecoParam",
Form("local://%s",gSystem->pwd()));
man->SetRun(0);
TH1F* hL0A = new TH1F("hL0A", "Layer 0, polar angle", 20, 0, TMath::PiOver2());
hL0A->SetDirectory(0);
hL0A->GetXaxis()->SetTitle("#alpha");
TH1F* hL0B = new TH1F("hL0B", "Layer 0, azimuthal angle", 20, 0, TMath::PiOver2());
hL0B->SetDirectory(0);
hL0B->GetXaxis()->SetTitle("#beta");
TH1F* hL1A = new TH1F("hL1A", "Layer 1, polar angle", 20, 0, TMath::PiOver2());
hL1A->SetDirectory(0);
hL1A->GetXaxis()->SetTitle("#alpha");
TH1F* hL1B = new TH1F("hL1B", "Layer 1, azimuthal angle", 20, 0, TMath::PiOver2());
hL1B->SetDirectory(0);
hL1B->GetXaxis()->SetTitle("#beta");
TH1F* hL2A = new TH1F("hL2A", "Layer 2, polar angle", 20, 0, TMath::PiOver2());
hL2A->SetDirectory(0);
hL2A->GetXaxis()->SetTitle("#alpha");
TH1F* hL2B = new TH1F("hL2B", "Layer 2, azimuthal angle", 20, 0, TMath::PiOver2());
hL2B->SetDirectory(0);
hL2B->GetXaxis()->SetTitle("#beta");
TH1F* hL3A = new TH1F("hL3A", "Layer 3, polar angle", 20, 0, TMath::PiOver2());
hL3A->SetDirectory(0);
hL3A->GetXaxis()->SetTitle("#alpha");
TH1F* hL3B = new TH1F("hL3B", "Layer 3, azimuthal angle", 20, 0, TMath::PiOver2());
hL3B->SetDirectory(0);
hL3B->GetXaxis()->SetTitle("#beta");
TH1F* hL4A = new TH1F("hL4A", "Layer 4, polar angle", 20, 0, TMath::PiOver2());
hL4A->SetDirectory(0);
hL4A->GetXaxis()->SetTitle("#alpha");
TH1F* hL4B = new TH1F("hL4B", "Layer 4, azimuthal angle", 20, 0, TMath::PiOver2());
hL4B->SetDirectory(0);
hL4B->GetXaxis()->SetTitle("#beta");
TH1F* hL5A = new TH1F("hL5A", "Layer 5, polar angle", 20, 0, TMath::PiOver2());
hL5A->SetDirectory(0);
hL5A->GetXaxis()->SetTitle("#alpha");
TH1F* hL5B = new TH1F("hL5B", "Layer 5, azimuthal angle", 20, 0, TMath::PiOver2());
hL5B->SetDirectory(0);
hL5B->GetXaxis()->SetTitle("#beta");
TH1F* hL6A = new TH1F("hL6A", "Layer 6, polar angle", 20, 0, TMath::PiOver2());
hL6A->SetDirectory(0);
hL6A->GetXaxis()->SetTitle("#alpha");
TH1F* hL6B = new TH1F("hL6B", "Layer 6, azimuthal angle", 20, 0, TMath::PiOver2());
hL6B->SetDirectory(0);
hL6B->GetXaxis()->SetTitle("#beta");
gAlice=NULL;
AliRunLoader* runLoader = AliRunLoader::Open("galice.root");
runLoader->LoadgAlice();
gAlice = runLoader->GetAliRun();
runLoader->LoadHeader();
runLoader->LoadKinematics();
runLoader->LoadRecPoints();
runLoader->LoadSDigits();
runLoader->LoadHits();
AliLoader *dl = runLoader->GetDetectorLoader("ITS");
AliGeomManager::LoadGeometry("geometry.root");
TObjArray algITS;
AliGeomManager::LoadAlignObjsFromCDBSingleDet("ITS",algITS);
AliGeomManager::ApplyAlignObjsToGeom(algITS);
//
AliITSUGeomTGeo* gm = new AliITSUGeomTGeo(kTRUE);
AliITSMFTClusterPix::SetGeom(gm);
//
AliITSURecoDet *its = new AliITSURecoDet(gm, "ITSinterface");
its->CreateClusterArrays();
//
Double_t xg1,yg1,zg1=0.,xg0,yg0,zg0=0.,tg0;
Double_t xExit,yExit,zExit,xEnt,yEnt,zEnt,tof1;
//
TTree *cluTree = 0x0;
//.........这里部分代码省略.........
示例13: MakeSnapshot
void MakeSnapshot(Int_t run, const char* defStorage, TMap* specStorages, const char* snapshotFileName)
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(defStorage);
cdb->SetRun(run);
TIter iter(specStorages->GetTable());
TPair *pair = 0;
while((pair = dynamic_cast<TPair*> (iter.Next()))){
TObjString* caltype = dynamic_cast<TObjString*> (pair->Key());
TObjString* specstor= dynamic_cast<TObjString*> (pair->Value());
if (caltype && specstor)
//TString calType = caltype->GetString();
//TString specStor = specstor->GetString();
//cdb->SetSpecificStorage(calType.Data(),specStor.Data());
cdb->SetSpecificStorage(caltype->GetString().Data(),specstor->GetString().Data());
else
//AliFatal("Error reading info for specific storage")
Printf("Error reading info for specific storage");
}
// ********************************** GRP ******************************************
cdb->Get("GRP/CTP/Config");
cdb->Get("GRP/Calib/LHCClockPhase");
cdb->Get("GRP/GRP/Data");
cdb->Get("GRP/Align/Data");
cdb->Get("GRP/Calib/MeanVertexSPD");
cdb->Get("GRP/Calib/MeanVertex");
cdb->Get("GRP/Calib/MeanVertexTPC");
cdb->Get("GRP/Calib/CosmicTriggers");
cdb->Get("GRP/CTP/Scalers");
cdb->Get("GRP/CTP/CTPtiming");
cdb->Get("GRP/CTP/TimeAlign");
cdb->Get("GRP/GRP/LHCData");
cdb->Get("GRP/Calib/RecoParam");
// ********************************** ALL ******************************************
TString detStr = ("ITS TPC TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO");
//TString detStr = ("ITS MUON TPC");
TObjArray *arr = detStr.Tokenize(' ');
for (Int_t iDet=0; iDet<arr->GetEntries(); iDet++) {
TObjString *detOStr = dynamic_cast<TObjString*>(arr->At(iDet));
AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",detOStr->GetString().Data()));
AliCDBManager::Instance()->Get(Form("%s/Align/Data",detOStr->GetString().Data()));
}
// ******************************** TRIGGER ****************************************
// Temporary fix - one has to define the correct policy in order
// to load the trigger OCDB entries only for the detectors that
// in the trigger or that are needed in order to put correct
// information in ESD
AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
// ********************************** HLT ******************************************
// cdb->Get("HLT/ConfigHLT/esdLayout");
// cdb->Get("HLT/Calib/StreamerInfo");
TMap* entriesMap = const_cast<TMap*>(cdb->GetEntryCache());
Printf("\nentriesMap has %d entries!\n", entriesMap->GetEntries());
TList* entriesList = const_cast<TList*>(cdb->GetRetrievedIds());
Printf("\nentriesList has %d entries!\n", entriesList->GetEntries());
//TString filename(TString::Format("CDBsnapshot_Run%d.root",run));
TString filename(snapshotFileName);
TFile *f = new TFile(filename.Data(),"recreate");
f->cd();
f->WriteObject(entriesMap,"entriesMap");
f->WriteObject(entriesList,"entriesList");
f->Close();
entriesMap->SetOwnerKeyValue(kFALSE,kFALSE);
entriesList->SetOwner(kFALSE);
}
示例14: testCosmicsTrigger
void testCosmicsTrigger(const char *esdfilename,
const char *treename,
const char *cdbURI,
int nofEvents=-1
)
{
// check the name of the tree
TString strtree=treename;
if (strtree.CompareTo("esdTree")==0) strtree="ESD";
else if (strtree.CompareTo("HLTesdTree")==0) strtree="HLTESD";
else {
cerr << "invalid treename '" << treename << "', supported 'esdTree' and 'HLTesdTree'" << endl;
return;
}
// connect to the GRID if we use a file or OCDB from the GRID
TString struri=cdbURI;
TString strfile=esdfilename;
if (struri.BeginsWith("raw://") ||
strfile.Contains("://") && !strfile.Contains("local://")) {
TGrid::Connect("alien");
}
// open the ESD file and get the event count
if (!strfile.EndsWith("/")) strfile+="/";
strfile+="AliESDs.root";
TFile* esdfile=TFile::Open(strfile);
if (!esdfile || esdfile->IsZombie()) {
cerr << "cannot open file " << strfile << endl;
return;
}
// get number of events
TTree* pTree=NULL;
esdfile->GetObject(treename, pTree);
if (!pTree) {
cerr << "can not find " << treename << " in file " << strfile << endl;
return;
}
if (pTree->GetEntries()<=0) {
cerr << "empty tree " << treename << " in file " << strfile << endl;
return;
}
AliESDEvent* esd=new AliESDEvent;
esd->ReadFromTree(pTree);
pTree->GetEntry(0);
if (nofEvents<0 || nofEvents>pTree->GetEntries())
nofEvents=pTree->GetEntries();
// Set the CDB storage location
AliCDBManager *man = AliCDBManager::Instance();
man->SetDefaultStorage(cdbURI);
man->SetRun(esd->GetRunNumber());
if (struri.BeginsWith("local://")) {
// set specific storage for GRP entry
// search in the working directory and one level above, the latter
// follows the standard simulation setup like e.g. in test/ppbench
if (!gSystem->AccessPathName("GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
} else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
}
}
//////////////////////////////////////////////////////////////////////////////////////
//
// setup the HLT system
AliHLTSystem *pHLT = AliHLTPluginBase::GetInstance();
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->Load("libTPCcalib");
TString arguments, triggerinput;
// ESD publisher component
arguments=" -datapath "; arguments+=esdfilename;
arguments+=" -entrytype "; arguments+=strtree;
triggerinput="ESD-publisher";
AliHLTConfiguration esdpublisher(triggerinput.Data(), "ESDMCEventPublisher", "", arguments.Data());
AliHLTConfiguration cosmicstr("cosmics-trigger","CosmicsTrigger", triggerinput.Data(),"");
//AliHLTConfiguration globaltriggerconf("global-trigger", "HLTGlobalTrigger", "cosmics-trigger" , "");
// set option for the HLT system
// arguments
// - libraries to be used as plugins
// - loglevel=0x79 : Important, Warning, Error, Fatal
pHLT->ScanOptions("libAliHLTUtil.so libAliHLTMUON.so libAliHLTTRD.so libAliHLTGlobal.so libAliHLTTrigger.so loglevel=0x79");
pHLT->BuildTaskList("cosmics-trigger");
//pHLT->BuildTaskList("global-trigger");
pHLT->Run(nofEvents);
}