PamCut: TofCuts/TofBetaRigCut/TofBetaRigCut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# TofCuts/TofBetaRigCut/TofBetaRigCut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * TofBetaRigCut.cpp
    00003  *
    00004  *  Created on: 13-mar-2009
    00005  *      Author: Sergio Ricciarini, Nicola Mori
    00006  */
    00007
    00010 #include "TofBetaRigCut.h"
    00011
    00012 int TofBetaRigCut::Check(PamLevel2 *event) {
    00013
    00014   TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();
    00015
    00016   Int_t seqno = trkTrack->GetSeqNo();
    00017   Int_t ntrack_tof = 0;
    00018   for (Int_t i = 0; i < event->GetToFLevel2()->ntrk(); i++) {
    00019     if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == seqno)
    00020       ntrack_tof = i;
    00021   }
    00022   Float_t betaModTof = fabs(event->GetToFLevel2()->CalcBeta(ntrack_tof, 10., 10., 20.)); // beta[12]
    00023
    00024   //  Float_t rigMod = _mass*fabs(beta)*pow((1-pow(beta,2)),-0.5)/abs(_charge);
    00025
    00026   Float_t betaModTrk = (trkTrack->GetRigidity() * abs(_charge)) / pow(pow(trkTrack->GetRigidity() * _charge, 2) + pow(
    00027       _mass, 2), 0.5);
    00028
    00029 #ifdef DEBUGPAMCUT
    00030
    00031   h_trk_vs_tof_betamod[0]->Fill(betaModTof,betaModTrk);
    00032
    00033 #endif
    00034
    00035   if (fabs(betaModTof - betaModTrk) > _threshold * betaModTof) {
    00036     return 0;
    00037   }
    00038
    00039 #ifdef DEBUGPAMCUT
    00040
    00041   h_trk_vs_tof_betamod[1]->Fill(betaModTof,betaModTrk);
    00042
    00043 #endif
    00044
    00045   return CUTOK;
    00046 }