/////////////////////////////////////////////////////////////////////////////// // export CTEQ6_DATA=/home/murat/4.10.4/cteq6/data // // assume that we're not changing Pt's, just eta's /////////////////////////////////////////////////////////////////////////////// TStnAna* x = 0; TChain* chain = 0; TStnGeneratorModule* m_pyt = 0; TTauMcAnaModule* m_tmc = 0; TG3Pythia6* py = 0; TInterpreter* ti = 0; void pythia_ana(const char* Process, Int_t PdfSet, Int_t NEvents = 1000, Int_t SaveHist = 1) { //----------------------------------------------------------------------------- // use Pythia to generate input events, talk to Pythia to select a process // known channels: "wtaunu" //----------------------------------------------------------------------------- char script[200], script_dir[50] = "Electroweak/pythia/scripts"; py = TG3Pythia6::Instance(); ti = gInterpreter; sprintf(script,"%s/%s/%s.C",gSystem->Getenv("SRT_LOCAL"),script_dir,Process); if (strcmp(Process,"wtaunu") == 0) { //----------------------------------------------------------------------------- // initialize W -> tau nu process //----------------------------------------------------------------------------- ti->ExecuteMacro(script); } else if (strcmp(Process,"wenu") == 0) { ti->ExecuteMacro(script); py->SetMSTP(111, 0); // turn off fragmentation } else if (strcmp(Process,"wmunu") == 0) { ti->ExecuteMacro(script); py->SetMSTP(111, 0); // turn off fragmentation } else if (strcmp(Process,"zee") == 0) { ti->ExecuteMacro(script); py->SetMSTP(111, 0); // turn off fragmentation } else if (strcmp(Process,"zmumu") == 0) { ti->ExecuteMacro(script); py->SetMSTP(111, 0); // turn off fragmentation } else { printf(" unknown process: %s, exit\n",Process); return; } //----------------------------------------------------------------------------- // PDF's: 10000*MSTP(52)+MSTP(51), for CTEQ6 : 30200-30241 // CTEQ5L : 24046 // MRST2003: 40001-40002 //----------------------------------------------------------------------------- int mstp_52 = PdfSet/10000; int mstp_51 = PdfSet%10000; py->SetMSTP(52,mstp_52); // use CTEQ6 py->SetMSTP(51,mstp_51); // best fit function //----------------------------------------------------------------------------- m_pyt = new TStnGeneratorModule(py); m_tmc = new TTauMcAnaModule(); chain = new TChain("STNTUPLE"); x = new TStnAna(); x->SetInputModule(m_pyt); x->AddModule(m_tmc,0); // no filtering // m_pyt->SetEnergy(1960.); // - this is the default //----------------------------------------------------------------------------- // passing values using env //----------------------------------------------------------------------------- const char* var; var = gSystem->Getenv("MIN_LOOSE_ELE_PT"); if (var) m_tmc->SetMinLooseElePt (atof(var)); var = gSystem->Getenv("MAX_LOOSE_ELE_ETA"); if (var) m_tmc->SetMaxLooseEleEta(atof(var)); var = gSystem->Getenv("MIN_TIGHT_ELE_PT"); if (var) m_tmc->SetMinTightElePt (atof(var)); var = gSystem->Getenv("MAX_TIGHT_ELE_ETA"); if (var) m_tmc->SetMaxTightEleEta(atof(var)); var = gSystem->Getenv("MIN_TIGHT_MUO_PT"); if (var) m_tmc->SetMinTightMuoPt (atof(var)); var = gSystem->Getenv("MAX_TIGHT_MUO_ETA"); if (var) m_tmc->SetmaxTightMuoEta(atof(var)); var = gSystem->Getenv("MIN_LOOSE_MUO_PT"); if (var) m_tmc->SetMinLooseMuoPt (atof(var)); var = gSystem->Getenv("MAX_LOOSE_MUO_ETA"); if (var) m_tmc->SetMaxLooseMuoEta(atof(var)); var = gSystem->Getenv("MIN_TIGHT_TAU_PT"); if (var) m_tmc->SetMinTightTauPt (atof(var)); var = gSystem->Getenv("MAX_TIGHT_TAU_ETA"); if (var) m_tmc->SetMaxTightTauEta(atof(var)); var = gSystem->Getenv("MIN_LOOSE_TAU_PT"); if (var) m_tmc->SetMinLooseTauPt (atof(var)); var = gSystem->Getenv("MAX_LOOSE_TAU_ETA"); if (var) m_tmc->SetMaxLooseTauEta(atof(var)); //----------------------------------------------------------------------------- // run //----------------------------------------------------------------------------- x->Run(NEvents); if (SaveHist) { x->SaveHist(Form("%s.pythia_ana.%05i.%i.root",Process,PdfSet,NEvents)); } }