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

Comparing UserCode/CmsHi/JetAnalysis/src/RecHitTreeProducer.cc (file contents):
Revision 1.8 by yjlee, Sun Nov 7 12:53:05 2010 UTC vs.
Revision 1.9 by yilmaz, Tue Nov 9 22:54:45 2010 UTC

# Line 68 | Line 68 | using namespace std;
68   #define MAXHITS 1000000
69  
70   struct MyRecHit{
71 <
71 >  int depth[MAXHITS];
72    int n;
73  
74    float e[MAXHITS];
# Line 140 | Line 140 | class RecHitTreeProducer : public edm::E
140     MyRecHit myTowers;
141     MyBkg bkg;
142  
143 <
143 >  TNtuple* nt;
144    TTree* hbheTree;
145    TTree* hfTree;
146    TTree* ebTree;
# Line 150 | Line 150 | class RecHitTreeProducer : public edm::E
150     TTree* bkgTree;
151  
152    double cone;
153 +  double hfTowerThreshold_;
154 +  double hfLongThreshold_;
155 +  double hfShortThreshold_;
156 +  double hbheThreshold_;
157 +  double ebThreshold_;
158 +  double eeThreshold_;
159  
160     edm::Service<TFileService> fs;
161     const CentralityBins * cbins_;
# Line 173 | Line 179 | class RecHitTreeProducer : public edm::E
179     bool doHcal_;
180  
181     bool doFastJet_;
182 +
183 +  bool doEbyEonly_;
184   };
185  
186   //
# Line 206 | Line 214 | RecHitTreeProducer::RecHitTreeProducer(c
214    doHcal_ = iConfig.getUntrackedParameter<bool>("doHcal",true);
215    doFastJet_ = iConfig.getUntrackedParameter<bool>("doFastJet",true);
216    FastJetTag_ = iConfig.getUntrackedParameter<edm::InputTag>("FastJetTag",edm::InputTag("kt4CaloJets"));
217 <
217 >  doEbyEonly_ = iConfig.getUntrackedParameter<bool>("doEbyEonly",false);
218 >  hfTowerThreshold_ = iConfig.getUntrackedParameter<double>("HFtowerMin",3.);
219 >  hfLongThreshold_ = iConfig.getUntrackedParameter<double>("HFlongMin",3.);
220 >  hfShortThreshold_ = iConfig.getUntrackedParameter<double>("HFshortMin",3.);
221   }
222  
223  
# Line 273 | Line 284 | RecHitTreeProducer::analyze(const edm::E
284        iSetup.get<CaloGeometryRecord>().get(pGeo);
285        geo = pGeo.product();
286     }
287 +
288 +   int nHFlong = 0;
289 +   int nHFshort = 0;
290 +   int nHFtower = 0;
291    
292     if(doHcal_){
293     for(unsigned int i = 0; i < hfHits->size(); ++i){
# Line 282 | Line 297 | RecHitTreeProducer::analyze(const edm::E
297       hfRecHit.eta[hfRecHit.n] = getEta(hit.id());
298       hfRecHit.phi[hfRecHit.n] = getPhi(hit.id());
299       hfRecHit.isjet[hfRecHit.n] = false;
300 +     hfRecHit.depth[hfRecHit.n] = hit.id().depth();
301 +     if(hit.energy() > hfShortThreshold_ && hit.id().depth() != 1) nHFshort++;
302 +     if(hit.energy() > hfLongThreshold_ && hit.id().depth() == 1) nHFlong++;
303 +
304       if(useJets_){
305         for(unsigned int j = 0 ; j < jets->size(); ++j){
306           const reco::Jet& jet = (*jets)[j];
# Line 291 | Line 310 | RecHitTreeProducer::analyze(const edm::E
310       }
311       hfRecHit.n++;
312     }
313 <  
313 >   if(!doEbyEonly_){
314     for(unsigned int i = 0; i < hbheHits->size(); ++i){
315       const HBHERecHit & hit= (*hbheHits)[i];
316       hbheRecHit.e[hbheRecHit.n] = hit.energy();
# Line 309 | Line 328 | RecHitTreeProducer::analyze(const edm::E
328       hbheRecHit.n++;
329     }
330     }
331 <   if(doEcal_){
331 >   }
332 >   if(doEcal_ && !doEbyEonly_){
333     for(unsigned int i = 0; i < ebHits->size(); ++i){
334       const EcalRecHit & hit= (*ebHits)[i];
335       ebRecHit.e[ebRecHit.n] = hit.energy();
# Line 354 | Line 374 | RecHitTreeProducer::analyze(const edm::E
374        myTowers.eta[myTowers.n] = getEta(hit.id());
375        myTowers.phi[myTowers.n] = getPhi(hit.id());
376        myTowers.isjet[myTowers.n] = false;
377 +
378 +      if(hit.ieta() > 29 && hit.energy() > hfTowerThreshold_) nHFtower++;
379 +
380        if(useJets_){
381           for(unsigned int j = 0 ; j < jets->size(); ++j){
382              const reco::Jet& jet = (*jets)[j];
# Line 366 | Line 389 | RecHitTreeProducer::analyze(const edm::E
389  
390     }
391  
392 <   if(doBasicClusters_){
392 >   if(doBasicClusters_ && !doEbyEonly_){
393        for(unsigned int j = 0 ; j < jets->size(); ++j){
394           const reco::Jet& jet = (*jets)[j];
395           myBC.n = 0;
# Line 389 | Line 412 | RecHitTreeProducer::analyze(const edm::E
412        }
413     }
414  
415 <   towerTree->Fill();
416 <  
417 <   eeTree->Fill();
418 <   ebTree->Fill();
419 <  
420 <   hbheTree->Fill();
421 <   hfTree->Fill();
415 >   if(!doEbyEonly_){
416 >     towerTree->Fill();
417 >    
418 >     eeTree->Fill();
419 >     ebTree->Fill();
420 >    
421 >     hbheTree->Fill();
422 >     hfTree->Fill();
423 >      
424 >     if (doFastJet_) {
425 >       bkgTree->Fill();
426 >     }
427 >   }
428 >
429 >   nt->Fill(nHFtower,nHFlong,nHFshort);
430    
400   if (doFastJet_) {
401      bkgTree->Fill();  
402   }
431   }
432  
433  
# Line 422 | Line 450 | RecHitTreeProducer::beginJob()
450    hfTree->Branch("et",hfRecHit.et,"et[n]/F");
451    hfTree->Branch("eta",hfRecHit.eta,"eta[n]/F");
452    hfTree->Branch("phi",hfRecHit.phi,"phi[n]/F");
453 +  hfTree->Branch("depth",hfRecHit.depth,"depth[n]/I");
454    hfTree->Branch("isjet",hfRecHit.isjet,"isjet[n]/O");
455  
456    eeTree = fs->make<TTree>("ee","");
# Line 468 | Line 497 | RecHitTreeProducer::beginJob()
497       bkgTree->Branch("rho",bkg.rho,"rho[n]/F");
498       bkgTree->Branch("sigma",bkg.sigma,"sigma[n]/F");
499    }
500 +  
501 +  nt = fs->make<TNtuple>("ntEvent","","nHF:nHFlong:nHFshort");
502  
503   }
504  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines