/[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.14 by mocchiut, Thu Sep 10 12:53:57 2009 UTC revision 1.15 by mocchiut, Mon Sep 14 13:56:50 2009 UTC
# Line 704  void CaloLong::UnMaskSection(TString sec Line 704  void CaloLong::UnMaskSection(TString sec
704    
705  void CaloLong::Clear(){  void CaloLong::Clear(){
706    //    //
707      if ( debug ) printf(" Clear called \n");
708      //
709    memset(eplane,0, 2*22*sizeof(Float_t));    memset(eplane,0, 2*22*sizeof(Float_t));
710    //    //
711    chi2 = 0.;    chi2 = 0.;
# Line 856  void CaloLong::Process(){ Line 858  void CaloLong::Process(){
858    //    //
859    // inclination factor (stolen from Daniele's code)    // inclination factor (stolen from Daniele's code)
860    //    //
861    Float_t ytgx = 0;    Float_t ytgx = 0.;
862    Float_t ytgy = 0;    Float_t ytgy = 0.;
863    ytgx = 0.76 * clp->tanx[0];    ytgx = 0.76 * clp->tanx[0];
864    ytgy = 0.76 * clp->tany[0];      ytgy = 0.76 * clp->tany[0];  
865    X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) );    X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) );
# Line 951  void CaloLong::SetEnergies(Float_t myene Line 953  void CaloLong::SetEnergies(Float_t myene
953      };      };
954    };    };
955    //    //
956      if ( !clp && debug ) printf(" ERROR!! no CaloLevel2 obj!!\n");
957      //
958    // inclination factor (stolen from Daniele's code)    // inclination factor (stolen from Daniele's code)
959    //    //
960    Float_t ytgx = 0;    Float_t ytgx = 0.;
961    Float_t ytgy = 0;    Float_t ytgy = 0.;
962    ytgx = 0.76 * clp->tanx[0];    ytgx = 0.76 * clp->tanx[0];
963    ytgy = 0.76 * clp->tany[0];      ytgy = 0.76 * clp->tany[0];  
964    X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) );    X0pl = sqrt( pow(0.76,2.) + pow(ytgx,2.) + pow(ytgy,2.) );
965      if ( debug ) printf(" X0pl %f tanx %f tany %f \n",X0pl,ytgx,ytgy);
966    //    //
967    // Find experimental plane of maximum    // Find experimental plane of maximum
968    //    //
# Line 978  void CaloLong::SetEnergies(Float_t myene Line 983  void CaloLong::SetEnergies(Float_t myene
983    //    //
984    if ( vmax == 0 ) pmax++;    if ( vmax == 0 ) pmax++;
985    etmax = pmax * X0pl;    etmax = pmax * X0pl;
986    if ( letmax < 0. ) letmax = etmax;    letmax = etmax;
987    //    //
988    if ( debug ) this->Print();    if ( debug ) this->Print();
989    if ( debug ) printf(" exit \n");    if ( debug ) printf(" exit \n");
# Line 1163  void CaloLong::Fit(Bool_t draw){ Line 1168  void CaloLong::Fit(Bool_t draw){
1168          if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo;          if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo;
1169          numpo++;          numpo++;
1170          //      th->Fill(xpos,enemip);          //      th->Fill(xpos,enemip);
1171          if ( debug ) printf(" AVE Filling: st %i xpos %f energy %f \n",st,xpos,enemip);          if ( debug ) printf(" AVE Filling: st %i xpos %f energy %f error %f letmax %f lmpith %f \n",st,xpos,enemip,eyy[numpo-1],letmax,lmipth);
1172        };        };
1173      } else {      } else {
1174        for (Int_t jj=0; jj<2; jj++){        for (Int_t jj=0; jj<2; jj++){
# Line 1234  void CaloLong::Fit(Bool_t draw){ Line 1239  void CaloLong::Fit(Bool_t draw){
1239    TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));    TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));
1240    if ( lfit ) lfit->Delete();    if ( lfit ) lfit->Delete();
1241    lfit = new TF1(fnam,ccurve,0.,xmax,3);    lfit = new TF1(fnam,ccurve,0.,xmax,3);
1242    //   if ( !lfit ){
1243    //     lfit = new TF1(fnam,ccurve,0.,xmax,3);
1244    //   };
1245    //   lfit->Clear();
1246    //   lfit->SetName(fnam);
1247    //   lfit->SetRange(0.,xmax);
1248    //  lfit->Print();
1249      //
1250    if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz);    if ( debug ) printf("qtot %f qtotparz %f \n",clp->qtot,qtotparz);
1251    E0 = qtotparz;    E0 = qtotparz;
1252    //  E0 = clp->qtot;    //  E0 = clp->qtot;
# Line 1257  void CaloLong::Fit(Bool_t draw){ Line 1270  void CaloLong::Fit(Bool_t draw){
1270    if ( debug ) printf(" OK, start the fitting procedure... options: %s \n",optio.Data());    if ( debug ) printf(" OK, start the fitting procedure... options: %s \n",optio.Data());
1271    //    //
1272    //  fitresult = th->Fit("lfit",optio);    //  fitresult = th->Fit("lfit",optio);
1273      //  lfit->Update();
1274    fitresult = gh->Fit("lfit",optio);    fitresult = gh->Fit("lfit",optio);
1275      //  fitresult = gh->Fit("lfit","ROQW");
1276    //    //
1277    if ( debug ) printf(" the fit is done! result: %i \n",fitresult);    if ( debug ) printf(" the fit is done! result: %i \n",fitresult);
1278    //    //
# Line 1301  void CaloLong::Fit(Bool_t draw){ Line 1316  void CaloLong::Fit(Bool_t draw){
1316      delete w;      delete w;
1317      delete xp;      delete xp;
1318      delete wp;      delete wp;
1319        delete xpp;
1320        delete wpp;
1321      //    Float_t i10max = lfit->Integral(0.,10.*tmax);      //    Float_t i10max = lfit->Integral(0.,10.*tmax);
1322      if ( debug ) printf(" Integral: %f \n",i10max);      if ( debug ) printf(" Integral: %f \n",i10max);
1323      //      //
# Line 1351  void CaloLong::Fit(Bool_t draw){ Line 1368  void CaloLong::Fit(Bool_t draw){
1368      if ( th ) th->Delete();      if ( th ) th->Delete();
1369    };    };
1370    //    //
1371    //   gMinuit->SetPrintLevel(1);
1372    //   gMinuit->mnamin();
1373    //   //  gMinuit->mnfree(0);
1374    //   gMinuit->mncler();
1375    //   gMinuit->mnrset(1);
1376      //  gMinuit->Delete();
1377      //ROOT::Math::Minimizer::Clear();
1378      //  gMinuit->mnhelp("*");
1379      //
1380    //  delete lfit;    //  delete lfit;
1381    //    //
1382  };  };

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.23