/[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.44 by mocchiut, Thu Feb 26 14:35:01 2015 UTC revision 1.46 by pam-fi, Tue May 19 10:49:14 2015 UTC
# Line 304  Int_t ToFLevel2::GetTrueNHitPaddles(Int_ Line 304  Int_t ToFLevel2::GetTrueNHitPaddles(Int_
304   * @param adcflag in the plane (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; )   * @param adcflag in the plane (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; )
305   */   */
306  Float_t ToFLevel2::GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl){  Float_t ToFLevel2::GetdEdx(Int_t notrack, Int_t plane, Int_t adcfl){
307    ToFTrkVar *trk = GetToFTrkVar(notrack);  //  ToFTrkVar *trk = GetToFTrkVar(notrack);
308        ToFTrkVar *trk = GetToFStoredTrack(notrack);//Elena 2015
309    return this->GetdEdx(trk, plane, adcfl);    return this->GetdEdx(trk, plane, adcfl);
310  }  }
311    
# Line 319  Float_t ToFLevel2::GetdEdx(Int_t notrack Line 320  Float_t ToFLevel2::GetdEdx(Int_t notrack
320   * The method was modified for the "ToF-standalone" part in february 2015   * The method was modified for the "ToF-standalone" part in february 2015
321   * The "adcfl" option is not very useful (an artificial dEdx is per   * The "adcfl" option is not very useful (an artificial dEdx is per
322   * definition= 1 mip and not a real measurement), anyway left in the code   * definition= 1 mip and not a real measurement), anyway left in the code
323   * @param trk Pointer to TofTrkVar class   * @param trk Pointer to TofTrkVar object
324   * @param plane Plane index (0,1,2,3,4,5)   * @param plane Plane index (0,1,2,3,4,5)
325   * @param adcflag in the plane (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; )   * @param adcflag in the plane (100<-> independent of the adcflag; !=0&&!=100 <-> at least one PMT with adcflag!=0; )
326   */   */
# Line 330  Float_t ToFLevel2::GetdEdx(ToFTrkVar *tr Line 331  Float_t ToFLevel2::GetdEdx(ToFTrkVar *tr
331    Int_t SatWarning;    Int_t SatWarning;
332    Int_t pad=-1;    Int_t pad=-1;
333    //    //
334      if(!trk) cout << "ToFLevel2::GetdEdx(...) ---> NULL ToFTrkVar obj "<<endl;
335    if(!trk) return 0; //ELENA    if(!trk) return 0; //ELENA
336    //    //
337    // ToF standalone part    // ToF standalone part
# Line 453  Int_t ToFLevel2::GetPlaneIndex(Int_t pmt Line 455  Int_t ToFLevel2::GetPlaneIndex(Int_t pmt
455   */   */
456  Int_t ToFLevel2::GetPMTid(Int_t hh, Int_t kk){  Int_t ToFLevel2::GetPMTid(Int_t hh, Int_t kk){
457    //    //
458    short tof[4][24] = {    static const short tof[4][24] = {
459      {4, 4,  4,  4,  1,  1, 2, 2,  3,  3, 3, 3,  3,  3, 1, 1,  1,  1, 2, 3,  3, 3, 3,  4},      {4, 4,  4,  4,  1,  1, 2, 2,  3,  3, 3, 3,  3,  3, 1, 1,  1,  1, 2, 3,  3, 3, 3,  4},
460      {1, 3,  5,  7, 10, 12, 2, 4,  2,  4, 6, 8, 10, 12, 1, 5,  3,  9, 7, 9, 11, 1, 5,  9},      {1, 3,  5,  7, 10, 12, 2, 4,  2,  4, 6, 8, 10, 12, 1, 5,  3,  9, 7, 9, 11, 1, 5,  9},
461      {2, 2,  2,  2,  1,  1, 1, 1,  4,  4, 4, 4,  4,  4, 2, 1,  2,  1, 2, 2,  2, 3, 3,  4},      {2, 2,  2,  2,  1,  1, 1, 1,  4,  4, 4, 4,  4,  4, 2, 1,  2,  1, 2, 2,  2, 3, 3,  4},
# Line 489  Int_t ToFLevel2::GetPMTid(Int_t hh, Int_ Line 491  Int_t ToFLevel2::GetPMTid(Int_t hh, Int_
491   */   */
492  void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){  void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){
493    //    //
494    short tof[4][24] = {    static const short tof[4][24] = {
495      {4, 4,  4,  4,  1,  1, 2, 2,  3,  3, 3, 3,  3,  3, 1, 1,  1,  1, 2, 3,  3, 3, 3,  4},      {4, 4,  4,  4,  1,  1, 2, 2,  3,  3, 3, 3,  3,  3, 1, 1,  1,  1, 2, 3,  3, 3, 3,  4},
496      {1, 3,  5,  7, 10, 12, 2, 4,  2,  4, 6, 8, 10, 12, 1, 5,  3,  9, 7, 9, 11, 1, 5,  9},      {1, 3,  5,  7, 10, 12, 2, 4,  2,  4, 6, 8, 10, 12, 1, 5,  3,  9, 7, 9, 11, 1, 5,  9},
497      {2, 2,  2,  2,  1,  1, 1, 1,  4,  4, 4, 4,  4,  4, 2, 1,  2,  1, 2, 2,  2, 3, 3,  4},      {2, 2,  2,  2,  1,  1, 1, 1,  4,  4, 4, 4,  4,  4, 2, 1,  2,  1, 2, 2,  2, 3, 3,  4},
# Line 529  void ToFLevel2::GetPMTIndex(Int_t ind, I Line 531  void ToFLevel2::GetPMTIndex(Int_t ind, I
531   */   */
532  void ToFLevel2::GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning){  void ToFLevel2::GetdEdxPaddle(Int_t notrack, Int_t paddleid, Int_t adcfl, Float_t &PadEdx, Int_t &SatWarning){
533    
534    ToFTrkVar *trk = GetToFTrkVar(notrack);  //  ToFTrkVar *trk = GetToFTrkVar(notrack);
535        ToFTrkVar *trk = GetToFStoredTrack(notrack); //Elena 2015
536    this->GetdEdxPaddle(trk, paddleid, adcfl, PadEdx, SatWarning);    this->GetdEdxPaddle(trk, paddleid, adcfl, PadEdx, SatWarning);
537        
538  };  };
# Line 579  void ToFLevel2::GetdEdxPaddle(ToFTrkVar Line 582  void ToFLevel2::GetdEdxPaddle(ToFTrkVar
582    Int_t pmt_id = -1;    Int_t pmt_id = -1;
583    Float_t adcraw[48];    Float_t adcraw[48];
584    //    //
585      if(!trk)cout << "ToFLevel2::GetdEdxPaddle(...) ---> NULL ToFTrkVar obj "<<endl;
586    if(!trk) return; //ELENA    if(!trk) return; //ELENA
587    //    //
588    
# Line 649  TString ToFLevel2::GetPMTName(Int_t ind, Line 653  TString ToFLevel2::GetPMTName(Int_t ind,
653        
654    TString pmtname = " ";    TString pmtname = " ";
655        
656    TString photoS[48] = {    static const TString photoS[48] = {
657      "S11_1A", "S11_1B", "S11_2A", "S11_2B", "S11_3A", "S11_3B", "S11_4A",      "S11_1A", "S11_1B", "S11_2A", "S11_2B", "S11_3A", "S11_3B", "S11_4A",
658      "S11_4B",      "S11_4B",
659      "S11_5A", "S11_5B", "S11_6A", "S11_6B", "S11_7A", "S11_7B", "S11_8A",      "S11_5A", "S11_5B", "S11_6A", "S11_6B", "S11_7A", "S11_7B", "S11_8A",
# Line 1109  Int_t ToFLevel2::GetNPaddle(Int_t plane) Line 1113  Int_t ToFLevel2::GetNPaddle(Int_t plane)
1113   * @param cut on chi2   * @param cut on chi2
1114   */   */
1115    
 Float_t ToFLevel2::CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut){  
1116    
1117  //  cout<<" in CalcBeta "<<resmax<<" "<<chi2cut<<" "<<qualitycut<<endl;  Float_t ToFTrkVar::CalcBeta( Float_t resmax, Float_t qualitycut, Float_t chi2cut){
1118    
1119    
1120    Float_t bxx = 100.;    Float_t bxx = 100.;
1121    //    //
1122    ToFTrkVar *trk = GetToFTrkVar(notrack);    ToFTrkVar *trk = this;
   if(!trk) return 0; //ELENA  
1123    
1124    
1125    Float_t chi2,xhelp,beta_mean;    Float_t chi2,xhelp,beta_mean;
# Line 1143  Float_t  w_il[6]; Line 1146  Float_t  w_il[6];
1146    for (Int_t i=0; i<trk->npmttdc; i++){    for (Int_t i=0; i<trk->npmttdc; i++){
1147      //      //
1148      pmt_id = (trk->pmttdc).At(i);      pmt_id = (trk->pmttdc).At(i);
1149      pmt_plane = GetPlaneIndex(pmt_id);      pmt_plane = ToFLevel2::GetPlaneIndex(pmt_id);
1150      tdcfl = (trk->tdcflag).At(i);      tdcfl = (trk->tdcflag).At(i);
1151      if (w_il[pmt_plane] != 1.) w_il[pmt_plane] = tdcfl; //tdcflag      if (w_il[pmt_plane] != 1.) w_il[pmt_plane] = tdcfl; //tdcflag
1152                                       };                                       };
# Line 1230  Int_t ibot[12] = {4,5,4,5,4,5,4,5,2,3,2, Line 1233  Int_t ibot[12] = {4,5,4,5,4,5,4,5,2,3,2,
1233    //    //
1234    return(bxx);    return(bxx);
1235  };  };
1236    ////////////////////////////////////////////////////
1237    ////////////////////////////////////////////////////
1238    /**
1239     * See ToFTrkVar::CalcBeta(Float_t,Float_t, Float_t).
1240     */
1241    Float_t ToFLevel2::CalcBeta(Int_t notrack, Float_t resmax, Float_t qualitycut, Float_t chi2cut){
1242    
1243    //  cout<<" in CalcBeta "<<resmax<<" "<<chi2cut<<" "<<qualitycut<<endl;
1244    
1245      ToFTrkVar *trk = GetToFTrkVar(notrack);
1246      if(!trk) return 0; //ELENA
1247    
1248      return trk->CalcBeta(resmax,qualitycut,chi2cut);
1249    
1250    };
1251    
1252    
1253  ////////////////////////////////////////////////////  ////////////////////////////////////////////////////

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.23