//================================================================== // // top_find.C // // Version 0.0: P. Koehn 5/5/01 // //================================================================== { //timer start gROOT->Time(); // Instantiate a StnAna object //---------------------------- // // Make a chain of files // // Make a chain of files TStnAna x("/datalx0a/run2/stntuple/loose_electrons"); // data // TStnAna x("/nosu1a/stntuple"); // data // Compile required code //----------------------- gSystem->CompileMacro("TEleCand.cc","k"); gSystem->CompileMacro("TConvEleCand.cc","k"); gSystem->CompileMacro("TJetCand.cc","k"); gSystem->CompileMacro("TTopFindModule.cc","k"); // // Make the output histogram file TFile* HistFile = new TFile("strip_ele_cand.hbk","RECREATE","test file"); // Create pointer to all of the objects //---------------------------------------- cout << ">>> Adding objects <<<" << endl; TConvEleCand* econv = new TConvEleCand(HistFile,"EleConv","EleConv"); TEleCand* ec = new TEleCand(HistFile,"EleC","EleC"); TJetCand* jc = new TJetCand(HistFile,"JetC","JetC"); TTopFindModule* tf = new TTopFindModule(HistFile,"TopFind","TopFind"); // // Define loose electron requirements ec->enableEleEtCut(true); ec->setEleEtCut(18.0); ec->enableEleEPCut(true); ec->setEleEPCut(4.0); ec->enableEleDelxCut(false); ec->setEleDelxCut(3.0); ec->enableEleDelzCut(false); ec->setEleDelzCut(5.0); ec->enableEleLshrCut(false); ec->setEleLshrCut(0.5); ec->enableEleHademCut(true); ec->setEleHademCut(0.2); // // Turn off this cut ec->enableEleTisolCut(false); ec->setEleTisolCut(0.1); ec->enableEleChisCut(false); ec->setEleChisCut(20.0); // // Turn off this cut ec->enableEleDelZvrtCut(false); ec->setEleDelZvrtCut(5.0); ec->enableEleZvrtCut(false); ec->setEleZvrtCut(100.0); // // Turn off the isolation cut ec->enableEleIsolCut(false); // // Turn the histograms on ec->enableEleHist(true); // // Turn the histograms on tf->enableHist(true); // // Modify some of the cuts tf->setNumberLeptonCut(1); tf->enableNumberLeptonCut(true); tf->enableMinNumberJetCut(false); tf->enableMaxNumberJetCut(false); tf->enableMetCut(false); // The modules must be added to TStnAna object. x.AddModule(ec); x.AddModule(jc); x.AddModule(tf); // This output module saves the events passing a filter to // a NEW Stntuple root file. //---------------------------------------------------------- TStnOutputModule out("test_output.root"); x.SetOutputModule(&out); // Run the StnAna object over the root file specified at instantiation //-------------------------------------------------------------------- x.Run(100); //make some histos at Endjob() - see TTopFindModule.cc // Or just grab the histos directly from TTopFindModule.cc //======================================================== //TCanvas* can = (TCanvas*) gROOT->FindObject("top find"); //can = new TCanvas("top find", "good jets",40,40,600,600); //can->Divide(2,2); //TTopFindModule::Hist_t* hstr = tf->GetHist(); //can->cd(1); //hstr.fJet->fgnj->Draw(); //can->cd(2); //hstr.fJet->fget->Draw(); //can->cd(3); //hstr.fJet->fgeta->Draw(); // Save a predefined set o' histos to file //tf->SaveHistograms("MyFavouriteHistos.root"); printf("Job Finished.\n"); printf("Output histograms are stored in: %s\n",HistFile->GetName()); // // Now close the histogram file HistFile->Write(); HistFile->Close(); //timer start gROOT->Time(); }