/[PAMELA software]/calo/flight/CaloProfile/src/CaloProfile.cpp
ViewVC logotype

Diff of /calo/flight/CaloProfile/src/CaloProfile.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by mocchiut, Thu Aug 13 15:56:39 2009 UTC revision 1.12 by mocchiut, Mon Aug 17 15:00:36 2009 UTC
# Line 995  void CaloLong::Fit(){ Line 995  void CaloLong::Fit(){
995    this->Fit(false);    this->Fit(false);
996  };  };
997    
998  Float_t CaloLong::Evaluate(TString s, Float_t tmax){  Float_t CaloLong::Evaluate(TString s, Float_t tmax, Float_t X0pl){
999    /* SAMPLE OUTPUT:    /* SAMPLE OUTPUT:
1000       Enter Infix Expression : A + B + C / (E - F)       Enter Infix Expression : A + B + C / (E - F)
1001       Postfix Expression is : A B + C E F - / +         Postfix Expression is : A B + C E F - / +  
1002    */      */  
1003    if ( !s.Contains("t") ){    if ( !s.Contains("tmax") && !s.Contains("X0pl") ){
1004      printf(" ERROR, the input formula must contain \"t\"\n");      printf(" ERROR, the input formula must contain \"t\"\n");
1005      return 0.;      return 0.;
1006    };    };
# Line 1009  Float_t CaloLong::Evaluate(TString s, Fl Line 1009  Float_t CaloLong::Evaluate(TString s, Fl
1009      return 0.;      return 0.;
1010    };    };
1011    TString g=Form("%f",tmax);    TString g=Form("%f",tmax);
1012      TString h=Form("%f",X0pl);
1013    TString *ts= new TString("");    TString *ts= new TString("");
1014    ts->Prepend(s.Data());    ts->Prepend(s.Data());
1015    ts->ReplaceAll("t",1,g.Data(),g.Capacity());    ts->ReplaceAll("tmax",4,g.Data(),g.Capacity());
1016      ts->ReplaceAll("X0pl",4,h.Data(),h.Capacity());
1017    ts->Prepend("(");    ts->Prepend("(");
1018    ts->Append(")");    ts->Append(")");
1019    if ( debug )  printf(" ts %s tssize %i capac %i s %s g %s \n",ts->Data(),ts->Sizeof(),ts->Capacity(),s.Data(),g.Data());    if ( debug )  printf(" ts %s tssize %i capac %i s %s g %s \n",ts->Data(),ts->Sizeof(),ts->Capacity(),s.Data(),g.Data());
# Line 1265  void CaloLong::Fit(Bool_t draw){ Line 1267  void CaloLong::Fit(Bool_t draw){
1267      asymm = -1.;      asymm = -1.;
1268      defE0 = -1.;      defE0 = -1.;
1269    } else {    } else {
1270      if ( slmax.MaybeRegexp() ) lmax = this->Evaluate(slmax,tmax);      if ( slmax.MaybeRegexp() ) lmax = this->Evaluate(slmax,tmax,X0pl);
1271      if ( sumax.MaybeRegexp() ) umax = this->Evaluate(sumax,tmax);      if ( sumax.MaybeRegexp() ) umax = this->Evaluate(sumax,tmax,X0pl);
1272      Int_t npp = 1000;      Int_t npp = 1000;
1273      double *xpp=new double[npp];      double *xpp=new double[npp];
1274      double *wpp=new double[npp];      double *wpp=new double[npp];

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23