# include "analysisSimDst.h" Bool_t analysisSimDst(TString inputFile, Int_t nEvents=0, Int_t startEvt=0) { Hades *myHades=NULL; TStopwatch timer; Int_t evN=0; myHades=new Hades; gHades->setTreeBufferSize(80000); printf("Setting configuration...\n"); //--------------- Set batch (needed for TCanvas's) ------------------ gROOT->SetBatch(); //----------------------------------------------------------------- TString inputDir = "/tmp/"; //pliki geantowe wejsciowe TU! TString outputDir = "/tmp/"; //TU! TString paramSource="ORACLE"; //TU! //TString paramSource="ORACLE, ASCII"; //TU! //TString paramSource="ROOT"; TString inFile = inputFile + "_dst.root"; // TString outputFile = outputDir+"/"+inputFile+"_dst.root"; TString ntupleFile = outputDir+"/"+inputFile+"_nt_lep.root"; TString ntupleFileeff = outputDir+"/"+inputFile+"_nt_eff.root"; TString outDirQA = ""; //TU! TString outDirPDF = ""; //Bool_t kDumpParam=kTRUE; //TU! Bool_t kDumpParam=kFALSE; //TU! TString asciiParFile1=""; //="/u/shower/akozuch/MetaMatchPar_ideal.txt"; //TU! TString rootParFile1="";///net/disk2/akozuch/hydra/simDSTapr06/SIMDST_par_refId.9000+20070604184201.root"; //TU! cout<<"----------------------------------------------------"<replaceHeaderVersion(0,kTRUE); source->setDirectory(((Text_t *)inputDir.Data())); source->addFile((Text_t *)inFile.Data()); source->setGlobalRefId(refId); gHades->setDataSource(source); // ----------Add detectors to the setup: NO NEED TO CHANGE ----------- HSpectrometer* spec = gHades->getSetup(); spec->addDetector(new HRichDetector); spec->addDetector(new HMdcDetector); spec->addDetector(new HTofDetector); spec->addDetector(new HTofinoDetector); spec->addDetector(new HShowerDetector); spec->addDetector(new HStartDetector); spec->addDetector(new HTBoxDetector); // spec->addDetector(new HTriggerDetector); // ----- Set active modules for each detector: NO NEED TO CHANGE ----- for (Int_t is=0; is<6; is++) { spec->getDetector("Shower")->setModules(is,showerMods); spec->getDetector("Tof")->setModules(is,tofMods); spec->getDetector("Tofino")->setModules(is,tofinoMods[is]); spec->getDetector("Mdc")->setModules(is,mdcMods[is]); spec->getDetector("Rich")->setModules(is,richMods); } // ------------- RuntimeDb input: CHANGE PARAM CONTEXT HERE ---------- HRuntimeDb* rtdb=gHades->getRuntimeDb(); // ----- SECOND PARAM INPUT FOR PID if (paramSource.Contains("ORACLE")) { HParOraIo* ora=new HParOraIo; ora->open(); ora->setHistoryDate("now"); rtdb->setFirstInput(ora); } if (paramSource.Contains("ROOT")) { HParRootFileIo *input1=new HParRootFileIo; input1->open(((Char_t *)rootParFile1.Data()),"READ"); rtdb->setSecondInput(input1); } if (paramSource.Contains("ASCII")) { HParAsciiFileIo *input2 = new HParAsciiFileIo(); input2->open((Text_t*)asciiParFile1.Data(),"in"); rtdb->setSecondInput(input2); } // ------------- RuntimeDb output: save the containers init from Oracle ---- if (paramSource.Contains("ORACLE") && kDumpParam) { TString outputName("SIMDST_par_"); TDatime dt; dt.Set(); outputName=outputName+"refId."; outputName+=refId; outputName+="+"; outputName+=dt.GetDate(); outputName+=dt.GetTime(); outputName+=".root"; HParRootFileIo* output=new HParRootFileIo; TString outputDir = "./"; output->open(((Text_t *)(outputDir+outputName).Data()),"RECREATE"); rtdb->setOutput(output); } // ----------- Build TASK SETS (using H***TaskSet::make) ------------- HRichTaskSet *richTaskSet = new HRichTaskSet(); HShowerTaskSet *showerTaskSet = new HShowerTaskSet(); HTofTaskSet *tofTaskSet = new HTofTaskSet(); HTofinoTaskSet *tofinoTaskSet = new HTofinoTaskSet(); HShowerTofinoTaskSet *showerTofinoTaskSet = new HShowerTofinoTaskSet(); HMdcTaskSet *mdcTaskSet = new HMdcTaskSet(); // ----------- RICH ----------------------------------------------------- HTask *richTasks = richTaskSet ->make("simulation","noiseon"); // ----------- SHOWER --------------------------------------------------- HTask *showerTasks =showerTaskSet->make("","simulation"); // ----------- TOF ------------------------------------------------------ HTask *tofTasks = tofTaskSet ->make("simulation"); // ----------- TOFINO --------------------------------------------------- HTask *tofinoTasks = tofinoTaskSet ->make("","simulation"); // ----------- SHOWERTOFINO --------------------------------------------- HTask *showerTofinoTasks = showerTofinoTaskSet->make("","simulation,leprecognition"); HTask *mdcTasks = mdcTaskSet ->make("rtdb",""); //----------------SPLINETACKING---------------------------------------- HSplineTaskSet *splineTaskSet=new HSplineTaskSet("",""); HTask *splineTasks=splineTaskSet->make("","spline,reslowb,&old,tofclust,runge,simulation"); //---------------------------- PID -------------------------------------- HTask *pTrackFiller = new HPidTrackFiller("NOCHI2SEG0,NOCHI2SEG1"); HPidReconstructor *pidReconstructor = new HPidReconstructor("pdf,CL,merge,ALG_RUNGEKUTTA"); HPidAlgStandCuts *pidAlgStandCuts = new HPidAlgStandCuts(ntupleFile,"RICHRINGCUTS,TOFPVSBETA,TOFINOPVSBETA,SHOWERSUMDIFFVSP"); Short_t pidPart[2]={2,3}; pidReconstructor->addAlgorithm(pidAlgStandCuts); pidReconstructor->setParticleIds(pidPart,sizeof(pidPart)/sizeof(Short_t)); HPidParticleFiller *pidParticleFiller = new HPidParticleFiller("RUNGEKUTTA"); pidParticleFiller->setAlgorithm(7); HPidTofRec *pidtofrec = new HPidTofRec("pidtofreconstructor","pidtofreconstructor","nopidparam"); pidtofrec->setQualityRichParams(150.,5.,5.,5.); // use new MDC cluster finder with level adaption HMdcLookUpTb::setUseFloatLevel(); // inner MDCs HMdc34ClFinder::setUseFloatLevel(); // outer MDCs // Track Cleaner - Jochen !!! HPidTrackCleaner* cleaner = new HPidTrackCleaner(); HPidTrackSorter::setIgnoreRICH(); HPidTrackSorter::setIgnoreInnerMDC(); //----------------------- Efficiency reconstructor ------------------------- HTaskSet *pSingleLeptonEffTask = new HTaskSet("Single lepton efficiency","Single lepton efficiency"); HPidSingleTrackEff * pTrackEff = new HPidSingleTrackEff((Char_t *)ntupleFileeff.Data()); pSingleLeptonEffTask->add(pTrackEff); //------------------------ Master task set -------------------------- HTaskSet *masterTaskSet = gHades->getTaskSet("simulation"); // masterTaskSet->add(tofTasks); // masterTaskSet->add(tofinoTasks); // masterTaskSet->add(richTasks); // masterTaskSet->add(mdcTasks); // masterTaskSet->add(showerTasks); // masterTaskSet->add(splineTasks); // masterTaskSet->add(pTrackFiller); // masterTaskSet->add(pidtofrec); masterTaskSet->add(pidReconstructor); masterTaskSet->add(pidParticleFiller); masterTaskSet->add(cleaner); masterTaskSet->add((HTask *) pSingleLeptonEffTask); masterTaskSet->isTimed(kTRUE); gHades->makeCounter(1000); //TU! bylo 100 //------------------------ Initialization ---------------------------- if (!gHades->init()) { printf("Error in initialization, exiting\n"); delete myHades; return EXIT_FAILURE; } //----------------- Set non-persistent categories -------------------- HEvent *event = gHades->getCurrentEvent(); for(UInt_t i=0;igetCategory(notPersistentCat[i]); if(cat)cat->setPersistency(kFALSE); } //-------------------------- Set output ------------------------------ // gHades->setOutputFile((Char_t *)outputFile.Data(),"RECREATE","Test",2); // gHades->makeTree(); //------------------------------------------------------------------ // EVENT LOOP printf("Processing events...\n"); timer.Reset(); timer.Start(); if (nEvents<1) { evN=gHades->eventLoop(); } else { evN=gHades->eventLoop(nEvents,startEvt); } timer.Stop(); //------------------------------------------------------------------ /* if (paramSource.Contains("ORACLE") && kDumpParam) { if (!rtdb->initContainers(refId)) Error("analysisSimDST.C","RTDB not initialized for ref run"); if (!rtdb->initContainers(refId)) Error("analysisSimDST.C","RTDB not initialized for ref run"); rtdb->writeContainers(); rtdb->setContainersStatic(); rtdb->saveOutput(); // rtdb->print(); }*/ //------------------------------------------------------------------ rtdb->saveOutput(); rtdb->print(); myHades->getTaskSet("simulation")->printTimer(); //activate this if you need param root output file // rtdb->saveOutput(); //cout<<"--output Saved "<BaseName(name),""); } #ifndef __CINT__ int main(int argc, char **argv) { TROOT AnalysisSimDst("AnalysisSimDst","compiled analysis macros"); cout << argc <