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

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

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

revision 1.6 by mocchiut, Tue Aug 11 13:32:04 2009 UTC revision 1.10 by mocchiut, Mon Aug 17 08:36:29 2009 UTC
# Line 46  void CaloEnergy::UseCaloPreSampler(){ Line 46  void CaloEnergy::UseCaloPreSampler(){
46  //   cp->ForceCaloFit();  //   cp->ForceCaloFit();
47  //   cp->SetDebug(true);  //   cp->SetDebug(true);
48  //   cp->Process();  //   cp->Process();
49      if ( clong ) clong->SetCaloLevel2Pointer(cp->GetLevel2Pointer());
50  }  }
51    
52    
# Line 190  void CaloEnergy::DefineGeometry(){ Line 191  void CaloEnergy::DefineGeometry(){
191    //    //
192    //    //
193    fM = 2. + 0.096; // real position from cbar    fM = 2. + 0.096; // real position from cbar
194    fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc.    //  fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc.
195      fM1 = 2. - 0.122 + 0.096; // due to calculation of xe1 etc.
196    if ( fM1 < 0. ) fM1 = 0.;    if ( fM1 < 0. ) fM1 = 0.;
197    //    //
198    CaloStrip *cs = new CaloStrip(fSimu);    CaloStrip *cs = new CaloStrip(fSimu);
# Line 377  void CaloEnergy::Print(){ Line 379  void CaloEnergy::Print(){
379    printf(" energyxo:.............. %f \n",energyxo);    printf(" energyxo:.............. %f \n",energyxo);
380    printf(" energyye:.............. %f \n",energyye);    printf(" energyye:.............. %f \n",energyye);
381    printf(" energyyo:.............. %f \n",energyyo);    printf(" energyyo:.............. %f \n",energyyo);
382      printf(" fXEen_maxplane:........ %f \n",fXEen_maxplane);
383      printf(" fXOen_maxplane:........ %f \n",fXOen_maxplane);
384      printf(" fYEen_maxplane:........ %f \n",fYEen_maxplane);
385      printf(" fYOen_maxplane:........ %f \n",fYOen_maxplane);
386    printf(" x0max   :.............. %f \n",x0max);    printf(" x0max   :.............. %f \n",x0max);
387    printf(" debug   :.............. %i \n",debug);    printf(" debug   :.............. %i \n",debug);
388    
# Line 538  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 544  Bool_t CaloEnergy::IsInsideAcceptance(TS
544      Int_t wpl = (Int_t)roundf(x0max/0.76);      Int_t wpl = (Int_t)roundf(x0max/0.76);
545      Bool_t isY = false;      Bool_t isY = false;
546      if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true;      if ( ((x0max/0.76)-(Float_t)wpl) > 0. ) isY = true;
547        xomax_en = 0.;
548        yemax_en = 0.;
549        xemax_en = 0.;
550        yomax_en = 0.;
551        //
552      if ( !(wpl%2) ){      if ( !(wpl%2) ){
553        // 0, 2, 4, ...        // 0, 2, 4, ...
554        if ( isY ){        if ( isY ){
555          yomax_en = 1000.;          if ( section.Contains("YO") ) yomax_en = 1000.;
556          xemax_en = 500.;          if ( section.Contains("XE") ) xemax_en = 500.;
557          fMax_planeyo=wpl/2;          fMax_planeyo=wpl/2;
558          fMax_planexe=wpl/2;          fMax_planexe=wpl/2;
559            if ( section.Contains("XO") ) xomax_en = 10.;
560            if ( section.Contains("YE") ) yemax_en = 5.;
561        } else {        } else {
562          yomax_en = 500.;          if ( section.Contains("YO") ) yomax_en = 500.;
563          xemax_en = 1000.;          if ( section.Contains("XE") ) xemax_en = 1000.;
564          fMax_planeyo=wpl/2;          fMax_planeyo=wpl/2;
565          fMax_planexe=wpl/2;          fMax_planexe=wpl/2;
566            if ( section.Contains("XO") ) xomax_en = 5.;
567            if ( section.Contains("YE") ) yemax_en = 10.;
568        };        };
       yomax_en = 0.;  
       xemax_en = 0.;  
569      } else {      } else {
570        // 1, 3, 5, ...        // 1, 3, 5, ...
571        if ( isY ){        if ( isY ){
572          yemax_en = 1000.;          if ( section.Contains("YE") ) yemax_en = 1000.;
573          xomax_en = 500.;          if ( section.Contains("XO") ) xomax_en = 500.;
574          fMax_planeye=(wpl-1)/2;          fMax_planeye=(wpl-1)/2;
575          fMax_planexo=(wpl-1)/2;          fMax_planexo=(wpl-1)/2;
576            if ( section.Contains("XE") ) xemax_en = 10.;
577            if ( section.Contains("YO") ) yomax_en = 5.;
578        } else {        } else {
579          yemax_en = 500.;          if ( section.Contains("YE") ) yemax_en = 500.;
580          xomax_en = 1000.;          if ( section.Contains("XO") ) xomax_en = 1000.;
581          fMax_planeye=(wpl-1)/2;          fMax_planeye=(wpl-1)/2;
582          fMax_planexo=(wpl-1)/2;          fMax_planexo=(wpl-1)/2;
583            if ( section.Contains("XE") ) xemax_en = 5.;
584            if ( section.Contains("YO") ) yomax_en = 10.;
585        };        };
       yemax_en = 0.;  
       xomax_en = 0.;  
586      };      };
587      if ( debug ) printf(" x0max %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo);      if ( debug ) printf(" x0max %f x0max/0.76 %f wpl %i isY %i yomax_en %f xemax_en %f yemax_en %f xomax_en %f fMaxplane %i %i %i %i\n",x0max,(x0max/0.76),wpl,isY,yomax_en,xemax_en,yemax_en,xomax_en,fMax_planeyo,fMax_planexe,fMax_planeye,fMax_planexo);
588    };    };
589    //    //
590    Int_t nPl = fPl;    Int_t nPl = fPl;
# Line 712  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 727  Bool_t CaloEnergy::IsInsideAcceptance(TS
727      // event is contained (or partially contained) hence we can integrate energy up to the maximum and calculate the energy as measured by this section      // event is contained (or partially contained) hence we can integrate energy up to the maximum and calculate the energy as measured by this section
728      //      //
729      if ( fXosel ){      if ( fXosel ){
730        for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++) fXOen_maxplane += en_xop[iplm];        for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexo+nPl)) ;iplm++){        
731            fXOen_maxplane += en_xop[iplm];
732            if ( debug ) printf(" XO iplm %i fXOen_maxplane %f  en_xop[iplm] %f\n",iplm,fXOen_maxplane,en_xop[iplm]);
733          };
734        fEnergyxo = fXOen_maxplane/fConv_rxo;        fEnergyxo = fXOen_maxplane/fConv_rxo;
735      };      };
736    };    };
# Line 761  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 779  Bool_t CaloEnergy::IsInsideAcceptance(TS
779        fXesel = true;        fXesel = true;
780      };      };
781      if ( fXesel ){      if ( fXesel ){
782        for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++) fXEen_maxplane += en_xep[iplm];        for (Int_t iplm=0;iplm<=TMath::Min(10,(Int_t)(fMax_planexe+nPl)) ;iplm++){
783            fXEen_maxplane += en_xep[iplm];
784            if ( debug ) printf(" XE iplm %i fXOen_maxplane %f  en_xop[iplm] %f\n",iplm,fXEen_maxplane,en_xep[iplm]);
785          };
786        fEnergyxe = fXEen_maxplane/fConv_rxe;        fEnergyxe = fXEen_maxplane/fConv_rxe;
787      };      };
788    };      };  
# Line 971  void CaloEnergy::Process(TString section Line 992  void CaloEnergy::Process(TString section
992        } else {        } else {
993          clong->Fit();          clong->Fit();
994        };              };      
995        fXOen_maxplane = clong->Get_E0();        if ( clong->GetLowerLimit() != 0. || clong->GetUpperLimit() != 0. ){
996            fXOen_maxplane = clong->Get_defE0();
997          } else {
998            fXOen_maxplane = clong->Get_E0();
999          };
1000          fMax_plane = clong->Get_tmax();
1001        fYOen_maxplane  = 0.;        fYOen_maxplane  = 0.;
1002        fYEen_maxplane = 0.;        fYEen_maxplane = 0.;
1003        fXEen_maxplane = 0.;        fXEen_maxplane = 0.;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.23