GitHistoryModel::GitHistoryModel(Git::Repo &repo, QObject *parent) : QAbstractTableModel(parent) , m_branch(repo.currentHead().name()) , m_commits() , m_repo(repo) { connect(&m_repo, SIGNAL(historyChanged()), this, SLOT(reset())); setBranch(m_branch); }
void TaikoSkin::begin(int course, int branch) { m_soulAni->changeAction(course >= 3 ? "40" : "30"); m_soulAni->play(); if(m_soulAni->getReferencePointCount() >= 3) { for(int i=0; i<3; i++) m_soulAni->getReferencePoint(i, m_soulPos[i*2], m_soulPos[i*2+1]); }else { memset(m_soulPos, 0, sizeof(m_soulPos)); } clearNote(); setNoteCount(-1, -1); m_hitFlash->getNode()->setBranchVisible(false); setHit(false, false, false, false); setHitJudge(-1); for(int i=0; i<4; i++) m_hitDrum[i]->getNode()->setBranchVisible(false); setCombo(0); setSoul(0); setGogo(false); setBranch(branch); }
//////////////////Taking in/out file name as input void loop(string infile, string outfile, bool REAL=0){ //void loop(bool REAL=0){ const char* infname; const char* outfname; ///////////////// if(REAL) { cout<<"--- REAL DATA ---"<<endl; infname = "/net/hidsk0001/d00/scratch/yjlee/bmeson/merged_pPbData_20131114.root"; outfname = "nt_data.root"; } else { cout<<"--- MC ---"<<endl; //infname = "/mnt/hadoop/cms/store/user/wangj/HI_Btuple/20140218_PAMuon_HIRun2013_PromptReco_v1/Bfinder_all_100_1_Jrd.root"; //outfname = "nt_mc.root"; ////////////////// infname = infile.c_str(); outfname = outfile.c_str(); ///////////////// } //File type TFile *f = new TFile(infname); TTree *root = (TTree*)f->Get("demo/root"); //Chain type //TChain* root = new TChain("demo/root"); //root->Add("/mnt/hadoop/cms/store/user/twang/HI_Btuple/20131202_PPMuon_Run2013A-PromptReco-v1_RECO/Bfinder_all_*"); setBranch(root); TFile *outf = new TFile(outfname,"recreate"); int ifchannel[7]; ifchannel[0] = 1; //jpsi+Kp ifchannel[1] = 1; //jpsi+pi ifchannel[2] = 1; //jpsi+Ks(pi+,pi-) ifchannel[3] = 1; //jpsi+K*(K+,pi-) ifchannel[4] = 1; //jpsi+K*(K-,pi+) ifchannel[5] = 1; //jpsi+phi ifchannel[6] = 1; //jpsi+pi pi <= psi', X(3872), Bs->J/psi f0 bNtuple* b0 = new bNtuple; bNtuple* b1 = new bNtuple; bNtuple* b2 = new bNtuple; bNtuple* b3 = new bNtuple; bNtuple* b4 = new bNtuple; bNtuple* b5 = new bNtuple; bNtuple* b6 = new bNtuple; TTree* nt0 = new TTree("ntKp",""); b0->buildBranch(nt0); TTree* nt1 = new TTree("ntpi",""); b1->buildBranch(nt1); TTree* nt2 = new TTree("ntKs",""); b2->buildBranch(nt2); TTree* nt3 = new TTree("ntKstar1",""); b3->buildBranch(nt3); TTree* nt4 = new TTree("ntKstar2",""); b4->buildBranch(nt4); TTree* nt5 = new TTree("ntphi",""); b5->buildBranch(nt5); TTree* nt6 = new TTree("ntmix",""); b6->buildBranch(nt6); TNtuple* ntGen = new TNtuple("ntGen","","y:eta:phi:pt:pdgId"); Long64_t nentries = root->GetEntries(); Long64_t nbytes = 0; TVector3* bP = new TVector3; TVector3* bVtx = new TVector3; TLorentzVector bGen; int type; for (Long64_t i=0; i<100;i++) { // for (Long64_t i=0; i<nentries;i++) { nbytes += root->GetEntry(i); if (i%10000==0) cout <<i<<" / "<<nentries<<endl; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; if(BInfo_type[j]==1) { fillTree(b0,bP,bVtx,j); nt0->Fill(); } if(BInfo_type[j]==2) { fillTree(b1,bP,bVtx,j); nt1->Fill(); } if(BInfo_type[j]==3) { fillTree(b2,bP,bVtx,j); nt2->Fill(); } if(BInfo_type[j]==4) { fillTree(b3,bP,bVtx,j); nt3->Fill(); } if(BInfo_type[j]==5) { fillTree(b4,bP,bVtx,j); nt4->Fill(); } if(BInfo_type[j]==6) { fillTree(b5,bP,bVtx,j); nt5->Fill(); } if(BInfo_type[j]==7) { fillTree(b6,bP,bVtx,j); nt6->Fill(); } } for (int j=0;j<GenInfo_size;j++) { for(type=1;type<8;type++) { if(signalGen(type,j)) { bGen.SetPtEtaPhiM(GenInfo_pt[j],GenInfo_eta[j],GenInfo_phi[j],GenInfo_mass[j]); ntGen->Fill(bGen.Rapidity(),bGen.Eta(),bGen.Phi(),bGen.Pt(),GenInfo_pdgId[j]); break; } } } } outf->Write(); outf->Close(); }
void TestItem::setData(const QVariant & value, int role){ switch(role) { case DurationRole: setDuration(value.toDouble()); break; case ChecksumRole: setChecksum(value.toString()); break; case DependsRole: setDepends(value.toString()); break; case TestNameRole: setTestname(value.toString()); break; case RequiresRole: setRequires(value.toString()); break; case DescriptionRole: setDescription(value.toString()); break; case CommandRole: setCommand(value.toString()); break; case EnvironRole: setEnviron(value.toString()); break; case PluginRole: setPlugin(value.toString()); break; case TypeRole: setType(value.toString()); break; case UserRole: setUser(value.toString()); break; case ViaRole: setVia(value.toString()); break; case GroupRole: setGroup(value.toString()); break; case CheckRole: setCheck(value.toBool()); break; case ObjectPathRole: setObjectpath(value.toString()); break; case RunstatusRole: setRunstatus(value.toInt()); break; case ElapsedtimeRole: setElapsedtime(value.toInt()); break; case GroupstatusRole: setGroupstatus(value.toInt()); break; case ParentNameRole: //setGroupstatus(value.toStringList())); break; case ParentIdRole: //setGroupstatus(value.toStringList()); break; case DepthRole: setDepth(value.toInt()); break; case BranchRole: setBranch(value.toBool()); break; case IOLogRole: setIo_log(value.toString()); break; case CommentsRole: setComments(value.toString()); break; case OutcomeRole: setOutcome(value.toString()); break; case RerunRole: setRerun(value.toBool()); break; } }
void loopNonpromptBzero(string infile="/mnt/hadoop/cms/store/user/jwang/Bfinder_BoostedMC_20140418_Hijing_PPb502_MinimumBias_HIJINGemb_inclBtoPsiMuMu_5TeV.root", string outfile="../../output/myoutputBzero.root", bool REAL=0){ //////////////////////////////////////////////////////////Phi // This file has been automatically generated // (Thu Nov 21 13:34:42 2013 by ROOT version5.27/06b) // from TTree root/root // found on file: merged_pPbData_20131114.root ////////////////////////////////////////////////////////// const char* infname; const char* outfname; if(REAL) cout<<"--- REAL DATA ---"<<endl; else cout<<"--- MC ---"<<endl; infname = infile.c_str(); outfname = outfile.c_str(); //File type TFile *f = new TFile(infname); TTree *root = (TTree*)f->Get("demo/root"); TTree *hlt = (TTree*)f->Get("hltanalysis/HltTree"); if (root->GetEntries()!=hlt->GetEntries()) { cout <<"Inconsistent number of entries!!!"<<endl; cout <<"HLT tree: "<<hlt->GetEntries()<<endl; cout <<"Bfinder tree: "<<root->GetEntries()<<endl; } //Chain type //TChain* root = new TChain("demo/root"); //root->Add("/mnt/hadoop/cms/store/user/wangj/HI_Btuple/20140213_PAMuon_HIRun2013_PromptReco_v1/Bfinder_all_100_1_dXJ.root"); //root->Add("/mnt/hadoop/cms/store/user/wangj/HI_Btuple/20140213_PAMuon_HIRun2013_PromptReco_v1/Bfinder_all_101_1_kuy.root"); //root->Add("/mnt/hadoop/cms/store/user/wangj/HI_Btuple/20140213_PAMuon_HIRun2013_PromptReco_v1/Bfinder_all_10_1_ZkX.root"); //root->Add("/mnt/hadoop/cms/store/user/wangj/HI_Btuple/20140213_PAMuon_HIRun2013_PromptReco_v1/Bfinder_all_102_1_NyI.root"); TFile *outf = new TFile(outfname,"recreate"); setBranch(root); setHltBranch(hlt); int ifchannel[7]; ifchannel[0] = 1; //jpsi+Kp ifchannel[1] = 1; //jpsi+pi ifchannel[2] = 1; //jpsi+Ks(pi+,pi-) ifchannel[3] = 1; //jpsi+K*(K+,pi-) ifchannel[4] = 1; //jpsi+K*(K-,pi+) ifchannel[5] = 1; //jpsi+phi ifchannel[6] = 1; //jpsi+pi pi <= psi', X(3872), Bs->J/psi f0 TTree* nt0 = new TTree("ntKp",""); buildBranch(nt0); TTree* nt1 = new TTree("ntpi",""); buildBranch(nt1); TTree* nt2 = new TTree("ntKs",""); buildBranch(nt2); TTree* nt3 = new TTree("ntKstar",""); buildBranch(nt3); TTree* nt5 = new TTree("ntphi",""); buildBranch(nt5); TTree* nt6 = new TTree("ntmix",""); buildBranch(nt6); TTree* ntGen = new TTree("ntGen",""); buildGenBranch(ntGen); cout<<"--- Tree building finished ---"<<endl; Long64_t nentries = root->GetEntries(); nentries = 100000; Long64_t nbytes = 0; TVector3* bP = new TVector3; TVector3* bVtx = new TVector3; TLorentzVector* b4P = new TLorentzVector; TLorentzVector* b4Pout = new TLorentzVector; TLorentzVector bGen; int type,flag; int flagEvt=0; int offsetHltTree=0; int testevent=0,testcand=0; for (Long64_t i=0; i<nentries;i++) { nbytes += root->GetEntry(i); flagEvt=0; while (flagEvt==0) { hlt->GetEntry(i+offsetHltTree); //cout <<offsetHltTree<<" "<<Bfr_HLT_Event<<" "<<EvtInfo_EvtNo<<endl; if (Bfr_HLT_Event==EvtInfo_EvtNo && Bfr_HLT_Run==EvtInfo_RunNo) flagEvt=1; else offsetHltTree++; } if (i%10000==0) cout <<i<<" / "<<nentries<<" offset HLT:"<<offsetHltTree<<endl; int type1size=0,type2size=0,type3size=0,type4size=0,type5size=0,type6size=0,type7size=0; float best,best2,temy; int bestindex,best2index; size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==1) { //if(TrackInfo_pt[BInfo_rftk1_index[j]]<0.9) continue; fillTree(bP,bVtx,b4P,j,type1size,KAON_MASS,0,REAL); if(chi2cl[type1size]>best) { best = chi2cl[type1size]; bestindex = type1size; } type1size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; } nt0->Fill(); size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==2) { fillTree(bP,bVtx,b4P,j,type2size,PION_MASS,0,REAL); if(chi2cl[type2size]>best) { best = chi2cl[type2size]; bestindex = type2size; } type2size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; } nt1->Fill(); size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==3) { fillTree(bP,bVtx,b4P,j,type3size,PION_MASS,PION_MASS,REAL); if(chi2cl[type3size]>best) { best = chi2cl[type3size]; bestindex = type3size; } if(abs(tktkmass[type3size]-KSHORT_MASS)<best2) { best2 = abs(tktkmass[type3size]-KSHORT_MASS); best2index = type3size; } type3size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; besttktkmass = best2index; isbesttktkmass[best2index] = 1; } nt2->Fill(); size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==4 || BInfo_type[j]==5) { fillTree(bP,bVtx,b4P,j,type4size,KAON_MASS,PION_MASS,REAL); if(chi2cl[type4size]>best) { best = chi2cl[type4size]; bestindex = type4size; } if(abs(tktkmass[type4size]-KSTAR_MASS)<best2) { best2 = abs(tktkmass[type4size]-KSTAR_MASS); best2index = type4size; } type4size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; besttktkmass = best2index; isbesttktkmass[best2index] = 1; } nt3->Fill(); size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==6) { //if(TrackInfo_pt[BInfo_rftk1_index[j]]<0.7) continue; //if(TrackInfo_pt[BInfo_rftk2_index[j]]<0.7) continue; fillTree(bP,bVtx,b4P,j,type6size,KAON_MASS,KAON_MASS,REAL); if(chi2cl[type6size]>best) { best = chi2cl[type6size]; bestindex = type6size; } if(abs(tktkmass[type6size]-PHI_MASS)<best2) { best2 = abs(tktkmass[type6size]-PHI_MASS); best2index = type6size; } type6size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; besttktkmass = best2index; isbesttktkmass[best2index] = 1; } nt5->Fill(); size=0; best=-1; bestindex=-1; best2=10000.; best2index=-1; for (int j=0;j<BInfo_size;j++) { if(BInfo_type[j]>7) continue; if (ifchannel[BInfo_type[j]-1]!=1) continue; //skim{{{ b4Pout->SetXYZM(BInfo_px[j],BInfo_py[j],BInfo_pz[j],BInfo_mass[j]); temy = b4Pout->Rapidity(); if(REAL) { if(!(((EvtInfo_RunNo>=210498&&EvtInfo_RunNo<=211256&&abs(temy+0.465)<1.93)||(EvtInfo_RunNo>=211313&&EvtInfo_RunNo<=211631&&abs(temy-0.465)<1.93)))) continue; } else { if(abs(temy+0.465)>=1.93) continue; } if(BInfo_mass[j]<5 || BInfo_mass[j]>6) continue; if(BInfo_pt[j]<10.) continue; //}}} if(BInfo_type[j]==7) { fillTree(bP,bVtx,b4P,j,type7size,PION_MASS,PION_MASS,REAL); if(chi2cl[type7size]>best) { best = chi2cl[type7size]; bestindex = type7size; } type7size++; } } if(size>0) { bestchi2 = bestindex; isbestchi2[bestindex] = 1; } nt6->Fill(); if(!REAL) { Gensize = 0; for (int j=0;j<GenInfo_size;j++) { bGen.SetPtEtaPhiM(GenInfo_pt[j],GenInfo_eta[j],GenInfo_phi[j],GenInfo_mass[j]); flag=0; for(type=1;type<8;type++) { if (signalGen(type,j)) { flag=type; break; } } Genmu1pt[j] = -1; Genmu1eta[j] = -20; Genmu1phi[j] = -20; Genmu1p[j] = -1; Genmu2pt[j] = -1; Genmu2eta[j] = -20; Genmu2phi[j] = -20; Genmu2p[j] = -1; Gentk1pt[j] = -1; Gentk1eta[j] = -20; Gentk1phi[j] = -20; Gentk2pt[j] = -1; Gentk2eta[j] = -20; Gentk2phi[j] = -20; if(flag!=0) { Genmu1pt[j] = GenInfo_pt[GenInfo_da1[GenInfo_da1[j]]]; Genmu1eta[j] = GenInfo_eta[GenInfo_da1[GenInfo_da1[j]]]; Genmu1phi[j] = GenInfo_phi[GenInfo_da1[GenInfo_da1[j]]]; Genmu1p[j] = Genmu1pt[j]*cosh(Genmu1eta[j]); Genmu2pt[j] = GenInfo_pt[GenInfo_da2[GenInfo_da1[j]]]; Genmu2eta[j] = GenInfo_eta[GenInfo_da2[GenInfo_da1[j]]]; Genmu2phi[j] = GenInfo_phi[GenInfo_da2[GenInfo_da1[j]]]; Genmu2p[j] = Genmu2pt[j]*cosh(Genmu2eta[j]); if(flag==1||flag==2) { Gentk1pt[j] = GenInfo_pt[GenInfo_da2[j]]; Gentk1eta[j] = GenInfo_eta[GenInfo_da2[j]]; Gentk1phi[j] = GenInfo_phi[GenInfo_da2[j]]; } else { Gentk1pt[j] = GenInfo_pt[GenInfo_da1[GenInfo_da2[j]]]; Gentk1eta[j] = GenInfo_eta[GenInfo_da1[GenInfo_da2[j]]]; Gentk1phi[j] = GenInfo_phi[GenInfo_da1[GenInfo_da2[j]]]; Gentk2pt[j] = GenInfo_pt[GenInfo_da2[GenInfo_da2[j]]]; Gentk2eta[j] = GenInfo_eta[GenInfo_da2[GenInfo_da2[j]]]; Gentk2phi[j] = GenInfo_phi[GenInfo_da2[GenInfo_da2[j]]]; } } Gensize = GenInfo_size; Geny[j] = bGen.Rapidity(); Geneta[j] = bGen.Eta(); Genphi[j] = bGen.Phi(); Genpt[j] = bGen.Pt(); GenpdgId[j] = GenInfo_pdgId[j]; GenisSignal[j] = flag; } ntGen->Fill(); } } outf->Write(); outf->Close(); }