本文整理汇总了C++中StIOMaker::SetDebug方法的典型用法代码示例。如果您正苦于以下问题:C++ StIOMaker::SetDebug方法的具体用法?C++ StIOMaker::SetDebug怎么用?C++ StIOMaker::SetDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StIOMaker
的用法示例。
在下文中一共展示了StIOMaker::SetDebug方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bfcread_hist_extract
void bfcread_hist_extract(
const Char_t *MainFile=
"/afs/rhic.bnl.gov/star/data/samples/gstar.hist.root",
const Char_t *MakerHistDir="EventQA",
const Char_t *TopDirTree="bfcTree",
Char_t *OutFile=0,
const Char_t *PrintList="")
{
cout << "bfcread_hist_extract.C, input hist file = "
<< MainFile << endl;
cout << "bfcread_hist_extract.C, directory name for hist = "
<< MakerHistDir << endl;
cout << "bfcread_hist_extract.C, top level directory in hist file = "
<< TopDirTree << endl;
//
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StUtilities");
gSystem->Load("StAnalysisUtilities");
gSystem->Load("libglobal_Tables");
// setup chain with IOMaker - can read in .dst.root, .dst.xdf files
StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,TopDirTree);
IOMk->SetDebug();
IOMk->SetIOMode("r");
IOMk->SetBranch("*",0,"0"); //deactivate all branches
IOMk->SetBranch("histBranch",0,"r"); //activate dst Branch
// constructor for other maker (not used in chain)
StHistUtil *HU = new StHistUtil;
// now must set pointer to StMaker so HistUtil can find histograms
// with StHistUtil methods
// -- input any maker pointer but must cast as type StMaker
HU->SetPntrToMaker((StMaker *)IOMk);
// ONLY use StIOMaker in chain
// --- now execute chain member functions - 1 event (histograms) only
IOMk->Init();
IOMk->Clear();
IOMk->Make();
// method to print out list of histograms
// - can do this anytime after they're booked
// - default is to print out QA hist branch
Int_t NoHist=0;
//NoHist = HU->ListHists(MakerHistDir);
TList* dList = HU->FindHists(MakerHistDir);
if (PrintList) HU->SetDefaultPrintList(MakerHistDir,PrintList);
NoHist = HU->CopyHists(dList);
TH1** nh = HU->getNewHist();
TString name = MainFile;
if (!OutFile) {
name.Remove(0,name.Last('/')+1);
TString name2 = MakerHistDir;
name2.Remove(0,name2.Last('/')+1);
name.Insert(name.First('.'),"_");
name.Insert(name.First('.'),name2);
OutFile = name.Data();
}
cout << "Output hist file: " << OutFile << endl;
TFile* ofile = new TFile(OutFile,"RECREATE");
for (int i=0; i<NoHist; i++) {
printf("Extracting: %d. %s : %s\n",
i+1,nh[i]->GetName(),nh[i]->GetTitle());
nh[i]->Write();
}
ofile->Close();
}
示例2: Example_read_dst_print_tables
void Example_read_dst_print_tables(
Int_t nevents=1,
const char *MainFile=
"/afs/rhic.bnl.gov/star/data/samples/gstar.dst.root")
{
//
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("libglobal_Tables");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libtpc_Tables");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
cout << " .. Example_read_dst_print_tables.C, have loaded libraries " << endl;
// Setup top part of chain
chain = new StChain("bfc");
chain->SetDebug();
//
// setup chain with IOMaker - can read in .dst.root, .dst.xdf files
StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,"bfcTree");
IOMk->SetDebug();
IOMk->SetIOMode("r");
IOMk->SetBranch("*",0,"0"); //deactivate all branches
// IOMk->SetBranch("tpc_tracks",0,"r"); //activate tpc_tracks Branch
// IOMk->SetBranch("geantBranch",0,"r"); //activate geant Branch
IOMk->SetBranch("dstBranch",0,"r"); //activate dst Branch
// --- now execute chain member functions
chain->Init();
for (int iev=0;iev<nevents; iev++)
{
chain->Clear();
int iret = chain->Make();
if (iret) break;
cout << endl << endl <<
" !!! Now print info about event # " << iev << endl;
// ------ List all tables -----------
// GetDataSet is a member function of St_Maker
Event = chain->GetDataSet("dst");
// ls() returns a virtual void, so don't have to set it = to anything
if (Event) Event->ls();
// ---------------------- globtrk table ---------------------
// get dataset for globtrk
TDataSet *ds=chain->GetDataSet("dst/globtrk");
if (ds) {
cout << " Now print info about globtrk table " << endl;
// create iterator for the dataset
TDataSetIter globtrkiter(ds);
// Du,Pwd return things, but we choose not to keep the return value
globtrkiter.Du();
globtrkiter.Pwd();
// find the table
St_dst_track *glob = (St_dst_track *) globtrkiter.Find("globtrk");
// print out info about it
// using ls() from TDataSetIter
glob->ls();
// Print() is a member function of TTable
//glob->Print(9,1);
//glob->Print(8,1);
//glob->Print(8,2);
//glob->Print(1,1);
glob->Print(0,5);
// can't use this method anymore!!! 5June00 Kathy
// get the table header data using member function of TTable
//table_head_st *tdt_h = glob->GetHeader();
// cout << " header name = " << tdt_h->name << endl;
// cout << " header type = " << tdt_h->type << endl;
// cout << " header maxlen = " << tdt_h->maxlen << endl;
// cout << " header nok = " << tdt_h->nok << endl;
// get the table header data using member functions of TTable
cout << " table header info: name = " << glob->GetName() << endl;
cout << " table header info: type = " << glob->GetType() << endl;
cout << " table header info: #rows used = " << glob->GetNRows() << endl;
cout << " table header info: #rows allocated = " << glob->GetTableSize() << endl;
cout << " table header info: row size (bytes) = " << glob->GetRowSize() << endl;
cout << " table header info: #columns = " << glob->GetNumberOfColumns() << endl;
//.........这里部分代码省略.........
示例3: doEvents
// ------------------ Here is the actual method -----------------------------------------
void doEvents(const Char_t *inname, const Char_t *histname, const Char_t *ntuplename)
{
Int_t nEvents = 10;
Int_t nfiles = 100;
//
// First load some shared libraries we need
//
if (gClassTable->GetID("TTable") < 0) {
gSystem->Load("libStar");
gSystem->Load("libPhysics");
}
gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StarMagField");
gSystem->Load("StMagF");
gSystem->Load("StTpcDb");
// gSystem->Load("StDbUtilities");
gSystem->Load("StDaqLib");
gSystem->Load("StDbBroker");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StDbUtilities");
gSystem->Load("St_db_Maker");
gSystem->Load("StEvent");
gSystem->Load("StEventMaker");
gSystem->Load("StarMagField");
gSystem->Load("StTofUtil");
gSystem->Load("StTofMaker");
gSystem->Load("libtpc_Tables");
gSystem->Load("libGeom");
gSystem->Load("St_g2t");
gSystem->Load("geometry");
gSystem->Load("St_geant_Maker");
gSystem->Load("StTofrMatchMaker");
// gSystem->Load("StTofpMatchMaker");
// gSystem->Load("StTofCalibMaker");
// gSystem->Load("StTofFlowMaker");
gSystem->Load("StTofrNtupleMaker");
// Handling depends on whether file is a ROOT file or XDF file
//
chain = new StChain("StChain");
StIOMaker* ioMaker = new StIOMaker();
ioMaker->SetFile(inname);
ioMaker->SetIOMode("r");
ioMaker->SetBranch("*",0,"0");
ioMaker->SetBranch("eventBranch",0,"r");
ioMaker->SetDebug(0);
int NwGeant=5000000, IwType=0, NwPaw=0;
St_geant_Maker *geantMk = new St_geant_Maker("geant",NwGeant,NwPaw,IwType);
geantMk->LoadGeometry("detp geometry y2008");
geantMk->SetActive(kFALSE);
cout<<endl<<"============ Data Base ========="<<endl;
dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb","StarDb");
StTofrMatchMaker *matchMaker = new StTofrMatchMaker("tofrMatch");
matchMaker->SetDebug(0);
matchMaker->SetMode(1);
matchMaker->setSaveGeometry(kTRUE);
matchMaker->setCreateHistoFlag(kTRUE);
matchMaker->setCreateTreeFlag(kTRUE);
matchMaker->setHistoFileName(histname);
//matchMaker->setNtupleFileName("test2.root");
StTofrNtupleMaker *tofrNtuple = new StTofrNtupleMaker("tofrNtuple", ntuplename);
tofrNtuple->SetDebug(0);
tofrNtuple->setInitGeomFromOther(kTRUE);
//
// Initialize chain
//
Int_t iInit = chain->Init();
if (iInit) chain->Fatal(iInit,"on init");
chain->PrintInfo();
//
// Event loop
//
int istat = 0, i = 1;
EventLoop: if (i <= nEvents && istat != 2) {
cout << endl << "============================ Event " << i
<< " start ============================" << endl;
chain->Clear();
istat = chain->Make(i);
if (istat == 2)
{cout << "Last event processed. Status = " << istat << endl;}
if (istat == 3)
{cout << "Error event processed. Status = " << istat << endl;}
// gObjectTable->Print();
i++;
goto EventLoop;
}
//.........这里部分代码省略.........
示例4: CorrectResolution
void CorrectResolution(Int_t nevents=100)
{
// Dynamically link needed shared libs
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("St_Tables");
gSystem->Load("StUtilities"); // new addition 22jul99
gSystem->Load("StAnalysisUtilities"); // needed by V0dstMaker
gSystem->Load("StMagF");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StEvent");
gSystem->Load("StEventMaker");
gSystem->Load("StHbtMaker");
cout << "Dynamic loading done" << endl;
chain = new StChain("StChain");
chain->SetDebug();
#ifndef USE_MICRODST
StIOMaker* ioMaker = new StIOMaker("IO","r","/star/rcf/data07/reco/P00hg/2000/07/st_physics_*dst.root","bfcTree");
ioMaker->SetDebug();
ioMaker->SetIOMode("r");
ioMaker->SetDebug();
ioMaker->SetBranch("*",0,"0"); //deactivate all branches
ioMaker->SetBranch("dstBranch",0,"r"); //activate EventBranch
StEventMaker* eventMaker = new StEventMaker("events","title");
cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
#endif
// Now we add Makers to the chain...
StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
cout << "StHbtMaker instantiated"<<endl;
/* -------------- set up of hbt stuff ----- */
cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
StHbtManager* TheManager = hbtMaker->HbtManager();
// here, we instantiate the appropriate StHbtEventReader
#ifdef USE_MICRODST
StHbtBinaryReader* Reader = new StHbtBinaryReader("-","microDst.lis");
#else
StStandardHbtEventReader* Reader = new StStandardHbtEventReader;
Reader->SetTheEventMaker(eventMaker); // gotta tell the reader where it should read from
#endif
// here would be the palce to plug in any "front-loaded" Event or Particle Cuts...
TheManager->SetEventReader(Reader);
StHbtVertexAnalysis* anal;
mikesEventCut* FrontLoadedEvcut;
mikesStarStandardEventCut* evcut;
mikesTrackCut* trkcut;
qualityPairCut* qpc;
ManyPairCuts* MPC;
EntranceSepPairCut* espc;
StHbtCoulomb* cc;
QinvCorrFctn* QinvCF;
BPLCMSFrame3DCorrFctn* BpLcmsCF;
char* QinvCF_name;
char* BP_name;
int MultLo,MultHi;
float pTLo,pTHi;
int charge;
// SPEED IT UP -- FRONT-LOADED EVENT CUT and TRACK CUT
FrontLoadedEvcut = new mikesEventCut;
FrontLoadedEvcut->SetEventMult(30,100000);
FrontLoadedEvcut->SetVertZPos(-75.0,75.0);
Reader->SetEventCut(FrontLoadedEvcut);
// Removed Front-loaded Track cut
cout << "READER SET UP.... " << endl;
/* MOST CENTRAL PIMINUS hi-pT (5) */
//.........这里部分代码省略.........
示例5: doEventsQQ
void doEventsQQ(const Int_t nevents=999,
const Char_t **fileList)
{
// Dynamically link needed shared libs
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("StUtilities");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StarMagField");
gSystem->Load("StMagF");
gSystem->Load("StEvent");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StTpcDb");
gSystem->Load("StEventMaker");
gSystem->Load("St_geom_Maker");
gSystem->Load("StEventDisplayMaker");
// Handling depends on whether file is a ROOT file or XDF file
chain = new StChain("StChain");
StFile *setFiles= new StFile();
for (int ifil=0; fileList[ifil]; ifil++)
{ setFiles->AddFile(fileList[ifil]);}
St_geom_Maker *geom = new St_geom_Maker; // this maker open its own TFile !!!
StIOMaker *IOMk = new StIOMaker("IO","r",setFiles,"bfcTree");
IOMk->SetDebug();
// Maker to read events from file or database into StEvent
StEventMaker *readerMaker = new StEventMaker ("events","title");
// Sample analysis maker
// StAnalysisMaker *analysisMaker = new StAnalysisMaker("analysis");
disp = new StEventDisplayMaker;
disp->SetDebug();
// Create an user's custom filter for "Tracks"
St_TLA_EventFilter *trackFilter = new St_TLA_EventFilter();
disp->SetFilter(trackFilter,StEventDisplayMaker::kTrack);
// Initialize chain
Int_t iInit = chain->Init();
if (iInit) chain->Fatal(iInit,"on init");
chain->PrintInfo();
// chain->MakeDoc();
// Event loop
int istat;
for (Int_t i=1; i<=nevents; i++) {
cout << "============================ Event " << i << " start" << endl;
chain->Clear();
istat = chain->Make(i);
if (istat) {
cout << "Last event processed. Status = " << istat << endl;
chain->Clear();
break;
}
St_DataSet *set = chain->DataSet("dst");
if (set) {
St_DataSetIter dirt(set);
dirt.Du();
}
cout << "============================ Event " << i << " finish" << endl;
}
gROOT->LoadMacro("PadControlPanel.C");
}
示例6: makePicoDst
void makePicoDst(const Int_t runnumber=999999,
const Char_t *inputFile="/star/institutions/lbl_prod/mlomnitz/SSD_Simu/StEvent/hijing_**.MuDst.root",
const Char_t *inputGeant="/star/institutions/lbl_prod/mlomnitz/SSD_Simu/StEvent/hijing_**.McEvent.root",
TString outfilename="out",
const bool creatingPhiWgt = kFALSE, const int prodMod = 0, const int emcMode=0,
const bool createMcBranch = kTRUE
){
Int_t nEvents = 10000000;
//Int_t nEvents = 50;
//Load all the System libraries
cout<<inputFile<<endl;
gSystem->Load("libTable");
gSystem->Load("libPhysics");
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("St_Tables");
gSystem->Load("StUtilities"); // new addition 22jul99
gSystem->Load("StTreeMaker");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StTriggerDataMaker"); // new starting from April 2003
gSystem->Load("StBichsel");
gSystem->Load("StEvent");
gSystem->Load("StEventUtilities");
gSystem->Load("StDbLib");
gSystem->Load("StEmcUtil");
gSystem->Load("StTofUtil");
gSystem->Load("StPmdUtil");
gSystem->Load("StPreEclMaker");
gSystem->Load("StStrangeMuDstMaker");
gSystem->Load("StMuDSTMaker");
if( createMcBranch){
gSystem->Load("StMcEvent");
gSystem->Load("StAssociationMaker");
}
if(!creatingPhiWgt&&emcMode) {
gSystem->Load("StTpcDb");
gSystem->Load("StMcEvent");
gSystem->Load("StMcEventMaker");
gSystem->Load("StDaqLib");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("StEmcTriggerMaker");
gSystem->Load("StEmcUtil");//mine
gSystem->Load("StEmcRawMaker");
gSystem->Load("StEmcADCtoEMaker");
gSystem->Load("StPreEclMaker");
gSystem->Load("StEpcMaker");
gSystem->Load("StEmcSimulatorMaker");
gSystem->Load("StEmcUtil");
gSystem->Load("StDbBroker");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StDbUtilities");
gSystem->Load("StEEmcUtil");
gSystem->Load("StEEmcDbMaker");
gSystem->Load("St_db_Maker");
gSystem->Load("StTriggerUtilities");
}
gSystem->Load("StPicoDstMaker");
chain = new StChain();
if( createMcBranch ){
StIOMaker* ioMaker = new StIOMaker("IO","r",inputGeant,"bfcTree");
ioMaker->SetDebug();
ioMaker->SetIOMode("r");
ioMaker->SetBranch("*",0,"0"); //deactivate all branches
//ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
ioMaker->SetBranch("McEventBranch",0,"r"); //activate geant Branch
ioMaker->SetBranch("eventBranch",0,"r"); //activate geant Branch
StAssociationMaker* associator = new StAssociationMaker;
cout<<"created new StAssociationMaker"<<endl;
associator->useInTracker();
}
StMuDstMaker *MuDstMaker = new StMuDstMaker(0,0,"",inputFile,"MuDst",100);
MuDstMaker->SetStatus("*",0);
MuDstMaker->SetStatus("MuEvent",1);
MuDstMaker->SetStatus("PrimaryVertices",1);
MuDstMaker->SetStatus("PrimaryTracks",1);
MuDstMaker->SetStatus("GlobalTracks",1);
MuDstMaker->SetStatus("CovGlobTrack",1);
//MuDstMaker->SetStatus("BTof*",1);
//MuDstMaker->SetStatus("Emc*",1);
if(!creatingPhiWgt&&emcMode) {
St_db_Maker *dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb","StarDb");
// Endcap database
StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
StEmcADCtoEMaker *adc2e = new StEmcADCtoEMaker();
adc2e->setPrint(false);
//adc2e->setFillHisto(false);
//adc2e->setDebug(false); //more histograms
//adc2e->setSMDRmsCut(0,0);
adc2e->saveAllStEvent(true);
//adc2e->setRemoveGhostEvent(false);
//.........这里部分代码省略.........
示例7: TestIOMaker
void TestIOMaker(Int_t nevents=3,
//This file points to 30 events of 10 neg muons w/ pt=.9
const char* MainFile="/star/data22/ITTF/data/simple_geant/DEV_10_8_01/*.event.root")
//This file points to 5 muons /event
//const char* MainFile="/star/data22/ITTF/EvalData/MCNtuple/muon_100_neg.event.root")
//This file points to 110 events from mevsim (homebrew had. cocktail)
//const char* MainFile="/star/data22/ITTF/data/mevsim/10_9_01/*.event.root")
//This file points to a nightly low density hadronic cocktail reconstruction.
//const char* MainFile="/star/rcf/test/dev/trs_redhat61/Tue/year_2001/hc_lowdensity/*.event.root")
{
// Dynamically link needed shared libs
cout <<"Loading St_base"<<endl;
gSystem->Load("St_base");
cout <<"Loading StChain"<<endl;
gSystem->Load("StChain");
cout <<"Loading St_Tables"<<endl;
gSystem->Load("St_Tables");
cout <<"Loading StUtilities"<<endl;
gSystem->Load("StUtilities");
cout <<"Loading StIOMaker"<<endl;
gSystem->Load("StIOMaker");
cout <<"Loading StarClassLibrary"<<endl;
gSystem->Load("StarClassLibrary");
cout <<"Loading DataBase"<<endl;
gSystem->Load("StDbUtilities");
gSystem->Load("StDbLib");
gSystem->Load("StDbBroker");
gSystem->Load("St_db_Maker");
gSystem->Load("StTpcDb");
cout <<"Loading StEvent"<<endl;
gSystem->Load("StEvent");
cout <<"Loading StEventMaker"<<endl;
gSystem->Load("StEventMaker");
cout <<"Loading StEmcUtil"<<endl;
gSystem->Load("StEmcUtil");
cout <<"Loading StMcEvent"<<endl;
gSystem->Load("StMcEvent");
cout <<"Loading StMcEventMaker"<<endl;
gSystem->Load("StMcEventMaker");
cout <<"Loading AssociationMaker"<<endl;
gSystem->Load("StAssociationMaker");
// create a new instance of the chain
chain = new StChain("StChain");
chain->SetDebug();
// add makers to the chain
StIOMaker* ioMaker = new StIOMaker("IO","r",MainFile,"bfcTree");
ioMaker->SetDebug();
ioMaker->SetIOMode("r");
ioMaker->SetBranch("*",0,"0"); //deactivate all branches
ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
ioMaker->SetBranch("dstBranch",0,"r"); //activate Event Branch
ioMaker->SetBranch("runcoBranch",0,"r"); //activate runco Branch
//Calibration Maker (StarDB,not a real Database!)
const char* calibDB = "MySQL:StarDb";
const char* paramsDB = "$STAR/StarDb";
St_db_Maker* calibMk = new St_db_Maker("StarDb",calibDB,paramsDB);
calibMk->SetDateTime("year_2b");
//calibMk->SetDateTime("year_1h");
calibMk->SetDebug();
//Read Tpc Database access
StTpcDbMaker *tpcDbMk = new StTpcDbMaker("tpcDb");
//StEventMaker
StEventMaker* eventReader = new StEventMaker("events","title");
eventReader->doPrintEventInfo = 0;
//StMcEventMaker
StMcEventMaker* mcEventReader = new StMcEventMaker();
//Association
StAssociationMaker* assocMaker = new StAssociationMaker();
cout <<"Calling Init() Methods "<<endl;
chain->Init();
cout <<"Starting Event Loop"<<endl;
int istat=0,iev=1;
EventLoop: if (iev<=nevents && !istat) {
chain->Clear();
//.........这里部分代码省略.........
示例8: StAssociator
void StAssociator(Int_t nevents=1,
const char *MainFile="/afs/rhic.bnl.gov/star/data/samples/*.geant.root")
{
// Dynamically link needed shared libs
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("StBFChain");
gSystem->Load("St_Tables");
gSystem->Load("StUtilities");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StTpcDb");
gSystem->Load("StEvent");
// gSystem->Load("StEventMaker"); //not needed if event.root branch present
gSystem->Load("StEmcUtil");
gSystem->Load("StEEmcUtil");
gSystem->Load("StMcEvent");
gSystem->Load("StMcEventMaker");
gSystem->Load("StAssociationMaker");
gSystem->Load("StMcAnalysisMaker");
chain = new StChain("StChain");
chain->SetDebug();
// Now we add Makers to the chain...
StIOMaker* ioMaker = new StIOMaker("IO","r",MainFile,"bfcTree");
ioMaker->SetDebug();
ioMaker->SetIOMode("r");
ioMaker->SetBranch("*",0,"0"); //deactivate all branches
ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
ioMaker->SetBranch("eventBranch",0,"r"); //activate geant Branch
// ioMaker->SetBranch("dstBranch",0,"r"); //activate Event Branch
// ioMaker->SetBranch("runcoBranch",0,"r"); //activate runco Branch
// Note, the title "events" is used in the Association Maker, so don't change it.
// StEventMaker is not needed for event.root files
// StEventMaker* eventReader = new StEventMaker("events","title");
// eventReader->doPrintMemoryInfo = kFALSE;
StMcEventMaker* mcEventReader = new StMcEventMaker; // Make an instance...
StAssociationMaker* associator = new StAssociationMaker;
// If you need to use L3 TRIGGER uncomment the line:
// associator->useL3Trigger();
//associator->SetDebug();
// For tracks created with the Sti package (ITTF), uncomment the next line:
//associator->useInTracker();
// Switch to use the distance or id association.
associator->useDistanceAssoc();
//associator->useIdAssoc();
// Note: useDistanceAssoc and useIdAssoc are mutually exclusive
// and they set and unset the same flag.
// The flag will be set by the call done at the end.
//associator->doPrintMemoryInfo = kTRUE;
StMcAnalysisMaker* examples = new StMcAnalysisMaker;
// Define the cuts for the Associations
StMcParameterDB* parameterDB = StMcParameterDB::instance();
// TPC
parameterDB->setXCutTpc(.6); // 6 mm
parameterDB->setYCutTpc(.6); // 6 mm
parameterDB->setZCutTpc(.6); // 6 mm
parameterDB->setReqCommonHitsTpc(3); // Require 3 hits in common for tracks to be associated
// FTPC
parameterDB->setRCutFtpc(.3); // 3 mm
parameterDB->setPhiCutFtpc(5*(3.1415927/180.0)); // 5 degrees
parameterDB->setReqCommonHitsFtpc(3); // Require 3 hits in common for tracks to be associated
// SVT
parameterDB->setXCutSvt(.08); // 800 um
parameterDB->setYCutSvt(.08); // 800 um
parameterDB->setZCutSvt(.08); // 800 um
parameterDB->setReqCommonHitsSvt(1); // Require 1 hits in common for tracks to be associated
// now execute the chain member functions
chain->PrintInfo();
Int_t initStat = chain->Init(); // This should call the Init() method in ALL makers
if (initStat) chain->Fatal(initStat, "during Init()");
int istat=0,iev=1;
EventLoop: if (iev<=nevents && istat!=2) {
chain->Clear();
cout << "---------------------- Processing Event : " << iev << " ----------------------" << endl;
istat = chain->Make(iev); // This should call the Make() method in ALL makers
if (istat == 2) { cout << "Last Event Processed. Status = " << istat << endl; }
if (istat == 3) { cout << "Error Event Processed. Status = " << istat << endl; }
iev++; goto EventLoop;
} // Event Loop
examples->mAssociationCanvas = new TCanvas("mAssociationCanvas", "Histograms",200,10,600,600);
TCanvas* myCanvas = examples->mAssociationCanvas;
myCanvas->Divide(2,2);
//.........这里部分代码省略.........
示例9: RunStiMaker
// ------------------ Here is the actual method -----------------------------------------
void RunStiMaker(Int_t nevents, const Char_t **fileList, const Char_t *qaflag, const Int_t wrStEOut)
{
Int_t theRunNumber=0;
bool simulated = true;
bool doFit = false;
bool optimized = false;
char* outfile = "Evaluation.root";
cout << endl << endl <<" doEvents - input # events = " << nevents << endl;
Int_t ilist=0;
while(fileList[ilist]){
cout << " doEvents - input fileList = " << fileList[ilist] << endl;
ilist++;
}
cout << " doEvents - input qaflag = " << qaflag << endl;
cout << " doEvents - input wrStEOut = " << wrStEOut << endl << endl << endl;
//
// First load some shared libraries we need
//
gSystem->Load("St_base");
gSystem->Load("StUtilities");
gSystem->Load("StChain");
gSystem->Load("StBFChain");
gSystem->Load("St_Tables");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("geometry");
gSystem->Load("St_g2t");
gSystem->Load("St_geant_Maker");
gSystem->Load("StIOMaker");
gSystem->Load("StTreeMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("St_db_Maker");
gSystem->Load("StDbLib");
gSystem->Load("StDbBroker");
gSystem->Load("StSvtDbMaker");
gSystem->Load("StDbUtilities");
gSystem->Load("StTpcDb");
gSystem->Load("StEvent");
gSystem->Load("StEventMaker");
gSystem->Load("StEmcUtil");
gSystem->Load("StMcEvent");
gSystem->Load("StMcEventMaker");
gSystem->Load("StAssociationMaker");
gSystem->Load("StDaqLib");
gSystem->Load("StDAQMaker");
gSystem->Load("StSvtClassLibrary");
gSystem->Load("StSvtDaqMaker");
gSystem->Load("StSvtSimulationMaker");
gSystem->Load("StSvtCalibMaker");
gSystem->Load("StSvtSeqAdjMaker");
//gSystem->Load("StSvtEvalMaker");
gSystem->Load("StSvtClusterMaker");
//cout <<"Loading StMcEventMaker"<<endl;
//gSystem->Load("StMcEventMaker");
//cout <<"Loading AssociationMaker"<<endl;
//gSystem->Load("StAssociationMaker");
cout <<"Loading Sti"<<endl;
gSystem->Load("Sti");
cout <<"Loading StiGui"<<endl;
gSystem->Load("StiGui");
cout <<"Loading StiEvaluator"<<endl;
gSystem->Load("StiEvaluator");
cout <<"Loading libGui"<<endl;
gSystem->Load("libGui");
cout <<"Loading StiMaker"<<endl;
gSystem->Load("StiMaker");
cout <<"Loading StItTestMaker"<<endl;
gSystem->Load("StItTestMaker");
//
// Handling depends on whether file is a ROOT file or XDF file
//
chain = new StChain("StChain");
StFileI *setFiles =0;
if (fileList) { //Normal case
setFiles= new StFile(fileList);
} else { //Grand Challenge
gSystem->Load("StChallenger");
setFiles = StChallenger::Challenge();
setFiles->SetDebug();
const char *Argv[]= {
"-s","daq", // list of components needed
//.........这里部分代码省略.........
示例10: DoEqualDaq
void DoEqualDaq(char* file="daq/*.daq",int nevents = 500000,char* name = "equal1.root")
{
//
// First load some shared libraries we need
//
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("libgen_Tables");
gSystem->Load("libsim_Tables");
gSystem->Load("libglobal_Tables");
gSystem->Load("StUtilities");
gSystem->Load("StIOMaker");
gSystem->Load("StTreeMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StEvent");
gSystem->Load("StMagF");
gSystem->Load("libgeometry_Tables");
gSystem->Load("St_Tables");
gSystem->Load("StEmcUtil");
gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StDbUtilities");
gSystem->Load("StDbLib");
gSystem->Load("StDbBroker");
gSystem->Load("St_db_Maker");
gSystem->Load("libgeometry_Tables");
gSystem->Load("StDaqLib");
gSystem->Load("StEmcRawMaker");
gSystem->Load("StEmcADCtoEMaker");
gSystem->Load("StPreEclMaker");
gSystem->Load("StEpcMaker");
gSystem->Load("StEmcCalibrationMaker");
chain=new StChain("StChain");
chain->SetDebug();
//
// Setup IO maker
//
StIOMaker *IOMk = new StIOMaker();
IOMk->SetFile(file);
IOMk->SetIOMode("r");
IOMk->SetBranch("*",0,"0"); //deactivate all branches
IOMk->SetBranch("daqBranch",0,"r");
IOMk->SetDebug();
St_db_Maker *db = new St_db_Maker("StarDb","MySQL:StarDb");
m = new StEmcADCtoEMaker();
m->saveAllStEvent(kTRUE);
m->setPrint(kFALSE);
// This process the EMC event and fill the tables
// necessary for calibration
StEmcCalibrationMaker *cal = new StEmcCalibrationMaker();
char outfile[300];
// does equalization
sprintf(outfile,"/home/emc/online/emc/pedestal/equal/%s",name);
StEmcEqualMaker *equal = new StEmcEqualMaker();
equal->setFile(outfile);
//
// Initialize chain
//
Int_t iInit = chain->Init();
if (iInit) chain->Fatal(iInit,"on init");
chain->PrintInfo();
int istat=0,i=1;
EventLoop: if (i <= nevents && istat!=2)
{
cout << endl << "============================ Event " << i<< " start ============================" << endl;
chain->Clear();
istat = chain->Make();
if (istat==2) {cout << "Last event processed. Status = " << istat << endl;}
if (istat==3) {cout << "Error event processed. Status = " << istat << endl;}
i++;
goto EventLoop;
}
i--;
cout << endl << "============================ Event " << i << " finish ============================" << endl;
}
示例11: ProcessQQ
//==========================================================================================
void ProcessQQ(const Int_t mode, const Int_t fsti, const Int_t nevents,
const Char_t **fileList, const Char_t* dirName)
{
cout << "Loading libraries ..." << endl;
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("StDaqLib");
gSystem->Load("St_Tables");
gSystem->Load("StarMagField");
gSystem->Load("StMagF");
gSystem->Load("StUtilities");
gSystem->Load("StTreeMaker");
gSystem->Load("StIOMaker");
gSystem->Load("StarClassLibrary");
gSystem->Load("StDetectorDbMaker");
gSystem->Load("StTpcDb");
gSystem->Load("StDbUtilities");
gSystem->Load("StBichsel");
gSystem->Load("StTriggerDataMaker");
gSystem->Load("StEvent");
gSystem->Load("StEventUtilities");
gSystem->Load("StMcEvent");
gSystem->Load("StMcEventMaker");
gSystem->Load("StAssociationMaker");
//if( mode & 0x2){
// EMC specific
cout << " EMC mode enabled" << endl;
gSystem->Load("StEmcUtil");
gSystem->Load("StDbLib");
gSystem->Load("StDbBroker");
gSystem->Load("St_db_Maker");
//}
if( mode & 0x4){
// RICH
cout << " RICH mode enabled" << endl;
gSystem->Load("StRrsMaker");
gSystem->Load("StRchMaker");
gSystem->Load("StRichPIDMaker");
gSystem->Load("StRichSpectraMaker");
}
gSystem->Load("StMcAnalysisMaker");
gSystem->Load("StStrangeMuDstMaker");
gSystem->Load("StMuDSTMaker");
if( mode & 0x2 ){
// EMC specific
gSystem->Load("StEmcADCtoEMaker"); // analysis maker
gSystem->Load("StPreEclMaker"); // analysis maker
gSystem->Load("StEpcMaker"); // analysis maker
}
cout << "Loading done " << endl;
chain = new StChain("StChain");
chain->SetDebug();
StFile *setFiles= new StFile();
for (int ifil=0; fileList[ifil]; ifil++)
setFiles->AddFile(fileList[ifil]);
// ********************************
// Now we add Makers to the chain...
// ********************************
// *************
// file handling
// *************
StIOMaker* ioMaker = new StIOMaker("IOMaker","r",setFiles,"bfcTree");
ioMaker->SetDebug();
ioMaker->SetIOMode("r");
ioMaker->SetDebug();
ioMaker->SetBranch("*",0,"0"); //deactivate all branches
ioMaker->SetBranch("eventBranch",0,"r"); //activate evt.root Branch
ioMaker->SetBranch("emcBranch",0,"r"); //activate evt.root Branch
ioMaker->SetBranch("runcoBranch",0,"r"); //activate runcoBranch
// ***********************************************
// MuDstMaker(s) instantiation / chain activation
// ***********************************************
// Common MuDST part
StStrangeMuDstMaker* v0dst = new StStrangeMuDstMaker("strangeMuDst");
v0dst->DoV0(); //Set v0MiniDstMaker to find only v0s
v0dst->DoXi(); //Set v0MiniDstMaker to find only v0s
v0dst->DoKink(); //Set v0MiniDstMaker to find only v0s
v0dst->SetNoKeep();
// RICH part
if( mode & 0x4 ){
StRichSpectraMaker* spectraMaker = new StRichSpectraMaker("spectraMaker");
}
//.........这里部分代码省略.........
示例12: bfcread_histBranch
void bfcread_histBranch(
Int_t nevents=1,
const char *MainFile=
"/afs/rhic.bnl.gov/star/data/samples/gstar.dst.root",
const char *fname="qa_hist.out")
{
//
cout << " events to process = " << nevents << endl;
cout << " Input File Name = " << MainFile << endl;
cout << " Output file containing printouts = " << fname << endl;
ofstream fout(fname);
fout << " Running: bfcread_histBranch.C " << endl;
fout << " events to process = " << nevents << endl;
fout << " Input File Name = " << MainFile << endl;
fout << " Output file containing printouts = " << fname << endl;
fout << endl << endl;
gSystem->Load("St_base");
gSystem->Load("StChain");
gSystem->Load("StIOMaker");
gSystem->Load("libglobal_Tables");
// Setup top part of chain
chain = new StChain("bfc");
chain->SetDebug();
StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,"bfcTree");
IOMk->SetDebug();
IOMk->SetIOMode("r");
IOMk->SetBranch("*",0,"0"); //deactivate all branches
IOMk->SetBranch("histBranch",0,"r"); //activate hist Branch
// --- now execute chain member functions
chain->Init();
TDataSet *ds=0;
TDataSet *obj=0;
int istat=0;
int i=0;
int countev=0;
int countevhds=0;
// Event loop
EventLoop: if (i < nevents && !istat) {
chain->Clear();
istat = chain->Make(i);
// count # times Make is called
i++;
// Now look at the data in the event:
int countObj=0;
int countHist=0;
if (!istat) {
countev++;
cout << " start event # " << countev << endl;
ds=chain->GetDataSet("hist");
TDataSetIter tabiter(ds);
if (ds) {
countevhds++;
TDataSetIter nextHistList(ds);
St_ObjectSet *histContainer = 0;
TList *dirList = 0;
// loop over directories:
while (histContainer = (St_ObjectSet *)nextHistList()) {
dirList = (TList *) histContainer->GetObject();
cout << " QAInfo: found directory: " <<
histContainer->GetName() << endl;
fout << " QAInfo: found directory: " <<
histContainer->GetName() << endl;
countObj++;
// Notes for future reference (if we want to generalize this...)
// dirList is returned 0 for non-histogram file
// in that case, use GetList instead of GetObject
TIter nextHist(dirList);
TObject *o = 0;
// loop over histograms in the directory:
while (o= nextHist()) {
countHist++;
cout << " QAInfo: Hist name: " << o->GetName() <<
" ==> Title: " << o->GetTitle() << endl;
fout << " QAInfo: Hist name: " << o->GetName() <<
" ==> Title: " << o->GetTitle() << endl;
//.........这里部分代码省略.........