PamCut: TofCuts/TofDedxS1Cut/TofDedxS1Cut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# TofCuts/TofDedxS1Cut/TofDedxS1Cut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * TofDedxS1Cut.cpp
    00003  *
    00004  *  Created on: 13-mar-2009
    00005  *      Author: Sergio Ricciarini, Nicola Mori
    00006  */
    00007
    00010 #include "TofDedxS1Cut.h"
    00011
    00012 int TofDedxS1Cut::Check(PamLevel2 *event) {
    00013
    00014   int iTrackTof=0; // index initialized to 0 (TOF stand-alone track)
    00015   if (! (_trackTof==0) ) {
    00016     iTrackTof=*_trackTof;
    00017   }
    00018
    00019   // for each layer of S1: check that there is one and only one hit paddle and identify it; if this condition is satisfied, do the check on DeDx for the paddle (otherwise no check is done)
    00020
    00021   for (int ipl=0; ipl<2; ipl++) {
    00022
    00023     int nhitpad = 0; // number of hit paddles
    00024     int ihitpad = 100; // identifier of hit paddle; maximum valid value is 24 (taking into account each possible TOF layer)
    00025     float dedxpad;
    00026
    00027     for (int ipad=0; ipad<TOFNPADLAYER[ipl]; ipad++) {
    00028       if (event->GetToFLevel2()->HitPaddle(ipl,ipad)) { // HitPaddle is true if and only if there are both TDC signal for that pad AND they are both 'good'
    00029         ihitpad=event->GetToFLevel2()->GetPaddleid(ipl,ipad);
    00030         nhitpad++;
    00031       }
    00032     }
    00033
    00034     if (nhitpad == 1) { // there is one and only one hit pad in the layer
    00035       int satwarnpad;
    00036       event->GetToFLevel2()->GetdEdxPaddle(iTrackTof,ihitpad,100,dedxpad,satwarnpad);
    00037       // NOTE: if dedxpad=0 then there is no dE/dL signal (i.e. no ADC signals to evaluate dE/dL): this means that ADC signals are under threshold and therefore event is good
    00038       if ( ! (dedxpad < _maxDedxS1) ) {
    00039 //        cout << "return on check " << ipl << " hitpad " << ihitpad << " track id " << *_trackTof << " dedxpad " << dedxpad << endl;
    00040         return ipl;
    00041       }
    00042     }
    00043
    00044   }
    00045
    00046   return CUTOK;
    00047
    00048 }