/[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.16 by mocchiut, Fri Nov 27 10:30:29 2009 UTC revision 1.19 by mocchiut, Tue May 18 04:03:29 2010 UTC
# Line 283  CaloLat::CaloLat(PamLevel2 *l2p){   Line 283  CaloLat::CaloLat(PamLevel2 *l2p){  
283    //    //
284    suf = "";    suf = "";
285    debug = false;    debug = false;
286      usepl18x = false;
287    //    //
288  };  };
289    
# Line 300  Calo2D::Calo2D(PamLevel2 *l2p){   Line 301  Calo2D::Calo2D(PamLevel2 *l2p){  
301    //    //
302    suf = "";    suf = "";
303    debug = false;    debug = false;
304      usepl18x = false;
305    //    //
306  };  };
307    
# Line 527  void CaloLat::Process(){ Line 529  void CaloLat::Process(){
529    //    //
530    for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){    for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){
531      mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1);      mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1);
532        //
533        if ( !usepl18x && view1==0 && plane1==18 ) mip1 = 0.;
534        //
535      estrip[view1][plane1][strip1] = mip1;      estrip[view1][plane1][strip1] = mip1;
536    };    };
537    //    //
# Line 574  void Calo2D::Process(){ Line 579  void Calo2D::Process(){
579    //    //
580    for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){    for (Int_t i=0; i<L2->GetCaloLevel1()->istrip ; i++){
581      mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1);      mip1 = L2->GetCaloLevel1()->DecodeEstrip(i,view1,plane1,strip1);
582        //
583        if ( !usepl18x && view1==0 && plane1==18 ) mip1 = 0.;
584        //
585      es[view1][plane1][strip1] = mip1;      es[view1][plane1][strip1] = mip1;
586    };    };
587    //    //
# Line 663  CaloLong::CaloLong(PamLevel2 *l2p){   Line 671  CaloLong::CaloLong(PamLevel2 *l2p){  
671    mask18b = -1;    mask18b = -1;
672    //    //
673    no18x = true;    no18x = true;
674      usepl18x = !no18x;
675    debug = false;    debug = false;
676    maskXE = false;    maskXE = false;
677    maskXO = false;    maskXO = false;
# Line 681  CaloLong::CaloLong(PamLevel2 *l2p){   Line 690  CaloLong::CaloLong(PamLevel2 *l2p){  
690    //  lmipth = 100.;    //  lmipth = 100.;
691    lmipth = 0.;    lmipth = 0.;
692    //    //
693      lfit = 0;
694  };  };
695    
696    TF1 *CaloLong::GetFit(){
697    //  TString fnam=Form("lfit%s",suf.Data());
698    //  TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));
699      if ( lfit ) return lfit;
700      return NULL;
701    }
702    
703  void CaloLong::MaskSection(TString sec){  void CaloLong::MaskSection(TString sec){
704    sec.ToUpper();    sec.ToUpper();
705    if ( sec.Contains("XO") ) maskXO = true;    if ( sec.Contains("XO") ) maskXO = true;
# Line 731  void CaloLong::Print(){ Line 748  void CaloLong::Print(){
748    Fit();    Fit();
749    //    //
750    printf("==================== Calorimeter Longitudinal Profile =======================\n");    printf("==================== Calorimeter Longitudinal Profile =======================\n");
751    printf(" OBT: %u PKT: %u ATIME: %u \n",OBT,PKT,atime);    printf(" OBT: %u PKT: %u ATIME: %u suf %s \n",OBT,PKT,atime,suf.Data());
752    printf(" fitresult:.. %i\n",fitresult);    printf(" fitresult:.. %i\n",fitresult);
753    printf(" chi2     :.. %f\n",chi2);    printf(" chi2     :.. %f\n",chi2);
754    printf(" ndf      :.. %f\n",ndf);    printf(" ndf      :.. %f\n",ndf);
# Line 849  void CaloLong::Process(){ Line 866  void CaloLong::Process(){
866    Bool_t gof = true;    Bool_t gof = true;
867    for (Int_t i=0; i < L2->GetCaloLevel1()->istrip; i++){    for (Int_t i=0; i < L2->GetCaloLevel1()->istrip; i++){
868      mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip);      mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip);
869        //
870        if ( !usepl18x && view==0 && plane==18 ) mip = 0.;
871        //
872      gof = true;      gof = true;
873      if ( maskXE && (plane%2)==0 && view==1 ) gof = false;      if ( maskXE && (plane%2)==0 && view==1 ) gof = false;
874      if ( maskXO && (plane%2)!=0 && view==1 ) gof = false;      if ( maskXO && (plane%2)!=0 && view==1 ) gof = false;
# Line 1166  void CaloLong::Fit(Bool_t draw){ Line 1186  void CaloLong::Fit(Bool_t draw){
1186          exx[numpo] = 0.1;          exx[numpo] = 0.1;
1187          yyy[numpo] = enemip;          yyy[numpo] = enemip;
1188          eyy[numpo] = sqrt(enemip*3.)+sqrt(5.);          eyy[numpo] = sqrt(enemip*3.)+sqrt(5.);
1189          //      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;
1190          if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.;          if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.;
1191          if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.;          if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.;
1192          //if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.;          //if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.;
# Line 1203  void CaloLong::Fit(Bool_t draw){ Line 1223  void CaloLong::Fit(Bool_t draw){
1223            exx[numpo] = 0.1;            exx[numpo] = 0.1;
1224            yyy[numpo] = enemip;            yyy[numpo] = enemip;
1225            eyy[numpo] = sqrt(enemip*3.)+sqrt(5.);            eyy[numpo] = sqrt(enemip*3.)+sqrt(5.);
1226          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;
1227              //if ( xpos > letmax && enemip > lmipth && heavytail ) eyy[numpo] = (sqrt(enemip*3.)+sqrt(5.))/numpo;
1228              if ( xpos > letmax && enemip > lmipth && heavytail) eyy[numpo] = sqrt(enemip)/5.;
1229              if ( xpos > letmax-1 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 5.;
1230            //if ( xpos > letmax-2 && xpos < letmax+1 && heavytail ) eyy[numpo] /= 7.;
1231              if ( xpos < 3. && heavytail ) eyy[numpo] /= 5.;        
1232            //      eyy[numpo] = sqrt(enemip)/(st*0.95);            //      eyy[numpo] = sqrt(enemip)/(st*0.95);
1233            numpo++;            numpo++;
1234            //      th->Fill(xpos,enemip);            //      th->Fill(xpos,enemip);
# Line 1241  void CaloLong::Fit(Bool_t draw){ Line 1266  void CaloLong::Fit(Bool_t draw){
1266    th = new TH2F(thid,thid,1000,-0.2,xmax,1000,0.,emax*1.2);    th = new TH2F(thid,thid,1000,-0.2,xmax,1000,0.,emax*1.2);
1267    gh = new TGraphErrors(numpo,xxx,yyy,exx,eyy);    gh = new TGraphErrors(numpo,xxx,yyy,exx,eyy);
1268    TString fnam=Form("lfit%s",suf.Data());    TString fnam=Form("lfit%s",suf.Data());
1269    TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));  //  TF1 *lfit  = dynamic_cast<TF1*>(gDirectory->FindObject(fnam));
1270    if ( lfit ) lfit->Delete();    if ( lfit ) lfit->Delete();
1271    lfit = new TF1(fnam,ccurve,0.,xmax,3);    lfit = new TF1(fnam,ccurve,0.,xmax,3);
1272  //   if ( !lfit ){  //   if ( !lfit ){

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.23