/[PAMELA software]/DarthVader/ToFLevel2/src/ToFLevel2.cpp
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/ToFLevel2.cpp

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

revision 1.31 by mocchiut, Fri Feb 5 12:51:44 2010 UTC revision 1.33 by mocchiut, Tue Nov 9 15:21:02 2010 UTC
# Line 1505  void ToFdEdx::Init(Int_t gg, Int_t hh, F Line 1505  void ToFdEdx::Init(Int_t gg, Int_t hh, F
1505        
1506  };  };
1507  //------------------------------------------------------------------------  //------------------------------------------------------------------------
1508  void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof)  void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat)
1509  {  {
1510    // the parameters should be already initialised by InitPar()    // the parameters should be already initialised by InitPar()
1511    Clear();    Clear();
# Line 1524  void ToFdEdx::Process(UInt_t atime, Floa Line 1524  void ToFdEdx::Process(UInt_t atime, Floa
1524    //    //
1525        
1526    
1527      //--------------------- TABLE OF PERIODS WITH HV PROBLEMS ----------------------------
1528      
1529      int Aconn=conn[0];    // PMT 0,20,22,24
1530      int Bconn=conn[1];    // PMT 6,12,26,34
1531      int Cconn=conn[2];    // PMT 4,14,28,32
1532      int Dconn=conn[3];    // PMT 2,8,10,30
1533      int Econn=conn[4];    // PMT 42,43,44,47
1534      int Fconn=conn[5];    // PMT 7,19,23,27
1535      int Gconn=conn[6];    // PMT 3,11,25,33
1536      int Hconn=conn[7];    // PMT 1,9,13,21
1537      int Iconn=conn[8];    // PMT 5,29,31,35
1538      int Lconn=conn[9];    // PMT 37,40,45,46
1539      int Mconn=conn[10];    // PMT 15,16,17,18
1540      int Nconn=conn[11];    // PMT 36,38,39,41
1541      if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings
1542        
1543    for( int ii=0; ii<48; ii++ ) {    for( int ii=0; ii<48; ii++ ) {
1544      //      //
1545      //    printf(" ii %i beta %f atime %u xtr 1 %f ytr 1 %f adc %f \n",ii,betamean,atime,xtr_tof[0],ytr_tof[0],adc[ii]);      //    printf(" ii %i beta %f atime %u xtr 1 %f ytr 1 %f adc %f \n",ii,betamean,atime,xtr_tof[0],ytr_tof[0],adc[ii]);
1546      if( adc[ii] >= PMTsat[ii]-5 )  continue;  
1547      if( adc[ii] <= 0. )            continue;      if( adc[ii] >= 4095 ){
1548          eDEDXpmt[ii] = 0.;
1549          continue; // EMILIANO
1550        };
1551    
1552        if( adc[ii] >= (PMTsat[ii]-5) && adc[ii] != 4095 ){
1553          eDEDXpmt[ii] = 1000.;
1554          continue; // EMILIANO
1555        };
1556    
1557        if( adc[ii] <= 0. ) {
1558          eDEDXpmt[ii] = 1500.;
1559          continue;
1560        };
1561      //      //
1562      double adcpC   = f_adcPC( adc[ii] );    // - adc conversion in pC      double adcpC   = f_adcPC( adc[ii] );    // - adc conversion in pC
1563      double adccorr = adcpC*fabs(cos(theta));      if ( exitat == 0 ){
1564      //        eDEDXpmt[ii]=(Float_t)adcpC;
1565      if(adccorr<=0.)           continue;        continue;
1566        }
     //--------------------- TABLE OF PERIODS WITH HV PROBLEMS ----------------------------  
1567    
1568      int Aconn=conn[0];    // PMT 0,20,22,24      double adccorr = adcpC*fabs(cos(theta));    
1569      int Bconn=conn[1];    // PMT 6,12,26,34      if(adccorr<=0.)           continue;
1570      int Cconn=conn[2];    // PMT 4,14,28,32      if ( exitat == 1 ){
1571      int Dconn=conn[3];    // PMT 2,8,10,30        eDEDXpmt[ii]=(Float_t)adccorr;
1572      int Econn=conn[4];    // PMT 42,43,44,47        continue;
1573      int Fconn=conn[5];    // PMT 7,19,23,27      }
     int Gconn=conn[6];    // PMT 3,11,25,33  
     int Hconn=conn[7];    // PMT 1,9,13,21  
     int Iconn=conn[8];    // PMT 5,29,31,35  
     int Lconn=conn[9];    // PMT 37,40,45,46  
     int Mconn=conn[10];    // PMT 15,16,17,18  
     int Nconn=conn[11];    // PMT 36,38,39,41  
1574    
1575      //    int standard=0;      //    int standard=0;
     if( false ) cout << Gconn << Iconn << Lconn <<endl;  
1576      int S115B_ok=0;      int S115B_ok=0;
1577      int S115B_break=0;      int S115B_break=0;
1578    
# Line 1570  void ToFdEdx::Process(UInt_t atime, Floa Line 1591  void ToFdEdx::Process(UInt_t atime, Floa
1591      adclin=-2;      adclin=-2;
1592      dEdx=-2;      dEdx=-2;
1593      Zeta=-2;      Zeta=-2;
1594        Double_t correction = 1.;
1595    
1596      if(Aconn==1 && (ii==0 || ii==20 || ii==22 || ii==24)){      if(Aconn==1 && (ii==0 || ii==20 || ii==22 || ii==24)){
1597        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.675;        correction = 1.675;
1598      }      }
1599      else if(Bconn==1 && (ii==6 || ii==12 || ii==26 || ii==34)){      else if(Bconn==1 && (ii==6 || ii==12 || ii==26 || ii==34)){
1600        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/2.482;        correction = 2.482;
1601      }      }
1602      else if(Cconn==1 && (ii==4 || ii==14 || ii==28 || ii==32)){      else if(Cconn==1 && (ii==4 || ii==14 || ii==28 || ii==32)){
1603        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.464;        correction = 1.464;
1604      }      }
1605      else if(Dconn==1 && (ii==2 || ii==8 || ii==10 || ii==30)){      else if(Dconn==1 && (ii==2 || ii==8 || ii==10 || ii==30)){
1606        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.995;        correction = 1.995;
1607      }      }
1608      else if(Econn==1 && (ii==42 || ii==43 || ii==44 || ii==47)){      else if(Econn==1 && (ii==42 || ii==43 || ii==44 || ii==47)){
1609        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.273;        correction = 1.273;
1610      }      }
1611      else if(Fconn==1 && (ii==7 || ii==19 || ii==23 || ii==27)){      else if(Fconn==1 && (ii==7 || ii==19 || ii==23 || ii==27)){
1612        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.565;        correction = 1.565;
1613      }      }
1614      else if(Mconn==1 && (ii==15 || ii==16 || ii==17 || ii==18)){      else if(Mconn==1 && (ii==15 || ii==16 || ii==17 || ii==18)){
1615        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.565;        correction = 1.565;
1616      }      }
1617      else if(Nconn==1 && (ii==36 || ii==38 || ii==39 || ii==41)){      else if(Nconn==1 && (ii==36 || ii==38 || ii==39 || ii==41)){
1618        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.018;        correction = 1.018;
1619      }      }
1620      else if(Hconn==1 && (ii==1 || ii==13 || ii==21 || (ii==9&&S115B_ok==1))){      else if(Hconn==1 && (ii==1 || ii==13 || ii==21 || (ii==9&&S115B_ok==1))){
1621        adcHe   = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.84;        correction = 1.84;
     }  
     else if(S115B_break==1 && ii==9 && Hconn==0){  
       adcHe   = f_att5B( ytr_tof[0] );   //N.B.: this function refers to the Carbon!!!  
1622      }      }
1623      else if(S115B_break==1 && ii==9 && Hconn==1){      else if(S115B_break==1 && ii==9 && Hconn==1){
1624        adcHe   = (f_att5B( ytr_tof[0] ))/1.64;        correction = 1.64;
1625      }      }
1626      else  adcHe   = Get_adc_he(ii, xtr_tof, ytr_tof);      else correction = 1.;
1627        
1628        if( S115B_break==1 ){
1629          adcHe   = f_att5B( ytr_tof[0] )/correction;
1630        } else {
1631          adcHe   = Get_adc_he(ii, xtr_tof, ytr_tof)/correction;
1632        };
1633      if(adcHe<=0)   continue;      if(adcHe<=0)   continue;
1634        if ( exitat == 2 ){
1635          if(ii==9 && S115B_break==1)  eDEDXpmt[ii]=36.*(Float_t)adccorr/adcHe;
1636          else  adclin  = 4.*(Float_t)adccorr/adcHe;
1637          continue;
1638        }
1639    
1640      if(ii==9 && S115B_break==1)  adcnorm = f_pos5B(adccorr);      if(ii==9 && S115B_break==1)  adcnorm = f_pos5B(adccorr);
1641      else adcnorm = f_pos( (parPos[ii]), adccorr);      else adcnorm = f_pos( (parPos[ii]), adccorr);
   
1642      if(adcnorm<=0) continue;      if(adcnorm<=0) continue;
   
1643      if(ii==9 && S115B_break==1)  adclin  = 36.*adcnorm/adcHe;      if(ii==9 && S115B_break==1)  adclin  = 36.*adcnorm/adcHe;
1644      else  adclin  = 4.*adcnorm/adcHe;      else  adclin  = 4.*adcnorm/adcHe;
   
1645      if(adclin<=0)  continue;      if(adclin<=0)  continue;
1646        if ( exitat == 3 ){
1647          if(ii==9 && S115B_break==1)  eDEDXpmt[ii]=(Float_t)adclin;
1648          else  eDEDXpmt[ii]=(Float_t)adclin;
1649          continue;
1650        }
1651      //      //
1652      if ( betamean > 99. ){      if ( betamean > 99. ){
1653        //      eDEDXpmt.AddAt((Float_t)adclin,ii);        //      eDEDXpmt.AddAt((Float_t)adclin,ii);
# Line 1634  void ToFdEdx::Process(UInt_t atime, Floa Line 1665  void ToFdEdx::Process(UInt_t atime, Floa
1665        else                       dEdxHe = parBBpos[ii];        else                       dEdxHe = parBBpos[ii];
1666      }      }
1667            
1668      if(dEdxHe<=0)  continue;      
1669        if(dEdxHe<=0){
1670          eDEDXpmt[ii]=(Float_t)adclin;
1671          continue;
1672        };
1673    
1674      if(ii==9 && S115B_break==1)  dEdx = f_desatBB5B( adclin );      if(ii==9 && S115B_break==1)  dEdx = f_desatBB5B( adclin );
1675      else  dEdx = f_desatBB((parDesatBB[ii]), adclin );      else  dEdx = f_desatBB((parDesatBB[ii]), adclin );
1676    
1677      if(dEdx<=0)    continue;      if(dEdx<=0){
1678          eDEDXpmt[ii]=(Float_t)adclin;
1679          continue;
1680        };
1681    
1682      eDEDXpmt[ii]=(Float_t)dEdx;      eDEDXpmt[ii]=(Float_t)dEdx;
1683      //    eDEDXpmt.AddAt((Float_t)dEdx,ii);      //    eDEDXpmt.AddAt((Float_t)dEdx,ii);

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.23