460 string tFile (fFile);
461 string dDir (dataDir);
468 bool doCurrent =
false;
469 doCurrent =
format.process(curRecord);
470 if(doCurrent ==
false){
473 cout<<
"Format File not found"<<endl;
476 while(doCurrent ==
true){
477 cout<<
format.numOfType(
"GENIE")<<
" root files and "<<
format.numOfType(
"EXPERIMENTAL")<<
" published data files "<<endl;
479 int legendSize =
format.numOfType(
"GENIE") +
format.numOfType(
"EXPERIMENTAL");
480 stringstream convert;
494 Double_t xl, yl, xu, yu;
495 convert.str(
format.xl); convert.clear();
497 convert.str(
format.yl); convert.clear();
499 convert.str(
format.xu); convert.clear();
501 convert.str(
format.yu); convert.clear();
506 canName.assign(curRecord,
'*');
507 cans=
new TCanvas(canName.c_str(),
format.fetchGTitle().c_str());
510 if(
format.logx==
true){gPad->SetLogx(1);}
511 if(
format.logy==
true){gPad->SetLogy(1);}
514 y1 = 1.05-(.075*legendSize);
516 TLegend*
leg1 =
new TLegend(.52,y1,1,1,
"");
517 leg1->SetTextSize(TextSize);
521 TH1F* hf1 = (TH1F*) cans->DrawFrame(xl,yl,xu,yu);
522 hf1->SetTitle(
format.mtitle.c_str());
523 if(
format.type.compare(
"Angle")==0){
524 hf1->GetXaxis()->SetTitle(
"cos(#theta)");
525 hf1->GetYaxis()->SetTitle(
"#frac{d#sigma}{d#Omega} [#frac{mb}{sr}]");
527 else if(
format.type.compare(
"Momentum")==0){
528 hf1->GetXaxis()->SetTitle(
"Momentum [Mev]");
529 hf1->GetYaxis()->SetTitle(
"#frac{d#sigma}{dp} [#frac{mb}{MeV}]");
531 else if(
format.type.compare(
"XS")==0){
532 hf1->GetXaxis()->SetTitle(
"Energy [MeV]");
533 hf1->GetYaxis()->SetTitle(
"#sigma (mb)");
536 hf1->GetXaxis()->SetTitle(
"Energy [MeV]");
537 hf1->GetYaxis()->SetTitle(
"#frac{d#sigma}{d#OmegadE} [#frac{mb}{sr#upointMev}]");
540 hf1->GetYaxis()->CenterTitle();
545 int numRoots =
format.numOfType(
"GENIE");
550 for(k=0;k<numRoots;k++){
552 if(
format.type.compare(
"XS")==0){
555 int curCol = simData->
color;
556 simData->
dataTuple->SetMarkerColor(curCol);
557 simData->
dataTuple->SetMarkerStyle(markerStyle);
560 simData->
dataTuple->SetLineColor(curCol);
561 cout<<
"About to draw tuple"<<endl;
563 cout<<simData->
cut.c_str()<<endl;
564 simData->
dataTuple->Draw(simData->
cut.c_str(),
"",
"line psame L");
566 cout<<
"Tuple drawn"<<endl;
569 TCanvas* tempVas =
new TCanvas(
"tempName",
"No title");
572 string newCut = simData->
cut;
573 newCut = newCut +
"&&"+simData->
cols+
"<="+
format.xu;
574 newCut = newCut +
"&&"+simData->
cols+
">"+
format.xl;
575 simData->
dataTree->Draw(simData->
cols.c_str(),newCut.c_str(),
"L");
577 if(simData->
valid()){
580 htemp = (TH1F*) gPad->GetPrimitive(
"htemp");
587 hist1 = (TH1F*) htemp->Clone(
"hist1");
588 size = hist1->GetBinWidth(1);
590 hist1->Rebin(
format.binFactor);
591 num = simData->
dataTree->GetEntries();
592 simData->
dataTree->SetBranchAddress(
"tgt",&target);
594 A = (target/10) - (target/10000)*1000;
595 factor = TMath::Power(3*1.4*TMath::Power(A,(1.0/3.0)),2)*10.0/(2*num*simData->
dcth);
596 hist1->Scale(factor,
"width");
597 int curCol = simData->
color;
598 hist1->SetMarkerColor(curCol);
599 hist1->SetMarkerStyle(markerStyle);
601 hist1->SetLineStyle(2);
602 hist1->SetLineColor(curCol);
605 cout<<
"Nothing was found in the cut of "<<simData->
filename<<endl;
611 leg1->AddEntry(hist1,simData->
title.c_str());
612 hist1->DrawCopy(
"e1 psame");
613 hist1->Draw(
"hist l same");
616 hist1error = (TH1F*) hist1->Clone(
"hist1error");
617 hist1error->SetLineStyle(1);
618 hist1error->DrawCopy(
"e1 same");
622 cout<<
"Something is wrong with data file "<<simData->
filename<<endl;
633 int numFiles =
format.numOfType(
"EXPERIMENTAL");
658 for(j=0;j<numFiles;j++){
659 DataFile* experimental =
format.makeDataFile(j,dDir,
"EXPERIMENTAL");
661 if(
format.type.compare(
"XS")==0){
662 experimental->
dataTuple->Draw(experimental->
cut.c_str(),
"",
"goff");
666 experimental->
dataTree->Draw(experimental->
cols.c_str(),
"",
"goff");
667 data1 =
new TGraphErrors(experimental->
dataTree->GetSelectedRows(),experimental->
dataTree->GetV2(), experimental->
dataTree->GetV1(),0,experimental->
dataTree->GetV3());
669 data1->SetLineStyle(3);
670 data1->SetMarkerColor(experimental->
color);
671 data1->SetMarkerStyle(markerStyle);
673 leg1->AddEntry(data1,experimental->
title.c_str(),
"P");
674 data1->Draw(
"p same");
681 leg1->SetLineWidth(2);
687 string saveName(saveDir);
688 saveName = saveName+
"/"+
format.savename+
".png";
689 cans->SaveAs(saveName.c_str());
693 cout<<
"\nLooking for next record:"<<endl;
694 doCurrent =
format.process(curRecord);
696 cout<<
"No more records found, exiting"<<endl;
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen)