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

Comparing UserCode/L1RpcTriggerAnalysis/src/AnaEmu.cc (file contents):
Revision 1.1 by konec, Mon Nov 28 18:39:48 2011 UTC vs.
Revision 1.5 by konec, Tue Nov 6 12:56:51 2012 UTC

# Line 4 | Line 4
4   #include "TH1F.h"
5   #include "TAxis.h"
6   #include "TGraphErrors.h"
7 + #include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h"
8   #include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h"
9   #include "UserCode/L1RpcTriggerAnalysis/interface/L1Obj.h"
10   #include "UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h"
# Line 14 | Line 15 | namespace {
15    TH1D  *hEmu_Muon, *hEmu_Wide, *hEmu_L1Rpc;
16   }
17  
18 < AnaEmu::AnaEmu(TObjArray& histos)
18 <  : debug(false)
18 > void AnaEmu::init(TObjArray& histos)
19   {
20   hEmu_Muon= new TH1D( "hEmu_Muon", "hEmu_Muon", 64, -1.6, 1.6);  histos.Add( hEmu_Muon);
21   hEmu_Wide= new TH1D( "hEmu_Wide", "hEmu_Wide", 64, -1.6, 1.6);  histos.Add( hEmu_Wide);
22   hEmu_L1Rpc= new TH1D( "hEmu_L1Rpc", "hEmu_L1Rpc", 64, -1.6, 1.6);  histos.Add( hEmu_L1Rpc);
23   }
24  
25 < void AnaEmu::run( const MuonObj* muon,
26 <            const L1ObjColl *l1RpcCollEmu,
27 <            const L1ObjColl *l1RpcColl)
25 > void AnaEmu::run( const EventObj* event, const MuonObj* muon, const L1ObjColl *l1Coll)
26   {
27    if( muon->pt() < 10.) return;
28    hEmu_Muon->Fill(muon->eta());
29 <  std::vector<L1Obj> l1Rpcs = l1RpcColl->getL1ObjsSelected();
30 <  std::vector<L1Obj> l1RpcsEmu = l1RpcCollEmu->getL1ObjsMatched();
29 >  L1ObjColl l1RpcColl = l1Coll->l1RpcColl();
30 >  std::vector<L1Obj> l1Rpcs = l1RpcColl.selectByMatched().selectByBx().getL1Objs();
31 >  L1ObjColl l1RpcCollEmu =  l1Coll->l1RpcCollEmu();
32 >  std::vector<L1Obj> l1RpcsEmu = l1RpcCollEmu.selectByMatched().selectByBx().getL1Objs();
33   /*
34    if (l1RpcsEmu.size()!=0 && l1Rpcs.size()==0 && muon->eta()>-0.25 && muon->eta() < -0.2) {
35      std::cout<<"--------------"<<std::endl;
36      debug = true;
37      std::cout <<"MUON: pt="<<muon->pt()<<" eta="<<muon->eta()<<std::endl;
38 <    std::cout <<" NO EMU TRIGGER (matched)" << std::endl;
38 >    std::cout <<" HAS EMU, NO TRIGGER matched" << std::endl;
39    }
40   */
41    if (l1Rpcs.size() > 0) hEmu_L1Rpc->Fill(muon->eta());
42    if (l1RpcsEmu.size() > 0) hEmu_Wide->Fill(muon->eta());
43 <  if (l1Rpcs.size() > 0 && l1RpcsEmu.size()==0) std::cout <<"has no Emu but Rpc"<<std::endl;
44 <  if (debug) {std::cout <<" L1 EMU: "<<std::endl; l1RpcCollEmu->print();}
45 <  if (debug) {std::cout <<" L1 RPC: "<<std::endl; l1RpcColl->print();}
43 >  if (l1Rpcs.size() > 0 && l1RpcsEmu.size()==0) {
44 > //     std::cout <<"has no Emu but Rpc, run="<<event->run<<" lumi="<<event->lumi<<std::endl;
45 > //     debug = true;
46 >  }
47 >  if (debug) std::cout <<"MUON: pt="<<muon->pt()<<" eta="<<muon->eta()<<std::endl;
48 >  if (debug) {std::cout <<" L1 EMU: "<<std::endl << l1RpcCollEmu;}
49 >  if (debug) {std::cout <<" L1 RPC: "<<std::endl << l1RpcColl;}
50   }
51  
52  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines