PamCut: TofCuts/TofTopS1Cut/TofTopS1Cut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# TofCuts/TofTopS1Cut/TofTopS1Cut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * TofTopS1Cut.cpp
    00003  *
    00004  *  Created on: 13-mar-2009
    00005  *      Author: Sergio Ricciarini, Nicola Mori
    00006  */
    00007
    00010 #include "TofTopS1Cut.h"
    00011
    00012 int TofTopS1Cut::Check(PamLevel2 *event) {
    00013
    00014   // Array initialization
    00015   for (int ipl = 0; ipl < 2; ipl++) {
    00016     _nHitPmtPl[ipl] = 0;
    00017   }
    00018
    00019   Int_t pmtId = -1;
    00020   Int_t layerId = 10; // valid values are 0 to 5
    00021
    00022   // Compute the number of hit PMT on each plane
    00023   for (int ih = 0; ih < event->GetToFLevel2()->npmt(); ih++) { // Int_t mandatory
    00024     pmtId = event->GetToFLevel2()->GetToFPMT(ih)->pmt_id;
    00025     layerId = event->GetToFLevel2()->GetPlaneIndex(pmtId);
    00026     if (0 <= layerId && layerId < 2)
    00027       _nHitPmtPl[layerId]++;
    00028   }
    00029
    00030   // CUT on hit PMTs
    00031   for (int ipl = 0; ipl < 2; ipl++) { // check done only for S1 layers
    00032     if (!(_nHitPmtPl[ipl] < 3))
    00033       return 0;
    00034   }
    00035
    00036   return CUTOK;
    00037 }