/[PAMELA software]/PamCut/TofCuts/TofDedxS1Cut/TofDedxS1Cut.cpp
ViewVC logotype

Contents of /PamCut/TofCuts/TofDedxS1Cut/TofDedxS1Cut.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed May 27 13:30:09 2009 UTC (15 years, 6 months ago) by pam-fi
Branch: MAIN
Branch point for: DEV
Initial revision

1 /*
2 * TofDedxS1Cut.cpp
3 *
4 * Created on: 13-mar-2009
5 * Author: Sergio Ricciarini, Nicola Mori
6 */
7
8 /*! @file TofDedxS1Cut.cpp The TofDedxS1Cut class implementation file */
9
10 #include "TofDedxS1Cut.h"
11
12 int TofDedxS1Cut::Check(PamLevel2 *event) {
13
14 int iTrackTof=0; // index initialized to 0 (TOF stand-alone track)
15 if (! (_trackTof==0) ) {
16 iTrackTof=*_trackTof;
17 }
18
19 // 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)
20
21 for (int ipl=0; ipl<2; ipl++) {
22
23 int nhitpad = 0; // number of hit paddles
24 int ihitpad = 100; // identifier of hit paddle; maximum valid value is 24 (taking into account each possible TOF layer)
25 float dedxpad;
26
27 for (int ipad=0; ipad<TOFNPADLAYER[ipl]; ipad++) {
28 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'
29 ihitpad=event->GetToFLevel2()->GetPaddleid(ipl,ipad);
30 nhitpad++;
31 }
32 }
33
34 if (nhitpad == 1) { // there is one and only one hit pad in the layer
35 int satwarnpad;
36 event->GetToFLevel2()->GetdEdxPaddle(iTrackTof,ihitpad,100,dedxpad,satwarnpad);
37 // 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
38 if ( ! (dedxpad < _maxDedxS1) ) {
39 // cout << "return on check " << ipl << " hitpad " << ihitpad << " track id " << *_trackTof << " dedxpad " << dedxpad << endl;
40 return ipl;
41 }
42 }
43
44 }
45
46 return CUTOK;
47
48 }

  ViewVC Help
Powered by ViewVC 1.1.23