Changeset 2681 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc


Ignore:
Timestamp:
Apr 20, 2005, 7:03:24 PM (20 years ago)
Author:
cmv
Message:

1-/ pour n/proj pas de display si histo existe ET pas d'option graphiques donnees
2-/ gestion correcte de la superposition d'histo 1D dans n/plot nt.x

L'histo pour le 2ieme display est dimensionne comme le premier.

(ajout de l'option graphique keepbin)

cmv 20/04/2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pawexecut.cc

    r2670 r2681  
    1919#include "nomgadapter.h"
    2020#include "pistdimgapp.h"
     21#include "pihisto.h"
    2122
    2223#ifdef SANS_EVOLPLANCK
     
    4546
    4647kw = "n/plot";
    47 usage = "Plot NTuple variables a la paw (alias n/pl)";
     48usage = "Plot NTuple variables \"a la paw\" (alias n/pl)";
    4849usage += "\n n/plot nameobj.x_exp [cut] [w_exp] [loop] [gratt]";
    4950usage += "\n n/plot nameobj.y_exp%x_exp [cut] [loop] [gratt]";
    5051usage += "\n n/plot nameobj.z_exp%y_exp%x_exp [cut] [loop] [gratt]";
    5152usage += "\n        for default use ! , loop=i1[:i2[:di]]";
     53usage += "\n for 1 dimensional (1D) projection:";
     54usage += "\n   use graphic option \"keepbin\" to superimpose";
     55usage += "\n   1D distribution with the same binning";
    5256usage += "\n  Related commands: plot2dw plot3d"; 
    5357piac->RegisterCommand(kw,usage,this,hgrp);
     
    5862usage += "\n n/proj nameproj nameobj.y_exp%x_exp [cut] [w_exp] [loop] [gratt]";
    5963usage += "\n        for default use ! , loop=i1[:i2[:di]]";
     64usage += "\n for 1 dimensional (1D) projection:";
     65usage += "\n   no display is performed if \"nameproj\" is an existing histogram";
     66usage += "\n   unless a graphic option \"gratt\" is given";
    6067usage += "\n  Related commands: projh1d projh2d projprof exptovec"; 
    6168piac->RegisterCommand(kw,usage,this,hgrp);
     
    375382      nameproj += buff;
    376383    }
     384    // --- Si option "keepbin" on projete avec le meme binning que l'histo 1D precedent
     385    if(dopt.find("keepbin")<dopt.size()) {
     386      PIStdImgApp* piimapp = omg.GetImgApp();
     387      if(piimapp) {
     388        PIBaseWdg* pibwdg = piimapp->CurrentBaseWdg();
     389        if(pibwdg) {
     390          int nbdrw = pibwdg->NbDrawers();
     391          if(nbdrw>0) {
     392            for(int i=nbdrw-1;i>=0;i--) {
     393              PIDrawer* pidwr = pibwdg->GetDrawer(i);
     394              PIHisto* pih = NULL;
     395              if( (pih = dynamic_cast<PIHisto *>(pidwr))==NULL ) continue;
     396              Histo* h = pih->Histogram();
     397              if(h==NULL) continue;
     398              if(h->NBins()<1) continue;
     399              Histo* hsame = new Histo(h->XMin(),h->XMax(),h->NBins());
     400              omg.AddObj(hsame,nameproj);
     401              // on force donc le display sur le meme plot
     402              dopt += " same";
     403              break;
     404            }
     405          }
     406        }
     407      }
     408    }
     409    // ---
    377410  }
    378411  srvo->ProjectH1(nameobj,expx,expwt,expcut,nameproj,dopt,loop);
Note: See TracChangeset for help on using the changeset viewer.