//------------------------------------------// // Problem 2: There is a requirement that // at least 400 DOMs launch. I want to look // at the average, and maybe also the average // for given event range. //------------------------------------------// void checkNDOM(TTree* tree) { // Plot the number of DOM's per event TString var = "DetectorResponseEvent_.totalNumberOfDom_"; // Make canvas TCanvas* c = makeCanvas("c"); // Make a vector of TCuts vector<TString> cuts; cuts.push_back("1"); // 1% cuts.push_back("3"); // 3% cuts.push_back("10"); // 10% cuts.push_back("30"); // 30% cuts.push_back("51"); // 51% cuts.push_back("100"); // 100% // Create histogram holders TH1F* hists[6]; int nbins = 100; int min = 0; int max = 2000; TString xtitle = "nDOMs"; TString ytitle = "Entries"; // Make legend TLegend* leg = makeLegend(0.7,0.8,0.6,0.9); leg->SetHeader("Luminosity"); // Loop and draw float maximum = -999; for(unsigned int i=0; i<cuts.size(); ++i){ // get cut value TString cutval = cuts.at(i); // create histogram hists[i] = makeFrame("hist_"+cutval,nbins,min,max, xtitle,ytitle); // cut the TCut object from value TCut cut = lumiCut(cutval); // Draw and set att tree->Draw((var+">>hist_"+cutval).Data(),cut,"hist"); setAtt(hists[i],xtitle,ytitle,m_colors[i],m_markers[i]); setMax(hists[i],maximum); // Add to legend leg->AddEntry(hists[i],(cutval+"%").Data(),"l"); } // Now draw the figures hists[0]->SetMaximum(maximum*1.1); hists[0]->Draw("hist"); for(unsigned int i=1; i<cuts.size(); ++i) hists[i]->Draw("samehist"); leg->Draw("same"); c->SaveAs((savedir+"nDoms_perLumi.png").Data()); }
//------------------------------------------------------------// // Make TH2F //------------------------------------------------------------// TH2F* makeHist2(TString name, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax, TString xtitle, TString ytitle, TString ztitle) { TH2F* h = new TH2F(name.Data(),name.Data(),nbinsx,xmin,xmax, nbinsy,ymin,ymax); setAtt(h,xtitle,ytitle,ztitle); return h; }
void Pokemon::SetStatsForLevel() { setHP(round(ceil(2 * getBaseHP() + 31) * getLevel() / 100 + getLevel() + 10)); setAtt(round(ceil(2 * getBaseAtt() + 31) * getLevel() / 100 + 5)); setDef(round(ceil(2 * getBaseDef() + 31) * getLevel() / 100 + 5)); setSpeed(round(ceil(2 * getBaseSpeed() + 31) * getLevel() / 100 + 5)); setCurrentHP(getHP()); setCurrentAtt(getAtt()); setCurrentDef(getDef()); setCurrentSpeed(getSpeed()); }
//------------------------------------------// // Problem 1: there is a function called // utctimes(...). I want to figure out // where I should place cuts to seperate // the various luminosities //------------------------------------------// void checkUTCTimes(TTree* tree) { // Variables to plot TString varx = "startUTCDaqTime_/1.e15"; // scale by 1e15 TString vary = "DetectorResponseEvent_.totalBestEstimatedNPE_/1000."; //TString vary = "AtwdResponseChannels_.estimatedNPE_"; // Make canvas TCanvas* c = makeCanvas("c"); // Make a histogram to save float xmin = isSC2 ? 279.98 : 276.67; float xmax = isSC2 ? 280.15 : 276.84; float ymin = 0; float ymax = isSC2 ? 900 : 160; TH2F* frame = new TH2F("frame","",1, xmin,xmax,1,ymin,ymax); setAtt(frame,"Start DAQ Time / 10^{14}","Total Best Estimated NPE / 10^{3}"); frame->Draw(); // Draw from tree tree->Draw((vary+":"+varx).Data(),"","same"); // Add constant functions of time vector<double> times = isSC2 ? getTimesSC2() : getTimesSC1(); TLine* line = new TLine(); line->SetLineWidth(1); line->SetLineColor(kBlue); for(unsigned int t=0; t<times.size(); ++t){ double time = times.at(t); line->DrawLine(time,ymin,time,ymax); line->Draw("same"); } // Save the plot TString pname = "timeVsAmp.png"; c->SaveAs((savedir+pname).Data()); }
// light constructor CglicLight::CglicLight(const int& i) { //cout << " --- - [create CglicLight]" << endl; ltyp = TL_DIRECTION; lid = i; //setCol(CglicMaterial::TC_AMB, 0.0, 0.0, 0.0, 1.0); //setCol(CglicMaterial::TC_DIF, 1.0, 1.0, 1.0, 1.0); //setCol(CglicMaterial::TC_SPE, 1.0, 1.0, 1.0, 1.0); setPos(0, 0, 0, 1); setAtt(1, 0, 0); spotCutoff = 45.0; spotDirect[0] = 0.0; spotDirect[1] = 0.0; spotDirect[2] = -1.0; spotExp = 0.0; //cout << " -- Number of Light: " << lid << endl; }