//////////////////////////////////////////////////////////////////// //Using: // root [0] .x mdcTrackD.C(); // or // root [0] .x mdcTrackD.C("file_name"); (inDir will used !!!) //////////////////////////////////////////////////////////////////// gROOT->Reset(); TString beamtime = "aug18"; //=Input and Output files and directory============================= Char_t *default_indir = "/lustre/hebe/hades/raw/jul18/default/tsm"; Int_t refrunID = 208536802; //-1; //1; // run number used to initialize rtdb TString paramrelease = "now"; // now, APR12_gen2_dst Char_t* inFiles[] = { "co1835219073101.hld","co1835221005501.hld","co1835302574401.hld","co1835303201901.hld" // "co1831101000201.hld","co1831105232801.hld","co1831105392501.hld","co1831106032501.hld" }; Int_t trBits = -1; //8192; //-1; //2048+8192; // select events with setted bits Bool_t doStartCorrection = kFALSE; // kTRUE (default)= use run by run start corrections Bool_t makeTree = kFALSE; //kTRUE; // do tree or not, if=kTRUE the HMdcClusterToHit task will added to tasks list // Parameters sources: TString paramSource = "ascii,root"; // root, ascii, oracle TString asciiParFile = "./all_params_ver1.txt"; TString rootParFile = "./allParam_AUG18_gen0_09072018_170916.root"; // List of modules: Int_t mdcMods[6][4] = { {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }; 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} }; //===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; //2; //3; //1; // see class HMdcCalibrater1 Int_t cutStatus = 1; //2; //1; //0; Int_t sourceCutPar = 0; //1; //0; Float_t cutTime1L[4] = { -80., -90., -90., -100.}; Float_t cutTime1R[4] = { 1100., 1200., 1700., 1700.}; Float_t cutTime2L[4] = {-2000.,-2000.,-2000.,-2000.}; Float_t cutTime2R[4] = { 2000., 2000., 2000., 2000.}; Float_t cutLeft [4] = { 22., 24., 26., 38.}; Float_t cutRight [4] = { 500., 500., 600., 700.}; Float_t cutReplace[4] = { 0., 0., 0., 0.}; Bool_t setGlobOffset = kFALSE; //kTRUE; Float_t glOffs[6][4] = { //MDC I, II, III, IV {-30., -30., -40., -40.}, {-30., -30., -40., -40.}, {-30., -30., -40., -40.}, {-30., -30., -40., -40.}, {-30., -30., -40., -40.}, {-30., -30., -40., -40.} }; //=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; //====================================================================== HMdcEfficiency* mdcEff; HMdcEffMenu* effMenu; //====================================================================== void mdcEfficiency(Char_t* fileI=0, Char_t* inDir2=0) { TString inDir(inDir2==NULL ? default_indir : inDir2); new Hades(); gHades->setQuietMode(); HRuntimeDb* rtdb = gHades->getRuntimeDb(); HDst::setupSpectrometer(beamtime,mdcMods,"mdc,start,tbox"); // Int_t mdcset[6][4] setup mdc. If not used put NULL (default). // if not NULL it will overwrite settings given by beamtime // detectors (default)= rich,mdc,tof,rpc,shower,wall,tbox,start HDst::setupParameterSources(paramSource,asciiParFile,rootParFile,paramrelease); // now, APR12_gen2_dst //HDst::setupParameterSources("oracle",asciiParFile,rootParFile,"now"); // use to create param file // parsource = oracle,ascii,root (order matters) // if source is "ascii" a ascii param file has to provided // if source is "root" a root param file has to provided // The histDate paramter (default "now") is used wit the oracle source // Data source settings: if(fileI) { HDst::setDataSource(0,inDir,fileI,refrunID); // Int_t sourceType,TString inDir,TString inFile,Int_t refId, TString eventbuilder" } else { Int_t numInFiles = sizeof(inFiles)/sizeof(*inFiles); HDst::setDataSource(0,inDir,inFiles[0],refrunID); for(Int_t n=1;ngetDataSource())->addFile(inFiles[n],refrunID); } // Unpackers: HDst::setupUnpackers(beamtime,"mdc,tbox,latch,start"); // detectors (default)= rich,mdc,tof,rpc,shower,wall,tbox,latch,start // Time cuts settings: 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,cutReplace,cutReplace,cutReplace,cutReplace); fcut->setStatic(kTRUE); } if(cutStatus==1) fcut->setIsUsed(kFALSE); } // Tasks:------------------------------------------------- HMdcTrackFinder* trackFinder; HStartTaskSet *startTaskSet = new HStartTaskSet(); HTaskSet *tasks = new HTaskSet("MDC","Mdc Track Finding Display"); startTasks = startTaskSet ->make("real"); HTrbnetAddressMapping* trbnetmap = (HTrbnetAddressMapping*)rtdb->getContainer("TrbnetAddressMapping"); rtdb->initContainers(refrunID); trbnetmap->setStatic(); HMdcCalibrater1* cal1; tasks->add((cal1=new HMdcCalibrater1("MdcCali1","MdcCali1",calibrater1Ver,(cutStatus<=1)?0:1))); tasks->add((trackFinder=new HMdcTrackFinder("MdcTrackD","MdcTrackD",isCoilOff,typeClustFinder))); tasks->add((mdcEff=new HMdcEfficiency("MdcEff","MdcEff"))); if(trBits != -1) mdcEff->selectEventWithTBits(trBits); if(makeTree) tasks->add((new HMdcClusterToHit("ClToHit","ClToHit"))); if(setGlobOffset) { for(Int_t s=0;s<6;s++) cal1->setSecGlobalOffset(s, glOffs[s][0], glOffs[s][1], glOffs[s][2], glOffs[s][3]); } gHades->getTaskSet("real")->connect(startTasks); gHades->getTaskSet("real")->add(tasks); gHades->getTaskSet("real")->print(); //====Seting of parameters of mdcTrackFinder=============== trackFinder->setPersistency(persistency); trackFinder->setLevel(level4s1, level5s1, level4s2, level5s2); trackFinder->setNLayers(&nLayers[0][0]); //==== Start Calibrater: ================================== HStart2Calibrater::setCorrection(doStartCorrection); //=====Init =============================================== if (!gHades->init()) { Error("init()","Hades did not initialize ..."); exit(1); } cout << "init finished" << endl; if(makeTree) gHades->makeTree(); gHades->eventLoop(1); // ((HMdcOepAddrCorrPar*)(rtdb->getContainer("MdcOepAddrCorrPar")))->printParam(); // Start EffMenu: ========================================= effMenu=HMdcEffMenu::makeMenu(mdcEff); // delete gHades; }