ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbCandidateFinderAlgo.cc
(Generate patch)

Comparing UserCode/VHbbAnalysis/HbbAnalyzer/plugins/HbbCandidateFinderAlgo.cc (file contents):
Revision 1.1 by tboccali, Tue Jun 28 12:03:54 2011 UTC vs.
Revision 1.2 by tboccali, Thu Jun 30 08:56:27 2011 UTC

# Line 101 | Line 101 | void HbbCandidateFinderAlgo::run (const
101    //
102    // now see which kind of andidate this can be
103    //
104 <  VHbbCandidateTools selector;
104 >  VHbbCandidateTools selector(true);
105  
106    VHbbCandidate result;
107    bool ok = false;
# Line 109 | Line 109 | void HbbCandidateFinderAlgo::run (const
109    // first: hZmumu
110    //
111    
112 +  if (verbose_){
113 +    std::cout <<" START SELECTION "<<std::endl;
114 +  }
115 +  
116    result = selector.getHZmumuCandidate(temp,ok);
117 +  if ( ok == true ){
118 +    result.setCandidateType(VHbbCandidate::Zmumu);
119 +    candidates.push_back(result);
120 +  }else{
121 +    //      HZee
122 +    result = selector. getHZeeCandidate(temp,ok);
123      if ( ok == true ){
124 <      result.setCandidateType(VHbbCandidate::Zmumu);
124 >      result.setCandidateType(VHbbCandidate::Zee);
125        candidates.push_back(result);
126 +      return;
127      }else{
128 <      //      HZee
129 <      result = selector. getHZeeCandidate(temp,ok);
128 >      //HWmunu
129 >      result = selector. getHWmunCandidate(temp,ok);
130 >      if ( ok == true ){
131 >        result.setCandidateType(VHbbCandidate::Wmun);
132 >        candidates.push_back(result);
133 >        return;
134 >      }else{
135 >        // HWenu
136 >        result = selector. getHWenCandidate(temp,ok);
137          if ( ok == true ){
138 <          result.setCandidateType(VHbbCandidate::Zee);
138 >          result.setCandidateType(VHbbCandidate::Wen);
139            candidates.push_back(result);
140            return;
141          }else{
142 <          //HWmunu
143 <          result = selector. getHWmunCandidate(temp,ok);
142 >          // HZnn
143 >          result = selector. getHZnnCandidate(temp,ok);
144            if ( ok == true ){
145 <            result.setCandidateType(VHbbCandidate::Wmun);
145 >            result.setCandidateType(VHbbCandidate::Znn);
146              candidates.push_back(result);
147              return;
130          }else{
131            // HWenu
132            result = selector. getHWenCandidate(temp,ok);
133            if ( ok == true ){
134              result.setCandidateType(VHbbCandidate::Wen);
135              candidates.push_back(result);
136              return;
137            }else{
138              // HZnn
139              result = selector. getHZnnCandidate(temp,ok);
140              if ( ok == true ){
141                result.setCandidateType(VHbbCandidate::Znn);
142                candidates.push_back(result);
143                return;
144              }
145            }
148            }
149          }
150 +      }
151      }
152 +  }
153    return;
154   }
155  
156   void HbbCandidateFinderAlgo::findMET(const VHbbEvent::METInfo & met, std::vector<VHbbEvent::METInfo>& out){
157    //
158 +
159    //  just preselection: met significance > 2
160 +
161      if (met.metSig >2 ) out.push_back(met);
162 <  
162 >    if (verbose_){
163 >      std::cout <<" CandidateFinder: Input MET = "<<met.metSig<<" Output MET = "<<out.size()<<std::endl;
164 >    }
165 >    
166   }
167  
168  
169   bool HbbCandidateFinderAlgo::findDiJets (const std::vector<VHbbEvent::SimpleJet>& jets, VHbbEvent::SimpleJet& j1, VHbbEvent::SimpleJet& j2,std::vector<VHbbEvent::SimpleJet>& addJets){
170    
171   std::vector<VHbbEvent::SimpleJet> tempJets;
172 <
172 >
173 > if (verbose_){
174 >   std::cout <<" CandidateFinder: Input Jets = "<<jets.size()<<std::endl;
175 > }
176 >
177   for (unsigned int i=0 ; i< jets.size(); ++i){
178     if (jets[i].fourMomentum.Pt()> jetPtThreshold)
179       tempJets.push_back(jets[i]);
# Line 168 | Line 181 | bool HbbCandidateFinderAlgo::findDiJets
181  
182   CompareBTag  bTagComparator;
183  
184 +
185 + if (verbose_){
186 +   std::cout <<" CandidateFinder: Intermediate Jets = "<<tempJets.size()<<std::endl;
187 + }
188 +
189 +
190   if (tempJets.size()<2) return false;
191  
192   std::sort(tempJets.begin(), tempJets.end(), bTagComparator);
# Line 184 | Line 203 | bool HbbCandidateFinderAlgo::findDiJets
203   }
204    CompareJetPt ptComparator;
205  
206 + if (verbose_){
207 +   std::cout <<" CandidateFinder: Output Jets = "<<2<<" Additional = "<<addJets.size()<<std::endl;
208 + }
209 +
210 +
211    std::sort(addJets.begin(), addJets.end(), ptComparator);
212   return true;
213 +
214 +
215   }
216  
217   void HbbCandidateFinderAlgo::findMuons(const std::vector<VHbbEvent::MuonInfo>& muons, std::vector<VHbbEvent::MuonInfo>& out){
# Line 220 | Line 246 | For both W -> mu nu and Z -> mu mu, we a
246        out.push_back(*it);
247      }
248    }
249 +
250 +    if (verbose_){
251 +      std::cout <<" CandidateFinder: Input Muons = "<<muons.size()<<" Output Muons = "<<out.size()<<std::endl;
252 +    }
253 +
254 +
255 +
256   }
257  
258  
# Line 251 | Line 284 | We adopt the standard cut-based selectio
284        out.push_back(*it);
285      }  
286    }
287 +    if (verbose_){
288 +      std::cout <<" CandidateFinder: Input Electrons = "<<electrons.size()<<" Output Electrons = "<<out.size()<<std::endl;
289 +    }
290 +
291 +
292   }
293  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines