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.11 by khahn, Mon Oct 17 16:23:43 2011 UTC vs.
Revision 1.12 by khahn, Sun Oct 23 10:53:01 2011 UTC

# Line 10 | Line 10
10  
11   RunLumiRangeMap rlrm;
12  
13 + unsigned getGenChannel(mithep::TGenInfo * ginfo) {
14 +  int gchannel=-1;
15 +  if( abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kElectron )  gchannel=0;
16 +  else if( abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kMuon ) gchannel=1;
17 +  else if( (abs(ginfo->id_1_a) == EGenType::kElectron && abs(ginfo->id_1_b) == EGenType::kMuon) ||
18 +           (abs(ginfo->id_1_a) == EGenType::kMuon && abs(ginfo->id_1_b) == EGenType::kElectron) ) gchannel=2;
19 +  
20 +  return gchannel;
21 + };
22 +
23 +
24   void initRunLumiRangeMap() {
25    rlrm.AddJSONFile(std::string("./data/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON.txt"));
26    //  rlrm.AddJSONFile(std::string("./data/Cert_160404-173244_7TeV_PromptReco_Collisions11_JSON_v2.txt"));
# Line 25 | Line 36 | unsigned fails_HZZ4L_selection(ControlFl
36                                 double eventweight,           // weight
37                                 TTree * passtuple ) {
38  
39 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, passtuple, NULL );
39 >  fails_HZZ4L_selection( ctrl, NULL, info, electronArr, muonArr, eventweight, passtuple, NULL );
40  
41   };
42  
43 +
44 +
45   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
46                                 mithep::TEventInfo *info,     // input event inof
47                                 TClonesArray *electronArr,    // input electrons
# Line 36 | Line 49 | unsigned fails_HZZ4L_selection(ControlFl
49                                 double eventweight,           // weight
50                                 LabVectors  *l ) {
51  
52 <  fails_HZZ4L_selection( ctrl, info, electronArr, muonArr, eventweight, NULL, l );
52 >  fails_HZZ4L_selection( ctrl, NULL, info, electronArr, muonArr, eventweight, NULL, l );
53  
54   };
55  
56  
57   unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
58 <                               mithep::TEventInfo *info,     // input event inof
58 >                               mithep::TGenInfo *ginfo ,     // input gen info
59 >                               mithep::TEventInfo *info,     // input event info
60 >                               TClonesArray *electronArr,    // input electrons
61 >                               TClonesArray *muonArr,        // input muons
62 >                               double eventweight,           // weight
63 >                               TTree * passtuple ) {
64 >
65 >  fails_HZZ4L_selection( ctrl, ginfo, info, electronArr, muonArr, eventweight, passtuple, NULL );
66 >
67 > };
68 >
69 >
70 > unsigned fails_HZZ4L_selection(ControlFlags &ctrl,           // input control
71 >                               mithep::TGenInfo *ginfo,     // input gen info
72 >                               mithep::TEventInfo *info,     // input event info
73                                 TClonesArray *electronArr,    // input electrons
74                                 TClonesArray *muonArr,        // input muons
75                                 double eventweight,           // weight
# Line 50 | Line 77 | unsigned fails_HZZ4L_selection(ControlFl
77                                 LabVectors * l) {       // output ntuple
78  
79    unsigned evtfail = 0x0;
80 +  unsigned gchannel=0xdeaddead;
81 +
82 +  if( ctrl.mc && ginfo != NULL ) {
83 +    gchannel = getGenChannel(ginfo);
84 +  }
85  
86  
87    if( ctrl.debug ) {
# Line 167 | Line 199 | unsigned fails_HZZ4L_selection(ControlFl
199          unsigned failsCICMedium = failsCicSelection(ctrl, ele, ciccuts_medium, ctrl.kinematics);
200          ciccuts_loose = getCiCCuts("loose");
201          unsigned failsCICLoose = failsCicSelection(ctrl, ele, ciccuts_loose, ctrl.kinematics);
202 <        failsCIC = ( failsCICLoose | failsCICMedium );
202 >        failsCIC = ( failsCICLoose > 0 && failsCICMedium > 0 );
203          if( !failsCICMedium ) isEleTight=1;
204        }
205        else {
# Line 190 | Line 222 | unsigned fails_HZZ4L_selection(ControlFl
222        if( ctrl.eleSeleScheme == "mediumloose" ) {
223          unsigned failsBDTMedium = failsBDTSelection(ctrl,"medium",ele);
224          unsigned failsBDTLoose  = failsBDTSelection(ctrl,"loose",ele);
225 <        failsBDT = ( failsBDTLoose | failsBDTMedium );
225 >        failsBDT = ( failsBDTLoose > 0 && failsBDTMedium > 0 );
226          if( !failsBDTMedium ) isEleTight=1;
227        } else {
228          failsBDT = failsBDTSelection(ctrl,"tight",ele);
# Line 501 | Line 533 | unsigned fails_HZZ4L_selection(ControlFl
533              if( abs(lepvec[i].type) == 13 ) {
534  
535                float reliso = lepvec[i].isoPF03/lepvec[i].vec.Pt();
536 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_TIGHT_EB_HIGHPT ) {  //0.13
536 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EB_HIGHPT ) {  //0.13
537                  failiso = true;
538                  break;
539                }
540 <              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_TIGHT_EB_LOWPT ) { //0.06
540 >              if( lepvec[i].isEB && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EB_LOWPT ) { //0.06
541                  failiso = true;
542                  break;
543                }
544 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_TIGHT_EE_HIGHPT ) { //0.09
544 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() > 20 && reliso > PFISO_MU_LOOSE_EE_HIGHPT ) { //0.09
545                  failiso = true;
546                  break;
547                }
548 <              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_TIGHT_EE_LOWPT ) { //0.05
548 >              if( !(lepvec[i].isEB) && lepvec[i].vec.Pt() < 20 && reliso > PFISO_MU_LOOSE_EE_LOWPT ) { //0.05
549                  failiso = true;
550                  break;
551                }
# Line 653 | Line 685 | unsigned fails_HZZ4L_selection(ControlFl
685            //      continue;
686          }
687          
688 <        int channel;
688 >        unsigned channel;
689          if( lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 11 ) channel=0;
690          if( lepvec[Z1LeptonMinusIndex].type == 13 && lepvec[Z2LeptonMinusIndex].type == 13 ) channel=1;
691          if( (lepvec[Z1LeptonMinusIndex].type == 11 && lepvec[Z2LeptonMinusIndex].type == 13) ||
# Line 673 | Line 705 | unsigned fails_HZZ4L_selection(ControlFl
705            float pt4l     = ZZSystem.Pt() ;
706            unsigned tZ1   = abs(lepvec[Z1LeptonMinusIndex].type);
707            unsigned tZ2   = abs(lepvec[Z2LeptonMinusIndex].type);
708 +          passtuple->SetBranchAddress("channel",  &channel);
709            passtuple->SetBranchAddress("run",  &run);
710            passtuple->SetBranchAddress("evt",  &evt);
711            passtuple->SetBranchAddress("lumi", &lumi);
# Line 683 | Line 716 | unsigned fails_HZZ4L_selection(ControlFl
716            passtuple->SetBranchAddress("m4l",  &m4l);
717            passtuple->SetBranchAddress("pt4l", &pt4l);
718            passtuple->SetBranchAddress("w",    &w);
719 +          if( ctrl.mc )           passtuple->SetBranchAddress("gchannel",  &gchannel);
720            passtuple->Fill( );
721          }
722  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines