/[PAMELA software]/PamCut/TrkCuts/TrkSigmaDeflCut/TrkSigmaDeflCut.cpp
ViewVC logotype

Annotation of /PamCut/TrkCuts/TrkSigmaDeflCut/TrkSigmaDeflCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Mon May 3 14:37:16 2010 UTC (14 years, 7 months ago) by pam-fi
Branch: MAIN
CVS Tags: Root_V8, MergedToHEAD_1, nuclei_reproc, MergedFromV8_1, BeforeMergingFromV8_1, V9, HEAD
Branch point for: V8
Changes since 1.1: +18 -26 lines
A new parameter has been added to allow MDR/n cuts.

1 pam-fi 1.1 /*
2     * TrkSigmaDeflCut.cpp
3     *
4     * Created on:23-apr-2009
5     * Author: S. Ricciarini
6     */
7    
8 pam-fi 1.2 /*! @file TrkSigmaDeflCut.cpp The TrkRigGeoCut class implementation file. */
9 pam-fi 1.1
10     #include "TrkSigmaDeflCut.h"
11    
12 pam-fi 1.2 TrkSigmaDeflCut::TrkSigmaDeflCut(const char *cutName, const char* rigBinListFileName, float sigmaDeflFactor) :
13     PamCut(cutName), _binning(0), _sigmaDeflFactor(sigmaDeflFactor) {
14 pam-fi 1.1
15 pam-fi 1.2 ifstream rigBinList;
16     rigBinList.open(rigBinListFileName);
17     TString bin;
18    
19     while (!rigBinList.eof()) {
20     rigBinList >> bin;
21     if (bin != "") {
22     _binning.push_back(bin.Atof());
23 pam-fi 1.1 #ifdef DEBUGPAMCUT
24 pam-fi 1.2 cout << "Bin: " << bin.Atof() << endl;
25 pam-fi 1.1 #endif
26     }
27 pam-fi 1.2 }
28 pam-fi 1.1
29 pam-fi 1.2 rigBinList.close();
30 pam-fi 1.1
31     #ifdef DEBUGPAMCUT
32 pam-fi 1.2 cout << "\nNumber of bins: " << _binning.size() << endl;
33 pam-fi 1.1 #endif
34 pam-fi 1.2 }
35 pam-fi 1.1
36     int TrkSigmaDeflCut::Check(PamLevel2 *event) {
37    
38     TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();
39    
40 pam-fi 1.2 float sigmaDefl = pow(trkTrack->coval[4][4], 0.5);
41 pam-fi 1.1 float rigMod = trkTrack->GetRigidity();
42    
43     // check on overall binning interval
44     if (rigMod >= _binning[_binning.size() - 1] || rigMod < _binning[0]) {
45     return 0;
46     }
47    
48     //Bin upper limit identification: after this loop, the bin containing rigMod is defined as (_binning[i-1] , _binning[i])
49     int i = 1;
50     while (_binning[i] < rigMod) {
51     i++;
52     }
53    
54 pam-fi 1.2 if (!(sigmaDefl * _sigmaDeflFactor < 1. / _binning[i])) { // required condition: sigma_defl * _sigmaFactor < |defl_min(bin)| = 1./|rig_max(bin)| = 1./_binning[i]
55 pam-fi 1.1 return 1;
56     }
57    
58     return CUTOK;
59     }

  ViewVC Help
Powered by ViewVC 1.1.23