当前位置: 首页>>代码示例>>C++>>正文


C++ StIOMaker类代码示例

本文整理汇总了C++中StIOMaker的典型用法代码示例。如果您正苦于以下问题:C++ StIOMaker类的具体用法?C++ StIOMaker怎么用?C++ StIOMaker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了StIOMaker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
//.........这里部分代码省略.........
开发者ID:kunsuoh,项目名称:auau200GeVRun14rnc,代码行数:101,代码来源:makePicoDst.C

示例2: WriteStiEvents

void WriteStiEvents(Int_t nevents=1,
	            const Char_t *Mainfile = "/star/data22/ITTF/EvalData/MCFiles/auau200/rcf0183_12_300evts.geant.root",
		    const Char_t *outfile= "test.event.root",
		    bool simulated = true)
{

    gSystem->Load("St_base");
    gSystem->Load("StChain");
    gSystem->Load("StUtilities");
    gSystem->Load("St_Tables");
    gSystem->Load("StarClassLibrary");

    gSystem->Load("StIOMaker");
    gSystem->Load("StEvent");
    gSystem->Load("StEmcUtil"); 
    gSystem->Load("StMcEvent");
    gSystem->Load("StMcEventMaker");
    gSystem->Load("StAssociationMaker");

    gSystem->Load("St_db_Maker");
    gSystem->Load("StDbLib");
    gSystem->Load("StDbBroker");
    gSystem->Load("StDbUtilities");
    gSystem->Load("StTpcDb");
    gSystem->Load("StDetectorDbMaker");
    gSystem->Load("StTreeMaker");
    gSystem->Load("StSvtClassLibrary");
    gSystem->Load("StSvtDbMaker");

    gSystem->Load("Sti");
    gSystem->Load("libGui");
    gSystem->Load("StiGui");
//     gSystem->Load("StiEvaluator");
    gSystem->Load("StiMaker");

    chain  = new StChain("StChain");
    StIOMaker *IOMk = new StIOMaker("IO","r",Mainfile); 
    IOMk->SetBranch("*",0,"0");	//deactivate all branches
    //IOMk->SetBranch("dstBranch",0,"r");
    //IOMk->SetBranch("runcoBranch",0,"r");
    IOMk->SetBranch("eventBranch",0,"r");
    IOMk->SetBranch("geantBranch",0,"r");

    dbaseMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb");
    if (simulated) dbaseMk-> SetDateTime(20010801,000000);  
    tpcDbMk  = new StTpcDbMaker("tpcDb");
    svtDbMk  = new StSvtDbMaker("svtDb");
    detDbMk = new StDetectorDbMaker("detDb");


    bool doFit = false;
    bool optimized = false;

    StiMaker* anaMk = StiMaker::instance();
    StiRootIOBroker* stiIO = anaMk->getIOBroker();//StiRootIOBroker::instance();
    stiIO->setTPHFMinPadrow(1);
    stiIO->setTPHFMaxPadrow(45);
    stiIO->setETSFLowerBound(5);
    stiIO->setETSFMaxHits(6);
  
    stiIO->setDoTrackFit(doFit);
  
    //Set Kalman Track Finder (KTF) run-time values:
    stiIO->setKTFMcsCalculated(false);
    stiIO->setKTFElossCalculated(false);
    stiIO->setKTFMaxChi2ForSelection(50);
    stiIO->setKTFBField(.5); //Tesla
    stiIO->setKTFMassHypothesis(.1395); //GeV
    stiIO->setKTFMinContiguousHitCount(2);
    stiIO->setKTFMaxNullCount(40);
    stiIO->setKTFMaxContiguousNullCount(25);
    stiIO->setKTFMinSearchRadius(.5); //cm
    stiIO->setKTFMaxSearchRadius(4.); //cm
    stiIO->setKTFSearchWindowScale(5.); //cm
  
    //Set Local Track Seed Finder (LTSF) run-time values
    stiIO->setLTSFZWindow(5.);
    stiIO->setLTSFYWindow(2.);
    stiIO->setLTSFSeedLength(2);
  
    stiIO->setLTSFDoHelixFit(true);
    stiIO->setLTSFExtrapYWindow(1.);
    stiIO->setLTSFExtrapZWindow(2.);
    stiIO->setLTSFExtrapMaxSkipped(2);
    stiIO->setLTSFExtrapMinLength(4);
    stiIO->setLTSFExtrapMaxLength(5);
    stiIO->setLTSFUseVertex(true);
  
    stiIO->setLTMDeltaR(1.); //10% in r
  
    //Add sectors:
    for (unsigned int sector=1; sector<=12; ++sector) {
	stiIO->addLTSFSector(sector);
    }
    //Add padrows;
    //for (unsigned int padrow=1; padrow<=45; ++padrow) {
    for (unsigned int padrow=6; padrow<=45; padrow+=1) {
	stiIO->addLTSFPadrow(padrow);
    }
    
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-sti,代码行数:101,代码来源:WriteStiEvents.C

示例3: 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();
      
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:76,代码来源:bfcread_hist_extract.C

示例4: bfcZ

//_____________________________________________________________________
void bfcZ(const Int_t First,
	 const Int_t Last,
	 const Char_t *Chain="gstar Cy2b tfs -NoHits TpcHitFilter",
	 const Char_t *infile=0,
	 const Double_t zmin=-200, const Double_t zmax=-100,
	 const Char_t *outfile=0,
	 const Char_t *TreeFile=0){ 
  gROOT->LoadMacro("bfc.C");
  bfc(-1,Chain,infile,outfile,TreeFile);
  if (chain->GetOption("TpcHitFilter")) {
    StTpcHitFilterMaker *filtMk = (StTpcHitFilterMaker *) chain->GetMaker("tpc_hit_filter");
    if (filtMk) {
      //      St_tcl_Maker *tclMk= (St_tcl_Maker *) chain->GetMaker("tpc_hits");
      if (zmin < 0 && zmax < 0) filtMk->WestOff();
      if (zmin > 0 && zmax > 0) filtMk->EastOff();
      filtMk->SetZrange(zmin,zmax);
    }
  }
  {
    TDatime t;
    printf ("QAInfo:Run is started at Date/Time %i/%i\n",t.GetDate(),t.GetTime());
    printf ("QAInfo:Run on %s in %s\n",
	    gSystem->HostName(),
	    gSystem->WorkingDirectory());
    printf ("QAInfo: with %s\n", chain->GetCVS());
  }
  // Init the chain and all its makers
  Int_t iTotal = 0, iBad = 0;
  St_XDFFile *xdf_out = 0;
  TBenchmark evnt;
  Int_t iMake = 0, i = First;
  if (Last >= 0) {
    Int_t iInit = chain->Init();
    if (iInit >=  kStEOF) {
      chain->Fatal(iInit,"on init");
      goto END;
    }
    StEvtHddr *hd = (StEvtHddr*)chain->GetDataSet("EvtHddr");
    if (hd) hd->SetRunNumber(-2); // to be sure that InitRun calls at least once
    // skip if any
    if (First > 1) {
      if (chain->GetOption("fzin")) {
	geant = (St_geant_Maker *) chain->GetMaker("geant");
	if (geant) {
	  if (geant->IsActive()) geant->Skip(First-1);
	}
      }
      else {
	StIOMaker *inpMk      = (StIOMaker *)      chain->GetMaker("inputStream");
	if (inpMk) {printf ("Skip %i Events\n",First-1);inpMk->Skip(First-1);}
      }
    }
  }
  xdf_out = chain->GetXdfOut();
  if (chain->GetOption("Event")) evMk  = (StEventMaker   *) chain->GetMaker("StEventMaker");  
  treeMk = chain->GetMaker("OutputStream");
 EventLoop: if (i <= Last && iMake != kStEOF && iMake != kStFatal) {
   evnt.Reset();
   evnt.Start("QAInfo:");
   chain->Clear();
   iMake = chain->Make(i);
   if (iMake <kStEOF) {
     if (xdf_out){
       St_DataSet *dstSet = chain->GetInputDS("dst");
       if (dstSet) xdf_out->NextEventPut(dstSet); // xdf output
     }
     iTotal++;
     if (treeMk && iMake == kStErr) {treeMk->Make(i); iBad++;}
     //    gSystem->Exec("ps ux");
     evnt.Stop("QAInfo:");
     //  evnt.Show("QAInfo:");
     printf ("QAInfo: Done with Event [no. %d/run %d/evt. %d/Date.Time %d.%d/sta %d] Real Time = %10.2f seconds Cpu Time =  %10.2f seconds \n",
	     i,chain->GetRunNumber(),chain->GetEventNumber(),chain->GetDate(), chain->GetTime(),
	     iMake,evnt.GetRealTime("QAInfo:"),evnt.GetCpuTime("QAInfo:"));
   }
   i++; goto EventLoop;
 }
 END:
  fflush(stdout);
  printf ("QAInfo:Run completed ");
  gSystem->Exec("date");
  if (evMk) Event = (StEvent *) chain->GetInputDS("StEvent");
  {
    TDatime t;
    printf ("\nQAInfo:Run is finished at Date/Time %i/%i; Total events processed :%i and not completed: %i\n",
	    t.GetDate(),t.GetTime(),iTotal,iBad);
  }
}
开发者ID:star-bnl,项目名称:star-macros,代码行数:89,代码来源:bfcZ.C

示例5: 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;
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-macros,代码行数:101,代码来源:Example_read_dst_print_tables.C

示例6: 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;
 }
//.........这里部分代码省略.........
开发者ID:jdbrice,项目名称:TofCalibration,代码行数:101,代码来源:doEvents.C

示例7: runTrigTreeMaker

void runTrigTreeMaker( const Char_t *file="rcf10063_2_6000evts.MuDst.root", const Char_t* fileOut = "rcf10063_2_6000evts.TrigTree-A.root", Char_t trigVer = 'g', Int_t nevents = 10000000,
                       Int_t flagMC = 1, const Char_t *eemcSetupPath="/star/u/sgliske/Share/StarTrigSimuSetup/" ){
  
   //int flagMC=0;  // 0/1 == Using Real/Simulation data files 
  int useEemc=2; // 0/1 == Exclude/Include EEMC in Trigger Decisions 
  int useBemc=0; // 0/1 == Exclude/Include BEMC in Trigger Decisions 
  int useL2=1;   // 0/1 == Exclude/Include L2 in Trigger Decisions 
  int L2ConfigYear=2006; // possible: 2006, 2008
  int bemcConfig=1; // Online==1, Offline==2, Expert==3
  int playConfig=0; // jan:100_199
  int emcEveDump=0; // extrating raw EMC data in a custom format
  int outputL2Histo=1;//output L2 histos to directory outL2
  TString outDir="./outL2/"; 

  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
  loadSharedLibraries();
  assert( !gSystem->Load("StDetectorDbMaker"));
  assert( !gSystem->Load("StTpcDb"));
  assert( !gSystem->Load("StDbUtilities"));
  assert( !gSystem->Load("StDbBroker"));
  assert( !gSystem->Load("St_db_Maker"));
  assert( !gSystem->Load("StEEmcUtil")); // needed by eemcDb
  assert( !gSystem->Load("StEEmcDbMaker"));
  assert( !gSystem->Load("StDaqLib")); // needed by bemcDb
  assert( !gSystem->Load("StEmcRawMaker"));
  assert( !gSystem->Load("StEmcADCtoEMaker"));
  if (flagMC) {
    assert( !gSystem->Load("StMcEvent"));
    assert( !gSystem->Load("StMcEventMaker"));
    assert( !gSystem->Load("StEmcSimulatorMaker"));
    assert( !gSystem->Load("StEEmcSimulatorMaker"));
    assert( !gSystem->Load("StEpcMaker"));
  }
  assert( !gSystem->Load("StTriggerUtilities"));
   assert( !gSystem->Load("StSpinDbMaker") );
  assert( !gSystem->Load("StEEmcPoolEEmcTreeContainers") );
  assert( !gSystem->Load("StEEmcTreeMaker") );

  gROOT->Macro("LoadLogger.C");
  cout << " loading done " << endl;
  
  chain= new StChain("StChain"); 

  if (flagMC){
    TString geantFile;
    geantFile += file;
    geantFile.ReplaceAll("MuDst.root", "geant.root");
    printf("geantFile=%s\n", geantFile.Data());
    StIOMaker* ioMaker = new StIOMaker();
    ioMaker->SetFile(geantFile);
    ioMaker->SetIOMode("r");
    ioMaker->SetBranch("*",0,"0");             //deactivate all branches
    ioMaker->SetBranch("geantBranch",0,"r");   //activate geant Branch
    StMcEventMaker *evtMaker = new StMcEventMaker();
  }

  //Need MuDstMaker to get data
  printf(" Analyzing file=%s\n",file);  
  StMuDstMaker* muDstMaker =new StMuDstMaker(0,0,"",file,"",1000);

   // just to make sure StEvent is found for the trig simu
   StMuDst2StEventMaker *muDst2StEvent = new StMuDst2StEventMaker();

  //Database -- get a real calibration from the database
  St_db_Maker* dbMk =0;
  if(useEemc || useL2) // full DB access
    dbMk = new St_db_Maker("StarDb","MySQL:StarDb","MySQL:StarDb","$STAR/StarDb");
  else // only Barrel is uploaded, is faster 
    dbMk  = new St_db_Maker("Calibrations","MySQL:Calibrations_emc");
   dbMk->SetAttr("blacklist", "fgt");
   dbMk->SetAttr("blacklist", "svt");
   dbMk->SetAttr("blacklist", "tpc");
   dbMk->SetAttr("blacklist", "ftpc");

    
  // CORRECTION: do not always need to set date and time for MC
  //If MC then must set database time and date
  //If Endcap fast simu is used tower gains in DB do not matter,JB
  //if (flagMC) dbMk->SetDateTime(20060522, 55000);//timestamp R7142018
  
  //Collect all output histograms 
  TObjArray* HList=new TObjArray; 
  
  //Endcap DB
  if(useEemc || useL2) new StEEmcDbMaker("eemcDb");
  

  //Get BEMC adc values
  if (flagMC && useBemc) {
    StEmcSimulatorMaker* emcSim = new StEmcSimulatorMaker(); //use this instead to "redo" converstion from geant->adc
    if (bemcConfig == 1) {
        emcSim->setCheckStatus(kBarrelEmcTowerId,false); //this returns hits regardless of offline tower status
    }
    emcSim->setCalibSpread(kBarrelEmcTowerId,0.15);//spread gains by 15%
  }
  if (flagMC==0 && useBemc){
    StEmcADCtoEMaker *bemcAdc = new StEmcADCtoEMaker();//for real data this sets calibration and status
    if (bemcConfig == 1) {
        bemcAdc->setCheckStatus(kBarrelEmcTowerId,false);
    }
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-emc,代码行数:101,代码来源:runTrigTreeMaker.C

示例8: 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) */

//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-hbt,代码行数:101,代码来源:CorrectResolution.C

示例9: run_StMcAccpMaker

void run_StMcAccpMaker(const char* file, const char* outfile) 
{
    //Check STAR Library. Please set SL_version to the original star library used 
    // in the production from http://www.star.bnl.gov/devcgi/dbProdOptionRetrv.pl
    string SL_version = "SL12d_embed";
    string env_SL = getenv("STAR");
    if (env_SL.find(SL_version) == string::npos) {
        cout << "Environment Star Library does not match the requested library in run_st_etree.C. Exiting..." << endl;
        return;
    }
    // Load shared libraries
    Load();

    // Create chain
    StChain* chain = new StChain;

    // I/O maker
    StIOMaker* ioMaker = new StIOMaker;
    ioMaker->SetFile(file);
    ioMaker->SetIOMode("r");
    ioMaker->SetBranch("*", 0, "0");
    //ioMaker->SetBranch("McEventBranch",0,"r"); 
    ioMaker->SetBranch("geantBranch", 0, "r");
    ioMaker->SetBranch("eventBranch", 0, "r");

    TString mudstfile = file;
    mudstfile.ReplaceAll(".event.root",".MuDst.root");
    mudstfile.ReplaceAll(".geant.root",".MuDst.root");
    StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile.Data(),"",100000,"MuDst");

    StMcEventMaker *mcEventMaker = new StMcEventMaker();
    mcEventMaker->doPrintEventInfo = false;
    mcEventMaker->doPrintMemoryInfo = false;

    StAssociationMaker* assoc = new StAssociationMaker;
    assoc->useInTracker();

    //.. see example in CVS: StRoot/macros/mudst/exampleEmc.C
    // Need St_db_Maker for Emc calibration
    St_db_Maker* dbMk = new St_db_Maker("StarDb", "MySQL:StarDb");
    //dbMk->SetMaxEntryTime(20100301,0);
    //dbMk->SetDateTime(20080101,000001);

    StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
    StEmcADCtoEMaker *adc_to_e = new StEmcADCtoEMaker();
    adc_to_e->saveAllStEvent(kTRUE);

    StEmcSimulatorMaker* emcSim = new StEmcSimulatorMaker(); //use this instead to "redo" converstion from geant->adc
    // Makers for clusterfinding
    StPreEclMaker *pre_ecl = new StPreEclMaker();
    pre_ecl->setPrint(kFALSE);
    StEpcMaker *epc = new StEpcMaker();
    epc->setPrint(kFALSE);

    StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker();
    simuTrig->useOfflineDB();

    simuTrig->setMC(2); // 0=data, 1=simulation, 2=embedding
    simuTrig->useBemc();
    simuTrig->useEemc();
    simuTrig->bemc->setConfig(2); // Online==1, Offline==2, Expert==3
    //   simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline); 
    int col_energy = 200; //.. option: 200, 62, 39
    // std::vector<unsigned int> triggers;
    // triggers.push_back(370542); //
    // triggers.push_back(370522); //

    
    // Monte Carlo event maker
    StMcAccpMaker* analysis = new StMcAccpMaker(simuTrig,outfile,col_energy);//,triggers);

    // Initialize chain
    chain->Init();
    chain->EventLoop(1000000);
    chain->Finish();

    //delete chain;
}
开发者ID:XiaozhiBai,项目名称:Run12,代码行数:78,代码来源:run_StMcAccpMaker.C

