/[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.10 by mocchiut, Mon Aug 17 08:36:29 2009 UTC revision 1.12 by mocchiut, Tue Aug 18 09:24:51 2009 UTC
# Line 99  void CaloEnergy::Set(){ Line 99  void CaloEnergy::Set(){
99    fXemin = 1000;    fXemin = 1000;
100    fYomin = 1000;    fYomin = 1000;
101    fYemin = 1000;    fYemin = 1000;
102      //
103  }  }
104    
105  void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){  void CaloEnergy::SetMinimumContainment(TString section, Int_t plane){
# Line 190  void CaloEnergy::DefineGeometry(){ Line 191  void CaloEnergy::DefineGeometry(){
191    // Use CaloStrip to determine once the position of border strips for each section    // Use CaloStrip to determine once the position of border strips for each section
192    //    //
193    //    //
194    fM = 2. + 0.096; // real position from cbar    //  fM = 2. + 0.096; // real position from cbar BUG the 0.096 is already taken into account in the border calculation made by Giovanna
195    //  fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc.    fM = 2. ; // real position from cbar
196    fM1 = 2. - 0.122 + 0.096; // due to calculation of xe1 etc.    //  fM1 = 2. - 0.122 - 0.096; // due to calculation of xe1 etc. BUG! this way we count from the silicon border not from the silicon sensitive area
197      fM1 = 2. - 0.122 - 0.096 + 0.096; // due to calculation of xe1 etc.
198    if ( fM1 < 0. ) fM1 = 0.;    if ( fM1 < 0. ) fM1 = 0.;
199    //    //
200    CaloStrip *cs = new CaloStrip(fSimu);    CaloStrip *cs = new CaloStrip(fSimu);
# Line 217  void CaloEnergy::DefineGeometry(){ Line 219  void CaloEnergy::DefineGeometry(){
219    cs->Set(1,0,95);    cs->Set(1,0,95);
220    xe6= cs->GetY();    xe6= cs->GetY();
221    
222      //  printf(" xe1 %f xe2 %f xe3 %f xe4 %f xe5 %f xe6 %f \n",xe1,xe2,xe3,xe4,xe5,xe6);
223    
224    // view x plane 0 strip 0    // view x plane 0 strip 0
225    cs->Set(0,0,0);    cs->Set(0,0,0);
226    yo1= cs->GetX();    yo1= cs->GetX();
# Line 237  void CaloEnergy::DefineGeometry(){ Line 241  void CaloEnergy::DefineGeometry(){
241    cs->Set(0,0,95);    cs->Set(0,0,95);
242    yo6= cs->GetX();    yo6= cs->GetX();
243    
     
244    // view y plane 1 strip 0    // view y plane 1 strip 0
245    cs->Set(1,1,0);    cs->Set(1,1,0);
246    xo1= cs->GetY();    xo1= cs->GetY();
# Line 278  void CaloEnergy::DefineGeometry(){ Line 281  void CaloEnergy::DefineGeometry(){
281    cs->Set(0,1,95);    cs->Set(0,1,95);
282    ye6= cs->GetX();    ye6= cs->GetX();
283    
284      //printf(" ye1 %f ye2 %f ye3 %f ye4 %f ye5 %f ye6 %f \n",ye1,ye2,ye3,ye4,ye5,ye6);
285      
286    //    //
287    for (Int_t p = 0; p<22; p ++){    for (Int_t p = 0; p<22; p ++){
288      for (Int_t v = 0; v<2; v++ ){        for (Int_t v = 0; v<2; v++ ){  
# Line 316  void CaloEnergy::Clear(){ Line 321  void CaloEnergy::Clear(){
321    yomax_en= 0.;    yomax_en= 0.;
322    yemax_en= 0.;    yemax_en= 0.;
323    //    //
324   memset(enstrip,0,2*22*96*(sizeof(Float_t)));      memset(enstrip,0,2*22*96*(sizeof(Float_t)));  
325    en = 0.;    en = 0.;
326    view = 0;    view = 0;
327    plane = 0;    plane = 0;
# Line 338  void CaloEnergy::Clear(){ Line 343  void CaloEnergy::Clear(){
343    memset(en_xop,0,11*sizeof(Float_t));    memset(en_xop,0,11*sizeof(Float_t));
344    memset(en_yop,0,11*sizeof(Float_t));    memset(en_yop,0,11*sizeof(Float_t));
345    //    //
346      fColumn = -1;
347      memset(encol,0,2*3*sizeof(Float_t));
348      //
349  }  }
350    
351  void CaloEnergy::Print(){  void CaloEnergy::Print(){
# Line 370  void CaloEnergy::Print(){ Line 378  void CaloEnergy::Print(){
378    printf(" fM1     :.............. %f \n",fM1);    printf(" fM1     :.............. %f \n",fM1);
379    printf(" fRad    :.............. %i \n",fRad);    printf(" fRad    :.............. %i \n",fRad);
380    printf(" fPl     :.............. %i \n",fPl);    printf(" fPl     :.............. %i \n",fPl);
381      printf(" fColumn :.............. %i \n",fColumn);
382    printf(" fConv_rxe ............. %f \n",fConv_rxe);    printf(" fConv_rxe ............. %f \n",fConv_rxe);
383    printf(" fConv_rxo ............. %f \n",fConv_rxo);    printf(" fConv_rxo ............. %f \n",fConv_rxo);
384    printf(" fConv_ryo ............. %f \n",fConv_ryo);    printf(" fConv_ryo ............. %f \n",fConv_ryo);
# Line 459  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 468  Bool_t CaloEnergy::IsInsideAcceptance(TS
468      enstrip[view][plane][strip]=en;      enstrip[view][plane][strip]=en;
469    };    };
470    //    //
471      if ( debug && ((fM1+0.122-0.244*(Float_t)fRad) < 0.) ) printf("Error: (fM1+0.122-0.244*(Float_t)fRad) < 0. fM1 %f fRad %i %f \n",fM1,fRad,(fM1+0.122-0.244*(Float_t)fRad));
472      //
473    // sum energy plane by plane for each sections    // sum energy plane by plane for each sections
474    //    //
475    for (Int_t i=0;i<11;i++){    for (Int_t i=0;i<11;i++){
476      for(strip=0; strip<96; strip++) {      for(strip=0; strip<96; strip++) {
477        if ( fRad < 0 ){        if ( fRad < 0 ){
478          //          //
479          // run over all the strips of the plane          // run over all the strips of the plane
480          //          //
481          en_xep[i] += enstrip[1][2*i][strip];          en_xep[i] += enstrip[1][2*i][strip];
482          en_yop[i] += enstrip[0][2*i][strip];          en_yop[i] += enstrip[0][2*i][strip];
# Line 475  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 486  Bool_t CaloEnergy::IsInsideAcceptance(TS
486          //          //
487          // use only the strips inside a cylinder of given radius fRad          // use only the strips inside a cylinder of given radius fRad
488          //          //
489          if ( strip >= cl2->cibar[2*i][1]-1-fRad &&  strip <= cl2->cibar[2*i][1]-1+fRad ) en_xep[i] += enstrip[1][2*i][strip];          if ( cl2->cibar[2*i][1] >= 1 && cl2->cibar[2*i][1] <= 96 && (strip >= (cl2->cibar[2*i][1]-1-fRad)) &&  (strip <= (cl2->cibar[2*i][1]-1+fRad)) ) en_xep[i] += enstrip[1][2*i][strip];
490          if ( strip >= cl2->cibar[2*i][0]-1-fRad &&  strip <= cl2->cibar[2*i][0]-1+fRad ) en_yop[i] += enstrip[0][2*i][strip];          if ( cl2->cibar[2*i][0] >= 1 && cl2->cibar[2*i][0] <= 96 && (strip >= (cl2->cibar[2*i][0]-1-fRad)) &&  (strip <= (cl2->cibar[2*i][0]-1+fRad)) ) en_yop[i] += enstrip[0][2*i][strip];
491          if ( strip >= cl2->cibar[(2*i)+1][1]-1-fRad &&  strip <= cl2->cibar[(2*i)+1][1]-1+fRad ) en_xop[i] += enstrip[1][(2*i)+1][strip];          if ( cl2->cibar[(2*i)+1][1] >= 1 && cl2->cibar[(2*i)+1][1] <= 96 && (strip >= (cl2->cibar[(2*i)+1][1]-1-fRad)) &&  (strip <= (cl2->cibar[(2*i)+1][1]-1+fRad)) ) en_xop[i] += enstrip[1][(2*i)+1][strip];
492          if ( strip >= cl2->cibar[(2*i)+1][0]-1-fRad &&  strip <= cl2->cibar[(2*i)+1][0]-1+fRad ) en_yep[i] += enstrip[0][(2*i)+1][strip];          if ( cl2->cibar[(2*i)+1][0] >= 1 && cl2->cibar[(2*i)+1][0] <= 96 && (strip >= (cl2->cibar[(2*i)+1][0]-1-fRad)) &&  (strip <= (cl2->cibar[(2*i)+1][0]-1+fRad)) ) en_yep[i] += enstrip[0][(2*i)+1][strip];
493        };        };
494      };      };
495      energyxe += en_xep[i];      energyxe += en_xep[i];
# Line 656  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 667  Bool_t CaloEnergy::IsInsideAcceptance(TS
667    //    //
668    // for each plane of the calorimeter find the position of the track in the direction along the strip (where we do not have a measurement from the selected plane) by looking at the plane above/below of the other view and extrapolating the trajectory to the given plane    // for each plane of the calorimeter find the position of the track in the direction along the strip (where we do not have a measurement from the selected plane) by looking at the plane above/below of the other view and extrapolating the trajectory to the given plane
669    //    //
   Float_t  track_coordx[22][2];  
   Float_t  track_coordy[22][2];  
670    //    //
671    Float_t tgx_cl2;    Float_t tgx_cl2;
672    Float_t tgy_cl2;      Float_t tgy_cl2;  
# Line 667  Bool_t CaloEnergy::IsInsideAcceptance(TS Line 676  Bool_t CaloEnergy::IsInsideAcceptance(TS
676    for (Int_t p=0; p<22; p++){        for (Int_t p=0; p<22; p++){    
677      track_coordy[p][1] = cl2->cbar[p][1];      track_coordy[p][1] = cl2->cbar[p][1];
678      track_coordx[p][1] = cl2->cbar[p][0] - fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2;      track_coordx[p][1] = cl2->cbar[p][0] - fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2;
679        //    track_coordx[p][1] = cl2->cbar[p][0] + fabs(trk_z[p][1]-trk_z[p][0])*tgx_cl2;
680      track_coordx[p][0] = cl2->cbar[p][0];      track_coordx[p][0] = cl2->cbar[p][0];
681      track_coordy[p][0] = cl2->cbar[p][1] - fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2;      track_coordy[p][0] = cl2->cbar[p][1] - fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2;
682        //    track_coordy[p][0] = cl2->cbar[p][1] + fabs(trk_z[p][1]-trk_z[p][0])*tgy_cl2;
683      if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f  track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]);      if ( debug ) printf(" p %i track_coordy[p][1] %f track_coordx[p][1] %f track_coordx[p][0] %f  track_coordy[p][0] %f \n",p,track_coordy[p][1],track_coordx[p][1],track_coordx[p][0],track_coordy[p][0]);
684    };    };
685    //    //

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

  ViewVC Help
Powered by ViewVC 1.1.23