#include #include #include void t() { gROOT->ProcessLine(".L EllipticalCut_C.so"); gROOT->ProcessLine(".L FadcStuff_C.so"); gROOT->ProcessLine(".L Filter_C.so"); gROOT->ProcessLine(".L mychain.C"); gROOT->ProcessLine("TChain *ch=mychain();"); gROOT->ProcessLine("TProof::Open(\"stat31.phys.uconn.edu\");"); gROOT->ProcessLine("ch->SetProof();"); gProof->UploadPackage("EllipticalCut.par"); gProof->UploadPackage("FadcStuff.par"); gProof->UploadPackage("Filter.par"); gProof->EnablePackage("EllipticalCut"); gProof->EnablePackage("FadcStuff"); gProof->EnablePackage("Filter"); cout << "Chain *ch is set to go (PROOF is active)" << endl; } TH1 *draw(const char *histname, const char* option="") { TH1F *h = gROOT->FindObject(histname); if (h == 0) { std::cout << "error - object named " << histname << " not found." << std::endl; return; } TCanvas *c1 = gROOT->FindObject("c1"); if (c1 == 0) { c1 = new TCanvas("c1"); } c1->SetLogy(0); h->Draw(option); return h; } void show(int xchan, int ychan) { std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); } void showcut0(int xchan, int ychan) { FadcStuff::Cut2d *cut0 = new FadcStuff::Cut2d(0,1,914,419,280,30,2.8,0); //FadcStuff::Cut2d *cut0 = new FadcStuff::Cut2d(0,1,914,419,680,30,2.8,0); if (xchan != 0 || ychan != 1) { gProof->AddInputData(cut0); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 0 && ychan == 1) { cut0->Draw(); } gProof->ClearInputData(cut0); delete cut0; } void showcut1(int xchan, int ychan) { FadcStuff::Cut2d *cut1 = new FadcStuff::Cut2d(1,3,794,503,257,30,20.3,0); //FadcStuff::Cut2d *cut1 = new FadcStuff::Cut2d(1,3,794,503,657,30,20.3,0); if (xchan != 1 || ychan != 3) { gProof->AddInputData(cut1); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 1 && ychan == 3) { cut1->Draw(); } gProof->ClearInputData(cut1); delete cut1; } void showcut2(int xchan, int ychan) { FadcStuff::Cut2d *cut2 = new FadcStuff::Cut2d(1,2,1018,1236,342,71,50,0); //FadcStuff::Cut2d *cut2 = new FadcStuff::Cut2d(1,2,1018,1236,942,71,50,0); if (xchan != 1 || ychan != 2) { gProof->AddInputData(cut2); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 1 && ychan == 2) { cut2->Draw(); } gProof->ClearInputData(cut2); delete cut2; } void showcut3(int xchan, int ychan) { FadcStuff::Cut2d *cut3 = new FadcStuff::Cut2d(3,4,1246,453,283,47,8.6,0); //FadcStuff::Cut2d *cut3 = new FadcStuff::Cut2d(3,4,1246,453,983,47,8.6,0); if (xchan != 3 || ychan != 4) { gProof->AddInputData(cut3); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 3 && ychan == 4) { cut3->Draw(); } gProof->ClearInputData(cut3); delete cut3; } void showcut4(int xchan, int ychan) { FadcStuff::Cut2d *cut4 = new FadcStuff::Cut2d(3,4,385,1164,352,66,86,0); //FadcStuff::Cut2d *cut4 = new FadcStuff::Cut2d(3,4,385,1164,952,66,86,0); if (xchan != 3 || ychan != 4) { gProof->AddInputData(cut4); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 3 && ychan == 4) { cut4->Draw(); } gProof->ClearInputData(cut4); delete cut4; } void showcut12(int xchan, int ychan) { FadcStuff::Cut2d *cut12 = new FadcStuff::Cut2d(12,13,957,490,229,18,0,0); if (xchan != 12 || ychan != 13) { gProof->AddInputData(cut12); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 12 && ychan == 13) { cut12->Draw(); } gProof->ClearInputData(cut12); delete cut12; } void showcut13(int xchan, int ychan) { FadcStuff::Cut2d *cut13 = new FadcStuff::Cut2d(12,13,390,824,246,25,90,0); if (xchan != 12 || ychan != 13) { gProof->AddInputData(cut13); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 12 && ychan == 13) { cut13->Draw(); } gProof->ClearInputData(cut13); delete cut13; } void showcut14(int xchan, int ychan) { FadcStuff::Cut2d *cut14 = new FadcStuff::Cut2d(12,14,390,874,246,25,90,0); if (xchan != 12 || ychan != 14) { gProof->AddInputData(cut14); } std::stringstream str; str << xchan << "," << ychan; int nevents = (xchan == 2 || ychan == 2)? 19800000 : 150000000; ch->Process("FadcStuff",str.str().c_str(),nevents,0); if (xchan == 12 && ychan == 14) { cut14->Draw(); } gProof->ClearInputData(cut14); delete cut14; } void addfilt() { gROOT->ProcessLine("Filter *fp=new Filter;"); gROOT->ProcessLine("fp->SetName(\"afilter\");"); gROOT->ProcessLine("gProof->AddInputData(fp,1);"); }