//////////////////////////////////////////////////////////////////// //Using: // root [0] .x mdcTrackD.C(); // or // root [0] .x mdcTrackD.C("file_name"); (inDir will used !!!) //////////////////////////////////////////////////////////////////// gROOT->Reset(); //=Input and Output files and directory============================= Char_t * default_indir = "../"; // "/lustre_alpha/hades/beam/sep08"; Char_t inDir[200]; Int_t refrunID = 1; //-1000; //1945425940; //1; // run number used to initialize rtdb Char_t* inFiles[]={ "be1025620063201.hld", "be1025620063202.hld", "be1025620063203.hld", "be1025620063204.hld", "be1025620063205.hld", "be1025620063206.hld", "be1025620063207.hld", "be1025620063208.hld" }; //Char_t outdir[200]="/s/mdc"; Char_t outdir[200] = ""; Bool_t makeTree = kFALSE; //kTRUE; // do tree or not, if=kTRUE the HMdcClusterToHit task // will added to tasks list // Parameters input files:www-hades.gsi.de/persons/halo/results/nov02/mdc/238www-hades.gsi.de/persons/halo/results/nov02/mdc/238 // used for mar02 cosmics: Char_t typeFile1 = 'a'; // ='a'-ASCII or 'r'-root file Char_t* parFile1 = "/u/pechenov/Hydra/online_sep10/test/Sep10/allParMerged.txt"; //"jun10_online_all_lookup_cal_140710.txt"; // List of modules: Int_t mdcMods[6][4]= { {1,1,1,1}, // moduledef for sector 1 {1,1,1,1}, // moduledef for sector 2 {1,1,1,1}, // ... {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }; // ---------------- Unpacker configuration -------------------------- // Int_t mdcUnpackers[2] = { 0x8100 ,0x8110 }; Int_t mdcUnpackers[12] = { 0x1000 ,0x1100,0x1010 ,0x1110, 0x1020 ,0x1120, 0x1030 ,0x1130, 0x1040 ,0x1140, 0x1050 ,0x1150 }; //===Mdc time cuts======================================================= // cutStatus=0 - HMdcCalibrater1, HMdcTrackFinder // and HMdcEfficiency will not do time cuts. // cutStatus=1 - HMdcCalibrater1 will not do time cuts, // HMdcTrackFinder and HMdcEfficiency will do time cuts. // cutStatus=2 - HMdcCalibrater1 will do time cuts. // sourceCutPar=0 - using param. of time cuts from parameters files // sourceCutPar=1 - seting of cut parameters in this macro. // // For selecting and checking cuts look on the time distributions // with out any cuts (cutStatus=0;). // Attention! The cuts in this example of macros seted for non calibreted // data (HMdcCalibrater1("MdcCali1","MdcCali1",3,0)). If you use // the calibrated data you need to change of cut. // // calibrater1Ver = 1 - No Start and Cal // = 2 - Start and Cal // = 3 - No Start and no Cal Int_t calibrater1Ver = 1; //3; // see class HMdcCalibrater1 Int_t cutStatus = 0; //2; //1; //0; Int_t sourceCutPar = 1; //0; // Float_t cutTime1L[4]={ 620., 600., 240., 250.}; // Float_t cutTime1R[4]={1300., 1400., 1700., 1700.}; // Float_t cutTime2L[4]={ 730., 700., 350., 350.}; // Float_t cutTime2R[4]={1500., 1700., 2000., 2000.}; // Float_t cutLeft [4]={ 20., 20., 20., 20.}; // cutLeft < driftTime1-drif // Float_t cutRight [4]={ 300., 400., 600., 600.}; // If cutLeft=cutRight=0. th cut will be ignored Float_t cutTime1L[4]={-150., -300., -210., -250.}; Float_t cutTime1R[4]={ 300., 300., 400., 500.}; Float_t cutTime2L[4]={-100., -250., -190., -200.}; Float_t cutTime2R[4]={ 350., 350., 450., 550.}; Float_t cutLeft [4]={ 10., 10., 10., 12.}; // cutLeft < driftTime1-drif Float_t cutRight [4]={ 200., 350., 400., 500.}; // If cutLeft=cutRight=0. th cut will be ignored //=Parameters of track finder and efficiency tasks:===================== // Type of working of Dubna cluster finder: // isCoilOff=kTRUE(kFULSE) - The current in coil is switched off(on). // typeClustFinder=1(0) // isCoilOff=kTRUE, typeClustFinder=1: // The tracks will searched in each MDC (1-4) independent // isCoilOff=kTRUE, typeClustFinder=0: // The tracks will searched in all MDC of sector together // (needs in a alignment of MDC's) // isCoilOff=kFALSE, typeClustFinder=1: // The tracks will searched in MDC1, MDC2 (segment 1) independent, // in MDC3, MDC4 (segment 2) together, but information about // hits in segment 2 will not used for estimation of efficiency // (it will be done in the future). // isCoilOff=kFALSE, typeClustFinder=0: // The tracks will searched in MDC1, MDC2 (segment 1) together // (needs in a alignment of MDC's) and // in MDC3, MDC4 (segment 2) alsow together, but information about // hits in segment 2 will not used for estimation of efficiency // (it will be done in the future). // For isCoilOff=kFALSE the program needs in HKickPlane parameters Bool_t isCoilOff=kTRUE; Int_t typeClustFinder=1; // =1,0 1-independent, // HMdcClus persistency: Bool_t persistency=kFALSE; // write or not the HMdcClus data in output file // Parameters for cluster finder for estimatin of efficiency: Int_t level4s1=4; Int_t level5s1=100000; Int_t level4s2=4; Int_t level5s2=100000; // List of num. of working layers in modules: lLayers[sec][mod] Int_t nLayers[6][4]={ {6,6,6,6}, {6,6,6,6}, {6,6,6,6}, {6,6,6,6}, {6,6,6,6}, {6,6,6,6} }; //====================================================================== HMdcEfficiency* mdcEff; HMdcEffMenu* effMenu; //====================================================================== void mdcEfficiency(Char_t* fileI=0, Char_t* inDir2=0, Bool_t RemoteSource=kFALSE) { if (inDir2 == 0) sprintf( inDir, "%s", default_indir ); else sprintf(inDir, "%s", inDir2 ); // multiuser tricks Char_t textfile[200]; Char_t outFile[200]; // FILE *pipe=gSystem->OpenPipe("nextName.sh output.root .root","r"); // fscanf(pipe,"%s",&textfile); // gSystem->ClosePipe(pipe); sprintf(outFile,"%s/%s",outdir,textfile); cout << endl << "OUTPUT >>" << outFile << endl << endl; // end multiuser Hades* myHades = new Hades(); myHades->setQuietMode(); HSpectrometer* spec=myHades->getSetup(); // MDC configuration HMdcDetector *mdc=new HMdcDetector; for(Int_t i=0;i<6;i++) mdc->setModules(i, mdcMods[i]); spec->addDetector(mdc); HRuntimeDb* rtdb=myHades->getRuntimeDb(); //Set the data source (here from Lmd file) if ( !RemoteSource ) { HldFileSource *source = new HldFileSource; } else { HldSockRemoteSource *source = new HldSockRemoteSource(fileI); } myHades->setDataSource(source); if ( !RemoteSource ) { source->setDirectory(inDir); // rtdb->addRun(refrunID); if(fileI) { if(refrunID<-1) source->addFile(fileI); else source->addFile(fileI,refrunID); } else { Int_t numInFiles=sizeof(inFiles)/sizeof(*inFiles); for(Int_t n=0; naddFile(inFiles[n]); else source->addFile(inFiles[n],refrunID); } } } // else rtdb->addRun(refrunID); for(Int_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { HMdcUnpacker* mdc_unpacker = new HMdcUnpacker( mdcUnpackers[i], kTRUE ); mdc_unpacker->setQuietMode(kTRUE); //! mdc_unpacker->setStandaloneMode(kTRUE,1); //mdc_unpacker->setFillDataWord(kFALSE); // kann man rausnehmen source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } ////////////////////////////// ///// Oracle ++ ////////////// ////////////////////////////// HParOra2Io *ora = new HParOra2Io ; ora->open(); if (!ora->check()) { Error("ora->check","no connection to Oracle\nexiting...!"); exit(EXIT_FAILURE);} rtdb->setSecondInput(ora); ora->setHistoryDate("now"); HMdcLayerCorrPar* fMdcLayerCorrPar = (HMdcLayerCorrPar*)rtdb->getContainer("MdcLayerCorrPar"); // fMdcLayerCorrPar->setDefaultPar(); fMdcLayerCorrPar->setStatic(); if(typeFile1 == 'a') { HParAsciiFileIo *inp1=new HParAsciiFileIo; inp1->open(parFile1,"in"); rtdb->setFirstInput(inp1); } else if(typeFile1 == 'r') { HParRootFileIo *inp1=new HParRootFileIo; inp1->open(parFile1,"READ"); rtdb->setFirstInput(inp1); } ////////////////////////////// if(cutStatus==1 || (cutStatus==2 && sourceCutPar==1)) { HMdcTimeCut* fcut=new HMdcTimeCut(); rtdb->addContainer(fcut); if(sourceCutPar==1) { fcut->setCut(cutTime1L, cutTime1R, cutTime2L,cutTime2R, cutLeft,cutRight); fcut->setStatic(kTRUE); } if(cutStatus==1) fcut->setIsUsed(kFALSE); } // // ------------ tasklist --------------------------- // HMdcTaskSet *myMdcTaskSet = 0; // HTask *mdcTask = 0; // myMdcTaskSet = new HMdcTaskSet(); // mdcTask = myMdcTaskSet->make("","cal1,real,notimecuts,nostartandnocal"); // myHades->getTaskSet("real")->add(mdcTask); // myHades->getTaskSet("real")->connect(tasks); // // ------------ init Container for remote source --- // Tasks:------------------------------------------------- HMdcTrackFinder* trackFinder; HTaskSet* tasks = new HTaskSet("MDC","Mdc Track Finding Display"); // HMdcBitFlipCor* mdcbitflipcor; // mdcbitflipcor= new HMdcBitFlipCor("mdcbitflipcor","mdcbitflipcor"); // tasks->connect(mdcbitflipcor); tasks->connect(new HMdcCalibrater1("MdcCali1","MdcCali1", calibrater1Ver,(cutStatus<=1)?0:1)/*,"mdcbitflipcor"*/); tasks->connect((trackFinder=new HMdcTrackFinder("MdcTrackD","MdcTrackD", isCoilOff,typeClustFinder)),"MdcCali1"); tasks->connect((mdcEff=new HMdcEfficiency("MdcEff","MdcEff")),"MdcTrackD"); if(makeTree) {tasks->connect((new HMdcClusterToHit("ClHit","ClHit")),"MdcEff"); tasks->connect((HTask*)NULL,"ClHit"); } else tasks->connect((HTask*)NULL,"MdcEff"); myHades->getTaskSet("real")->connect(tasks); myHades->getTaskSet("real")->connect(NULL,tasks); myHades->getTaskSet("real")->print(); //====Seting of parameters of mdcTrackFinder=============== trackFinder->setPersistency(persistency); trackFinder->setLevel(level4s1, level5s1, level4s2, level5s2); trackFinder->setNLayers(&nLayers[0][0]); //========================================================= if (RemoteSource) { rtdb->initContainers(1); rtdb->setContainersStatic(); } if (!myHades->init()) { rtdb->closeFirstInput(); rtdb->closeSecondInput(); delete myHades; return; } // Set output file Int_t compLevel = 2; //myHades->setOutputFile("deleteMe----.root","RECREATE","runs",compLevel); //if(makeTree) myHades->setOutputFile(outFile,"RECREATE","runs",compLevel); //if(makeTree) cout << endl << "OUTPUT >>" << outFile << endl; if(makeTree) myHades->makeTree(); // if(makeTree) // { // myHades->getOutputFile()->Write(); // myHades->getOutputFile()->Close(); // //myHades->saveOutputFile(); // //myHades->getOutputFile()->Write(); // } cout << "init finished" << endl; gHades->eventLoop(1); ((HMdcOepAddrCorrPar*)(rtdb->getContainer("MdcOepAddrCorrPar")))->printParam(); // HParAsciiFileIo* output=new HParAsciiFileIo; // output->open("paramSep08.txt","out"); // rtdb->setOutput(output); // delete myHades; effMenu=HMdcEffMenu::makeMenu(mdcEff); // delete myHades; }