CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MITConversionUtilities.cc
Go to the documentation of this file.
2 #include "TMath.h"
3 
4 namespace HWWFunctions {
5 
6  bool isMITConversion(HWW& hww, unsigned int elidx,
7  int nWrongHitsMax,
8  float probMin,
9  float dlMin,
10  bool matchCTF,
11  bool requireArbitratedMerged) {
12 
13  unsigned int nconvs = hww.convs_isConverted().size();
14  if(nconvs == 0)
15  return false;
16  bool isGoodConversion = false;
17 
18  for(unsigned int iconv = 0; iconv < nconvs; iconv++) {
19 
20  bool conversionMatchFound = false;
21  for(unsigned int itk = 0; itk < hww.convs_tkidx().at(iconv).size(); itk++) {
22 
23  if(hww.convs_tkalgo().at(iconv)[itk] == 29 && hww.convs_tkidx().at(iconv)[itk] == hww.els_gsftrkidx().at(elidx))
24  conversionMatchFound = true;
25  if(matchCTF) {
26  if(hww.convs_tkalgo().at(iconv)[itk] > 3 && hww.convs_tkalgo().at(iconv)[itk] < 14 && hww.convs_tkalgo().at(iconv)[itk] != 12 && hww.convs_tkidx().at(iconv)[itk] == hww.els_trkidx().at(elidx))
27  conversionMatchFound = true;
28  }
29 
30  if(conversionMatchFound)
31  break;
32  }
33 
34 
35  if(conversionMatchFound==false)
36  continue;
37 
38  if( TMath::Prob( hww.convs_chi2().at(iconv), (Int_t)hww.convs_ndof().at(iconv) ) > probMin && hww.convs_dl().at(iconv) > dlMin ) isGoodConversion = true;
39  if(requireArbitratedMerged) {
40  if(hww.convs_quality().at(iconv) & 4)
41  isGoodConversion = true;
42  else
43  isGoodConversion = false;
44  }
45 
46  for(unsigned int j = 0; j < hww.convs_nHitsBeforeVtx().at(iconv).size(); j++) {
47  if(hww.convs_nHitsBeforeVtx().at(iconv)[j] > nWrongHitsMax)
48  isGoodConversion = false;
49  }
50 
51  if(isGoodConversion)
52  break;
53 
54 
55  }//loop over convserions
56 
57 
58  return isGoodConversion;
59  }
60 }
bool isMITConversion(HWW &, unsigned int elidx, int nWrongHitsMax, float probMin, float dlMin, bool matchCTF, bool requireArbitratedMerged)
std::vector< int > & els_gsftrkidx()
Definition: HWW.cc:333
std::vector< std::vector< int > > & convs_nHitsBeforeVtx()
Definition: HWW.cc:673
std::vector< std::vector< int > > & convs_tkalgo()
Definition: HWW.cc:665
int j
Definition: DBlmapReader.cc:9
std::vector< float > & convs_chi2()
Definition: HWW.cc:653
std::vector< float > & convs_ndof()
Definition: HWW.cc:649
std::vector< int > & convs_quality()
Definition: HWW.cc:677
std::vector< float > & convs_dl()
Definition: HWW.cc:657
Definition: HWW.h:12
std::vector< int > & convs_isConverted()
Definition: HWW.cc:661
std::vector< std::vector< int > > & convs_tkidx()
Definition: HWW.cc:669
std::vector< int > & els_trkidx()
Definition: HWW.cc:341