示例10: OnlineQaTpcRaw

void OnlineQaTpcRaw(
 Int_t nevents=2, 
 const char *MainFile=
 "/afs/rhic.bnl.gov/star/data/samples/june_2000_st_physics_1164058_raw_0001.daq",
 Int_t nevHistOut=0)
{
//
  cout << " OnlineQaTpcRaw.C: #events to process  = " << nevents << endl;
  cout << " OnlineQaTpcRaw.C: input file name = " << MainFile << endl;
  cout << " OnlineQaTpcRaw.C: #events to write to hist file (0=all) = " << 
            nevHistOut << endl;

// Generate a name for an outHistFile using input file name
//
  fInFile = new TString(MainFile);
  fFileOut = new TString(gSystem->BaseName(fInFile->Data()));
  fFileOut->ReplaceAll(".daq",""); // remove old file extension
  const char *histoDir = "./"; // directory for histos
  fFileOut->Prepend(histoDir);
  const Char_t *outHistFile= fFileOut->Data(); // done


// define other values needed:
   const Char_t *topTree="OnlQaTpcTree";
   const Char_t *makerName="RawTpcQa";


   cout << " OnlineQaTpcRaw.C: output hist file name set to " << 
           outHistFile << ".hist.root" << endl;
   cout << " OnlineQaTpcRaw.C: top level Tree directory set to " << 
           topTree << endl;
   cout << " OnlineQaTpcRaw.C: maker name set to " << 
           makerName << endl;

// load libraries - basic ones needed
    gSystem->Load("St_base");
    gSystem->Load("StChain");
    gSystem->Load("StIOMaker");
    gSystem->Load("StTreeMaker");

// these 2 are for using the StHistUtil class
    gSystem->Load("StUtilities");
    gSystem->Load("StAnalysisUtilities");

// for raw tpc qa maker
    gSystem->Load("StRawTpcQaMaker");


//  Setup top part of chain
    chain = new StChain("OnlineQaTpcRawChain");
    //    chain->SetDebug(0);
   
// now any Maker that gets constructed will be added to the chain
  StIOMaker *IOMk = new StIOMaker("IO","r",MainFile,topTree);
  //IOMk->SetDebug();
    IOMk->SetIOMode("r");

// histogram utility class (this is not a Maker so not used in chain)
    StHistUtil   *HU  = new StHistUtil;
// now must set pointer to any StMaker so HistUtil can find histograms
//  with StHistUtil methods
// -- input any maker pointer but must cast as type StMaker
   HU->SetPntrToMaker((StMaker *)IOMk);


   StRawTpcQaMaker *RTQa = new StRawTpcQaMaker(makerName);

// output hist.root file:
   StTreeMaker* treeMk = new StTreeMaker("tree",outHistFile,topTree);
      treeMk->SetIOMode("w");
      treeMk->SetBranch("histBranch");


// --- now execute chain member functions
  chain->Init();


// method to print out list of histograms - 
//can do this anytime after they're booked
  Int_t NoHist=0;
  NoHist = HU->ListHists(makerName);
  cout << " !!! OnlineQaTpcRaw.C, No. of Hist Booked = " << NoHist << endl;

  int istat=0;
  int iev=0;
  int countev=0;

// Event loop
EventLoop: if (iev < nevents && !istat) {

    chain->Clear();
    istat = chain->Make(iev);
    
//  count # times Make is called
    iev++;

    cout << " Called Make # " << iev << endl; 
    cout << "     istat value returned from chain Make = " << istat <<

endl;
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-macros,代码行数:101,代码来源:OnlineQaTpcRaw.C

示例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");
  }

//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-macros,代码行数:101,代码来源:StMuDstMakerYear1.C

示例12: rdSt2spinTest

void rdSt2spinTest( Int_t nevents=10){

  char *   fname="/star/data03/daq/2005/janMisc/st_physics_6156028_raw_2040010.event.root";
  //char *   fname="/star/data03/daq/2005/janMisc/st_physics_5135068_raw_2020006.event.root";
  initHisto();
  
  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
  loadSharedLibraries();
  cout << " loading done " << endl;
  gSystem->Load("StDbLib");
  gSystem->Load("StDbBroker");
  gSystem->Load("St_db_Maker");
  gSystem->Load("StSpinDbMaker");
    
  // create chain    
  chain = new StChain("bfc"); 
 
  // StIOMaker - to read files ...
  StIOMaker* ioMaker = new StIOMaker();  
  ioMaker->SetFile(fname); 
  ioMaker->SetIOMode("r");
  ioMaker->SetBranch("*",0,"0");  //deactivate all branches
  ioMaker->SetBranch("eventBranch",0,"r");   //activate Event Branch
  ioMaker->SetIOMode("r"); 
 
  St_db_Maker *stDb = new St_db_Maker("StarDb", "MySQL:StarDb");
  spDb=new StSpinDbMaker("spinDb");
  
  gMessMgr->SwitchOff("D");
  gMessMgr->SwitchOn("I");

  chain->ls(3);
  Int_t initStat = chain->Init(); 
  if (initStat) chain->Fatal(initStat, "during Init()");
    
  int istat=0,iev=0;

  // Do the event loop    
  while(1) {
    if (iev>=nevents) break;
    chain->Clear();
    istat = chain->Make(); 
    iev++; 
    if(istat) break; 
    cout << "---------------------- Processing Event : " << iev << " ---------------------- " << istat<<endl;

    if(iev==1){// fill pattern acquired for first event
      // spDb->print(0);
      for(int bx48=0;bx48<120;bx48++){
	int bxStar=spDb->BXstarUsingBX48(bx48);
	if(spDb->isBXfilledUsingBX48(bx48)) hfb->Fill(bxStar);
	//printf("bxStar=%3d   bx48=%3d   fill=%d\n",bxStar,bx48,spDb->isBXfilledUsingBX48(bx48));
      }
    }
    if (istat  == kStEOF || istat == kStFatal) break;
    
    StEvent* mEvent = (StEvent*)chain->GetInputDS("StEvent");
    assert(mEvent);// fix your chain or open the right event file
    StTriggerIdCollection *tic=mEvent->triggerIdCollection();
    assert(tic); 

    StTriggerData* trgD= mEvent->triggerData(); assert(trgD);
    int bx48=trgD->bunchId48Bit();
    int bx7=trgD->bunchId7Bit();
    int bxStar48=spDb->BXstarUsingBX48(bx48);
    int bxStar7=spDb->BXstarUsingBX7(bx7);
    int bxPhase=spDb->offsetBX48minusBX7(bx48,bx7);
    int spin8ev=trgD->spinBit();
    int spin8db=spDb->spin8usingBX48(bx48);
    int spin4db=spDb->spin4usingBX48(bx48);
    //.... do histo
    hbx->Fill(bxStar48);
    hdbx->Fill(bxStar48,bxStar7);
    hs8ev->Fill(bxStar48,spin8ev);
    if(spDb->isBXfilledUsingBX48(bx48)){
      hs8db->Fill(bxStar48,spin8db);
      hs4db->Fill(bxStar48,spin4db);
    }
    int nV=mEvent->numberOfPrimaryVertices();
    printf("eveID=%d  nPrimVert=%d  ", mEvent->id(),nV);
    printf("bx48=%3d bx7= %3d bxPhase=%3d spin8: ev=0x%02x : 0x%02x=db bxStar48=%3d \n",bx48,bx7,bxPhase,spin8ev,spin8db,bxStar48);
    // assert(spin8ev>10);
  } // Event Loop
 hf->Write();
    
}
开发者ID:star-bnl,项目名称:star-emc,代码行数:86,代码来源:rdSt2spinTest.C

示例13: Run2006SimuTriggerMaker

void Run2006SimuTriggerMaker(const char *dir ="",
			     const char* file="/star/data32/reco/pp200/pythia6_205/above_35gev/cdf_a/y2004y/gheisha_on/p05ih/rcf1230_10_4000evts.MuDst.root",
			     const char *fname="/star/data32/reco/pp200/pythia6_205/above_35gev/cdf_a/y2004y/gheisha_on/p05ih/rcf1230_10_4000evts.event.root",
			     const char *filter = "")
{
  int nevents = 10;
  
  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
  loadSharedLibraries();
  gSystem->Load("StTpcDb");
  gSystem->Load("StDetectorDbMaker");
  gSystem->Load("StDbUtilities");
  gSystem->Load("StMcEvent");
  gSystem->Load("StMcEventMaker");
  gSystem->Load("StDaqLib");
  gSystem->Load("StEmcRawMaker");
  gSystem->Load("StEmcADCtoEMaker");
  gSystem->Load("StPreEclMaker");
  gSystem->Load("StEpcMaker");
  gSystem->Load("StEmcSimulatorMaker");
  gSystem->Load("StEmcUtil");
  gSystem->Load("StDbBroker");
  gSystem->Load("St_db_Maker");
  gSystem->Load("StEEmcUtil");
  gSystem->Load("StEEmcDbMaker");
  gSystem->Load("StEmcTriggerMaker");

  double pi = atan(1.0)*4.0;
  cout << " loading done " << endl;
  
  chain= new StChain("StChain"); 
  chain->SetDebug(1);
  gMessMgr->SwitchOff("D");
  gMessMgr->SwitchOff("I");
  
  StIOMaker* ioMaker = new StIOMaker();
  ioMaker->SetFile(fname);
  ioMaker->SetIOMode("r");
  ioMaker->SetBranch("*",0,"0");             //deactivate all branches
  ioMaker->SetBranch("geantBranch",0,"r");   //activate geant Branch

  class StMcEventMaker *mcEventMaker = new StMcEventMaker();
  mcEventMaker->doPrintEventInfo = false;
  mcEventMaker->doPrintMemoryInfo = false;
  
  StMuDebug::setLevel(1); 
  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,dir,file,filter,1e6,"MuDst");
 
  //Database -- get a real calibration from the database
  St_db_Maker* dbMk = new St_db_Maker("StarDb","MySQL:StarDb","MySQL:StarDb","$STAR/StarDb");
  dbMk->SetDateTime(20060506,214129 ); // for simulation
 
  //to use ideal ideal gains/status/calib uncommment correct line below
  //dbMk->SetFlavor("sim","bemcPed");
  //dbMk->SetFlavor("sim","bemcStatus");
  //dbMk->SetFlavor("sim","bemcCalib");
  //dbMk->SetFlavor("sim","bemcGain");
  //dbMk->SetFlavor("sim","eemcPMTcal");
  //dbMk->SetFlavor("sim","eemcPIXcal");

  chain->ls(3);
 //Database interface
  StDetectorDbMaker* detDbMk = new StDetectorDbMaker();

 //Endcap DB
  StEEmcDbMaker* eemcb = new StEEmcDbMaker("eemcDb");
  
  //StEmcADCtoEMaker *adc = new StEmcADCtoEMaker(); // this will just convert what's in MuDst to ADC, use for data only!
  StEmcSimulatorMaker* emcSim = new StEmcSimulatorMaker(); //use this instead to "redo" converstion from geant->adc
  emcSim->setCalibSpread(kBarrelEmcTowerId, 0.15);
  StPreEclMaker* preEcl = new StPreEclMaker(); //need this to fill new StEvent information
  
  //StEmcTrigger
  StEmcTriggerMaker *emcTrig = new StEmcTriggerMaker("bemctrigger");

  chain->Init();
  chain->PrintInfo();
  
  chain->ls(3);
  TChain* fileChain = muDstMaker->chain(); 


  int BL1_ADC[6];
  int hold=-1;
  for (Int_t iev=0;iev<nevents; iev++) {
    cout << "****************************************** " << endl;
    cout << "Working on eventNumber:\t" << iev <<"\tof:\t"<<nevents<<endl;
    cout << "*************************1***************** " << endl;
    chain->Clear();
    int iret = chain->Make(iev);
    total++;
    if (iret) {
      cout << "Bad return code!" << endl;
      break;
    }

    cout<<"           "<<endl;
    map<int,int>::iterator iter;
    map<int,int> tower;
    map<int,int> tpatch;
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-emc,代码行数:101,代码来源:Run2006SimuTriggerMaker.C

示例14: 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();
//.........这里部分代码省略.........
开发者ID:star-bnl,项目名称:star-sti,代码行数:101,代码来源:TestIOMaker.C

示例15: 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;
    
}
开发者ID:star-bnl,项目名称:star-emc,代码行数:95,代码来源:DoEqualDaq.C


注:本文中的StIOMaker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。