Changeset 169
- Timestamp:
- Jun 16, 2006, 4:57:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MEMPHYS/HEAD/applications/MEMPHYS_analysis.cxx
r168 r169 7 7 #include <iostream> 8 8 9 ////////////////////////////////////////////////////////////////////////////// 10 bool getXYZ( 9 // Lib : 10 #include <Lib/smanip.h> 11 12 ////////////////////////////////////////////////////////////////////////////// 13 bool get_XYZ( 11 14 AIDA::ITuple& aParent 12 15 ,int aColumn … … 63 66 64 67 double dx,dy,dz; 65 if(!get XYZ(*tuple,3,dx,dy,dz)) return false;68 if(!get_XYZ(*tuple,3,dx,dy,dz)) return false; 66 69 67 70 double mass = tuple->getDouble(4); … … 70 73 71 74 double px,py,pz; 72 if(!get XYZ(*tuple,7,px,py,pz)) return false;75 if(!get_XYZ(*tuple,7,px,py,pz)) return false; 73 76 74 77 double start_x,start_y,start_z; 75 if(!get XYZ(*tuple,8,start_x,start_y,start_z)) return false;78 if(!get_XYZ(*tuple,8,start_x,start_y,start_z)) return false; 76 79 77 80 double stop_x,stop_y,stop_z; 78 if(!get XYZ(*tuple,9,stop_x,stop_y,stop_z)) return false;81 if(!get_XYZ(*tuple,9,stop_x,stop_y,stop_z)) return false; 79 82 80 83 int startVol = tuple->getInt(10); … … 175 178 } 176 179 ////////////////////////////////////////////////////////////////////////////// 180 void set_region_style( 181 AIDA::IPlotterRegion& aRegion 182 ) 183 ////////////////////////////////////////////////////////////////////////////// 184 // Taken from G4SPL_analysis.cxx. 185 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 186 { 187 //FIXME : have to do the below with AIDA styles. 188 189 // ROOT is in NDC, then we take a plotter with width = height = 1 190 191 // PAW : 192 //float XSIZ = 20.0F; 193 //float XLAB = 1.4F; 194 //float YSIZ = 20.0F; 195 //float YLAB = 1.4F; 196 197 float XLAB = 1.4F/20.0F; //0.07 //x distance of y title to data frame. 198 float YLAB = 0.8F/20.0F; //0.04 //y distance of x title to data frame. 199 YLAB = 0.05F; //FIXME : cooking. 200 201 // To have a good matching with ROOT for text size : 202 //double majic = 0.014/0.027; 203 double majic = 0.6; 204 std::string s = Lib::smanip::tostring(majic); 205 //FIXME : have methods for the below : 206 aRegion.style().setParameter("textScale",s); 207 aRegion.style().xAxisStyle().setParameter("magStyle.scale",s); 208 aRegion.style().yAxisStyle().setParameter("magStyle.scale",s); 209 aRegion.style().xAxisStyle().tickLabelStyle().setParameter("scale",s); 210 aRegion.style().xAxisStyle().labelStyle().setParameter("scale",s); 211 aRegion.style().yAxisStyle().tickLabelStyle().setParameter("scale",s); 212 aRegion.style().yAxisStyle().labelStyle().setParameter("scale",s); 213 214 // ROOT def margins 0.1. SoPlotter def 0.1. 215 aRegion.layout().setParameter("rightMargin",0.1); 216 aRegion.layout().setParameter("topMargin",0.1); 217 //gStyle->SetPadBottomMargin(0.15); 218 aRegion.layout().setParameter("leftMargin",0.15); 219 //gStyle->SetPadLeftMargin(0.15); 220 aRegion.layout().setParameter("bottomMargin",0.15); 221 222 aRegion.style().setParameter("superposeBins","TRUE"); 223 aRegion.setParameter("plotter.wallStyle.visible","FALSE"); 224 aRegion.setParameter("plotter.gridStyle.visible","FALSE"); 225 226 //std::string font = "Hershey"; //PAW font. 227 //std::string font = "TTF/arialbd"; //Default ROOT font 62. 228 //std::string font = "TTF/couri"; 229 std::string font = "TTF/times"; //= ROOT 132 ? 230 //std::string smoothing = "FALSE"; 231 std::string smoothing = "TRUE"; 232 233 // X axis : 234 aRegion.style().xAxisStyle().tickLabelStyle().setFont(font); 235 aRegion.style().xAxisStyle().tickLabelStyle().setParameter("smoothing",smoothing); 236 aRegion.style().xAxisStyle().labelStyle().setFont(font); 237 aRegion.style().xAxisStyle().labelStyle().setParameter("smoothing",smoothing); 238 aRegion.setParameter("plotter.xAxis.magStyle.fontName",font); 239 aRegion.setParameter("plotter.xAxis.magStyle.smoothing",smoothing); 240 aRegion.style().xAxisStyle().lineStyle().setThickness(2); 241 aRegion.setParameter("plotter.xAxis.ticksStyle.width","2"); 242 aRegion.style().setParameter("topAxisVisible","TRUE"); 243 // Set hplot tick modeling : 244 aRegion.style().xAxisStyle().setParameter("modeling","hplot"); 245 aRegion.style().xAxisStyle().setParameter("divisions","505"); 246 247 // Y axis : 248 //aRegion.style().setParameter("yAxisLogScale","TRUE"); 249 aRegion.style().yAxisStyle().tickLabelStyle().setFont(font); 250 aRegion.style().yAxisStyle().tickLabelStyle().setParameter("smoothing",smoothing); 251 aRegion.style().yAxisStyle().labelStyle().setFont(font); 252 aRegion.style().yAxisStyle().labelStyle().setParameter("smoothing",smoothing); 253 aRegion.setParameter("plotter.yAxis.magStyle.fontName",font); 254 aRegion.setParameter("plotter.yAxis.magStyle.smoothing",smoothing); 255 aRegion.style().yAxisStyle().lineStyle().setThickness(2); 256 aRegion.setParameter("plotter.yAxis.ticksStyle.width","2"); 257 258 //gStyle->SetTitleSize(0.06,"XYZ"); //ROOT def 0.04. SoPlotter : 0.014 259 aRegion.setParameter("plotter.xAxis.titleHeight","0.06"); 260 aRegion.setParameter("plotter.yAxis.titleHeight","0.06"); 261 //gStyle->SetLabelOffset(0.01,"Y"); //ROOT def 0.005. SoPlotter def 0.02 262 aRegion.setParameter("plotter.yAxis.labelToAxis","0.01"); 263 //gStyle->SetTitleOffset(1.1,"Y"); 264 aRegion.setParameter("plotter.yAxis.titleToAxis", 265 Lib::smanip::tostring(1.1*XLAB)); 266 aRegion.setParameter("plotter.xAxis.titleToAxis", 267 Lib::smanip::tostring(1.1*YLAB)); 268 //gStyle->SetLabelSize(0.05,"XYZ"); //ROOT def 0.04. SoPlotter def 0.014. 269 aRegion.setParameter("plotter.yAxis.labelHeight","0.05"); 270 aRegion.setParameter("plotter.xAxis.labelHeight","0.05"); 271 272 aRegion.style().setParameter("rightAxisVisible","TRUE"); 273 // Set hplot tick modeling : 274 aRegion.style().yAxisStyle().setParameter("modeling","hplot"); 275 aRegion.style().yAxisStyle().setParameter("divisions","505"); 276 277 // title : 278 aRegion.style().setParameter("titleHeight","0.04"); 279 aRegion.style().setParameter("titleToAxis","0.02"); 280 aRegion.style().titleStyle().textStyle().setFont(font); 281 aRegion.style().titleStyle().textStyle().setParameter("smoothing",smoothing); 282 aRegion.style().titleStyle().textStyle().setColor("0 0 1"); 283 284 // legend box : 285 aRegion.setParameter("legendRegionVisible","TRUE"); 286 aRegion.setParameter("legendRegion.viewportRegion.backgroundColor","1 1 0"); 287 aRegion.setParameter("legendRegionSize","0.15 0.16"); 288 aRegion.setParameter("legendRegionOrigin","0.1 0.1"); 289 aRegion.setParameter("legendRegion.horizontalMargin","2"); 290 aRegion.setParameter("legendRegion.verticalMargin","2"); 291 292 // Frame : 293 aRegion.setParameter("plotter.innerFrameStyle.lineWidth","2"); 294 } 295 ////////////////////////////////////////////////////////////////////////////// 177 296 bool plot( 178 297 AIDA::IAnalysisFactory& aAIDA … … 201 320 plotter->createRegions(1,2,0); 202 321 203 plotter->setCurrentRegionNumber(0); 204 plotter->currentRegion().plot(aHisto1D); 205 206 plotter->setCurrentRegionNumber(1); 207 plotter->currentRegion().plot(aHisto2D); 208 322 {plotter->setCurrentRegionNumber(0); 323 AIDA::IPlotterRegion& region = plotter->currentRegion(); 324 set_region_style(region); 325 region.style().xAxisStyle().setLabel("time"); 326 region.style().yAxisStyle().setLabel("Entries"); 327 region.plot(aHisto1D);} 328 329 {plotter->setCurrentRegionNumber(1); 330 AIDA::IPlotterRegion& region = plotter->currentRegion(); 331 set_region_style(region); 332 region.style().xAxisStyle().setLabel("time"); 333 region.style().yAxisStyle().setLabel("PE"); 334 region.plot(aHisto2D);} 209 335 210 336 plotter->show(); … … 314 440 315 441 int nentries = tuple->rows(); 316 // intnentries = 100000;317 //intnentries = 40;442 //nentries = 100000; 443 nentries = 40; 318 444 std::cout << header 319 445 << "traitements de " << nentries << " entrees"
Note: See TracChangeset
for help on using the changeset viewer.