ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/Selection.cc
(Generate patch)

Comparing UserCode/MitHzz4l/Selection/src/Selection.cc (file contents):
Revision 1.3 by dkralph, Thu Sep 22 18:01:19 2011 UTC vs.
Revision 1.6 by khahn, Thu Oct 13 14:20:55 2011 UTC

# Line 2 | Line 2
2   #include "PassHLT.h"
3   #include "HZZCiCElectronSelection.h"
4   #include "HZZLikelihoodElectronSelection.h"
5 + #include "HZZBDTElectronSelection.h"
6   #include "RunLumiRangeMap.h"
7  
8   RunLumiRangeMap rlrm;
# Line 18 | Line 19 | unsigned fails_HZZ4L_selection(ControlFl
19                                 TClonesArray *electronArr,    // input electrons
20                                 TClonesArray *muonArr,        // input muons
21                                 double eventweight,           // weight
22 <                               TNtuple * passtuple ) {
22 >                               TTree * passtuple ) {
23  
24    fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL );
25  
# Line 41 | Line 42 | unsigned fails_HZZ4L_selection(ControlFl
42                                 TClonesArray *electronArr,    // input electrons
43                                 TClonesArray *muonArr,        // input muons
44                                 double eventweight,           // weight
45 <                               TNtuple * passtuple,
45 >                               TTree * passtuple,
46                                 LabVectors * l) {       // output ntuple
47  
48    unsigned evtfail = 0x0;
49  
50 +
51 +  if( ctrl.debug ) {
52 +    cout << "Run: " << info->runNum
53 +         << "\tEvt: " << info->evtNum
54 +         << "\tLumi: " << info->lumiSec
55 +         << endl;
56 +  }
57 +
58    if( !ctrl.mc ) {
59      // not accounting for overlap atm
60      RunLumiRangeMap::RunLumiPairType rl(info->runNum, info->lumiSec);      
61      if( !(rlrm.HasRunLumi(rl)) )  {
62 +      if( ctrl.debug ) cout << "\tfails JSON" << endl;
63        evtfail |= (1<<EVTFAIL_JSON);
64        return evtfail;
65      }
66    }
67    
68    
69 <  if( ctrl.debug ) {
60 <    cout << "Run: " << info->runNum
61 <         << "\tEvt: " << info->evtNum
62 <         << "\tLumi: " << info->lumiSec
63 <         << endl;
64 <  }
69 >
70    
71    
72    //********************************************************
# Line 142 | Line 147 | unsigned fails_HZZ4L_selection(ControlFl
147        }
148      }
149  
150 <    unsigned FAIL;
151 <    CICStruct tightcuts = getTightCuts();
152 <    unsigned  failsCIC  = failsCicSelection(ctrl, ele, tightcuts, ctrl.kinematics);
153 <    LikStruct likcuts = getLikCuts(ctrl.lik_cut);
154 <    unsigned  failsLike = failsLikelihoodSelection(ele, likcuts, ctrl.kinematics);
155 <
156 <    if ( ctrl.cic ) { FAIL = failsCIC;}
157 <    else            { FAIL = failsLike; }
150 >    unsigned FAIL=0;
151 >    CICStruct ciccuts = getCiCCuts(ctrl.eleSeleScheme);
152 >    unsigned  failsCIC=0;
153 >    if(ctrl.eleSele=="cic") {
154 >      failsCIC = failsCicSelection(ctrl, ele, ciccuts, ctrl.kinematics);
155 >      FAIL = failsCIC;
156 >    }
157 >    LikStruct likcuts;
158 >    unsigned failsLike=0;
159 >    if(ctrl.eleSele=="lik") {
160 >      likcuts = getLikCuts(ctrl.eleSeleScheme);
161 >      failsLike = failsLikelihoodSelection(ele, likcuts, ctrl.kinematics);
162 >      FAIL = failsLike;
163 >    }
164 >    unsigned  failsBDT=0;
165 >    if(ctrl.eleSele=="bdt") {
166 >      failsBDT = failsBDTSelection(ele,ctrl.kinematics,ctrl.eleSeleScheme);
167 >      FAIL = failsBDT;
168 >    }
169  
170      if( ctrl.debug ){
171        cout << "CIC category: " << cicCategory(ele)
# Line 157 | Line 173 | unsigned fails_HZZ4L_selection(ControlFl
173             << "\tFAIL:  0x"     << hex << FAIL      << dec
174             << "\tfailsCIC:  0x" << hex << failsCIC  << dec
175             << "\tfailsLike: 0x" << hex << failsLike << dec
176 +           << "\tfailsBDT:  0x" << hex << failsBDT << dec
177             << "\tscEt: " << ele->scEt
178             << "\tscEta: " << ele->scEta
179             << "\tncluster: " << ele->ncluster
# Line 557 | Line 574 | unsigned fails_HZZ4L_selection(ControlFl
574              (lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 11)) channel=2;
575          
576  
577 <        
577 >
578          if( passtuple != NULL ) {
579 <          passtuple->Fill( info->runNum,
580 <                           info->evtNum,
581 <                           info->lumiSec,
582 <                           channel,
583 <                           Z1Candidate.M(),
584 <                           Z2Candidate.M(),
585 <                           ZZSystem.M(),
586 <                           ZZSystem.Pt(),
587 <                           eventweight);
579 >          unsigned run   = info->runNum;
580 >          unsigned evt   = info->evtNum;
581 >          unsigned lumi  = info->lumiSec;
582 >          unsigned chan  = channel;
583 >          float mZ1      = Z1Candidate.M() ;
584 >          float mZ2      = Z2Candidate.M() ;
585 >          float m4l      = ZZSystem.M() ;
586 >          float pt4l     = ZZSystem.Pt() ;
587 >          passtuple->SetBranchAddress("run",  &run);
588 >          passtuple->SetBranchAddress("evt",  &evt);
589 >          passtuple->SetBranchAddress("lumi", &lumi);
590 >          passtuple->SetBranchAddress("mZ1",  &mZ1);
591 >          passtuple->SetBranchAddress("mZ2",  &mZ2);
592 >          passtuple->SetBranchAddress("m4l",  &m4l);
593 >          passtuple->SetBranchAddress("pt4l", &pt4l);
594 >          passtuple->SetBranchAddress("w",    &eventweight);
595 >          passtuple->Fill( );
596          }
597  
598          if( ctrl.debug ) cout  << "run: " << info->runNum  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines