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

Comparing UserCode/L1RpcTriggerAnalysis/src/AnaMenu.cc (file contents):
Revision 1.1 by konec, Mon Oct 29 12:46:00 2012 UTC vs.
Revision 1.3 by konec, Tue Nov 27 16:16:47 2012 UTC

# Line 5 | Line 5
5   #include "TGraphErrors.h"
6   #include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h"
7   #include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h"
8 + #include "UserCode/L1RpcTriggerAnalysis/interface/Utilities.h"
9 + #include "UserCode/L1RpcTriggerAnalysis/interface/TriggerMenuResultObj.h"
10   #include <sstream>
11   #include <iostream>
12 + #include <cmath>
13  
14   namespace {
15 + TH1D *hMuonPt_MEN, *hMuonEta_MEN, *hMuonPhi_MEN;
16   }
17  
18  
19   bool AnaMenu::filter( const EventObj* ev, const MuonObj* muon,
20 <                  const  std::vector<std::string> & namesL1,
21 <                  const std::vector<unsigned int> & algosL1,
22 <                  const std::vector<std::string> &  namesHLT,
19 <                  const std::vector<unsigned int> & algosHLT)
20 >                      const TriggerMenuResultObj *bitsL1,
21 >                      const TriggerMenuResultObj *bitsHLT)
22 >
23   {
24 +  if (bitsL1->names.size() != 0)    namesL1=bitsL1->names;
25 +  if (bitsHLT->names.size() != 0)   namesHLT=bitsHLT->names;
26 +  const std::vector<unsigned int> & algosL1 = bitsL1->firedAlgos;
27 +  const std::vector<unsigned int> & algosHLT = bitsHLT->firedAlgos;
28 +
29 +
30    typedef std::vector<unsigned int>::const_iterator CIT;
31  
32   //  static int count = 0;
# Line 44 | Line 53 | bool AnaMenu::filter( const EventObj* ev
53   //  if (hasNoHLTMu) std::cout <<" HAS NO HLT MUON!" << std::endl;
54  
55    if (hasNoL1Mu && hasNoHLTMu) {
56 < //  if (hasNoL1Mu ) {
56 >  //if (!hasNoL1Mu && !hasNoHLTMu) {
57      for (CIT it=algosL1.begin();  it != algosL1.end();  ++it)  theAlgosL1[ namesL1[*it] ]++;
58      for (CIT it=algosHLT.begin(); it != algosHLT.end(); ++it) theAlgosHLT[ namesHLT[*it] ]++;
59 +    if (hMuonPt_MEN)  hMuonPt_MEN->Fill(muon->pt());
60 +    if (hMuonEta_MEN) hMuonEta_MEN->Fill(muon->eta());
61 +    if (hMuonPhi_MEN) hMuonPhi_MEN->Fill(muon->phi());
62      return true;
63    }
64  
# Line 65 | Line 77 | void AnaMenu::resume(TObjArray& histos)
77      ibin++;
78      hMenuAlgosL1->GetXaxis()->SetBinLabel(ibin, (*it).first.c_str());
79      hMenuAlgosL1->SetBinContent(ibin, (*it).second);
80 <    std::cout <<" BIN "<<ibin<<" LABEL: "<<(*it).first.c_str()<<" ENTRIES:"<<(*it).second<<std::endl;
80 > //    std::cout <<" BIN "<<ibin<<" LABEL: "<<(*it).first.c_str()<<" ENTRIES:"<<(*it).second<<std::endl;
81    }
82    ibin = 0;
83    for (CIM it=theAlgosHLT.begin(); it != theAlgosHLT.end(); ++it) {
84      ibin++;
85      hMenuAlgosHLT->GetXaxis()->SetBinLabel(ibin, (*it).first.c_str());
86      hMenuAlgosHLT->SetBinContent(ibin, (*it).second);
87 <    std::cout <<" BIN "<<ibin<<" LABEL: "<<(*it).first.c_str()<<" ENTRIES:"<<(*it).second<<std::endl;
87 > //    std::cout <<" BIN "<<ibin<<" LABEL: "<<(*it).first.c_str()<<" ENTRIES:"<<(*it).second<<std::endl;
88    }
89   }
90  
91  
92   void AnaMenu::init(TObjArray& histos)
93   {
94 < /*
95 < hClu_SizeDigi = new TH1D( "hClu_SizeDigi", "hClu_SizeDigi", 97, -0.5, 96.5);  histos.Add( hClu_SizeDigi);
96 < hClu_SizeRHit = new TH1D( "hClu_SizeRHit", "hClu_SizeRHit", 97, -0.5, 96.5);  histos.Add( hClu_SizeRHit);
85 < hClu_DigiRHit = new TH2D( "hClu_DigiRHit","hClu_DigiRHit", 97, -0.5, 96.5, 97, -0.5, 96.5);  histos.Add(hClu_DigiRHit);
86 < */
94 >  hMuonPt_MEN  = new TH1D("hMuonPt_MEN","All global muons Pt;Glb.muon p_{T} [GeV];Muons / bin",L1PtScale::nPtBins,L1PtScale::ptBins); histos.Add(hMuonPt_MEN);
95 >  hMuonEta_MEN = new TH1D("hMuonEta_MEN","All global muons Eta;Glb.muon #eta;Muons / bin",96, -2.4, 2.4);  histos.Add(hMuonEta_MEN);
96 >  hMuonPhi_MEN = new TH1D("hMuonPhi_MEN","All global muons Phi;Glb.muon #phi [rad];Muons / bin",90,-M_PI,M_PI);  histos.Add(hMuonPhi_MEN);
97   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines