Beispiel #1
0
void Tell::tellCmd(const QString& from, const QStringList& list) {
    octAssert(list.count() == 2);

    QStringList tmp = list[0].split(",",QString::SkipEmptyParts);
    QStringList dest, ok, ko;
    for(QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it)
        dest << manager()->databasePlugin()->canonicalName(*it);

    QString cc = dest.join(",") + ",";

    for(QStringList::Iterator it = dest.begin(); it != dest.end(); ++it) {
        QString cc_tmp(cc);
        cc_tmp.replace(*it + ",","");
        cc_tmp = cc_tmp.left(cc_tmp.length() - 1);
        QString txt1(from + " tells you" + (dest.count() > 1 ? ("(CC: " + cc_tmp + ")") : "") + ": " + list[1]);

        if(manager()->connectionPlugin()->serverSend(*it,txt1))
            ok << *it;
        else
            ko << *it;
    }

    if(ok.count()){
        QString txt2("You tell " + (ok.join(",")) + ": " + list[1]);
        manager()->connectionPlugin()->serverSend(from,txt2);
    }
    if(ko.count()) {
        QString txt2((ko.join(",")) + (ko.count() > 1 ? " are" : " is") + " not connected!");
        manager()->connectionPlugin()->serverSend(from,txt2);
    }
}
Beispiel #2
0
void Wall::wallCmd(const QString &from, const QStringList& list) {
    octAssert(list.size() < 2);

    if(list.size() != 0 && list[0] != "") {
        QString message(QDate::currentDate().toString("dd/MM/yyyy ") + QTime::currentTime().toString("hh:mm:ss ") + from);
        for(int i=from.length(); i<=manager()->databasePlugin()->validLoginLength(); i++)
            message += " ";
        message += list[0];
        addToWall(message);
        manager()->logPlugin()->write("wall", message);
        QString txt1(from + " writes to the wall: " + list[0]);
        manager()->connectionPlugin()->serverBroadcastOthers(from, txt1);
        QString txt2("You write to the wall: " + list[0]);
        manager()->connectionPlugin()->serverSend(from, txt2);
    } else {
        QString wall_lines = getWall(from);
        QString txt;
        if (wall_lines == "")
            txt = "Wall is empty";
        else
            txt = "Wall :\n" + wall_lines;
        manager()->connectionPlugin()->serverSend(from, txt);
        if (wall_lines != "")
            manager()->connectionPlugin()->serverSend(from, "End of Wall");
    }
}
Beispiel #3
0
void Tell::senddataCmd(const QString& from, const QStringList& list) {
    octAssert(list.count() == 2);

    QString to = manager()->databasePlugin()->canonicalName(list[0]);
    QString txt1("|" + from + "| " + list[1]);
    if(!manager()->connectionPlugin()->send(to,txt1)) {
	    QString txt2(to + " is not connected!");
	    manager()->connectionPlugin()->serverSend(from,txt2);
    }
}
Beispiel #4
0
void Msg::sendmsgUser(const QString& from, const QStringList& list, bool quiet) {
    QString txt1(from + " sends a message to you: " + list[1]);
    QString message(QDate::currentDate().toString("dd/MM/yyyy ") + QTime::currentTime().toString("hh:mm:ss ") + from + " : " + list[1]);
    QString to(manager()->databasePlugin()->canonicalName(list[0]));
    if((manager()->connectionPlugin()->serverSend(to,txt1) || manager()->databasePlugin()->isRegisteredUser(to))
       && writeMsg(to,message) && !quiet) {
        QString txt2("You send a message to " + to + ": " + list[1]);
        manager()->connectionPlugin()->serverSend(from,txt2);
    } else if(!quiet) {
		QString error("Invalid user");
		manager()->connectionPlugin()->serverSend(from,error);
    }
}
Beispiel #5
0
void draw_plots(){
	CreateCanvas(Form("Limit_Plot"),"",600,600);
	CName["Limit_Plot"]->cd();
	gPad->SetLogy();
	
	grName["squark_xs"]->SetLineColor(kBlack);
    grName["squark_xs"]->SetLineStyle(kDotted);
    grName["squark_xs"]->SetFillColor(46);

	grName["xs_exp_combined"]->SetLineColor(kBlack);
	grName["xs_obs_combined"]->SetLineColor(kBlack);
	
	grName["xs_exp_combined"]->SetLineStyle(kDashed);
    
	grName["xs_exp_combined_1sigma"]->SetFillStyle(1001);
	grName["xs_exp_combined_2sigma"]->SetFillStyle(1001);
    
	grName["xs_exp_combined_1sigma"]->SetFillColor(3);
	grName["xs_exp_combined_2sigma"]->SetFillColor(5);
	
	grName["xs_exp_combined_1sigma"]->Draw("a3");
    grName["xs_exp_combined_2sigma"]->Draw("a3");
	grName["xs_exp_combined_1sigma"]->GetXaxis()->SetRangeUser(300,900);
    grName["xs_exp_combined_2sigma"]->GetXaxis()->SetRangeUser(300,900);
	grName["xs_exp_combined_1sigma"]->GetYaxis()->SetRangeUser(5,1.5*grName["squark_xs"]->Eval(300));
    grName["xs_exp_combined_2sigma"]->GetYaxis()->SetRangeUser(5,1.5*grName["squark_xs"]->Eval(300));

	grName["xs_exp_combined_1sigma"]->GetXaxis()->SetTitle("M_{#tilde{q}} (GeV)");
	grName["xs_exp_combined_1sigma"]->GetYaxis()->SetTitle("#sigma (fb)");
    
    grName["xs_exp_combined_2sigma"]->GetXaxis()->SetTitle("M_{#tilde{q}} (GeV)");
	grName["xs_exp_combined_2sigma"]->GetYaxis()->SetTitle("#sigma (fb)");
    
	//grName["xs_exp_combined_2sigma"]->Draw("a3 same");
    grName["xs_exp_combined_1sigma"]->Draw("a3");
	grName["xs_exp_combined"]->Draw("l same");
	grName["xs_obs_combined"]->Draw("l same");
    
    grName["squark_xs"]->Draw("3 same");
    grName["squark_xs"]->Draw("cx0 same");

    grName["xs_exp_combined"]->Draw("l same");
	grName["xs_obs_combined"]->Draw("l same");

	TLegend Leg(0.6,0.5,0.85,0.67);
	Leg.SetFillColor(10);
	Leg.SetBorderSize(0);
	Leg.SetLineColor(10);
	
	Leg.AddEntry(grName["xs_exp_combined"],"Expected","L" );
	Leg.AddEntry(grName["xs_obs_combined"],"Observed","L");
	Leg.AddEntry(grName["xs_exp_combined_1sigma"],"#pm 1 #sigma_{ex}","f");
   // Leg.AddEntry(grName["xs_exp_combined_2sigma"],"#pm 2 SD","f");

	Leg.AddEntry(grName["squark_xs"],"#sigma_{#tilde{q}#tilde{q}} #pm 1 #sigma_{th} ","LF");
	Leg.DrawClone();
	
	//TLatex txt(0.4,0.85,"M_{#tilde{#chi}_{1}^{#pm}}=1/2#timesM_{#tilde{q}}, Br(#tilde{#chi}_{1}^{#pm}#rightarrowW^{#pm},#tilde{S})=1");
    TLatex txt(0.6,0.85,"pp #rightarrow #tilde{q}_{L}#tilde{q}_{L}");
    //TLatex txt1(0.2,0.3,"M_{ #tilde{#chi}_{1}^{#pm} }=1/2#timesM_{ #tilde{q} }");
    TLatex txt1(0.2,0.3,"M_{ #tilde{#chi}_{1}^{#pm} }=1/2#timesM_{ #tilde{q} }");
	TLatex txt2(0.2,0.2,"M_{#tilde{S}} = 100 GeV, M_{S} = 90 GeV");

    //, Br(#tilde{#chi}_{1}^{#pm}#rightarrowW^{#pm},#tilde{S})=1");
    txt.SetTextSize(0.045);
	txt.SetNDC(kTRUE);
	txt.DrawClone();
    txt.DrawLatex(0.6,0.77,"#tilde{q}_{L}#rightarrow q #tilde{#chi}_{1}^{#pm}");
    txt.DrawLatex(0.6,0.69,"#tilde{#chi}_{1}^{#pm}#rightarrow W^{#pm} #tilde{S}");
    txt.DrawLatex(0.2,0.4,"#tilde{q}_{L}: #tilde{u}, #tilde{d}, #tilde{s}, #tilde{c}");
    
    txt1.SetTextSize(0.045);
	txt1.SetNDC(kTRUE);
	txt2.SetTextSize(0.045);
	txt2.SetNDC(kTRUE);
	txt1.DrawClone();
	txt2.DrawClone();
    //txt.DrawLatex(0.4,0.75,"M_{#tilde{S}}=100 GeV, M_{S}=90 GeV");
    
    CMS_lumi(CName["Limit_Plot"],2,10);
	//draw_header();
    gPad->RedrawAxis();

    
}