Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:26

0001 
0002 #include "L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h"
0003 
0004 int CheckL1Ntuple(const char * file= "L1Ntuple.root", const char * treepath = "l1UpgradeEmuTree/L1UpgradeTree"){
0005   cout << "INFO: summary of content in file " << file << "\n";
0006   TFile input(file);
0007   TTree * tree  = (TTree*) input.Get(treepath);
0008   if (! tree) {
0009     cout << "ERROR: could not open tree.\n";
0010     input.ls();
0011     return 1;
0012   }
0013   tree->Print();
0014 
0015   TH1F * jetEt = new TH1F("jetEt","", 20, 0.0, 200.0);
0016   tree->Draw("jetEt>>jetEt","jetEt > 10.0");
0017   int jet_count = jetEt->GetEntries();
0018 
0019   TH1F * egEt = new TH1F("egEt","", 20, 0.0, 200.0);
0020   tree->Draw("egEt>>egEt","egEt > 10.0");
0021   int eg_count = egEt->GetEntries();
0022 
0023   TH1F * tauEt = new TH1F("tauEt","", 20, 0.0, 200.0);
0024   tree->Draw("tauEt>>tauEt","tauEt > 10.0");
0025   int tau_count = tauEt->GetEntries();
0026 
0027   TH1F * muonEt = new TH1F("muonEt","", 20, 0.0, 200.0);
0028   tree->Draw("muonEt>>muonEt","muonEt > 1.0");
0029   int muon_count = muonEt->GetEntries();
0030 
0031 
0032   int success = 1;
0033   if (jet_count <= 0)  success = 0;
0034   if (eg_count <= 0)   success = 0;
0035   if (tau_count <= 0)  success = 0;
0036   if (muon_count <= 0) success = 0;
0037   
0038   cout << "jet count:   " << jet_count << "\n";  
0039   cout << "eg count:    " << eg_count << "\n";  
0040   cout << "tau count:   " << tau_count << "\n";  
0041   cout << "muon count:  " << muon_count << "\n";  
0042 
0043   if (success){
0044     cout << "STATUS:  SUCCESS\n";
0045     return 0;
0046   } else {
0047     cout << "STATUS:  FAILURE\n";
0048     return 1;
0049   }
0050 }