/[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.32 by mocchiut, Mon Oct 25 13:22:11 2010 UTC revision 1.35 by mocchiut, Tue Dec 20 14:16:37 2011 UTC
# Line 1422  ToFdEdx::ToFdEdx() Line 1422  ToFdEdx::ToFdEdx()
1422    memset(conn,0,12*sizeof(Bool_t));    memset(conn,0,12*sizeof(Bool_t));
1423    memset(ts,0,12*sizeof(UInt_t));    memset(ts,0,12*sizeof(UInt_t));
1424    memset(te,0,12*sizeof(UInt_t));    memset(te,0,12*sizeof(UInt_t));
1425      eDEDXpmt = new TArrayF(48);
1426    Define_PMTsat();    Define_PMTsat();
1427    Clear();    Clear();
1428  }  }
1429    
1430    ToFdEdx::~ToFdEdx(){
1431      Clear();
1432      Delete();
1433    }
1434    
1435    void ToFdEdx::Delete(Option_t *option){
1436      if ( eDEDXpmt ){
1437        eDEDXpmt->Set(0);
1438        if ( eDEDXpmt) delete eDEDXpmt;
1439      }
1440    }
1441    
1442  //------------------------------------------------------------------------  //------------------------------------------------------------------------
1443  void ToFdEdx::CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc)  void ToFdEdx::CheckConnectors(UInt_t atime, GL_PARAM *glparam, TSQLServer *dbc)
1444  {  {
# Line 1466  void ToFdEdx::Clear(Option_t *option) Line 1480  void ToFdEdx::Clear(Option_t *option)
1480  {  {
1481    //    //
1482    // Set arrays and initialize structure    // Set arrays and initialize structure
1483    eDEDXpmt.Set(48);    eDEDXpmt.Reset(-1);   // Set array size  and reset structure    //  eDEDXpmt.Set(48);    eDEDXpmt.Reset(-1);   // Set array size  and reset structure
1484      eDEDXpmt->Set(48);    eDEDXpmt->Reset(-1);   // Set array size  and reset structure
1485    //    //
1486  };  };
1487    
# Line 1508  void ToFdEdx::Init(Int_t gg, Int_t hh, F Line 1523  void ToFdEdx::Init(Int_t gg, Int_t hh, F
1523  void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat)  void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat)
1524  {  {
1525    // the parameters should be already initialised by InitPar()    // the parameters should be already initialised by InitPar()
1526      //  printf(" in process \n");
1527    Clear();    Clear();
1528    
1529   // define angle:     // define angle:  
# Line 1540  void ToFdEdx::Process(UInt_t atime, Floa Line 1556  void ToFdEdx::Process(UInt_t atime, Floa
1556    int Nconn=conn[11];    // PMT 36,38,39,41    int Nconn=conn[11];    // PMT 36,38,39,41
1557    if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings    if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings
1558            
1559      //  printf(" size %i \n",eDEDXpmt.GetSize());
1560    for( int ii=0; ii<48; ii++ ) {    for( int ii=0; ii<48; ii++ ) {
1561      //      //
1562        //    eDEDXpmt.SetAt(-1.,ii);
1563      //    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]);
1564      //    if( adc[ii] >= PMTsat[ii]-5 )  continue; // EMILIANO  
1565      if( adc[ii] <= 0. )            continue;      if( adc[ii] >= 4095. ){
1566          //      eDEDXpmt[ii] = 0.;
1567          eDEDXpmt->AddAt(0.,ii);
1568          continue; // EMILIANO
1569        };
1570    
1571        if( adc[ii] >= (PMTsat[ii]-5.) && adc[ii] < 4095. ){
1572          eDEDXpmt->AddAt(1000.,ii);
1573          continue; // EMILIANO
1574        };
1575    
1576        if( adc[ii] <= 0. ) {
1577          eDEDXpmt->AddAt(1500.,ii);
1578          continue;
1579        };
1580      //      //
1581      double adcpC   = f_adcPC( adc[ii] );    // - adc conversion in pC      double adcpC   = f_adcPC( adc[ii] );    // - adc conversion in pC
1582      if ( exitat == 0 ){      if ( exitat == 0 ){
1583        eDEDXpmt[ii]=(Float_t)adcpC;        eDEDXpmt->AddAt((Float_t)adcpC,ii);
1584        continue;        continue;
1585      }      }
1586        //    printf(" e qua? \n");
1587    
1588      double adccorr = adcpC*fabs(cos(theta));          double adccorr = adcpC*fabs(cos(theta));    
1589      if(adccorr<=0.)           continue;      if(adccorr<=0.)           continue;
1590      if ( exitat == 1 ){      if ( exitat == 1 ){
1591        eDEDXpmt[ii]=(Float_t)adccorr;        eDEDXpmt->AddAt((Float_t)adccorr,ii);
1592        continue;        continue;
1593      }      }
1594        //    printf(" e quo? \n");
1595    
1596      //    int standard=0;      //    int standard=0;
1597      int S115B_ok=0;      int S115B_ok=0;
# Line 1568  void ToFdEdx::Process(UInt_t atime, Floa Line 1602  void ToFdEdx::Process(UInt_t atime, Floa
1602    
1603    
1604      //------------------------------------------------------------------------      //------------------------------------------------------------------------
1605        //    printf(" e qui? \n");
1606      //---------------------------------------------------- Z reconstruction      //---------------------------------------------------- Z reconstruction
1607    
1608      double adcHe, adcnorm, adclin, dEdx, Zeta;      double adcHe, adcnorm, adclin, dEdx, Zeta;
# Line 1612  void ToFdEdx::Process(UInt_t atime, Floa Line 1646  void ToFdEdx::Process(UInt_t atime, Floa
1646      }      }
1647      else correction = 1.;      else correction = 1.;
1648            
1649      if( S115B_break==1 ){      if( ii==9 && S115B_break==1 ){
1650        adcHe   = f_att5B( ytr_tof[0] )/correction;        adcHe   = f_att5B( ytr_tof[0] )/correction;
1651      } else {      } else {
1652        adcHe   = Get_adc_he(ii, xtr_tof, ytr_tof)/correction;        adcHe   = Get_adc_he(ii, xtr_tof, ytr_tof)/correction;
1653      };      };
1654      if(adcHe<=0)   continue;      if(adcHe<=0)   continue;
1655      if ( exitat == 2 ){      if ( exitat == 2 ){
1656        if(ii==9 && S115B_break==1)  eDEDXpmt[ii]=36.*(Float_t)adccorr/adcHe;        if(ii==9 && S115B_break==1)  eDEDXpmt->AddAt(36.*(Float_t)adccorr/adcHe,ii);
1657        else  adclin  = 4.*(Float_t)adccorr/adcHe;        else  adclin  = 4.*(Float_t)adccorr/adcHe;
1658        continue;        continue;
1659      }      }
# Line 1631  void ToFdEdx::Process(UInt_t atime, Floa Line 1665  void ToFdEdx::Process(UInt_t atime, Floa
1665      else  adclin  = 4.*adcnorm/adcHe;      else  adclin  = 4.*adcnorm/adcHe;
1666      if(adclin<=0)  continue;      if(adclin<=0)  continue;
1667      if ( exitat == 3 ){      if ( exitat == 3 ){
1668        if(ii==9 && S115B_break==1)  eDEDXpmt[ii]=(Float_t)adclin;        if(ii==9 && S115B_break==1)  eDEDXpmt->AddAt((Float_t)adclin,ii);
1669        else  eDEDXpmt[ii]=(Float_t)adclin;        else  eDEDXpmt->AddAt((Float_t)adclin,ii);
1670        continue;        continue;
1671      }      }
1672      //      //
1673      if ( betamean > 99. ){      if ( betamean > 99. ){
1674        //      eDEDXpmt.AddAt((Float_t)adclin,ii);        //      eDEDXpmt.AddAt((Float_t)adclin,ii);
1675        eDEDXpmt[ii]=(Float_t)adclin;        eDEDXpmt->AddAt((Float_t)adclin,ii);
1676        //      printf(" AAPMT IS %i dedx is %f vector is %f \n",ii,adclin,eDEDXpmt[ii]);        //      printf(" AAPMT IS %i dedx is %f vector is %f \n",ii,adclin,eDEDXpmt[ii]);
1677        continue;        continue;
1678      };      };
# Line 1654  void ToFdEdx::Process(UInt_t atime, Floa Line 1688  void ToFdEdx::Process(UInt_t atime, Floa
1688            
1689            
1690      if(dEdxHe<=0){      if(dEdxHe<=0){
1691        eDEDXpmt[ii]=(Float_t)adclin;        eDEDXpmt->AddAt((Float_t)adclin,ii);
1692        continue;        continue;
1693      };      };
1694    
# Line 1662  void ToFdEdx::Process(UInt_t atime, Floa Line 1696  void ToFdEdx::Process(UInt_t atime, Floa
1696      else  dEdx = f_desatBB((parDesatBB[ii]), adclin );      else  dEdx = f_desatBB((parDesatBB[ii]), adclin );
1697    
1698      if(dEdx<=0){      if(dEdx<=0){
1699        eDEDXpmt[ii]=(Float_t)adclin;        eDEDXpmt->AddAt((Float_t)adclin,ii);
1700        continue;        continue;
1701      };      };
1702    
1703      eDEDXpmt[ii]=(Float_t)dEdx;      eDEDXpmt->AddAt((Float_t)dEdx,ii);
1704      //    eDEDXpmt.AddAt((Float_t)dEdx,ii);      //    eDEDXpmt.AddAt((Float_t)dEdx,ii);
1705    
1706      //    printf(" PMT IS %i dedx is %f vector is %f \n",ii,dEdx,eDEDXpmt[ii]);      //    printf(" PMT IS %i dedx is %f vector is %f \n",ii,dEdx,eDEDXpmt[ii]);

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.23